Exemplo n.º 1
0
        private void BuildSceneItems()
        {
            lock (LoadingTaskMan._lock_TaskDictEdit)
            {
                MapMenuEntriesToTaskKeys.Clear();
                Items.Clear();

                foreach (var it in baseMenuItems)
                {
                    Items.Add(it);
                }

                foreach (var kvp in LoadingTaskMan.TaskDict)
                {
                    var menuItem = new DbgMenuItem()
                    {
                        ClickAction         = (m) => LoadingTaskMan.KillTask(kvp.Key),
                        RefreshTextFunction = () => $"{kvp.Key} [{kvp.Value.ProgressRatio:0.00}] [\"{kvp.Value.DisplayString}\"]",
                        CustomColorFunction = () => kvp.Value.IsBeingKilledManually ? Color.Red : Color.Cyan
                    };

                    Items.Add(menuItem);
                    MapMenuEntriesToTaskKeys.Add(menuItem, kvp.Key);
                }

                RequestTextRefresh();
            }
        }
Exemplo n.º 2
0
        public static void EnterNewSubMenu(DbgMenuItem menu)
        {
            CFG.Save();

            menu.RequestTextRefresh();
            DbgMenuStack.Push(CurrentMenu);
            CurrentMenu = menu;
        }
Exemplo n.º 3
0
        public static void GoBack()
        {
            CFG.Save();

            if (DbgMenuStack.Count > 0)
            {
                CurrentMenu = DbgMenuStack.Pop();
            }
        }