载入中...
搜索中...
未找到
UIHost.cpp
浏览该文件的文档.
101bool UIHost::setTreeReconcile(WidgetDesc root) { return applyTreeReconcile(this, std::move(root)); }
187 if (explicitTarget && eligible(explicitTarget->get(), true)) return requestFocusById(explicitId);
280bool 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:243
bool setTreeReconcile(WidgetDesc root)
Key-aware patch when structure matches; else full replace.
Definition UIHost.cpp:101
void setCheckedById(const std::string &id, bool checked)
Definition UIHost.cpp:150
eve::OptionalRef< UINode > findById(const std::string &id)
Looks up a node by stable id without transferring ownership.
Definition UIHost.cpp:114
std::string focusedId()
Return the currently focused control id, or an empty string.
Definition UIHost.cpp:224
void setValueById(const std::string &id, float value)
Definition UIHost.cpp:154
bool setToggleHandler(const std::string &id, std::function< void(bool)> fn)
Definition UIHost.cpp:248
void setThemeOverride(const Theme &theme)
Apply a host-local Theme without mutating ui::globalTheme().
Definition UIHost.cpp:71
const Theme * themeOverride()
Borrow the host-local Theme when one is installed.
Definition UIHost.cpp:80
void clearThemeOverride()
Stop using a host-local Theme and inherit the process global again.
Definition UIHost.cpp:76
bool moveFocus(FocusDirection direction, bool wrap=true)
Move through explicit neighbors or deterministic tab order.
Definition UIHost.cpp:171
bool setTextHandler(const std::string &id, std::function< void(const std::string &)> fn)
Definition UIHost.cpp:280
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:232
static UIHostHandle createHost(const std::string &name="")
Creates an ECS-owned UI host.
Definition UIHost.cpp:48
void setVisibleById(const std::string &id, bool visible)
Definition UIHost.cpp:136
UIHostHandle handle() const noexcept
Returns this host's generation-qualified ECS handle.
Definition UIHost.h:364
void setValueTextById(const std::string &id, const std::string &value)
Definition UIHost.cpp:158
void clearWorldAnchor()
Disables 3D projection and returns the host to normal screen layout.
Definition UIHost.cpp:92
void setTextById(const std::string &id, const std::string &text)
Widget state updates by node id.
Definition UIHost.cpp:132
void setWorldAnchor(float x, float y, float z)
Enables projection of this host from a 3D world point.
Definition UIHost.cpp:84
void setEnabledById(const std::string &id, bool enabled)
Definition UIHost.cpp:140
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:103
static eve::OptionalRef< UIHost > resolve(UIHostHandle handle) noexcept
Resolves a UI host handle with ECS generation checking.
Definition UIHost.cpp:61
bool setValueHandler(const std::string &id, std::function< void(float)> fn)
Definition UIHost.cpp:264
eve::OptionalRef< UINode > findByKey(const std::string &key)
Looks up a node by reconciliation key without transferring ownership.
Definition UIHost.cpp:123
bool requestFocusById(const std::string &id)
Request keyboard/gamepad focus for a control on the next frame.
Definition UIHost.cpp:162
Definition Component.cpp:5
WidgetDesc window(std::string title, std::vector< WidgetDesc > children, std::string id)
Top-level window widget with a title bar.
Definition Widget.cpp:292
@ InputText
@ ImageButton
@ Slider
@ Checkbox
@ ColorPalette
@ Button
@ Viewport
@ Switch
@ MenuItem
@ SearchField
@ Combo
FocusDirection
Logical focus movement understood by keyboard, gamepad and automation.
Definition UIHost.h:82
@ Previous
@ None
WidgetDesc button(std::string label, std::string id, std::function< void()> onClick)
Clickable button; fires onClick.
Definition Widget.cpp:311
bool applyTreeReconcile(UIHost *host, WidgetDesc root)
Patch by key/id when structure (type + child keys) matches; otherwise full replace....
Definition Widget.cpp:748
@ 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:39
Retained UI widget node (arena tree). Conceptual counterpart of eve::scene::SceneNode; built declarat...
Definition UIHost.h:128
Declarative widget description (build once / on dirty → flatten into UIHost::Tree).
Definition Widget.h:15