mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add 'src' scripting property to modelviewer
This commit is contained in:
parent
4ff42b94c3
commit
476865504b
1 changed files with 5 additions and 0 deletions
|
|
@ -14,6 +14,7 @@
|
|||
#include "graphics/ui/elements/TextBox.hpp"
|
||||
#include "graphics/ui/elements/TrackBar.hpp"
|
||||
#include "graphics/ui/elements/InlineFrame.hpp"
|
||||
#include "graphics/ui/elements/ModelViewer.hpp"
|
||||
#include "graphics/ui/gui_util.hpp"
|
||||
#include "graphics/ui/markdown.hpp"
|
||||
#include "graphics/core/Font.hpp"
|
||||
|
|
@ -351,6 +352,8 @@ static int p_get_src(UINode* node, lua::State* L) {
|
|||
return lua::pushstring(L, image->getTexture());
|
||||
} else if (auto iframe = dynamic_cast<InlineFrame*>(node)) {
|
||||
return lua::pushstring(L, iframe->getSrc());
|
||||
} else if (auto modelviewer = dynamic_cast<ModelViewer*>(node)) {
|
||||
return lua::pushstring(L, modelviewer->getModel());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -693,6 +696,8 @@ static void p_set_src(UINode* node, lua::State* L, int idx) {
|
|||
image->setTexture(lua::require_string(L, idx));
|
||||
} else if (auto iframe = dynamic_cast<InlineFrame*>(node)) {
|
||||
iframe->setSrc(lua::require_string(L, idx));
|
||||
} else if (auto modelviewer = dynamic_cast<ModelViewer*>(node)) {
|
||||
modelviewer->setModel(lua::require_string(L, idx));
|
||||
}
|
||||
}
|
||||
static void p_set_region(UINode* node, lua::State* L, int idx) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue