示例#1
0
        public void MakeSettings(UIHelperBase helperBase)
        {
            UIHelper    helper    = helperBase as UIHelper;
            UIComponent container = helper.self as UIComponent;

            _ui_always                          = container.AddUIComponent <UICheckboxDropDownExt>();
            _ui_always.Title                    = "Always";
            _ui_always.selectedItems            = Split(loaded_always);
            _ui_always.eventAfterDropdownClose += (_) => PrefabUtils.CacheAlways(_ui_always.selectedItems);
            PrefabUtils.CacheAlways(_ui_always.selectedItems);


            _ui_never                          = container.AddUIComponent <UICheckboxDropDownExt>();
            _ui_never.Title                    = "Never";
            _ui_never.selectedItems            = Split(loaded_never);
            _ui_never.eventAfterDropdownClose += (_) => PrefabUtils.CacheNever(_ui_never.selectedItems);
            PrefabUtils.CacheNever(_ui_never.selectedItems);

            helper.AddButton("Save", Save);
        }
示例#2
0
        public void MakeSettings(UIHelperBase helperBase)
        {
            UIHelper    helper    = helperBase as UIHelper;
            UIComponent container = helper.self as UIComponent;

            Extensions.Init();
            bool active = Extensions.IsActive;

#if DEBUG
            active = true; // Fast test of options from main menu
#endif
            void RefreshPrefabs()
            {
                if (PrefabUtils.PrefabsLoaded)
                {
                    NetInfoExt.InitNetInfoExtArray();
                }
            }

            if (active)
            {
                _ui_never               = container.AddUIComponent <UICheckboxDropDownExt>();
                _ui_never.Title         = "Except List";
                _ui_never.tooltip       = "TMPE cannot hide crosswalks from roads in this list.\nThis list does not affect NS2 junction markings.";
                _ui_never.selectedItems = Split(loaded_never);

                void HandleAfterDropdownClose(UICheckboxDropDown _) => RefreshPrefabs();

                _ui_never.eventAfterDropdownClose += HandleAfterDropdownClose;
                RefreshPrefabs();

                helper.AddButton("Save", Save);
            }
            else
            {
                var label = container.AddUIComponent <UILabel>();
                label.text = "Options are only available in game";
            }
        }