载入中...
搜索中...
未找到
UIHost.cpp
浏览该文件的文档.
102bool UIHost::setTreeReconcile(WidgetDesc root) { return applyTreeReconcile(this, std::move(root)); }
205 if (explicitTarget && eligible(explicitTarget->get(), true)) return requestFocusById(explicitId);
298bool UIHost::setTextHandler(const std::string &id, std::function<void(const std::string &)> fn) {
ECS mount point for one UI panel/screen. Subclass to attach UI to game entities, e....
Definition UIHost.h:284
bool setTreeReconcile(WidgetDesc root)
Key-aware patch when structure matches; else full replace.
Definition UIHost.cpp:102
void setCheckedById(const std::string &id, bool checked)
Definition UIHost.cpp:168
eve::OptionalRef< UINode > findById(const std::string &id)
Looks up a node by stable id without transferring ownership.
Definition UIHost.cpp:132
std::string focusedId()
Return the currently focused control id, or an empty string.
Definition UIHost.cpp:242
void setValueById(const std::string &id, float value)
Definition UIHost.cpp:172
bool setToggleHandler(const std::string &id, std::function< void(bool)> fn)
Definition UIHost.cpp:266
void setThemeOverride(const Theme &theme)
Apply a host-local Theme without mutating ui::globalTheme().
Definition UIHost.cpp:72
const Theme * themeOverride()
Borrow the host-local Theme when one is installed.
Definition UIHost.cpp:81
void clearThemeOverride()
Stop using a host-local Theme and inherit the process global again.
Definition UIHost.cpp:77
bool moveFocus(FocusDirection direction, bool wrap=true)
Move through explicit neighbors or deterministic tab order.
Definition UIHost.cpp:189
bool setTextHandler(const std::string &id, std::function< void(const std::string &)> fn)
Definition UIHost.cpp:298
static eve::OptionalRef< UINode > resolveNode(UINodeHandle handle)
Resolve a node token in constant time without transferring ownership.
Definition UIHost.cpp:124
bool setClickHandler(const std::string &id, std::function< void()> fn)
Installs a widget callback by node id (returns false if not found).
Definition UIHost.cpp:250
static UIHostHandle createHost(const std::string &name="")
Creates an ECS-owned UI host.
Definition UIHost.cpp:49
void setVisibleById(const std::string &id, bool visible)
Definition UIHost.cpp:154
UIHostHandle handle() const noexcept
Returns this host's generation-qualified ECS handle.
Definition UIHost.h:408
void setValueTextById(const std::string &id, const std::string &value)
Definition UIHost.cpp:176
void clearWorldAnchor()
Disables 3D projection and returns the host to normal screen layout.
Definition UIHost.cpp:93
void setTextById(const std::string &id, const std::string &text)
Widget state updates by node id.
Definition UIHost.cpp:150
void setWorldAnchor(float x, float y, float z)
Enables projection of this host from a 3D world point.
Definition UIHost.cpp:85
void setEnabledById(const std::string &id, bool enabled)
Definition UIHost.cpp:158
void setSimplePanel(const std::string &title, const std::string &labelText, const std::string &buttonText, const std::string &labelId="label", const std::string &buttonId="btn")
One-shot convenience panel: window + label + button.
Definition UIHost.cpp:104
static eve::OptionalRef< UIHost > resolve(UIHostHandle handle) noexcept
Resolves a UI host handle with ECS generation checking.
Definition UIHost.cpp:62
bool setValueHandler(const std::string &id, std::function< void(float)> fn)
Definition UIHost.cpp:282
eve::OptionalRef< UINode > findByKey(const std::string &key)
Looks up a node by reconciliation key without transferring ownership.
Definition UIHost.cpp:141
bool requestFocusById(const std::string &id)
Request keyboard/gamepad focus for a control on the next frame.
Definition UIHost.cpp:180
std::optional< UINodeHandle > nodeHandle(const std::string &id)
Resolve an id once into a non-owning, generation-checked node token.
Definition UIHost.cpp:115
Definition Component.cpp:7
WidgetDesc window(std::string title, std::vector< WidgetDesc > children, std::string id)
Top-level window widget with a title bar.
Definition Widget.cpp:326
@ InputText
@ ImageButton
@ Slider
@ Checkbox
@ ColorPalette
@ Button
@ Viewport
@ Link
@ Switch
@ MenuItem
@ SearchField
@ Combo
FocusDirection
Logical focus movement understood by keyboard, gamepad and automation.
Definition UIHost.h:104
@ Previous
@ None
WidgetDesc button(std::string label, std::string id, std::function< void()> onClick)
Clickable button; fires onClick.
Definition Widget.cpp:345
bool applyTreeReconcile(UIHost *host, WidgetDesc root)
Patch by key/id when structure (type + child keys) matches; otherwise full replace....
Definition Widget.cpp:940
@ Disabled
std::optional< std::reference_wrapper< T > > OptionalRef
Optional borrowed reference; it does not extend T's lifetime.
Definition BorrowedRef.h:24
Unified UI design tokens (colors, geometry, typography). Applied to ImGui each frame via applyThemeTo...
Definition Theme.h:41
Non-owning node token; valid across property reconciliation, invalid after tree replacement....
Definition UIHost.h:25
Retained UI widget node (arena tree). Conceptual counterpart of eve::scene::SceneNode; built declarat...
Definition UIHost.h:151
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:15