mirror of
https://github.com/osukey/osukey.git
synced 2025-05-31 02:17:34 +09:00
TestCase buttons + minor fixes
This commit is contained in:
parent
7277cf5af1
commit
a3b4a34a1a
@ -24,8 +24,6 @@ namespace osu.Desktop.Tests
|
|||||||
{
|
{
|
||||||
base.Reset();
|
base.Reset();
|
||||||
|
|
||||||
Random rnd = new Random();
|
|
||||||
|
|
||||||
ScoreCounter uc = new ScoreCounter
|
ScoreCounter uc = new ScoreCounter
|
||||||
{
|
{
|
||||||
Origin = Anchor.TopRight,
|
Origin = Anchor.TopRight,
|
||||||
@ -89,35 +87,16 @@ namespace osu.Desktop.Tests
|
|||||||
};
|
};
|
||||||
Add(pc);
|
Add(pc);
|
||||||
|
|
||||||
Button resetButton = new Button
|
AddButton(@"Reset all", delegate
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Anchor = Anchor.TopLeft,
|
|
||||||
Text = @"Reset all",
|
|
||||||
Width = 100,
|
|
||||||
Height = 20,
|
|
||||||
Position = new Vector2(0, 0),
|
|
||||||
};
|
|
||||||
resetButton.Action += delegate
|
|
||||||
{
|
{
|
||||||
uc.Count = 0;
|
uc.Count = 0;
|
||||||
sc.Count = 0;
|
sc.Count = 0;
|
||||||
ac.Count = 0;
|
ac.Count = 0;
|
||||||
cc.Count = 0;
|
cc.Count = 0;
|
||||||
pc.SetCount(0, 0);
|
pc.SetCount(0, 0);
|
||||||
};
|
});
|
||||||
Add(resetButton);
|
|
||||||
|
|
||||||
Button hitButton = new Button
|
AddButton(@"Hit! :D", delegate
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Anchor = Anchor.TopLeft,
|
|
||||||
Text = @"Hit! :D",
|
|
||||||
Width = 100,
|
|
||||||
Height = 20,
|
|
||||||
Position = new Vector2(0, 20),
|
|
||||||
};
|
|
||||||
hitButton.Action += delegate
|
|
||||||
{
|
{
|
||||||
uc.Count += 300 + (ulong)(300.0 * (sc.Count > 0 ? sc.Count - 1 : 0) / 25.0);
|
uc.Count += 300 + (ulong)(300.0 * (sc.Count > 0 ? sc.Count - 1 : 0) / 25.0);
|
||||||
sc.Count++;
|
sc.Count++;
|
||||||
@ -130,64 +109,24 @@ namespace osu.Desktop.Tests
|
|||||||
);
|
);
|
||||||
pc.Numerator++;
|
pc.Numerator++;
|
||||||
pc.Denominator++;
|
pc.Denominator++;
|
||||||
};
|
});
|
||||||
Add(hitButton);
|
|
||||||
|
|
||||||
Button missButton = new Button
|
AddButton(@"miss...", delegate
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Anchor = Anchor.TopLeft,
|
|
||||||
Text = @"miss...",
|
|
||||||
Width = 100,
|
|
||||||
Height = 20,
|
|
||||||
Position = new Vector2(0, 40),
|
|
||||||
};
|
|
||||||
missButton.Action += delegate
|
|
||||||
{
|
{
|
||||||
sc.Count = 0;
|
sc.Count = 0;
|
||||||
ac.Count = 0;
|
ac.Count = 0;
|
||||||
cc.Count = 0;
|
cc.Count = 0;
|
||||||
pc.Denominator++;
|
pc.Denominator++;
|
||||||
};
|
});
|
||||||
Add(missButton);
|
|
||||||
|
|
||||||
Button forceResetButton = new Button
|
AddButton(@"Stop counters", delegate
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Anchor = Anchor.TopLeft,
|
|
||||||
Text = @"Force reset",
|
|
||||||
Width = 100,
|
|
||||||
Height = 20,
|
|
||||||
Position = new Vector2(0, 60),
|
|
||||||
};
|
|
||||||
forceResetButton.Action += delegate
|
|
||||||
{
|
|
||||||
uc.ResetCount();
|
|
||||||
sc.ResetCount();
|
|
||||||
ac.ResetCount();
|
|
||||||
pc.ResetCount();
|
|
||||||
cc.ResetCount();
|
|
||||||
};
|
|
||||||
Add(forceResetButton);
|
|
||||||
|
|
||||||
Button stopButton = new Button
|
|
||||||
{
|
|
||||||
Origin = Anchor.TopLeft,
|
|
||||||
Anchor = Anchor.TopLeft,
|
|
||||||
Text = @"STOP!",
|
|
||||||
Width = 100,
|
|
||||||
Height = 20,
|
|
||||||
Position = new Vector2(0, 80),
|
|
||||||
};
|
|
||||||
stopButton.Action += delegate
|
|
||||||
{
|
{
|
||||||
uc.StopRolling();
|
uc.StopRolling();
|
||||||
sc.StopRolling();
|
sc.StopRolling();
|
||||||
cc.StopRolling();
|
cc.StopRolling();
|
||||||
ac.StopRolling();
|
ac.StopRolling();
|
||||||
pc.StopRolling();
|
pc.StopRolling();
|
||||||
};
|
});
|
||||||
Add(stopButton);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -43,9 +43,9 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Tints pop-out before animation. Intended to use the last grabbed fruit colour.
|
/// Increaces counter and tints pop-out before animation.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="colour"></param>
|
/// <param name="colour">Last grabbed fruit colour.</param>
|
||||||
public void CatchFruit(Color4 colour)
|
public void CatchFruit(Color4 colour)
|
||||||
{
|
{
|
||||||
popOutSpriteText.Colour = colour;
|
popOutSpriteText.Colour = colour;
|
||||||
|
@ -258,7 +258,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateTextSize()
|
protected virtual void updateTextSize()
|
||||||
{
|
{
|
||||||
if (countSpriteText != null)
|
if (countSpriteText != null)
|
||||||
countSpriteText.TextSize = TextSize;
|
countSpriteText.TextSize = TextSize;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user