-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key Counter #31
Key Counter #31
Conversation
db32f34
to
9cbe710
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good structure overall. suggestions attached.
private SpriteText countSpriteText; | ||
|
||
public override string Name { get; } | ||
public KeyCounter ParentCounter { get; set; } |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
public override string Name { get; } | ||
public KeyCounter ParentCounter { get; set; } | ||
public int Counts { get; private set; } |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
||
private void UpdateGlowSprite() | ||
{ | ||
//can have a FadeTime property or const |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Origin = Anchor.Centre, | ||
Children = new Drawable[] | ||
{ | ||
glowSprite = new Sprite |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Colour = KeyUpTextColor | ||
} | ||
}; | ||
glowSprite.Hide(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
if (IsLit) | ||
{ | ||
glowSprite.Show(); | ||
countSpriteText.FadeColour(KeyDownTextColor, 0); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
private void IncreaseCount() | ||
{ | ||
Counts++; | ||
countSpriteText.Text = Counts.ToString(); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
00a0159
to
604d896
Compare
604d896
to
63535df
Compare
} | ||
|
||
private List<KeyCounter> counters = new List<KeyCounter>(); | ||
//default capacity is 4, and osu! uses 4 keys usually, so it won't trouble |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
@@ -0,0 +1,32 @@ | |||
using System; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Text = Name, | ||
Anchor = Anchor.Centre, | ||
Origin = Anchor.Centre, | ||
Position = new Vector2(0, -buttonSprite.Height / 4), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
private Sprite buttonSprite; | ||
private Sprite glowSprite; | ||
private Container textLayer; | ||
private SpriteText keySpriteText; |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Width = buttonSprite.Width; | ||
} | ||
|
||
private void UpdateGlowSprite() |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
An implementation for #29 .
Custom features:
Preconditions: