Пример #1
0
        public static void addCriticalMessage(string msg, int size = MainMenuMessages.defaultSize, string color = MainMenuMessages.defaultColor)
        {
#if GAME_BZ
            MainMenuMessages.BZFixPatches.patcher.patch();
#endif
            if (qmmAddMessage)
            {
                qmmAddMessage.invoke(qmmServicesMain.get(), msg, size, color, true);
            }
            else
            {
                MainMenuMessages.add(msg, size, color);
            }
        }
Пример #2
0
                    protected override void UpdateLabel()
                    {
                        _slider ??= this.getFieldValue("slider");
                        _label ??= this.getFieldValue("label");

                        float res = (sliderValue.get <float>(_slider) - min) / (max - min);

                        text.set(_label, "{0:P0}".format(res));
                    }
Пример #3
0
 public static void addCriticalMessage(string msg, int size = MainMenuMessages.defaultSize, string color = MainMenuMessages.defaultColor)
 {
     if (qmmAddMessage)
     {
         qmmAddMessage.invoke(qmmServicesMain.get(), msg, size, color, true);
     }
     else
     {
         MainMenuMessages.add(msg, size, color);
     }
 }
Пример #4
0
            // recreates all ui controls in the options panel
            // keeps selected tab and scroll position
            public static void resetPanel()
            {
                if (!optionsPanel || !optionsPanel.enabled || optionsPanel.tabs.Count == 0)
                {
                    return;
                }

                int currentTab = optionsPanel.currentTab;

                Debug.assert(currentTab < optionsPanel.tabs.Count);

                Component _getScroll() => optionsPanel.tabs[currentTab].pane.GetComponent(typeScrollRect);

                var   scroll    = _getScroll();
                float scrollPos = propScrollPos.get <float>(scroll);

                optionsPanel.enabled = false;                 // all work is done by OnDisable() and OnEnable()
                optionsPanel.enabled = true;
                optionsPanel.SetVisibleTab(currentTab);

                scroll = _getScroll();                 // new objects and components
                propScrollPos.set(scroll, scrollPos);
            }
Пример #5
0
            void onClick()
            {
                cfgField.value = (cfgField.value as int?) + 1;                 // cfgField will run attached actions when we change its value

                setSelectedGameObject.invoke(currentEventSystem.get(), null);  // so button don't stays pressed after click
            }