Ejemplo n.º 1
0
 public void Hide(uint id)
 {
     if (_activeForm != null)
     {
         if (_activeForm.FormId == id)
         {
             GuiManager.HideDialog(_activeForm);
             _activeForm = null;
         }
     }
 }
Ejemplo n.º 2
0
        public void Show(uint id, Form form)
        {
            if (_activeForm != null)
            {
                GuiManager.HideDialog(_activeForm);
            }

            if (form is SimpleForm simpleForm)
            {
                GuiManager.ShowDialog(_activeForm = new SimpleFormDialog(id, this, simpleForm, InputManager));
            }
            else if (form is CustomForm customForm)
            {
                GuiManager.ShowDialog(_activeForm = new CustomFormDialog(id, this, customForm, InputManager));
            }
            else
            {
                Log.Warn($"Form type not supported: {form.GetType()}");
            }
        }