From 764402bca7cfb8c192bed50ac68cd1a0cf5c8a7a Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 7 Mar 2007 03:58:16 +0000 Subject: [PATCH] fixup: odn't use ScreenMetric outside of init --- .../ScreenWithMenuElements overlay.lua | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/stepmania/Themes/default/BGAnimations/ScreenWithMenuElements overlay.lua b/stepmania/Themes/default/BGAnimations/ScreenWithMenuElements overlay.lua index 7476c032be..341a101a49 100644 --- a/stepmania/Themes/default/BGAnimations/ScreenWithMenuElements overlay.lua +++ b/stepmania/Themes/default/BGAnimations/ScreenWithMenuElements overlay.lua @@ -1,28 +1,33 @@ local children = { }; -children[#children+1] = Def.HelpDisplay { - File = THEME:GetPathF("HelpDisplay", "text"); +local function MakeHelpDisplay() + local X = self:x( ScreenMetric("HelpX") ); + local Y = self:y( ScreenMetric("HelpY") ); + local On = ScreenMetric("HelpOnCommand"); + local Off = ScreenMetric("HelpOffCommand"); - InitCommand=function(self) - local s = ScreenString("HelpText"); - self:SetTipsColonSeparated(s); - end; + local t = Def.HelpDisplay { + File = THEME:GetPathF("HelpDisplay", "text"); - SetHelpTextCommand=function(self, params) - self:SetTipsColonSeparated( params.Text ); - end; - OnCommand=function(self) - self:x( ScreenMetric("HelpX") ); - self:y( ScreenMetric("HelpY") ); - local f = ScreenMetric("HelpOnCommand"); - f(self); - end; - OffCommand=function(self) - local f = ScreenMetric("HelpOffCommand"); - f(self); - end; -}; + InitCommand=function(self) + local s = ScreenString("HelpText"); + self:SetTipsColonSeparated(s); + end; + SetHelpTextCommand=function(self, params) + self:SetTipsColonSeparated( params.Text ); + end; + OnCommand=function(self) + self:x( X ); + self:y( Y ); + On(self); + end; + OffCommand=Off; + }; + return t; +end + +children[#children+1] = MakeHelpDisplay(); return Def.ActorFrame { children = children; };