mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
chore(ui): clean up SystemRegisterFunctions
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
Some checks are pending
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Waiting to run
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Waiting to run
This commit is contained in:
parent
caf628145d
commit
cbbf491620
@ -27,6 +27,7 @@
|
||||
#include "ui/Interface.hpp"
|
||||
#include "ui/Key.hpp"
|
||||
#include "ui/ScriptFunctions.hpp"
|
||||
#include "ui/ScriptFunctionsSystem.hpp"
|
||||
#include "ui/game/CGVideoOptions.hpp"
|
||||
#include "ui/simple/CSimpleModelFFX.hpp"
|
||||
#include "ui/simple/CSimpleTop.hpp"
|
||||
|
||||
@ -54,12 +54,3 @@ void RegisterSimpleFrameScriptMethods() {
|
||||
// CSimpleColorSelect::CreateScriptMetaTable();
|
||||
// CSimpleMovieFrame::CreateScriptMetaTable();
|
||||
}
|
||||
|
||||
void SystemRegisterFunctions() {
|
||||
for (int32_t i = 0; i < NUM_SCRIPT_FUNCTIONS_SYSTEM; ++i) {
|
||||
FrameScript_RegisterFunction(
|
||||
FrameScript::s_ScriptFunctions_System[i].name,
|
||||
FrameScript::s_ScriptFunctions_System[i].method
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,15 +7,11 @@
|
||||
struct lua_State;
|
||||
|
||||
#define NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME 7
|
||||
#define NUM_SCRIPT_FUNCTIONS_SYSTEM 7
|
||||
|
||||
namespace FrameScript {
|
||||
extern FrameScript_Method s_ScriptFunctions_SimpleFrame[NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME];
|
||||
extern FrameScript_Method s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SYSTEM];
|
||||
}
|
||||
|
||||
void RegisterSimpleFrameScriptMethods();
|
||||
|
||||
void SystemRegisterFunctions();
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#include "ui/ScriptFunctions.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "ui/ScriptFunctionsShared.hpp"
|
||||
#include "ui/Types.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
@ -22,10 +22,12 @@ int32_t Script_ConsoleExec(lua_State* L) {
|
||||
}
|
||||
|
||||
int32_t Script_AccessDenied(lua_State* L) {
|
||||
return luaL_error(L, "Access Denied");
|
||||
luaL_error(L, "Access Denied");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
FrameScript_Method FrameScript::s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SYSTEM] = {
|
||||
static FrameScript_Method s_SystemFunctions[] = {
|
||||
{ "GetTime", &Script_GetTime },
|
||||
{ "GetGameTime", &Script_GetGameTime },
|
||||
{ "ConsoleExec", &Script_ConsoleExec },
|
||||
@ -34,3 +36,9 @@ FrameScript_Method FrameScript::s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SY
|
||||
{ "AppendToFile", &Script_AccessDenied },
|
||||
{ "GetAccountExpansionLevel", &Script_GetAccountExpansionLevel }
|
||||
};
|
||||
|
||||
void SystemRegisterFunctions() {
|
||||
for (auto& func : s_SystemFunctions) {
|
||||
FrameScript_RegisterFunction(func.name, func.method);
|
||||
}
|
||||
}
|
||||
|
||||
6
src/ui/ScriptFunctionsSystem.hpp
Normal file
6
src/ui/ScriptFunctionsSystem.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef UI_SCRIPT_FUNCTIONS_SYSTEM_HPP
|
||||
#define UI_SCRIPT_FUNCTIONS_SYSTEM_HPP
|
||||
|
||||
void SystemRegisterFunctions();
|
||||
|
||||
#endif
|
||||
@ -1,7 +1,6 @@
|
||||
#include "ui/game/ScriptEvents.hpp"
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "ui/ScriptFunctions.hpp"
|
||||
#include "ui/ScriptFunctionsShared.hpp"
|
||||
#include "ui/ScriptFunctionsSystem.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t Script_UnitExists(lua_State* L) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user