Exemple #1
0
        void back_OnClick(UIBase sender, MouseClickArgs e)
        {
            selectedUpgrade--;
            if (selectedUpgrade < 0)
                selectedUpgrade = Player.GetEquipmentList.Count - 1;
            updateSelected();

            ContentHandler.PlaySFX("switch");
        }
Exemple #2
0
        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");
        }
Exemple #3
0
        //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");
        }
Exemple #4
0
        void start_OnClick(UIBase sender, MouseClickArgs e)
        {
            ContentHandler.StopAll();

            SwitchGameState(last);
        }
Exemple #5
0
        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();
        }
Exemple #6
0
 void return_OnClick(UIBase sender, MouseClickArgs e)
 {
     ContentHandler.PlaySFX("switch");
     return_MouseAway(null, EventArgs.Empty);
     SwitchGameState(GameState.Menu);
 }
Exemple #7
0
        void next_OnClick(UIBase sender, MouseClickArgs e)
        {
            selectedUpgrade++;
            selectedUpgrade %= Player.GetEquipmentList.Count;
            updateSelected();

            ContentHandler.PlaySFX("switch");
        }
Exemple #8
0
 //HELP UI - ENTER/EXIT
 void help_OnClick(UIBase sender, MouseClickArgs e)
 {
     help_MouseAway(null, EventArgs.Empty);
     ContentHandler.PlaySFX("switch");
     SwitchGameState(GameState.Help);
 }
Exemple #9
0
 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
 }
Exemple #10
0
        void exitToMenu_OnClick(UIBase sender, MouseClickArgs e)
        {
            ContentHandler.PlaySFX("switch");

            SwitchGameState(GameState.Menu);
        }
Exemple #11
0
        //UPGRADE UI - CONTINUE
        void continue_OnClick(UIBase sender, MouseClickArgs e)
        {
            Player.ActiveSlot = Slots.Slot1;

            ContentHandler.PlaySFX("switch");

            SwitchGameState(GameState.Game);
        }