fixup: odn't use ScreenMetric outside of init

This commit is contained in:
Glenn Maynard
2007-03-07 03:58:16 +00:00
parent 62700dffa4
commit 764402bca7
@@ -1,6 +1,12 @@
local children = { }; local children = { };
children[#children+1] = Def.HelpDisplay { local function MakeHelpDisplay()
local X = self:x( ScreenMetric("HelpX") );
local Y = self:y( ScreenMetric("HelpY") );
local On = ScreenMetric("HelpOnCommand");
local Off = ScreenMetric("HelpOffCommand");
local t = Def.HelpDisplay {
File = THEME:GetPathF("HelpDisplay", "text"); File = THEME:GetPathF("HelpDisplay", "text");
InitCommand=function(self) InitCommand=function(self)
@@ -12,17 +18,16 @@ children[#children+1] = Def.HelpDisplay {
self:SetTipsColonSeparated( params.Text ); self:SetTipsColonSeparated( params.Text );
end; end;
OnCommand=function(self) OnCommand=function(self)
self:x( ScreenMetric("HelpX") ); self:x( X );
self:y( ScreenMetric("HelpY") ); self:y( Y );
local f = ScreenMetric("HelpOnCommand"); On(self);
f(self);
end; end;
OffCommand=function(self) OffCommand=Off;
local f = ScreenMetric("HelpOffCommand"); };
f(self); return t;
end; end
};
children[#children+1] = MakeHelpDisplay();
return Def.ActorFrame { return Def.ActorFrame {
children = children; children = children;
}; };