예제 #1
0
        private void DrawCommandsGroup(string InGroupName, CheatCommandGroup InGroups)
        {
            {
                var iter = InGroups.Commands.GetEnumerator();

                while (iter.MoveNext())
                {
                    if (iter.Current.Value.isSupportInEditor)
                    {
                        DrawCommand(InGroupName, iter.Current.Key, iter.Current.Value);
                    }
                }
            }

            {
                if (InGroups.ChildrenGroups.Count > 0)
                {
                    string[] LocalToolbarTitles = new string[InGroups.ChildrenGroups.Count];

                    {
                        var Iter = InGroups.ChildrenGroups.GetEnumerator();

                        int Index = 0;
                        while (Iter.MoveNext())
                        {
                            LocalToolbarTitles[Index] = Iter.Current.Key;

                            ++Index;
                        }

                        InGroups.Selection = GUILayout.Toolbar(InGroups.Selection, LocalToolbarTitles);
                    }


                    if (InGroups.Selection >= 0 && LocalToolbarTitles != null && InGroups.Selection < LocalToolbarTitles.Length)
                    {
                        var Iter = InGroups.ChildrenGroups.GetEnumerator();

                        while (Iter.MoveNext())
                        {
                            string GroupName = Iter.Current.Key;
                            //  var Commands = Iter.Current.Value.Commands;

                            if (LocalToolbarTitles[InGroups.Selection] == GroupName)
                            {
                                GUILayout.BeginVertical();

                                DrawCommandsGroup(GroupName, Iter.Current.Value);

                                GUILayout.EndVertical();

                                DrawSplitter();

                                break;
                            }
                        }
                    }
                }
            }
        }
예제 #2
0
        public void AddCommand(ICheatCommand InCommand, int HierarchiesIndex)
        {
            DebugHelper.Assert(InCommand != null);
            string[] GroupHierarchies = InCommand.command.groupHierarchies;

            DebugHelper.Assert(GroupHierarchies != null);

            if (HierarchiesIndex < GroupHierarchies.Length)
            {
                // should add to children group
                CheatCommandGroup Groups = null;
                if (!ChildrenGroups.TryGetValue(GroupHierarchies[HierarchiesIndex], out Groups))
                {
                    Groups = new CheatCommandGroup();
                    ChildrenGroups.Add(GroupHierarchies[HierarchiesIndex], Groups);
                }

                DebugHelper.Assert(Groups != null);

                Groups.AddCommand(InCommand, HierarchiesIndex + 1);
            }
            else
            {
                // add to this group
                Commands.Add(InCommand.command.baseName, InCommand);
            }
        }
예제 #3
0
        public void SelectGroup(CheatCommandGroup InGroup)
        {
            DebugHelper.Assert(InGroup != null);

            States.Push(new CommandInGroupDisplayState(ParentWindow, this));

            (States.TopState() as CommandInGroupDisplayState).SetGroup(InGroup);
        }
예제 #4
0
        public void RegisterCommand(ICheatCommand InCommand)
        {
            // 1.
            DebugHelper.Assert(InCommand != null && !HasCommand(InCommand.command.baseName));

            GeneralRepositories.Commands[InCommand.command.baseName.ToLower()] = InCommand;

            // 2.
            string[] GroupHierarchies = InCommand.command.groupHierarchies;

            DebugHelper.Assert(GroupHierarchies != null);

            string BaseGroup = GroupHierarchies[0];

            CheatCommandGroup Groups = null;

            if (!Repositories.TryGetValue(BaseGroup, out Groups))
            {
                Groups = new CheatCommandGroup();
                Repositories[BaseGroup] = Groups;
            }

            Groups.AddCommand(InCommand, 1);
        }
예제 #5
0
        public void SetGroup(CheatCommandGroup InGroup)
        {
            currentGroup = InGroup;

            OnResetSkipCount();
        }
예제 #6
0
 public void SetGroup(CheatCommandGroup InGroup)
 {
     currentGroup = InGroup;
 }