diff --git a/src/glue/CGlueMgr.cpp b/src/glue/CGlueMgr.cpp index 292a99e..5b87912 100644 --- a/src/glue/CGlueMgr.cpp +++ b/src/glue/CGlueMgr.cpp @@ -480,10 +480,7 @@ void CGlueMgr::Resume() { GlueScriptEventsRegisterFunctions(); CharSelectRegisterScriptFunctions(); CharacterCreateRegisterScriptFunctions(); - - // TODO - // RealmListRegisterScriptFunctions(); - + RealmListRegisterScriptFunctions(); SI2::RegisterScriptFunctions(); // TODO diff --git a/src/ui/ScriptFunctions.cpp b/src/ui/ScriptFunctions.cpp index bf382bc..3a16262 100644 --- a/src/ui/ScriptFunctions.cpp +++ b/src/ui/ScriptFunctions.cpp @@ -40,6 +40,15 @@ void GlueScriptEventsRegisterFunctions() { } } +void RealmListRegisterScriptFunctions() { + for (int32_t i = 0; i < NUM_SCRIPT_FUNCTIONS_REALM_LIST; ++i) { + FrameScript_RegisterFunction( + FrameScript::s_ScriptFunctions_RealmList[i].name, + FrameScript::s_ScriptFunctions_RealmList[i].method + ); + } +} + void RegisterSimpleFrameScriptMethods() { for (int32_t i = 0; i < NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME; ++i) { FrameScript_RegisterFunction( diff --git a/src/ui/ScriptFunctions.hpp b/src/ui/ScriptFunctions.hpp index 2cbb5ba..1bf8779 100644 --- a/src/ui/ScriptFunctions.hpp +++ b/src/ui/ScriptFunctions.hpp @@ -9,6 +9,7 @@ struct lua_State; #define NUM_SCRIPT_FUNCTIONS_CHAR_CREATE 32 #define NUM_SCRIPT_FUNCTIONS_CHAR_SELECT 13 #define NUM_SCRIPT_FUNCTIONS_GLUE_SCRIPT_EVENTS 113 +#define NUM_SCRIPT_FUNCTIONS_REALM_LIST 14 #define NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME 7 #define NUM_SCRIPT_FUNCTIONS_SYSTEM 7 @@ -16,6 +17,7 @@ namespace FrameScript { extern FrameScript_Method s_ScriptFunctions_CharCreate[NUM_SCRIPT_FUNCTIONS_CHAR_CREATE]; extern FrameScript_Method s_ScriptFunctions_CharSelect[NUM_SCRIPT_FUNCTIONS_CHAR_SELECT]; extern FrameScript_Method s_ScriptFunctions_GlueScriptEvents[NUM_SCRIPT_FUNCTIONS_GLUE_SCRIPT_EVENTS]; + extern FrameScript_Method s_ScriptFunctions_RealmList[NUM_SCRIPT_FUNCTIONS_REALM_LIST]; extern FrameScript_Method s_ScriptFunctions_SimpleFrame[NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME]; extern FrameScript_Method s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SYSTEM]; } @@ -25,6 +27,7 @@ namespace FrameScript { void CharacterCreateRegisterScriptFunctions(); void CharSelectRegisterScriptFunctions(); void GlueScriptEventsRegisterFunctions(); +void RealmListRegisterScriptFunctions(); void RegisterSimpleFrameScriptMethods(); void SystemRegisterFunctions(); diff --git a/src/ui/ScriptFunctionsRealmList.cpp b/src/ui/ScriptFunctionsRealmList.cpp new file mode 100644 index 0000000..59bc1ce --- /dev/null +++ b/src/ui/ScriptFunctionsRealmList.cpp @@ -0,0 +1,78 @@ +#include "ui/ScriptFunctions.hpp" +#include "ui/Types.hpp" +#include "util/Lua.hpp" +#include "util/Unimplemented.hpp" +#include + +int32_t Script_RequestRealmList(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_RealmListUpdateRate(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_CancelRealmListQuery(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_GetNumRealms(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_GetRealmInfo(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_ChangeRealm(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_GetRealmCategories(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_SetPreferredInfo(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_SortRealms(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_GetSelectedCategory(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_RealmListDialogCancelled(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_IsInvalidTournamentRealmCategory(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_IsTournamentRealmCategory(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +int32_t Script_IsInvalidLocale(lua_State* L) { + WHOA_UNIMPLEMENTED(); +} + +FrameScript_Method FrameScript::s_ScriptFunctions_RealmList[NUM_SCRIPT_FUNCTIONS_REALM_LIST] = { + { "RequestRealmList", &Script_RequestRealmList }, + { "RealmListUpdateRate", &Script_RealmListUpdateRate }, + { "CancelRealmListQuery", &Script_CancelRealmListQuery }, + { "GetNumRealms", &Script_GetNumRealms }, + { "GetRealmInfo", &Script_GetRealmInfo }, + { "ChangeRealm", &Script_ChangeRealm }, + { "GetRealmCategories", &Script_GetRealmCategories }, + { "SetPreferredInfo", &Script_SetPreferredInfo }, + { "SortRealms", &Script_SortRealms }, + { "GetSelectedCategory", &Script_GetSelectedCategory }, + { "RealmListDialogCancelled", &Script_RealmListDialogCancelled }, + { "IsInvalidTournamentRealmCategory", &Script_IsInvalidTournamentRealmCategory }, + { "IsTournamentRealmCategory", &Script_IsTournamentRealmCategory }, + { "IsInvalidLocale", &Script_IsInvalidLocale } +};