combo cleanup

This commit is contained in:
Chris Danford
2009-04-04 23:18:12 +00:00
parent 13d28b44b5
commit 6ed1c8bd2b
6 changed files with 46 additions and 21 deletions
@@ -0,0 +1 @@
_venacti 100
@@ -0,0 +1 @@
return Def.Actor {}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

@@ -1,6 +1,7 @@
local c; local c;
local player = Var "Player"; local player = Var "Player";
local ShowComboAt = THEME:GetMetric("Combo", "ShowComboAt"); local ShowComboAt = THEME:GetMetric("Combo", "ShowComboAt");
local ShowMissesAt = THEME:GetMetric("Combo", "ShowMissesAt");
local Pulse = THEME:GetMetric("Combo", "PulseCommand"); local Pulse = THEME:GetMetric("Combo", "PulseCommand");
local NumberMinZoom = THEME:GetMetric("Combo", "NumberMinZoom"); local NumberMinZoom = THEME:GetMetric("Combo", "NumberMinZoom");
@@ -8,53 +9,72 @@ local NumberMaxZoom = THEME:GetMetric("Combo", "NumberMaxZoom");
local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt"); local NumberMaxZoomAt = THEME:GetMetric("Combo", "NumberMaxZoomAt");
local t = Def.ActorFrame { local t = Def.ActorFrame {
LoadFont( "Combo", "numbers" ) .. { LoadFont( "Combo", "ComboNumber" ) .. {
Name="Number"; Name="ComboNumber";
OnCommand = THEME:GetMetric("Combo", "NumberOnCommand"); OnCommand = THEME:GetMetric("Combo", "ComboNumberOnCommand");
};
LoadFont( "Combo", "MissesNumber" ) .. {
Name="MissesNumber";
OnCommand = THEME:GetMetric("Combo", "MissesNumberOnCommand");
}; };
LoadActor("_combo") .. { LoadActor("_combo") .. {
Name="ComboLabel"; Name="ComboLabel";
OnCommand = THEME:GetMetric("Combo", "LabelOnCommand"); OnCommand = THEME:GetMetric("Combo", "ComboLabelOnCommand");
}; };
LoadActor("_misses") .. { LoadActor("_misses") .. {
Name="MissesLabel"; Name="MissesLabel";
OnCommand = THEME:GetMetric("Combo", "LabelOnCommand"); OnCommand = THEME:GetMetric("Combo", "MissesLabelOnCommand");
}; };
InitCommand = function(self) InitCommand = function(self)
c = self:GetChildren(); c = self:GetChildren();
c.Number:visible(false); c.ComboNumber:visible(false);
c.MissesNumber:visible(false);
c.ComboLabel:visible(false); c.ComboLabel:visible(false);
c.MissesLabel:visible(false); c.MissesLabel:visible(false);
end; end;
ComboCommand=function(self, param) ComboCommand=function(self, param)
local iCombo = param.Misses or param.Combo; local iNum = param.Misses or param.Combo;
if not iCombo or iCombo < ShowComboAt then
c.Number:visible(false); c.ComboNumber:visible(false);
c.ComboLabel:visible(false); c.MissesNumber:visible(false);
c.MissesLabel: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
return; return;
end end
local Number;
if param.Combo then
Number = c.ComboNumber;
else
Number = c.MissesNumber;
end
local Label; local Label;
if param.Combo then if param.Combo then
Label = c.ComboLabel; Label = c.ComboLabel;
else else
Label = c.MissesLabel; Label = c.MissesLabel;
end end
-- reset the label's visibility so we don't accidentally draw both labels
Label:visible(false);
param.Zoom = scale( iCombo, 0, NumberMaxZoomAt, NumberMinZoom, NumberMaxZoom ); param.Zoom = scale( iNum, 0, NumberMaxZoomAt, NumberMinZoom, NumberMaxZoom );
param.Zoom = clamp( param.Zoom, NumberMinZoom, NumberMaxZoom ); param.Zoom = clamp( param.Zoom, NumberMinZoom, NumberMaxZoom );
c.Number:visible(true); Number:visible(true);
Label:visible(true); Label:visible(true);
c.Number:settext( string.format("%i", iCombo) ); Number:settext( string.format("%i", iNum) );
Pulse( c.Number, param ); Pulse( Number, param );
Pulse( Label, param ); Pulse( Label, param );
end; end;
}; };
+6 -3
View File
@@ -2316,9 +2316,12 @@ HoldJudgmentLetGoCommand=shadowlength,0;diffusealpha,1;zoom,1;y,-10;linear,0.8;y
HoldJudgmentHeldCommand=shadowlength,0;diffusealpha,1;zoom,1.25;linear,0.3;zoomx,1;zoomy,1;sleep,0.5;linear,0.1;zoomy,0.5;zoomx,2;diffusealpha,0 HoldJudgmentHeldCommand=shadowlength,0;diffusealpha,1;zoom,1.25;linear,0.3;zoomx,1;zoomy,1;sleep,0.5;linear,0.1;zoomy,0.5;zoomx,2;diffusealpha,0
[Combo] [Combo]
ShowComboAt=2 ShowComboAt=5
LabelOnCommand=x,SCREEN_CENTER_X-314;y,SCREEN_CENTER_Y-220;shadowlength,0;horizalign,left;vertalign,bottom ShowMissesAt=0
NumberOnCommand=y,SCREEN_CENTER_Y-216;shadowlength,0;horizalign,right;vertalign,bottom ComboLabelOnCommand=x,6;y,22;horizalign,left;vertalign,bottom
MissesLabelOnCommand=x,6;y,22;horizalign,left;vertalign,bottom
ComboNumberOnCommand=y,240-216;shadowlength,0;horizalign,right;vertalign,bottom
MissesNumberOnCommand=y,240-216;shadowlength,0;horizalign,right;vertalign,bottom
NumberMinZoom=0.4 NumberMinZoom=0.4
NumberMaxZoom=0.6 NumberMaxZoom=0.6
NumberMaxZoomAt=150 NumberMaxZoomAt=150