mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-10-26 22:06:06 +03:00
feat(ui): implement Script_GetMovieResolution method
This commit is contained in:
parent
5a36ab2f7c
commit
92a3925797
@ -31,16 +31,16 @@ FrameScript_Object::ScriptIx* CSimpleMovieFrame::GetScriptByName(const char* nam
|
||||
}
|
||||
|
||||
if (!SStrCmpI(name, "OnMovieFinished", STORM_MAX_STR)) {
|
||||
//return (int)this + 948;
|
||||
return &this->m_onMovieFinished;
|
||||
}
|
||||
|
||||
if (!SStrCmpI(name, "OnMovieShowSubtitle", STORM_MAX_STR)) {
|
||||
data.wrapper = "return function(self,text) %s end";
|
||||
//return (int)this + 956;
|
||||
return &this->m_onMovieShowSubtitle;
|
||||
}
|
||||
|
||||
if (!SStrCmpI(name, "OnMovieHideSubtitle", STORM_MAX_STR)) {
|
||||
//return (int)this + 964;
|
||||
return &this->m_onMovieHideSubtitle;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
|
||||
@ -19,6 +19,9 @@ class CSimpleMovieFrame : public CSimpleFrame {
|
||||
static void RegisterScriptMethods(lua_State* L);
|
||||
|
||||
// Member variables
|
||||
ScriptIx m_onMovieFinished;
|
||||
ScriptIx m_onMovieShowSubtitle;
|
||||
ScriptIx m_onMovieHideSubtitle;
|
||||
|
||||
// Virtual member functions
|
||||
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) {
|
||||
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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user