Toast Engine
Loading...
Searching...
No Matches
ui_binds_proxy.hpp
Go to the documentation of this file.
1
8
9#pragma once
10#include <string_view>
11#include <toast/world/box.hpp>
12
13struct lua_State;
14
15namespace luabridge {
16class LuaRef;
17}
18
19namespace toast {
20class Node;
21}
22
23namespace scripting {
24
28class UIBindsProxy {
29public:
30 UIBindsProxy() = default;
31 explicit UIBindsProxy(toast::Box<toast::Node> box) noexcept;
32
33 [[nodiscard]]
34 auto exists() const noexcept -> bool;
35
36 [[nodiscard]]
37 auto box() const noexcept -> const toast::Box<toast::Node>& {
38 return m_box;
39 }
40
41private:
43};
44
45auto uiBindsProxyIndex(UIBindsProxy& proxy, const luabridge::LuaRef& key, lua_State* l) -> luabridge::LuaRef;
46auto uiBindsProxyNewindex(UIBindsProxy& proxy, const luabridge::LuaRef& key, const luabridge::LuaRef& value, lua_State* l)
47 -> luabridge::LuaRef;
48
49// `self.<bind>` works the same as `self.ui_binds.<bind>` TODO: maybe remove this
50[[nodiscard]]
51auto uiBindsHas(const toast::Node* node, std::string_view name) -> bool;
52auto uiBindsGet(const toast::Node* node, std::string_view name, lua_State* l) -> luabridge::LuaRef;
53auto uiBindsSet(toast::Node* node, std::string_view name, const luabridge::LuaRef& value, lua_State* l) -> bool;
54
55}
pseudo shared pointer for Nodes
Lua type returned by self.ui_binds.
Definition ui_binds_proxy.hpp:28
Intrusive reference-counted handle to a Node.
Definition box.hpp:35
Definition node.hpp:81