载入中...
搜索中...
未找到
PcgTooltip.h
浏览该文件的文档.
1#pragma once
2
3#include <cstdint>
4#include <string>
5#include <vector>
6#include "common/Export.h"
7#include "common/Result.h"
8namespace ssq { class Table; }
9namespace eve::ui {
struct PcgTooltipEntry{std::string id,header,text;};
13public:
[[nodiscard]] Result<void> configure(int interactionMode,int theme,float delay,float bottomOffset,float topOffset,int wrapLimit); [[nodiscard]] Result<void> addTooltip(const std::string&id,const std::string&header,const std::string&text); [[nodiscard]] Result<bool> removeTooltip(const std::string&query); [[nodiscard]] Result<bool> enter(int source,const std::string&query,float now); [[nodiscard]] Result<void> enterText(int source,const std::string&content,const std::string&header,float now); [[nodiscard]] Result<void> exit(int source); [[nodiscard]] Result<void> tick(float now,float mouseX,float mouseY,float screenWidth,float screenHeight,bool anyInput); void hide()noexcept{visible_=false;pending_=false;} bool getVisible()const noexcept{return visible_;} bool getPending()const noexcept{return pending_;} const std::string& getHeader()const noexcept{return header_;} const std::string& getText()const noexcept{return text_;} bool getHeaderVisible()const noexcept{return !header_.empty();} bool getWrapEnabled()const noexcept{return int(header_.size())>wrapLimit_||int(text_.size())>wrapLimit_;} float getPivotX()const noexcept{return pivotX_;} float getPivotY()const noexcept{return pivotY_;} float getBackgroundR()const noexcept{return theme_==0?1.f:0.1981132f;} float getForeground()const noexcept{return theme_==0?0.f:1.f;} int getCount()const noexcept{return int(entries_.size());}
33private:bool accepts(int source)const noexcept;std::vector<PcgTooltipEntry>entries_;int mode_=2,theme_=1,wrapLimit_=40,source_=-1;float delay_=2,bottomOffset_=2,topOffset_=2,showAt_=0,pivotX_=0,pivotY_=0;bool visible_=false,pending_=false;std::string header_,text_;
34};
void exposePcgTooltipBindings(ssq::Table& table);
36}
Object::Ptr theme
#define EVENGINE_API_WORLD
Definition Export.h:109
std::string text
const std::string * accepts
Move-only, checked operation results for the common layer.
SimulationTick tick
const UnitySourceAsset & source
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Caller-owned runtime model of Pcg Tooltip, TooltipManager, Profile and Trigger.
Definition PcgTooltip.h:12
void exposePcgTooltipBindings(ssq::Table &t)
Register Pcg tooltip bindings.
enum EVENGINE_API_FOUNDATION Table
OT_TABLE (editable via Runtime table APIs / ReflectedPropertyModel).
Definition Runtime.h:121
EVEngine ECS 集成层:底层实现使用 sunxfancy/ECS.hpp https://github.com/sunxfancy/ECS.hpp
Definition ECS.h:14