From 499d4e3c8f9a304f8ce35aeedbe8c4d014eec08a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 27 May 2007 19:09:18 +0000 Subject: [PATCH] var, not global --- .../Graphics/ScreenSelectProfile scroll choiceProfile.lua | 6 +++--- .../Themes/default/Graphics/ScreenTitleMenu scroll.lua | 2 +- stepmania/src/ScreenSelectMaster.cpp | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/stepmania/Themes/default/Graphics/ScreenSelectProfile scroll choiceProfile.lua b/stepmania/Themes/default/Graphics/ScreenSelectProfile scroll choiceProfile.lua index a9a1ce35a7..843ab41c4f 100644 --- a/stepmania/Themes/default/Graphics/ScreenSelectProfile scroll choiceProfile.lua +++ b/stepmania/Themes/default/Graphics/ScreenSelectProfile scroll choiceProfile.lua @@ -1,11 +1,11 @@ return Def.ActorFrame { GainFocusCommand=cmd(); LoseFocusCommand=cmd(); - LoadActor( PROFILEMAN:GetLocalProfile( GAMESTATE:Env().ThisGameCommand:GetProfileID() ):GetCharacter():GetIconPath() ) .. { + LoadActor( PROFILEMAN:GetLocalProfile( Var("GameCommand"):GetProfileID() ):GetCharacter():GetIconPath() ) .. { InitCommand=cmd(x,20); }; LoadFont( "Common normal" ) .. { - Text=PROFILEMAN:GetLocalProfile( GAMESTATE:Env().ThisGameCommand:GetProfileID() ):GetDisplayName(); + Text=PROFILEMAN:GetLocalProfile( Var("GameCommand"):GetProfileID() ):GetDisplayName(); OnCommand=cmd(diffusealpha,0;linear,0.3;diffusealpha,1): OffCommand=cmd(linear,0.3;diffusealpha,0); InitCommand=cmd(halign,0;shadowlength,2;x,50); @@ -15,7 +15,7 @@ return Def.ActorFrame { DisabledCommand="diffuse,0.5,0.5,0.5,1" }; LoadFont( "Common normal" ) .. { - Text="PROFILEMAN:GetLocalProfile( GAMESTATE:Env().ThisGameCommand:GetProfileID() ):GetNumTotalSongsPlayed() .. ' song(s) played'" + Text=PROFILEMAN:GetLocalProfile( Var("GameCommand"):GetProfileID() ):GetNumTotalSongsPlayed() .. " song(s) played"; OnCommand=cmd(diffusealpha,0;linear,0.3;diffusealpha,1); OffCommand=cmd(linear,0.3;diffusealpha,0); InitCommand=cmd(halign,0;shadowlength,2;x,280); diff --git a/stepmania/Themes/default/Graphics/ScreenTitleMenu scroll.lua b/stepmania/Themes/default/Graphics/ScreenTitleMenu scroll.lua index 1410d07bf6..8e942a72c4 100644 --- a/stepmania/Themes/default/Graphics/ScreenTitleMenu scroll.lua +++ b/stepmania/Themes/default/Graphics/ScreenTitleMenu scroll.lua @@ -1,6 +1,6 @@ local t = Def.ActorFrame { LoadFont("", "blaster") ..{ - Text=THEME:GetString( 'ScreenTitleMenu', ThisGameCommand:GetText() ); + Text=THEME:GetString( 'ScreenTitleMenu', Var("GameCommand"):GetText() ); InitCommand=cmd(horizalign,center;shadowlength,0); GainFocusCommand=cmd(stoptweening;diffuseshift;effectperiod,0.5;effectcolor1,0.5,1,0.5,1;effectcolor2,0.25,0.5,0.25,1;); LoseFocusCommand=cmd(stoptweening;stopeffect); diff --git a/stepmania/src/ScreenSelectMaster.cpp b/stepmania/src/ScreenSelectMaster.cpp index bc4afc9a42..ab3a2aef78 100644 --- a/stepmania/src/ScreenSelectMaster.cpp +++ b/stepmania/src/ScreenSelectMaster.cpp @@ -103,6 +103,7 @@ void ScreenSelectMaster::Init() { GameCommand& mc = m_aGameCommands[c]; + LuaThreadVariable var( "GameCommand", LuaReference::Create(&mc) ); Lua *L = LUA->Get(); mc.PushSelf( L ); lua_setglobal( L, "ThisGameCommand" );