void back_OnClick(UIBase sender, MouseClickArgs e) { selectedUpgrade--; if (selectedUpgrade < 0) selectedUpgrade = Player.GetEquipmentList.Count - 1; updateSelected(); ContentHandler.PlaySFX("switch"); }
void buy_OnClick(UIBase sender, MouseClickArgs e) { var temp = Player.GetEquipmentList; if (Player.StoredOre >= temp[selectedUpgrade].Value.OreCost) { switch (Player.ActiveSlot) { case Slots.Slot1: Player.Slot1 = temp[selectedUpgrade].Key; Player.StoredOre -= temp[selectedUpgrade].Value.OreCost; updateSlots(sender, EventArgs.Empty); break; case Slots.Slot2: Player.Slot2 = temp[selectedUpgrade].Key; Player.StoredOre -= temp[selectedUpgrade].Value.OreCost; updateSlots(sender, EventArgs.Empty); break; default: throw new ArgumentOutOfRangeException(); } ContentHandler.PlaySFX("switch"); } else ContentHandler.PlaySFX("error"); }
//UPGRADE UI - SLOTS void slot2_OnClick(UIBase sender, MouseClickArgs e) { UpgradeUI["slot2"].Color = Color.Red; UpgradeUI["slot2"].Scale = HIGHLIGHT_SCALE; Player.ActiveSlot = Slots.Slot2; UpgradeUI["slot1"].Color = NORMAL_COLOR; UpgradeUI["slot1"].Scale = NORMAL_SCALE; ContentHandler.PlaySFX("switch"); }
void start_OnClick(UIBase sender, MouseClickArgs e) { ContentHandler.StopAll(); SwitchGameState(last); }
void repair_OnClick(UIBase sender, MouseClickArgs e) { if (Player.RepairCost <= Player.StoredOre) { Player.StoredOre -= Player.RepairCost; Player.Health = Player.STARTING_HEALTH; ContentHandler.PlaySFX("click"); } else ContentHandler.PlaySFX("error"); updateSelected(); }
void return_OnClick(UIBase sender, MouseClickArgs e) { ContentHandler.PlaySFX("switch"); return_MouseAway(null, EventArgs.Empty); SwitchGameState(GameState.Menu); }
void next_OnClick(UIBase sender, MouseClickArgs e) { selectedUpgrade++; selectedUpgrade %= Player.GetEquipmentList.Count; updateSelected(); ContentHandler.PlaySFX("switch"); }
//HELP UI - ENTER/EXIT void help_OnClick(UIBase sender, MouseClickArgs e) { help_MouseAway(null, EventArgs.Empty); ContentHandler.PlaySFX("switch"); SwitchGameState(GameState.Help); }
void exit_OnClick(UIBase sender, MouseClickArgs e) { if(ContentHandler.ShouldPlaySFX) { SoundEffectInstance tempClick = ContentHandler.SFX["click"].CreateInstance(); tempClick.Play(); while (tempClick.State == SoundState.Playing) ; //wait until click is done playing } this.Exit(); //then exit }
void exitToMenu_OnClick(UIBase sender, MouseClickArgs e) { ContentHandler.PlaySFX("switch"); SwitchGameState(GameState.Menu); }
//UPGRADE UI - CONTINUE void continue_OnClick(UIBase sender, MouseClickArgs e) { Player.ActiveSlot = Slots.Slot1; ContentHandler.PlaySFX("switch"); SwitchGameState(GameState.Game); }