mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(ui): add CGVideoOptions::RegisterScriptFunctions
This commit is contained in:
parent
c83fd24a72
commit
22a2e1a411
@ -22,6 +22,7 @@
|
||||
#include "ui/FrameXML.hpp"
|
||||
#include "ui/Interface.hpp"
|
||||
#include "ui/ScriptFunctions.hpp"
|
||||
#include "ui/game/CGVideoOptions.hpp"
|
||||
#include "util/Filesystem.hpp"
|
||||
#include "util/Locale.hpp"
|
||||
#include "util/Log.hpp"
|
||||
@ -923,7 +924,8 @@ void CGlueMgr::Resume() {
|
||||
|
||||
// TODO
|
||||
// AccountMsg_RegisterScriptFunctions();
|
||||
// CGVideoOptions::RegisterScriptFunctions();
|
||||
|
||||
CGVideoOptions::RegisterScriptFunctions();
|
||||
|
||||
// TODO
|
||||
// FrameScript::s_scriptFunctionsLoaded = 1;
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
file(GLOB PRIVATE_SOURCES "*.cpp")
|
||||
file(GLOB PRIVATE_SOURCES
|
||||
"*.cpp"
|
||||
"game/*.cpp"
|
||||
)
|
||||
|
||||
add_library(ui STATIC
|
||||
${PRIVATE_SOURCES}
|
||||
|
||||
14
src/ui/game/CGVideoOptions.cpp
Normal file
14
src/ui/game/CGVideoOptions.cpp
Normal file
@ -0,0 +1,14 @@
|
||||
#include "ui/game/CGVideoOptions.hpp"
|
||||
|
||||
void CGVideoOptions::RegisterScriptFunctions() {
|
||||
for (int32_t i = 0; i < NUM_SCRIPT_FUNCTIONS_VIDEO_OPTIONS; i++) {
|
||||
FrameScript_RegisterFunction(
|
||||
CGVideoOptions::s_ScriptFunctions[i].name,
|
||||
CGVideoOptions::s_ScriptFunctions[i].method
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void CGVideoOptions::UnregisterScriptFunctions() {
|
||||
// TODO
|
||||
}
|
||||
17
src/ui/game/CGVideoOptions.hpp
Normal file
17
src/ui/game/CGVideoOptions.hpp
Normal file
@ -0,0 +1,17 @@
|
||||
#ifndef UI_GAME_C_G_VIDEO_OPTIONS_HPP
|
||||
#define UI_GAME_C_G_VIDEO_OPTIONS_HPP
|
||||
|
||||
#include "ui/FrameScript.hpp"
|
||||
#include "ui/game/CGVideoOptionsScript.hpp"
|
||||
|
||||
class CGVideoOptions {
|
||||
public:
|
||||
// Static members
|
||||
static FrameScript_Method s_ScriptFunctions[NUM_SCRIPT_FUNCTIONS_VIDEO_OPTIONS];
|
||||
|
||||
// Static functions
|
||||
static void RegisterScriptFunctions();
|
||||
static void UnregisterScriptFunctions();
|
||||
};
|
||||
|
||||
#endif
|
||||
82
src/ui/game/CGVideoOptionsScript.cpp
Normal file
82
src/ui/game/CGVideoOptionsScript.cpp
Normal file
@ -0,0 +1,82 @@
|
||||
#include "ui/game/CGVideoOptionsScript.hpp"
|
||||
#include "ui/game/CGVideoOptions.hpp"
|
||||
#include "ui/Types.hpp"
|
||||
#include "util/Lua.hpp"
|
||||
#include "util/Unimplemented.hpp"
|
||||
|
||||
int32_t Script_GetScreenResolutions(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
int32_t Script_GetCurrentResolution(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_SetScreenResolution(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetRefreshRates(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_SetupFullscreenScale(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetMultisampleFormats(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetCurrentMultisampleFormat(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_SetMultisampleFormat(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetVideoCaps(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetGamma(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_SetGamma(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_GetTerrainMip(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_SetTerrainMip(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_IsStereoVideoAvailable(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
int32_t Script_IsPlayerResolutionAvailable(lua_State* L) {
|
||||
WHOA_UNIMPLEMENTED(0);
|
||||
}
|
||||
|
||||
FrameScript_Method CGVideoOptions::s_ScriptFunctions[NUM_SCRIPT_FUNCTIONS_VIDEO_OPTIONS] = {
|
||||
{ "GetScreenResolutions", &Script_GetScreenResolutions },
|
||||
{ "GetCurrentResolution", &Script_GetCurrentResolution },
|
||||
{ "SetScreenResolution", &Script_SetScreenResolution },
|
||||
{ "GetRefreshRates", &Script_GetRefreshRates },
|
||||
{ "SetupFullscreenScale", &Script_SetupFullscreenScale },
|
||||
{ "GetMultisampleFormats", &Script_GetMultisampleFormats },
|
||||
{ "GetCurrentMultisampleFormat", &Script_GetCurrentMultisampleFormat },
|
||||
{ "SetMultisampleFormat", &Script_SetMultisampleFormat },
|
||||
{ "GetVideoCaps", &Script_GetVideoCaps },
|
||||
{ "GetGamma", &Script_GetGamma },
|
||||
{ "SetGamma", &Script_SetGamma },
|
||||
{ "GetTerrainMip", &Script_GetTerrainMip },
|
||||
{ "SetTerrainMip", &Script_SetTerrainMip },
|
||||
{ "IsStereoVideoAvailable", &Script_IsStereoVideoAvailable },
|
||||
{ "IsPlayerResolutionAvailable", &Script_IsPlayerResolutionAvailable }
|
||||
};
|
||||
6
src/ui/game/CGVideoOptionsScript.hpp
Normal file
6
src/ui/game/CGVideoOptionsScript.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
#ifndef UI_GAME_C_G_VIDEO_OPTIONS_SCRIPT_HPP
|
||||
#define UI_GAME_C_G_VIDEO_OPTIONS_SCRIPT_HPP
|
||||
|
||||
#define NUM_SCRIPT_FUNCTIONS_VIDEO_OPTIONS 15
|
||||
|
||||
#endif
|
||||
Loading…
Reference in New Issue
Block a user