Skip to content
This repository was archived by the owner on Dec 3, 2020. It is now read-only.

Commit 1c386f2

Browse files
committed
Fix properties sidebar
1 parent d0626b6 commit 1c386f2

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/GUIHelpers.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ void fillTB(IGUIElement* sidebar, int parentId, int id, int value){
1414
}
1515
}
1616

17+
void fillTB(IGUIElement* sidebar, int parentId, int id, float value){
18+
IGUIElement* element = sidebar->getElementFromId(parentId)->getElementFromId(id);
19+
20+
if (element) {
21+
IGUIEditBox* editbox = static_cast<IGUIEditBox*>(element);
22+
23+
if (!editbox) {
24+
return;
25+
}
26+
27+
editbox->setText(stringw(value).c_str());
28+
}
29+
}
30+
1731

1832
void addBox(IGUIElement* parent, IGUIEnvironment* guienv, vector2di pos, int index, const wchar_t* label){
1933
guienv->addStaticText(label,

src/GUIHelpers.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "common.hpp"
55

66
extern void fillTB(IGUIElement* sidebar, int parentId, int id, int value);
7+
extern void fillTB(IGUIElement* sidebar, int parentId, int id, float value);
78
extern void addBox(IGUIElement* parent, IGUIEnvironment* guienv, vector2di pos, int index, const wchar_t* label);
89
extern void addXYZ(IGUIElement* parent, IGUIEnvironment* guienv, vector2di pos, int startIndex);
910

0 commit comments

Comments
 (0)