Beispiel #1
0
        public void UpdateClass(HeroClass cl)
        {
            if (curClass == cl)
            {
                Add(new WndClass(cl));
                return;
            }

            if (curClass != null)
            {
                Shields[curClass].Highlight(false);
            }

            Shields[curClass = cl].Highlight(true);

            if (cl != HeroClass.Huntress || huntressUnlocked)
            {
                unlock.Visible = false;

                var buttonPos = (Camera.Main.CameraHeight + HEIGHT) / 2 - BUTTON_HEIGHT;

                var left = (Camera.Main.CameraWidth - WIDTH) / 2;

                var info = GamesInProgress.Check(curClass);
                if (info != null)
                {
                    btnLoad.Visible = true;
                    btnLoad.Secondary(Utils.Format(TXT_DPTH_LVL, info.Depth, info.Level));
                    btnNewGame.Visible = true;
                    btnNewGame.Secondary(TXT_ERASE);

                    var w = (WIDTH - GAP) / 2;

                    btnLoad.SetRect(left, buttonPos, w, BUTTON_HEIGHT);
                    btnNewGame.SetRect(btnLoad.Right() + GAP, buttonPos, w, BUTTON_HEIGHT);
                }
                else
                {
                    btnLoad.Visible = false;

                    btnNewGame.Visible = true;
                    btnNewGame.Secondary(null);
                    btnNewGame.SetRect(left, buttonPos, WIDTH, BUTTON_HEIGHT);
                }
            }
            else
            {
                unlock.Visible     = true;
                btnLoad.Visible    = false;
                btnNewGame.Visible = false;
            }
        }
Beispiel #2
0
 private void NewGameClick(Button obj)
 {
     if (GamesInProgress.Check(curClass) != null)
     {
         var progressWnd = new WndOptions(TXT_REALLY, TXT_WARNING, TXT_YES, TXT_NO);
         progressWnd.SelectAction = (index) =>
         {
             if (index == 0)
             {
                 StartNewGame();
             }
         };
         Add(progressWnd);
     }
     else
     {
         StartNewGame();
     }
 }