refactor enums: CursorShape, InterpolationType, ParticleSpawnShape

This commit is contained in:
MihailRis
2025-04-13 14:18:50 +03:00
parent 7749675a61
commit 3be8546bf4
9 changed files with 44 additions and 91 deletions
+5 -4
View File
@@ -1,3 +1,4 @@
#define VC_ENABLE_REFLECTION
#include "libgui.hpp"
#include "assets/Assets.hpp"
#include "engine/Engine.hpp"
@@ -422,7 +423,7 @@ static int p_get_line_pos(UINode*, lua::State* L) {
}
static int p_get_cursor(UINode* node, lua::State* L) {
return lua::pushstring(L, to_string(node->getCursor()));
return lua::pushlstring(L, CursorShapeMeta.getName(node->getCursor()));
}
static int p_get_scroll(UINode* node, lua::State* L) {
@@ -660,9 +661,9 @@ static void p_set_focused(
}
static void p_set_cursor(UINode* node, lua::State* L, int idx) {
if (auto cursor = CursorShape_from(lua::require_string(L, idx))) {
node->setCursor(*cursor);
}
auto cursor = CursorShape::ARROW; // reset to default
CursorShapeMeta.getItem(lua::require_string(L, idx), cursor);
node->setCursor(cursor);
}
static int p_set_scroll(UINode* node, lua::State* L, int idx) {