broken ui system

This commit is contained in:
Jan Racek
2026-03-25 12:25:29 +01:00
parent 60a7063a17
commit f485ec36a8
14 changed files with 1309 additions and 18 deletions

View File

@@ -8,6 +8,7 @@ namespace psxsplash {
class SceneManager; // Forward declaration
class CutscenePlayer; // Forward declaration
class UISystem; // Forward declaration
/**
* Lua API - Provides game scripting functionality
@@ -24,7 +25,7 @@ class CutscenePlayer; // Forward declaration
class LuaAPI {
public:
// Initialize all API modules
static void RegisterAll(psyqo::Lua& L, SceneManager* scene, CutscenePlayer* cutscenePlayer = nullptr);
static void RegisterAll(psyqo::Lua& L, SceneManager* scene, CutscenePlayer* cutscenePlayer = nullptr, UISystem* uiSystem = nullptr);
// Called once per frame to advance the Lua frame counter
static void IncrementFrameCount();
@@ -39,6 +40,9 @@ private:
// Cutscene player pointer (set during RegisterAll)
static CutscenePlayer* s_cutscenePlayer;
// UI system pointer (set during RegisterAll)
static UISystem* s_uiSystem;
// ========================================================================
// ENTITY API
// ========================================================================
@@ -267,6 +271,31 @@ private:
// Cutscene.IsPlaying() -> boolean
static int Cutscene_IsPlaying(lua_State* L);
// ========================================================================
// UI API - Canvas and element control
// ========================================================================
static int UI_FindCanvas(lua_State* L);
static int UI_SetCanvasVisible(lua_State* L);
static int UI_IsCanvasVisible(lua_State* L);
static int UI_FindElement(lua_State* L);
static int UI_SetVisible(lua_State* L);
static int UI_IsVisible(lua_State* L);
static int UI_SetText(lua_State* L);
static int UI_GetText(lua_State* L);
static int UI_SetProgress(lua_State* L);
static int UI_GetProgress(lua_State* L);
static int UI_SetColor(lua_State* L);
static int UI_GetColor(lua_State* L);
static int UI_SetPosition(lua_State* L);
static int UI_GetPosition(lua_State* L);
static int UI_SetSize(lua_State* L);
static int UI_GetSize(lua_State* L);
static int UI_SetProgressColors(lua_State* L);
static int UI_GetElementType(lua_State* L);
static int UI_GetElementCount(lua_State* L);
static int UI_GetElementByIndex(lua_State* L);
// ========================================================================
// HELPERS
// ========================================================================