mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 03:02:30 +00:00
feat(ui): implement Script_GetMovieResolution method
This commit is contained in:
parent
5a36ab2f7c
commit
92a3925797
3 changed files with 16 additions and 4 deletions
|
|
@ -31,16 +31,16 @@ FrameScript_Object::ScriptIx* CSimpleMovieFrame::GetScriptByName(const char* nam
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SStrCmpI(name, "OnMovieFinished", STORM_MAX_STR)) {
|
if (!SStrCmpI(name, "OnMovieFinished", STORM_MAX_STR)) {
|
||||||
//return (int)this + 948;
|
return &this->m_onMovieFinished;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SStrCmpI(name, "OnMovieShowSubtitle", STORM_MAX_STR)) {
|
if (!SStrCmpI(name, "OnMovieShowSubtitle", STORM_MAX_STR)) {
|
||||||
data.wrapper = "return function(self,text) %s end";
|
data.wrapper = "return function(self,text) %s end";
|
||||||
//return (int)this + 956;
|
return &this->m_onMovieShowSubtitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SStrCmpI(name, "OnMovieHideSubtitle", STORM_MAX_STR)) {
|
if (!SStrCmpI(name, "OnMovieHideSubtitle", STORM_MAX_STR)) {
|
||||||
//return (int)this + 964;
|
return &this->m_onMovieHideSubtitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,9 @@ class CSimpleMovieFrame : public CSimpleFrame {
|
||||||
static void RegisterScriptMethods(lua_State* L);
|
static void RegisterScriptMethods(lua_State* L);
|
||||||
|
|
||||||
// Member variables
|
// Member variables
|
||||||
|
ScriptIx m_onMovieFinished;
|
||||||
|
ScriptIx m_onMovieShowSubtitle;
|
||||||
|
ScriptIx m_onMovieHideSubtitle;
|
||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,16 @@ int32_t Script_StopGlueMusic(lua_State* L) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetMovieResolution(lua_State* L) {
|
int32_t Script_GetMovieResolution(lua_State* L) {
|
||||||
WHOA_UNIMPLEMENTED(0);
|
auto gxResolution = CVar::Lookup("gxResolution");
|
||||||
|
STORM_ASSERT(gxResolution);
|
||||||
|
auto resolution = gxResolution->GetString();
|
||||||
|
STORM_ASSERT(resolution);
|
||||||
|
|
||||||
|
int32_t width = 0;
|
||||||
|
int32_t height = 0;
|
||||||
|
sscanf(resolution, "%dx%d", &width, &height);
|
||||||
|
lua_pushnumber(L, width);
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t Script_GetScreenWidth(lua_State* L) {
|
int32_t Script_GetScreenWidth(lua_State* L) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue