mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-03 01:02:44 +03:00
Compare commits
1 Commits
3c7c1800bf
...
215e17d02a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
215e17d02a |
@ -26,11 +26,10 @@
|
|||||||
#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/ScriptFunctionsSystem.hpp"
|
#include "ui/ScriptFunctions.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"
|
||||||
@ -1198,10 +1197,6 @@ void CGlueMgr::Suspend() {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
SystemUnregisterFunctions();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
FrameXML_FreeHashNodes();
|
FrameXML_FreeHashNodes();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|||||||
@ -522,6 +522,36 @@ 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,15 +1047,6 @@ 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,8 +99,6 @@ 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();
|
||||||
|
|||||||
65
src/ui/ScriptFunctions.cpp
Normal file
65
src/ui/ScriptFunctions.cpp
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
#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
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
21
src/ui/ScriptFunctions.hpp
Normal file
21
src/ui/ScriptFunctions.hpp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
#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/ScriptFunctionsShared.hpp"
|
#include "ui/ScriptFunctions.hpp"
|
||||||
#include "util/Lua.hpp"
|
#include "util/Lua.hpp"
|
||||||
#include "util/Unimplemented.hpp"
|
#include "util/Unimplemented.hpp"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -6,33 +6,3 @@
|
|||||||
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,10 +6,4 @@
|
|||||||
|
|
||||||
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,24 +1,13 @@
|
|||||||
#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 <storm/String.hpp>
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include <storm/String.hpp>
|
||||||
|
|
||||||
int32_t Script_GetText(lua_State* L) {
|
int32_t Script_GetText(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
@ -148,7 +137,7 @@ int32_t Script_GetCurrentKeyBoardFocus(lua_State* L) {
|
|||||||
WHOA_UNIMPLEMENTED(0);
|
WHOA_UNIMPLEMENTED(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static FrameScript_Method s_ScriptFunctions[] = {
|
FrameScript_Method FrameScript::s_ScriptFunctions_SimpleFrame[NUM_SCRIPT_FUNCTIONS_SIMPLE_FRAME] = {
|
||||||
{ "GetText", &Script_GetText },
|
{ "GetText", &Script_GetText },
|
||||||
{ "GetNumFrames", &Script_GetNumFrames },
|
{ "GetNumFrames", &Script_GetNumFrames },
|
||||||
{ "EnumerateFrames", &Script_EnumerateFrames },
|
{ "EnumerateFrames", &Script_EnumerateFrames },
|
||||||
@ -157,42 +146,3 @@ static FrameScript_Method s_ScriptFunctions[] = {
|
|||||||
{ "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();
|
|
||||||
}
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#include "ui/FrameScript.hpp"
|
#include "ui/ScriptFunctions.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,12 +22,10 @@ int32_t Script_ConsoleExec(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_AccessDenied(lua_State* L) {
|
int32_t Script_AccessDenied(lua_State* L) {
|
||||||
luaL_error(L, "Access Denied");
|
return luaL_error(L, "Access Denied");
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static FrameScript_Method s_SystemFunctions[] = {
|
FrameScript_Method FrameScript::s_ScriptFunctions_System[NUM_SCRIPT_FUNCTIONS_SYSTEM] = {
|
||||||
{ "GetTime", &Script_GetTime },
|
{ "GetTime", &Script_GetTime },
|
||||||
{ "GetGameTime", &Script_GetGameTime },
|
{ "GetGameTime", &Script_GetGameTime },
|
||||||
{ "ConsoleExec", &Script_ConsoleExec },
|
{ "ConsoleExec", &Script_ConsoleExec },
|
||||||
@ -36,15 +34,3 @@ static FrameScript_Method s_SystemFunctions[] = {
|
|||||||
{ "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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
#ifndef UI_SCRIPT_FUNCTIONS_SYSTEM_HPP
|
|
||||||
#define UI_SCRIPT_FUNCTIONS_SYSTEM_HPP
|
|
||||||
|
|
||||||
void SystemRegisterFunctions();
|
|
||||||
|
|
||||||
void SystemUnregisterFunctions();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -3,8 +3,6 @@
|
|||||||
#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"
|
||||||
@ -15,17 +13,9 @@ CSimpleTop* CGGameUI::s_simpleTop;
|
|||||||
void LoadScriptFunctions() {
|
void LoadScriptFunctions() {
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
GameScriptRegisterFunctions();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
ScriptEventsRegisterFunctions();
|
ScriptEventsRegisterFunctions();
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
GMTicketInfoRegisterScriptFunctions();
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGGameUI::Initialize() {
|
void CGGameUI::Initialize() {
|
||||||
|
|||||||
@ -1,87 +0,0 @@
|
|||||||
#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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
#ifndef UI_GAME_GM_TICKET_INFO_SCRIPT_HPP
|
|
||||||
#define UI_GAME_GM_TICKET_INFO_SCRIPT_HPP
|
|
||||||
|
|
||||||
void GMTicketInfoRegisterScriptFunctions();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +0,0 @@
|
|||||||
#ifndef UI_GAME_GAME_SCRIPT_HPP
|
|
||||||
#define UI_GAME_GAME_SCRIPT_HPP
|
|
||||||
|
|
||||||
void GameScriptRegisterFunctions();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
#include "ui/game/ScriptEvents.hpp"
|
#include "ui/game/ScriptEvents.hpp"
|
||||||
#include "ui/FrameScript.hpp"
|
#include "ui/FrameScript.hpp"
|
||||||
#include "ui/ScriptFunctionsSystem.hpp"
|
#include "ui/ScriptFunctions.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,16 +73,7 @@ int32_t CSimpleFontString_Hide(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleFontString_IsVisible(lua_State* L) {
|
int32_t CSimpleFontString_IsVisible(lua_State* L) {
|
||||||
auto type = CSimpleFontString::GetObjectType();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
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; child = this->m_children.Link(child)->Next()) {
|
for (auto child = this->m_children.Head(); 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,10 +49,6 @@ 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,7 +32,6 @@ 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,29 +97,11 @@ int32_t CSimpleTexture_Hide(lua_State* L) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t CSimpleTexture_IsVisible(lua_State* L) {
|
int32_t CSimpleTexture_IsVisible(lua_State* L) {
|
||||||
auto type = CSimpleTexture::GetObjectType();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
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) {
|
||||||
auto type = CSimpleTexture::GetObjectType();
|
WHOA_UNIMPLEMENTED(0);
|
||||||
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,6 +0,0 @@
|
|||||||
#ifndef UI_SIMPLE_SCRIPT_METHODS_HPP
|
|
||||||
#define UI_SIMPLE_SCRIPT_METHODS_HPP
|
|
||||||
|
|
||||||
void RegisterSimpleFrameScriptMethods();
|
|
||||||
|
|
||||||
#endif
|
|
||||||
Loading…
Reference in New Issue
Block a user