moved the star buy sound to the correct place

This commit is contained in:
Ellpeck 2020-07-01 00:59:33 +02:00
parent e6f0a9b877
commit 32affd77a1

View file

@ -318,7 +318,6 @@ namespace TouchyTickets {
upgradeHeader.AddChild(new Paragraph(Anchor.AutoCenter, 1, p => GameImpl.Instance.Stars + "<i star>", true) {TextScale = 0.3F});
upgradeHeader.AddChild(new Button(Anchor.AutoCenter, new Vector2(0.8F, 30), Localization.Get("EarnStar")) {
PositionOffset = new Vector2(0, 4),
ActionSound = new SoundEffectInfo(Assets.BuySound),
OnUpdated = (e, time) => ((Button) e).IsDisabled = GameImpl.Instance.GetBuyableStars() <= 0,
OnPressed = e => {
var infoBox = new Group(Anchor.TopLeft, Vector2.One, false) {
@ -330,6 +329,7 @@ namespace TouchyTickets {
OnPressed = e2 => this.uiSystem.Remove(e2.Root.Name)
});
panel.AddChild(new Button(Anchor.AutoInlineIgnoreOverflow, new Vector2(0.5F, 30), Localization.Get("Yes")) {
ActionSound = new SoundEffectInfo(Assets.BuySound),
OnPressed = e2 => {
this.uiSystem.Remove(e2.Root.Name);
@ -639,7 +639,7 @@ namespace TouchyTickets {
SetHeightBasedOnChildren = true,
PositionOffset = new Vector2(0, 1),
ChildPadding = new Vector2(4),
ActionSound = new SoundEffectInfo(MlemGame.LoadContent<SoundEffect>("Sounds/StarBuy")),
ActionSound = new SoundEffectInfo(Assets.BuySound),
OnPressed = e => {
GameImpl.Instance.Stars -= upgrade.Price;
GameImpl.Instance.Platform.AddResourceEvent(true, "Stars", upgrade.Price, "Upgrade", upgrade.Name);