Files
itgmania212121/stepmania/Themes/default/Graphics/Player combo/default.lua
T

83 lines
2.0 KiB
Lua
Raw Normal View History

2007-03-01 23:40:52 +00:00
local c;
local player = Var "Player";
local ShowComboAt = THEME:GetMetric("Combo", "ShowComboAt");
2009-04-04 23:18:12 +00:00
local ShowMissesAt = THEME:GetMetric("Combo", "ShowMissesAt");
2007-03-01 23:40:52 +00:00
local Pulse = THEME:GetMetric("Combo", "PulseCommand");
local NumberMinZoom = THEME:GetMetric("Combo", "NumberMinZoom");
local NumberMaxZoom = THEME:GetMetric("Combo", "NumberMaxZoom");
local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt");
2007-05-20 17:59:03 +00:00
local t = Def.ActorFrame {
2009-04-04 23:18:12 +00:00
LoadFont( "Combo", "ComboNumber" ) .. {
Name="ComboNumber";
OnCommand = THEME:GetMetric("Combo", "ComboNumberOnCommand");
};
LoadFont( "Combo", "MissesNumber" ) .. {
Name="MissesNumber";
OnCommand = THEME:GetMetric("Combo", "MissesNumberOnCommand");
2007-03-01 23:40:52 +00:00
};
LoadActor("_combo") .. {
Name="ComboLabel";
2009-04-04 23:18:12 +00:00
OnCommand = THEME:GetMetric("Combo", "ComboLabelOnCommand");
2007-03-01 23:40:52 +00:00
};
LoadActor("_misses") .. {
Name="MissesLabel";
2009-04-04 23:18:12 +00:00
OnCommand = THEME:GetMetric("Combo", "MissesLabelOnCommand");
2007-03-01 23:40:52 +00:00
};
InitCommand = function(self)
c = self:GetChildren();
2009-04-04 23:18:12 +00:00
c.ComboNumber:visible(false);
c.MissesNumber:visible(false);
2007-03-01 23:40:52 +00:00
c.ComboLabel:visible(false);
c.MissesLabel:visible(false);
end;
ComboCommand=function(self, param)
2009-04-04 23:18:12 +00:00
local iNum = param.Misses or param.Combo;
c.ComboNumber:visible(false);
c.MissesNumber:visible(false);
c.ComboLabel:visible(false);
c.MissesLabel:visible(false);
local ShowAt;
if param.Combo then
ShowAt = ShowComboAt;
else
ShowAt = ShowMissesAt;
end
if not iNum or ShowAt == 0 or iNum < ShowAt then
2007-03-01 23:40:52 +00:00
return;
end
2009-04-04 23:18:12 +00:00
local Number;
if param.Combo then
Number = c.ComboNumber;
else
Number = c.MissesNumber;
end
2007-03-01 23:40:52 +00:00
local Label;
if param.Combo then
Label = c.ComboLabel;
else
Label = c.MissesLabel;
end
2009-04-04 23:18:12 +00:00
param.Zoom = scale( iNum, 0, NumberMaxZoomAt, NumberMinZoom, NumberMaxZoom );
2007-03-01 23:40:52 +00:00
param.Zoom = clamp( param.Zoom, NumberMinZoom, NumberMaxZoom );
2009-04-04 23:18:12 +00:00
Number:visible(true);
2007-03-01 23:40:52 +00:00
Label:visible(true);
2009-04-04 23:18:12 +00:00
Number:settext( string.format("%i", iNum) );
2007-03-01 23:40:52 +00:00
2009-04-04 23:18:12 +00:00
Pulse( Number, param );
2007-03-01 23:40:52 +00:00
Pulse( Label, param );
end;
};
2007-05-20 17:59:03 +00:00
return t;