Beispiel #1
0
 public void RemovePanel(BasePanel panel)
 {
     if (panel.IsChangeBgm)
     {
         SoundManager.PlayLastBGM();
     }
     if (panel.NeedBlackForm)
     {
         tabPageGame.Controls.Remove(BlackWallForm.Instance);
         SystemMenuManager.isHotkeyEnabled = true;
     }
     tabPageGame.Controls.Remove(panel);
     panelList.Remove(panel);
     SystemMenuManager.formCount--;
 }
Beispiel #2
0
        public void DealPanel(BasePanel panel)
        {
            foreach (Control control in tabPageGame.Controls)
            {
                if (control.GetType() == panel.GetType())
                {
                    RemovePanel(control as BasePanel);
                    return;
                }
            }

            if (panel.NeedBlackForm)
            {
                BlackWallForm.Instance.Init(tabPageGame.Width, tabPageGame.Height);
                tabPageGame.Controls.Add(BlackWallForm.Instance);
                BlackWallForm.Instance.BringToFront();
                SystemMenuManager.isHotkeyEnabled = false;
            }
            else
            {
                panelList.Add(panel);
            }
            panel.Init(tabPageGame.Width, tabPageGame.Height);            
            tabPageGame.Controls.Add(panel);
            panel.BringToFront();
            SystemMenuManager.formCount++;
        }