Toast Engine
Toggle main menu visibility
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
13
struct
lua_State;
14
15
namespace
luabridge {
16
class
LuaRef;
17
}
18
19
namespace
toast {
20
class
Node
;
21
}
22
23
namespace
scripting {
24
28
class
UIBindsProxy {
29
public
:
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
41
private
:
42
toast::Box<toast::Node>
m_box;
43
};
44
45
auto
uiBindsProxyIndex(
UIBindsProxy
& proxy,
const
luabridge::LuaRef& key, lua_State* l) -> luabridge::LuaRef;
46
auto
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]]
51
auto
uiBindsHas(
const
toast::Node
* node, std::string_view name) -> bool;
52
auto
uiBindsGet(
const
toast::Node
* node, std::string_view name, lua_State* l) -> luabridge::LuaRef;
53
auto
uiBindsSet(
toast::Node
* node, std::string_view name,
const
luabridge::LuaRef& value, lua_State* l) -> bool;
54
55
}
box.hpp
pseudo shared pointer for Nodes
scripting::UIBindsProxy
Lua type returned by self.ui_binds.
Definition
ui_binds_proxy.hpp:28
toast::Box
Intrusive reference-counted handle to a Node.
Definition
box.hpp:35
toast::Node
Definition
node.hpp:81
engine
src
toast
scripting
ui_binds_proxy.hpp
Generated by
1.17.0