Example #1
0
        public ActionPanel(string Name, ActionPanelHolder ListActionMenuChoice, bool CanCancel)
        {
            this.CanCancel            = CanCancel;
            this.Name                 = Name;
            this.ListActionMenuChoice = ListActionMenuChoice;
            ActionMenuWidth           = MinActionMenuWidth;

            ListNextChoice = new List <ActionPanel>();
            if (ListActionMenuChoice.HasMainPanel)
            {
                ActionPanel LastPanel = ListActionMenuChoice.Last();

                MenuX = LastPanel.MenuX;
                MenuY = LastPanel.MenuY;
            }
        }
        public void ReplaceChoiceInCurrentPanel(ActionPanel Panel, Type PanelToReplace)
        {
            int CurrentIndex = -1;

            for (int P = 0; P < ListActionMenuChoice.Last().ListNextChoice.Count; P++)
            {
                if (ListActionMenuChoice.Last().ListNextChoice[P].GetType() == PanelToReplace)
                {
                    CurrentIndex = P;
                    break;
                }
            }

            if (CurrentIndex >= 0)
            {
                ListActionMenuChoice.Last().ListNextChoice[CurrentIndex] = Panel;
            }
        }
        public static ActionPanel Read(ByteReader BR, Dictionary <string, ActionPanel> DicActionPanel)
        {
            string NewActionPanelName = BR.ReadString();

            ActionPanel NewActionPanel = DicActionPanel[NewActionPanelName].Copy();

            NewActionPanel.DoRead(BR);

            int ListActionPanelCount = BR.ReadInt32();

            ActionPanel[] ListActionPanel = new ActionPanel[ListActionPanelCount];
            for (int A = 0; A < ListActionPanelCount; ++A)
            {
                ListActionPanel[A] = Read(BR, DicActionPanel);
            }

            NewActionPanel.AddChoicesToCurrentPanel(ListActionPanel);

            return(NewActionPanel);
        }
        public ActionPanel(string Name, ActionPanelHolder ListActionMenuChoice, bool CanCancel)
        {
            this.Name = Name;
            this.ListActionMenuChoice = ListActionMenuChoice;
            this.CanCancel            = CanCancel;

            ActionMenuWidth  = MinActionMenuWidth;
            IsEnabled        = true;
            SendBackToSender = false;

            ListNextChoice = new List <ActionPanel>();
            if (ListActionMenuChoice.HasMainPanel)
            {
                ActionPanel LastPanel = ListActionMenuChoice.Last();

                BaseMenuX  = LastPanel.BaseMenuX;
                BaseMenuY  = LastPanel.BaseMenuY;
                FinalMenuX = LastPanel.BaseMenuX;
                FinalMenuX = LastPanel.BaseMenuY;
            }
        }
 public void Remove(ActionPanel NewActionPanel)
 {
     ListActionPanel.Remove(NewActionPanel);
 }
 public virtual void AddToPanelListAndSelect(ActionPanel NewActionPanel)
 {
     ListActionPanel.Add(NewActionPanel);
     NewActionPanel.OnSelect();
 }
 public virtual void Add(ActionPanel NewActionPanel)
 {
     ListActionPanel.Add(NewActionPanel);
 }
 public void RemoveFromPanelList(ActionPanel Panel)
 {
     ListActionMenuChoice.Remove(Panel);
 }
 public void AddToPanelList(ActionPanel Panel)
 {
     ListActionMenuChoice.Add(Panel);
 }
 public virtual void AddChoiceToCurrentPanel(ActionPanel Panel)
 {
     ListNextChoice.Add(Panel);
 }
Example #11
0
 public void AddToPanelListAndSelect(ActionPanel Panel)
 {
     ListActionPanel.Add(Panel);
     Panel.OnSelect();
 }