mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
Compare commits
16 Commits
0ffa52cf9b
...
2ef2a6118e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ef2a6118e | ||
|
|
b9f2c60966 | ||
|
|
5f7bf8c95c | ||
|
|
7d9173b880 | ||
|
|
98ea309985 | ||
|
|
ba5006a4d8 | ||
|
|
e872450202 | ||
|
|
bc1d7cbd66 | ||
|
|
61b05eb366 | ||
|
|
a168c6fd41 | ||
|
|
95a8f4287f | ||
|
|
c0ec4aed44 | ||
|
|
6dd15ed2cf | ||
|
|
dc071210ca | ||
|
|
cbbf491620 | ||
|
|
4a102c6ace |
@ -26,10 +26,11 @@
|
|||||||
#include "ui/FrameXML.hpp"
|
#include "ui/FrameXML.hpp"
|
||||||
#include "ui/Interface.hpp"
|
#include "ui/Interface.hpp"
|
||||||
#include "ui/Key.hpp"
|
#include "ui/Key.hpp"
|
||||||
#include "ui/ScriptFunctions.hpp"
|
#include "ui/ScriptFunctionsSystem.hpp"
|
||||||
#include "ui/game/CGVideoOptions.hpp"
|
#include "ui/game/CGVideoOptions.hpp"
|
||||||
#include "ui/simple/CSimpleModelFFX.hpp"
|
#include "ui/simple/CSimpleModelFFX.hpp"
|
||||||
#include "ui/simple/CSimpleTop.hpp"
|
#include "ui/simple/CSimpleTop.hpp"
|
||||||
|
#include "ui/simple/ScriptMethods.hpp"
|
||||||
#include "util/Filesystem.hpp"
|
#include "util/Filesystem.hpp"
|
||||||
#include "util/Locale.hpp"
|
#include "util/Locale.hpp"
|
||||||
#include "util/Log.hpp"
|
#include "util/Log.hpp"
|
||||||
@ -46,6 +47,7 @@ float CGlueMgr::m_aspect;
|
|||||||
bool CGlueMgr::m_authenticated;
|
bool CGlueMgr::m_authenticated;
|
||||||
const CharacterSelectionDisplay* CGlueMgr::m_characterInfo;
|
const CharacterSelectionDisplay* CGlueMgr::m_characterInfo;
|
||||||
int32_t CGlueMgr::m_clientKickReason;
|
int32_t CGlueMgr::m_clientKickReason;
|
||||||
|
int32_t CGlueMgr::m_contestAccepted = 1; // TODO
|
||||||
char CGlueMgr::m_currentScreen[64];
|
char CGlueMgr::m_currentScreen[64];
|
||||||
EffectDeath* CGlueMgr::m_deathEffect;
|
EffectDeath* CGlueMgr::m_deathEffect;
|
||||||
int32_t CGlueMgr::m_disconnectPending;
|
int32_t CGlueMgr::m_disconnectPending;
|
||||||
@ -1186,6 +1188,10 @@ void CGlueMgr::Suspend() {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
SystemUnregisterFunctions();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
FrameXML_FreeHashNodes();
|
FrameXML_FreeHashNodes();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -41,6 +41,7 @@ class CGlueMgr {
|
|||||||
static bool m_authenticated;
|
static bool m_authenticated;
|
||||||
static const CharacterSelectionDisplay* m_characterInfo;
|
static const CharacterSelectionDisplay* m_characterInfo;
|
||||||
static int32_t m_clientKickReason;
|
static int32_t m_clientKickReason;
|
||||||
|
static int32_t m_contestAccepted;
|
||||||
static char m_currentScreen[];
|
static char m_currentScreen[];
|
||||||
static EffectDeath* m_deathEffect;
|
static EffectDeath* m_deathEffect;
|
||||||
static int32_t m_disconnectPending;
|
static int32_t m_disconnectPending;
|
||||||
|
|||||||
@ -222,7 +222,14 @@ int32_t Script_ShowContestNotice(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_ContestAccepted(lua_State* L) {
|
int32_t Script_ContestAccepted(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
if (CGlueMgr::m_contestAccepted) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AcceptContest(lua_State* L) {
|
int32_t Script_AcceptContest(lua_State* L) {
|
||||||
@ -522,36 +529,6 @@ int32_t Script_IsScanDLLFinished(lua_State* L) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_IsWindowsClient(lua_State* L) {
|
|
||||||
#if defined(WHOA_SYSTEM_WIN)
|
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
#else
|
|
||||||
lua_pushnil(L);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_IsMacClient(lua_State* L) {
|
|
||||||
#if defined(WHOA_SYSTEM_MAC)
|
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
#else
|
|
||||||
lua_pushnil(L);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_IsLinuxClient(lua_State* L) {
|
|
||||||
#if defined(WHOA_SYSTEM_LINUX)
|
|
||||||
lua_pushnumber(L, 1.0);
|
|
||||||
#else
|
|
||||||
lua_pushnil(L);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t Script_SetRealmSplitState(lua_State* L) {
|
int32_t Script_SetRealmSplitState(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1047,6 +1047,15 @@ const char* FrameScript_Sprintf(lua_State* L, int32_t idx, char buffer[], uint32
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FrameScript_UnregisterFunction(const char* name) {
|
||||||
|
auto L = FrameScript::s_context;
|
||||||
|
|
||||||
|
lua_pushnil(L);
|
||||||
|
lua_pushstring(L, name);
|
||||||
|
lua_insert(L, -2);
|
||||||
|
lua_rawset(L, LUA_GLOBALSINDEX);
|
||||||
|
}
|
||||||
|
|
||||||
void FrameScript_UnregisterScriptEvent(FrameScript_Object* object, FrameScript_EventObject* event) {
|
void FrameScript_UnregisterScriptEvent(FrameScript_Object* object, FrameScript_EventObject* event) {
|
||||||
if (event->pendingSignalCount) {
|
if (event->pendingSignalCount) {
|
||||||
auto node = event->unregisterListeners.Head();
|
auto node = event->unregisterListeners.Head();
|
||||||
|
|||||||
@ -99,6 +99,8 @@ void FrameScript_SignalEvent(uint32_t index, const char* format, ...);
|
|||||||
|
|
||||||
const char* FrameScript_Sprintf(lua_State* L, int32_t idx, char buffer[], uint32_t bufferLen);
|
const char* FrameScript_Sprintf(lua_State* L, int32_t idx, char buffer[], uint32_t bufferLen);
|
||||||
|
|
||||||
|
void FrameScript_UnregisterFunction(const char* name);
|
||||||
|
|
||||||
void FrameScript_UnregisterScriptEvent(FrameScript_Object* object, FrameScript_EventObject* event);
|
void FrameScript_UnregisterScriptEvent(FrameScript_Object* object, FrameScript_EventObject* event);
|
||||||
|
|
||||||
void ScriptEventsInitialize();
|
void ScriptEventsInitialize();
|
||||||
|
|||||||
@ -1,65 +0,0 @@
|
|||||||
#include "ui/ScriptFunctions.hpp"
|
|
||||||
#include "ui/FrameScript.hpp"
|
|
||||||
#include "ui/simple/CSimpleButton.hpp"
|
|
||||||
#include "ui/simple/CSimpleCheckbox.hpp"
|
|
||||||
#include "ui/simple/CSimpleEditBox.hpp"
|
|
||||||
#include "ui/simple/CSimpleFont.hpp"
|
|
||||||
#include "ui/simple/CSimpleFontString.hpp"
|
|
||||||
#include "ui/simple/CSimpleFrame.hpp"
|
|
||||||
#include "ui/simple/CSimpleHTML.hpp"
|
|
||||||
#include "ui/simple/CSimpleModel.hpp"
|
|
||||||
#include "ui/simple/CSimpleModelFFX.hpp"
|
|
||||||
#include "ui/simple/CSimpleScrollFrame.hpp"
|
|
||||||
#include "ui/simple/CSimpleSlider.hpp"
|
|
||||||
#include "ui/simple/CSimpleTexture.hpp"
|
|
||||||
|
|
||||||
void RegisterSimpleFrameScriptMethods() {
|
|
||||||
for (int32_t i = 0; i < NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME; ++i) {
|
|
||||||
FrameScript_RegisterFunction(
|
|
||||||
FrameScript::s_ScriptFunctions_SimpleFrame[i].name,
|
|
||||||
FrameScript::s_ScriptFunctions_SimpleFrame[i].method
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
// CSimpleAnim::CreateScriptMetaTable();
|
|
||||||
// CSimpleTranslationAnim::CreateScriptMetaTable();
|
|
||||||
// CSimpleRotationAnim::CreateScriptMetaTable();
|
|
||||||
// CSimpleScaleAnim::CreateScriptMetaTable();
|
|
||||||
// CSimpleControlPoint::CreateScriptMetaTable();
|
|
||||||
// CSimplePathAnim::CreateScriptMetaTable();
|
|
||||||
// CSimpleAlphaAnim::CreateScriptMetaTable();
|
|
||||||
// CSimpleAnimGroup::CreateScriptMetaTable();
|
|
||||||
|
|
||||||
CSimpleFont::CreateScriptMetaTable();
|
|
||||||
CSimpleTexture::CreateScriptMetaTable();
|
|
||||||
CSimpleFontString::CreateScriptMetaTable();
|
|
||||||
CSimpleFrame::CreateScriptMetaTable();
|
|
||||||
CSimpleButton::CreateScriptMetaTable();
|
|
||||||
CSimpleCheckbox::CreateScriptMetaTable();
|
|
||||||
CSimpleEditBox::CreateScriptMetaTable();
|
|
||||||
CSimpleHTML::CreateScriptMetaTable();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
// CSimpleMessageFrame::CreateScriptMetaTable();
|
|
||||||
// CSimpleMessageScrollFrame::CreateScriptMetaTable();
|
|
||||||
|
|
||||||
CSimpleModel::CreateScriptMetaTable();
|
|
||||||
CSimpleModelFFX::CreateScriptMetaTable();
|
|
||||||
CSimpleScrollFrame::CreateScriptMetaTable();
|
|
||||||
CSimpleSlider::CreateScriptMetaTable();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
// CSimpleStatusBar::CreateScriptMetaTable();
|
|
||||||
// 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
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
#ifndef UI_SCRIPT_FUNCTIONS_HPP
|
|
||||||
#define UI_SCRIPT_FUNCTIONS_HPP
|
|
||||||
|
|
||||||
#include "ui/Types.hpp"
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
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/ScriptFunctionsShared.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -6,3 +6,33 @@
|
|||||||
int32_t Script_GetAccountExpansionLevel(lua_State* L) {
|
int32_t Script_GetAccountExpansionLevel(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t Script_IsLinuxClient(lua_State* L) {
|
||||||
|
#if defined(WHOA_SYSTEM_LINUX)
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
#else
|
||||||
|
lua_pushnil(L);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_IsMacClient(lua_State* L) {
|
||||||
|
#if defined(WHOA_SYSTEM_MAC)
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
#else
|
||||||
|
lua_pushnil(L);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_IsWindowsClient(lua_State* L) {
|
||||||
|
#if defined(WHOA_SYSTEM_WIN)
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
#else
|
||||||
|
lua_pushnil(L);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|||||||
@ -6,4 +6,10 @@
|
|||||||
|
|
||||||
int32_t Script_GetAccountExpansionLevel(lua_State* L);
|
int32_t Script_GetAccountExpansionLevel(lua_State* L);
|
||||||
|
|
||||||
|
int32_t Script_IsLinuxClient(lua_State* L);
|
||||||
|
|
||||||
|
int32_t Script_IsMacClient(lua_State* L);
|
||||||
|
|
||||||
|
int32_t Script_IsWindowsClient(lua_State* L);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "ui/ScriptFunctions.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/ScriptFunctionsShared.hpp"
|
#include "ui/ScriptFunctionsShared.hpp"
|
||||||
#include "ui/Types.hpp"
|
#include "ui/Types.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
@ -22,10 +22,12 @@ int32_t Script_ConsoleExec(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AccessDenied(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 },
|
{ "GetTime", &Script_GetTime },
|
||||||
{ "GetGameTime", &Script_GetGameTime },
|
{ "GetGameTime", &Script_GetGameTime },
|
||||||
{ "ConsoleExec", &Script_ConsoleExec },
|
{ "ConsoleExec", &Script_ConsoleExec },
|
||||||
@ -34,3 +36,15 @@ FrameScript_Method FrameScript::s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SY
|
|||||||
{ "AppendToFile", &Script_AccessDenied },
|
{ "AppendToFile", &Script_AccessDenied },
|
||||||
{ "GetAccountExpansionLevel", &Script_GetAccountExpansionLevel }
|
{ "GetAccountExpansionLevel", &Script_GetAccountExpansionLevel }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void SystemRegisterFunctions() {
|
||||||
|
for (auto& func : s_SystemFunctions) {
|
||||||
|
FrameScript_RegisterFunction(func.name, func.method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void SystemUnregisterFunctions() {
|
||||||
|
for (auto& func : s_SystemFunctions) {
|
||||||
|
FrameScript_UnregisterFunction(func.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
8
src/ui/ScriptFunctionsSystem.hpp
Normal file
8
src/ui/ScriptFunctionsSystem.hpp
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef UI_SCRIPT_FUNCTIONS_SYSTEM_HPP
|
||||||
|
#define UI_SCRIPT_FUNCTIONS_SYSTEM_HPP
|
||||||
|
|
||||||
|
void SystemRegisterFunctions();
|
||||||
|
|
||||||
|
void SystemUnregisterFunctions();
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -3,6 +3,8 @@
|
|||||||
#include "ui/FrameXML.hpp"
|
#include "ui/FrameXML.hpp"
|
||||||
#include "ui/Key.hpp"
|
#include "ui/Key.hpp"
|
||||||
#include "ui/game/CGWorldFrame.hpp"
|
#include "ui/game/CGWorldFrame.hpp"
|
||||||
|
#include "ui/game/GMTicketInfoScript.hpp"
|
||||||
|
#include "ui/game/GameScript.hpp"
|
||||||
#include "ui/game/ScriptEvents.hpp"
|
#include "ui/game/ScriptEvents.hpp"
|
||||||
#include "ui/simple/CSimpleTop.hpp"
|
#include "ui/simple/CSimpleTop.hpp"
|
||||||
#include "util/CStatus.hpp"
|
#include "util/CStatus.hpp"
|
||||||
@ -13,9 +15,17 @@ CSimpleTop* CGGameUI::s_simpleTop;
|
|||||||
void LoadScriptFunctions() {
|
void LoadScriptFunctions() {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
GameScriptRegisterFunctions();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
ScriptEventsRegisterFunctions();
|
ScriptEventsRegisterFunctions();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
GMTicketInfoRegisterScriptFunctions();
|
||||||
|
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGGameUI::Initialize() {
|
void CGGameUI::Initialize() {
|
||||||
|
|||||||
87
src/ui/game/GMTicketInfoScript.cpp
Normal file
87
src/ui/game/GMTicketInfoScript.cpp
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
#include "ui/game/GMTicketInfoScript.hpp"
|
||||||
|
#include "ui/FrameScript.hpp"
|
||||||
|
#include "util/Unimplemented.hpp"
|
||||||
|
|
||||||
|
int32_t Script_GetGMTicket(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_NewGMTicket(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_UpdateGMTicket(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_DeleteGMTicket(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMResponseNeedMoreHelp(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMResponseResolve(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GetGMStatus(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMSurveyQuestion(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMSurveyNumAnswers(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMSurveyAnswer(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMSurveyAnswerSubmit(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMSurveyCommentSubmit(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMSurveySubmit(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_GMReportLag(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t Script_RegisterStaticConstants(lua_State* L) {
|
||||||
|
WHOA_UNIMPLEMENTED(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static FrameScript_Method s_ScriptFunctions[] = {
|
||||||
|
{ "GetGMTicket", &Script_GetGMTicket },
|
||||||
|
{ "NewGMTicket", &Script_NewGMTicket },
|
||||||
|
{ "UpdateGMTicket", &Script_UpdateGMTicket },
|
||||||
|
{ "DeleteGMTicket", &Script_DeleteGMTicket },
|
||||||
|
{ "GMResponseNeedMoreHelp", &Script_GMResponseNeedMoreHelp },
|
||||||
|
{ "GMResponseResolve", &Script_GMResponseResolve },
|
||||||
|
{ "GetGMStatus", &Script_GetGMStatus },
|
||||||
|
{ "GMSurveyQuestion", &Script_GMSurveyQuestion },
|
||||||
|
{ "GMSurveyNumAnswers", &Script_GMSurveyNumAnswers },
|
||||||
|
{ "GMSurveyAnswer", &Script_GMSurveyAnswer },
|
||||||
|
{ "GMSurveyAnswerSubmit", &Script_GMSurveyAnswerSubmit },
|
||||||
|
{ "GMSurveyCommentSubmit", &Script_GMSurveyCommentSubmit },
|
||||||
|
{ "GMSurveySubmit", &Script_GMSurveySubmit },
|
||||||
|
{ "GMReportLag", &Script_GMReportLag },
|
||||||
|
{ "RegisterStaticConstants", &Script_RegisterStaticConstants },
|
||||||
|
};
|
||||||
|
|
||||||
|
void GMTicketInfoRegisterScriptFunctions() {
|
||||||
|
for (auto& func : s_ScriptFunctions) {
|
||||||
|
FrameScript_RegisterFunction(func.name, func.method);
|
||||||
|
}
|
||||||
|
}
|
||||||
6
src/ui/game/GMTicketInfoScript.hpp
Normal file
6
src/ui/game/GMTicketInfoScript.hpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef UI_GAME_GM_TICKET_INFO_SCRIPT_HPP
|
||||||
|
#define UI_GAME_GM_TICKET_INFO_SCRIPT_HPP
|
||||||
|
|
||||||
|
void GMTicketInfoRegisterScriptFunctions();
|
||||||
|
|
||||||
|
#endif
|
||||||
1590
src/ui/game/GameScript.cpp
Normal file
1590
src/ui/game/GameScript.cpp
Normal file
File diff suppressed because it is too large
Load Diff
6
src/ui/game/GameScript.hpp
Normal file
6
src/ui/game/GameScript.hpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef UI_GAME_GAME_SCRIPT_HPP
|
||||||
|
#define UI_GAME_GAME_SCRIPT_HPP
|
||||||
|
|
||||||
|
void GameScriptRegisterFunctions();
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -1,7 +1,6 @@
|
|||||||
#include "ui/game/ScriptEvents.hpp"
|
#include "ui/game/ScriptEvents.hpp"
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/ScriptFunctions.hpp"
|
#include "ui/ScriptFunctionsSystem.hpp"
|
||||||
#include "ui/ScriptFunctionsShared.hpp"
|
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
|
|
||||||
int32_t Script_UnitExists(lua_State* L) {
|
int32_t Script_UnitExists(lua_State* L) {
|
||||||
|
|||||||
@ -73,7 +73,16 @@ int32_t CSimpleFontString_Hide(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFontString_IsVisible(lua_State* L) {
|
int32_t CSimpleFontString_IsVisible(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleFontString::GetObjectType();
|
||||||
|
auto string = static_cast<CSimpleFontString*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (string->IsVisible()) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFontString_IsShown(lua_State* L) {
|
int32_t CSimpleFontString_IsShown(lua_State* L) {
|
||||||
|
|||||||
@ -1342,7 +1342,7 @@ void CSimpleFrame::SetBeingScrolled(int32_t a2, int32_t a3) {
|
|||||||
this->m_batchDirty |= 0x1F;
|
this->m_batchDirty |= 0x1F;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto child = this->m_children.Head(); child; this->m_children.Link(child)->Next()) {
|
for (auto child = this->m_children.Head(); child; child = this->m_children.Link(child)->Next()) {
|
||||||
if (!(child->frame->m_flags & 0x4000)) {
|
if (!(child->frame->m_flags & 0x4000)) {
|
||||||
child->frame->SetBeingScrolled(a2, -1);
|
child->frame->SetBeingScrolled(a2, -1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,6 +49,10 @@ bool CSimpleRegion::IsShown() {
|
|||||||
return this->m_shown == 1;
|
return this->m_shown == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CSimpleRegion::IsVisible() {
|
||||||
|
return this->m_visible == 1;
|
||||||
|
}
|
||||||
|
|
||||||
void CSimpleRegion::OnColorChanged(bool a2) {
|
void CSimpleRegion::OnColorChanged(bool a2) {
|
||||||
if (this->m_parent) {
|
if (this->m_parent) {
|
||||||
uint8_t effectiveAlpha = this->m_parent->m_alpha * this->m_parent->alphaBD / 255;
|
uint8_t effectiveAlpha = this->m_parent->m_alpha * this->m_parent->alphaBD / 255;
|
||||||
|
|||||||
@ -32,6 +32,7 @@ class CSimpleRegion : public CScriptRegion {
|
|||||||
void Hide();
|
void Hide();
|
||||||
void HideThis();
|
void HideThis();
|
||||||
bool IsShown();
|
bool IsShown();
|
||||||
|
bool IsVisible();
|
||||||
void OnRegionChanged();
|
void OnRegionChanged();
|
||||||
void SetVertexColor(const CImVector& color);
|
void SetVertexColor(const CImVector& color);
|
||||||
void SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor);
|
void SetVertexGradient(ORIENTATION orientation, const CImVector& minColor, const CImVector& maxColor);
|
||||||
|
|||||||
@ -97,11 +97,29 @@ int32_t CSimpleTexture_Hide(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleTexture_IsVisible(lua_State* L) {
|
int32_t CSimpleTexture_IsVisible(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleTexture::GetObjectType();
|
||||||
|
auto texture = static_cast<CSimpleTexture*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (texture->IsVisible()) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleTexture_IsShown(lua_State* L) {
|
int32_t CSimpleTexture_IsShown(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto type = CSimpleTexture::GetObjectType();
|
||||||
|
auto texture = static_cast<CSimpleTexture*>(FrameScript_GetObjectThis(L, type));
|
||||||
|
|
||||||
|
if (texture->IsShown()) {
|
||||||
|
lua_pushnumber(L, 1.0);
|
||||||
|
} else {
|
||||||
|
lua_pushnil(L);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleTexture_GetTexture(lua_State* L) {
|
int32_t CSimpleTexture_GetTexture(lua_State* L) {
|
||||||
|
|||||||
@ -1,13 +1,24 @@
|
|||||||
|
#include "ui/simple/ScriptMethods.hpp"
|
||||||
#include "ui/FrameXML.hpp"
|
#include "ui/FrameXML.hpp"
|
||||||
#include "ui/ScriptFunctions.hpp"
|
|
||||||
#include "ui/Types.hpp"
|
#include "ui/Types.hpp"
|
||||||
|
#include "ui/simple/CSimpleButton.hpp"
|
||||||
|
#include "ui/simple/CSimpleCheckbox.hpp"
|
||||||
|
#include "ui/simple/CSimpleEditBox.hpp"
|
||||||
|
#include "ui/simple/CSimpleFont.hpp"
|
||||||
|
#include "ui/simple/CSimpleFontString.hpp"
|
||||||
#include "ui/simple/CSimpleFrame.hpp"
|
#include "ui/simple/CSimpleFrame.hpp"
|
||||||
|
#include "ui/simple/CSimpleHTML.hpp"
|
||||||
|
#include "ui/simple/CSimpleModel.hpp"
|
||||||
|
#include "ui/simple/CSimpleModelFFX.hpp"
|
||||||
|
#include "ui/simple/CSimpleScrollFrame.hpp"
|
||||||
|
#include "ui/simple/CSimpleSlider.hpp"
|
||||||
|
#include "ui/simple/CSimpleTexture.hpp"
|
||||||
#include "util/CStatus.hpp"
|
#include "util/CStatus.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
#include <common/XML.hpp>
|
#include <common/XML.hpp>
|
||||||
#include <cstdint>
|
|
||||||
#include <storm/String.hpp>
|
#include <storm/String.hpp>
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
int32_t Script_GetText(lua_State* L) {
|
int32_t Script_GetText(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
@ -137,7 +148,7 @@ int32_t Script_GetCurrentKeyBoardFocus(lua_State* L) {
|
|||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
FrameScript_Method FrameScript::s_ScriptFunctions_SimpleFrame[NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME] = {
|
static FrameScript_Method s_ScriptFunctions[] = {
|
||||||
{ "GetText", &Script_GetText },
|
{ "GetText", &Script_GetText },
|
||||||
{ "GetNumFrames", &Script_GetNumFrames },
|
{ "GetNumFrames", &Script_GetNumFrames },
|
||||||
{ "EnumerateFrames", &Script_EnumerateFrames },
|
{ "EnumerateFrames", &Script_EnumerateFrames },
|
||||||
@ -146,3 +157,42 @@ FrameScript_Method FrameScript::s_ScriptFunctions_SimpleFrame[NUM_SCRIPT_FUNCTIO
|
|||||||
{ "GetFramesRegisteredForEvent", &Script_GetFramesRegisteredForEvent },
|
{ "GetFramesRegisteredForEvent", &Script_GetFramesRegisteredForEvent },
|
||||||
{ "GetCurrentKeyBoardFocus", &Script_GetCurrentKeyBoardFocus },
|
{ "GetCurrentKeyBoardFocus", &Script_GetCurrentKeyBoardFocus },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void RegisterSimpleFrameScriptMethods() {
|
||||||
|
for (auto& func : s_ScriptFunctions) {
|
||||||
|
FrameScript_RegisterFunction(func.name, func.method);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// CSimpleAnim::CreateScriptMetaTable();
|
||||||
|
// CSimpleTranslationAnim::CreateScriptMetaTable();
|
||||||
|
// CSimpleRotationAnim::CreateScriptMetaTable();
|
||||||
|
// CSimpleScaleAnim::CreateScriptMetaTable();
|
||||||
|
// CSimpleControlPoint::CreateScriptMetaTable();
|
||||||
|
// CSimplePathAnim::CreateScriptMetaTable();
|
||||||
|
// CSimpleAlphaAnim::CreateScriptMetaTable();
|
||||||
|
// CSimpleAnimGroup::CreateScriptMetaTable();
|
||||||
|
|
||||||
|
CSimpleFont::CreateScriptMetaTable();
|
||||||
|
CSimpleTexture::CreateScriptMetaTable();
|
||||||
|
CSimpleFontString::CreateScriptMetaTable();
|
||||||
|
CSimpleFrame::CreateScriptMetaTable();
|
||||||
|
CSimpleButton::CreateScriptMetaTable();
|
||||||
|
CSimpleCheckbox::CreateScriptMetaTable();
|
||||||
|
CSimpleEditBox::CreateScriptMetaTable();
|
||||||
|
CSimpleHTML::CreateScriptMetaTable();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// CSimpleMessageFrame::CreateScriptMetaTable();
|
||||||
|
// CSimpleMessageScrollFrame::CreateScriptMetaTable();
|
||||||
|
|
||||||
|
CSimpleModel::CreateScriptMetaTable();
|
||||||
|
CSimpleModelFFX::CreateScriptMetaTable();
|
||||||
|
CSimpleScrollFrame::CreateScriptMetaTable();
|
||||||
|
CSimpleSlider::CreateScriptMetaTable();
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
// CSimpleStatusBar::CreateScriptMetaTable();
|
||||||
|
// CSimpleColorSelect::CreateScriptMetaTable();
|
||||||
|
// CSimpleMovieFrame::CreateScriptMetaTable();
|
||||||
|
}
|
||||||
6
src/ui/simple/ScriptMethods.hpp
Normal file
6
src/ui/simple/ScriptMethods.hpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#ifndef UI_SIMPLE_SCRIPT_METHODS_HPP
|
||||||
|
#define UI_SIMPLE_SCRIPT_METHODS_HPP
|
||||||
|
|
||||||
|
void RegisterSimpleFrameScriptMethods();
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user