示例#1
0
        public override void TopSettingsUI(UIHelperExtension helper)
        {
            UIHelperExtension group8 = helper.AddGroupExtended(Locale.Get("K45_WTS_GENERAL_INFO"));

            AddFolderButton(WTSController.DefaultBuildingsConfigurationFolder, group8, "K45_WTS_DEFAULT_BUILDINGS_CONFIG_PATH_TITLE");
            AddFolderButton(WTSController.DefaultVehiclesConfigurationFolder, group8, "K45_WTS_DEFAULT_VEHICLES_CONFIG_PATH_TITLE");
            AddFolderButton(WTSController.DefaultPropsLayoutConfigurationFolder, group8, "K45_WTS_DEFAULT_PROP_LAYOUTS_PATH_TITLE");
            AddFolderButton(WTSController.DefaultHwShieldsConfigurationFolder, group8, "K45_WTS_DEFAULT_HWSHIELDS_CONFIG_PATH_TITLE");
            AddFolderButton(WTSController.AbbreviationFilesPath, group8, "K45_WTS_ABBREVIATION_FILES_PATH_TITLE");
            AddFolderButton(WTSController.FontFilesPath, group8, "K45_WTS_FONT_FILES_PATH_TITLE");
            AddFolderButton(WTSController.ExtraSpritesFolder, group8, "K45_WTS_EXTRA_SPRITES_PATH_TITLE");
            group8.AddLabel(Locale.Get("K45_WTS_GET_FILES_GITHUB"));
            group8.AddButton(Locale.Get("K45_WTS_GO_TO_GITHUB"), () => Application.OpenURL("https://github.com/klyte45/WriteTheSignsFiles"));
            group8.AddButton(Locale.Get("K45_WTS_GO_TO_WIKI"), () => Application.OpenURL("https://github.com/klyte45/WriteTheSigns/wiki"));
            group8.AddButton(Locale.Get("K45_WTS_GO_TO_WTSWORKSHOP"), () => Application.OpenURL("https://github.com/klyte45/WriteTheSigns/wiki"));
            reloadImages = (UIButton)group8.AddButton(Locale.Get("K45_WTS_REFRESH_IMAGES_FOLDER"), () => Controller?.AtlasesLibrary.LoadImagesFromLocalFolders());
            reloadImages.eventVisibilityChanged += (k, x) =>
            {
                if (x)
                {
                    if (Controller is null)
                    {
                        k.Disable();
                    }
                    else
                    {
                        k.Enable();
                    }
                }
            };

            UIHelperExtension group4 = helper.AddGroupExtended(Locale.Get("K45_WTS_GENERATED_TEXT_OPTIONS"));

            (group4.AddDropdownLocalized("K45_WTS_INITIAL_TEXTURE_SIZE_FONT", new string[] { "512", "1024", "2048", "4096 (!)", "8192 (!!!)", "16384 (WTF??)" }, StartTextureSizeFont, (x) => StartTextureSizeFont.value = x).parent as UIPanel).autoFitChildrenVertically = true;
            (group4.AddDropdownLocalized("K45_WTS_FONT_QUALITY", new string[] { "50%", "75%", "100%", "125%", "150% (!)", "200% (!!!)", "400% (BEWARE!)", "800% (You don't need this!)" }, FontQuality, (x) =>
            {
                FontQuality.value = x;
                FontServer.instance.SetQualityMultiplier(m_qualityArray[x]);
                WTSController.ReloadFontsFromPath();
            }).parent as UIPanel).autoFitChildrenVertically = true;
            FontServer.instance.SetQualityMultiplier(m_qualityArray[FontQuality]);
            (group4.AddDropdownLocalized("K45_WTS_MAX_PARALLEL_WORD_PROCESSES", new string[] { "1", "2", "4", "8", "16", "32", "64", "128 (!)", "256 (!!)", "512 (Your game may freeze)", "1024 (Your game WILL freeze)" }, Convert.ToString(FontSystem.MaxCoroutines, 2).Length - 1, (x) => FontSystem.MaxCoroutines.value = 1 << x).parent as UIPanel).autoFitChildrenVertically = true;



            UIHelperExtension group5 = helper.AddGroupExtended(Locale.Get("K45_WTS_GENERATED_CLOCK_OPTIONS"));

            (group5.AddDropdownLocalized("K45_WTS_CLOCK_MINUTES_PRECISION", new string[] { "30", "20", "15 (DEFAULT)", "12", "10", "7.5", "6", "5", "4", "3 (!)", "2 (!!)", "1 (!!!!)" }, Array.IndexOf(m_clockPrecision, ClockPrecision), (x) =>
            {
                ClockPrecision.value = m_clockPrecision[x];
            }).parent as UIPanel).autoFitChildrenVertically = true;
            group5.AddCheckboxLocale("K45_WTS_CLOCK_SHOW_LEADING_ZERO", ClockShowLeadingZero, (x) => ClockShowLeadingZero.value = x);
            group5.AddCheckboxLocale("K45_WTS_CLOCK_12H_CLOCK", Clock12hFormat, (x) => Clock12hFormat.value = x);
            UIHelperExtension group6       = helper.AddGroupExtended(Locale.Get("K45_WTS_CACHE_INFO"));
            UIButton          calcMeshSize = null;
            var calcMeshLbl = "Calculate text meshes cache size";

            calcMeshSize = (UIButton)group6.AddButton(calcMeshLbl, () => calcMeshSize.text = $"{calcMeshLbl}: {FontServer.instance?.GetAllFontsCacheSize().ToString("#,##0") ?? "N/A " }bytes");
        }
示例#2
0
        public override void TopSettingsUI(UIHelperExtension helper)
        {
            UIHelperExtension group8 = helper.AddGroupExtended(Locale.Get("SVM_DISTRICT_SERVICE_RESTRICTIONS"));

            group8.AddCheckboxLocale("SVM_DEFAULT_ALLOW_OUTSIDERS", m_allowOutsidersAsDefault.value, (x) => { m_allowOutsidersAsDefault.value = x; });
            group8.AddCheckboxLocale("SVM_DEFAULT_ALLOW_GO_OUTSIDE", m_allowGoOutsideAsDefault.value, (x) => { m_allowGoOutsideAsDefault.value = x; });
            group8.AddLabel(Locale.Get("SVM_DEFAULT_RESTRICTIONS_NOTE2")).textColor = Color.white;
            group8.AddLabel(Locale.Get("SVM_DEFAULT_RESTRICTIONS_NOTE")).textColor  = Color.yellow;
            group8.AddLabel(Locale.Get("SVM_DEFAULT_RESTRICTIONS_NOTE3")).textColor = Color.red;
        }
示例#3
0
        private void Awake()
        {
            if (m_instance != null)
            {
                throw new Exception("MULTIPLE INSTANTIATION!!!!!!!!");
            }
            m_instance                    = this;
            mainPanel                     = GetComponentInChildren <UIScrollablePanel>();
            mainPanel.autoLayout          = true;
            mainPanel.autoLayoutDirection = LayoutDirection.Vertical;
            m_uiHelper                    = new UIHelperExtension(mainPanel);

            TLMUtils.doLog("PrefixDD");

            m_prefixSelector = m_uiHelper.AddDropdownLocalized("TLM_PREFIX", new string[0], -1, onChangePrefix);

            ReloadPrefixOptions();
            TLMUtils.doLog("PrefixDD Panel");
            var ddPanel = m_prefixSelector.GetComponentInParent <UIPanel>();

            ConfigComponentPanel(m_prefixSelector);


            TLMUtils.doLog("SubPanel");
            TLMUtils.createUIElement(out UIPanel subpanel, mainPanel.transform, "Subpanel", new Vector4(0, 0, 500, 180));
            subpanel.autoLayout          = true;
            subpanel.autoLayoutDirection = LayoutDirection.Vertical;
            subpanel.autoSize            = true;
            m_subpanel = new UIHelperExtension(subpanel);

            TLMUtils.doLog("AssetSelector");
            TLMUtils.createUIElement(out m_panelAssetSelector, mainPanel.transform, "AssetSelector", new Vector4(0, 0, 0, 0.0001f));
            m_assetSelectorWindow = TLMUtils.createElement(ImplClassChildren, m_panelAssetSelector.transform).GetComponent <TLMAssetSelectorWindowPrefixTab <T> >();

            m_subpanel.self.isVisible = false;
            m_assetSelectorWindow.mainPanel.isVisible = false;

            TLMUtils.doLog("Name");
            m_prefixName = m_subpanel.AddTextField(Locale.Get("TLM_PREFIX_NAME"), null, "", onPrefixNameChange);
            ConfigComponentPanel(m_prefixName);

            TLMUtils.doLog("Price");
            m_prefixTicketPrice = m_subpanel.AddTextField(Locale.Get("TLM_TICKET_PRICE_LABEL"), null, "", onTicketChange);
            ConfigComponentPanel(m_prefixTicketPrice);

            TLMUtils.doLog("ColorForModel");
            m_useColorForModel = m_subpanel.AddCheckboxLocale("TLM_USE_PREFIX_COLOR_FOR_VEHICLE", false, onUseColorVehicleChange);
            TLMUtils.LimitWidth(m_useColorForModel.label, 420, true);

            TLMUtils.doLog("ColorSel");
            CreateColorSelector();

            TLMUtils.doLog("Budget");
            TLMUtils.createUIElement(out UIPanel m_budgetPanel, subpanel.transform, "BudgetPanel", new Vector4(0, 0, 460, 180));
            CreateBudgetSliders(m_budgetPanel);
            CreateToggleBudgetButtons(m_budgetPanel);

            GetComponent <UIComponent>().eventVisibilityChanged += (x, y) => forceRefresh();
            TLMConfigWarehouse.eventOnPropertyChanged           += OnWarehouseChange;
        }
示例#4
0
        public static void OverrideStart(PublicTransportWorldInfoPanel __instance)
        {
            m_obj.origInstance         = __instance;
            __instance.component.width = 800;

            BindComponents(__instance);

            SetNameFieldProperties();

            KlyteMonoUtils.CreateTabsComponent(out m_obj.m_lineConfigTabs, out _, __instance.transform, "LineConfig", new Vector4(15, 45, 365, 30), new Vector4(15, 80, 380, 445));

            m_obj.m_childControls.Add("Default", TabCommons.CreateTab <UVMMainWIPTab>(m_obj.m_lineConfigTabs, "ThumbStatistics", "K45_TLM_WIP_STATS_TAB", "Default", false));
            m_obj.m_childControls.Add("Reports", TabCommons.CreateTab <TLMReportsTab>(m_obj.m_lineConfigTabs, "IconMessage", "K45_TLM_WIP_REPORT_TAB", "Reports", false));
            m_obj.m_childControls.Add("Budget", TabCommons.CreateTab <UVMBudgetConfigTab>(m_obj.m_lineConfigTabs, "InfoPanelIconCurrency", "K45_TLM_WIP_BUDGET_CONFIGURATION_TAB", "Budget", false));
            m_obj.m_childControls.Add("Ticket", TabCommons.CreateTab <TLMTicketConfigTab>(m_obj.m_lineConfigTabs, "FootballTicketIcon", "K45_TLM_WIP_TICKET_CONFIGURATION_TAB", "Ticket", false));
            m_obj.m_childControls.Add("AssetSelection", TabCommons.CreateTab <TLMAssetSelectorTab>(m_obj.m_lineConfigTabs, "IconPolicyFreePublicTransport", "K45_TLM_WIP_ASSET_SELECTION_TAB", "AssetSelection", false));
            m_obj.m_childControls.Add("DepotSelection", TabCommons.CreateTab <TLMDepotSelectorTab>(m_obj.m_lineConfigTabs, "UIFilterBigBuildings", "K45_TLM_WIP_DEPOT_SELECTION_TAB", "DepotSelection", false));
            m_obj.m_childControls.Add("PrefixConfig", TabCommons.CreateTab <TLMPrefixOptionsTab>(m_obj.m_lineConfigTabs, "InfoIconLevel", "K45_TLM_WIP_PREFIX_CONFIG_TAB", "PrefixConfig", false));
            m_obj.m_childControls.Add("StopsPanel", __instance.Find <UIPanel>("StopsPanel").parent.gameObject.AddComponent <UVMTransportLineLinearMap>());
            DestroyNotUsed(__instance);

            m_obj.m_specificConfig = UIHelperExtension.AddCheckboxLocale(__instance.component, "K45_TLM_USE_SPECIFIC_CONFIG", false, (x) =>
            {
                TLMTransportLineExtension.Instance.SetUseCustomConfig(GetLineID(), x);
                MarkDirty(typeof(UVMPublicTransportWorldInfoPanel));
            });
            m_obj.m_specificConfig.relativePosition = new Vector3(10, 530);
            m_obj.m_specificConfig.isInteractive    = false;
            KlyteMonoUtils.LimitWidthAndBox(m_obj.m_specificConfig.label, 400);
        }
示例#5
0
        public void Awake()
        {
            m_bg = component as UIScrollablePanel;

            PublicTransportWorldInfoPanel ptwip = UVMPublicTransportWorldInfoPanel.m_obj.origInstance;

            AddNewStopTemplate();

            ptwip.component.width = 800;

            BindComponents(ptwip);
            AdjustLineStopsPanel(ptwip);

            KlyteMonoUtils.CreateUIElement(out m_panelModeSelector, m_bg.parent.transform);
            m_panelModeSelector.autoFitChildrenHorizontally = true;
            m_panelModeSelector.autoFitChildrenVertically   = true;
            m_panelModeSelector.autoLayout          = true;
            m_panelModeSelector.autoLayoutDirection = LayoutDirection.Horizontal;
            m_mapModeDropDown = UIHelperExtension.CloneBasicDropDownNoLabel(Enum.GetNames(typeof(MapMode)).Select(x => Locale.Get("K45_TLM_LINEAR_MAP_VIEW_MODE", x)).ToArray(), (int idx) =>
            {
                m_currentMode = (MapMode)idx;
                RefreshVehicleButtons(GetLineID());
            }, m_panelModeSelector);
            m_mapModeDropDown.textScale  = 0.75f;
            m_mapModeDropDown.size       = new Vector2(200, 25);
            m_mapModeDropDown.itemHeight = 16;

            UICheckBox unscaledCheck = UIHelperExtension.AddCheckboxLocale(m_panelModeSelector, "K45_TLM_LINEAR_MAP_SHOW_UNSCALED", m_unscaledMode, (val) => m_unscaledMode = val);

            KlyteMonoUtils.LimitWidthAndBox(unscaledCheck.label, 165);

            InstanceManagerOverrides.EventOnBuildingRenamed += (x) => m_dirtyNames = true;
        }
        public void Awake()
        {
            Instance            = this;
            MainContainer       = GetComponent <UIComponent>();
            m_uiHelperNeighbors = new UIHelperExtension(MainContainer);

            ((UIPanel)m_uiHelperNeighbors.Self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIPanel)m_uiHelperNeighbors.Self).wrapLayout          = true;
            ((UIPanel)m_uiHelperNeighbors.Self).autoLayout          = true;

            UILabel titleLabel = m_uiHelperNeighbors.AddLabel("");

            titleLabel.autoSize      = true;
            titleLabel.textAlignment = UIHorizontalAlignment.Center;
            titleLabel.wordWrap      = false;
            titleLabel.minimumSize   = new Vector2(MainContainer.width - 10, 0);
            titleLabel.localeID      = "K45_TLM_PER_HOUR_BUDGET_TITLE";

            m_uiHelperNeighbors.AddSpace(5);
            KlyteMonoUtils.CreateElement(out m_clockChart, m_uiHelperNeighbors.Self.transform, "DailyClock");
            m_showAbsoluteCheckbox = m_uiHelperNeighbors.AddCheckboxLocale("K45_TLM_SHOW_ABSOLUTE_VALUE", false, (x) =>
            {
                RebuildList(UVMPublicTransportWorldInfoPanel.GetLineID());
            });
            KlyteMonoUtils.LimitWidthAndBox(m_showAbsoluteCheckbox.label, m_uiHelperNeighbors.Self.width - 40f);
            KlyteMonoUtils.CreateElement(out m_titleContainer, m_uiHelperNeighbors.Self.transform, "Title");
            PopulateTitlePanel(m_titleContainer);
            KlyteMonoUtils.CreateScrollPanel(m_uiHelperNeighbors.Self, out m_entryListContainer, out _, m_uiHelperNeighbors.Self.width - 20f, m_uiHelperNeighbors.Self.height - 150, Vector3.zero);
        }
示例#7
0
        protected override void AwakeActions()
        {
            MainPanel.eventVisibilityChanged += (x, y) => OnShow(y);

            KlyteMonoUtils.CreateUIElement(out UIPanel layoutPanel, MainPanel.transform, "LayoutPanel", new Vector4(0, 40, PanelWidth, PanelHeight - 40));
            layoutPanel.padding             = new RectOffset(8, 8, 10, 10);
            layoutPanel.autoLayout          = true;
            layoutPanel.autoLayoutDirection = LayoutDirection.Vertical;
            layoutPanel.autoLayoutPadding   = new RectOffset(0, 0, 10, 10);
            var uiHelper = new UIHelperExtension(layoutPanel);

            uiHelper.AddCheckboxLocale("K45_TTT_SHOWUNDERGROUNDVIEW", false, OnUndergroundChange);
        }
示例#8
0
 private void CreateIgnoreDistrictOption()
 {
     m_ignoreDistrict = m_uiHelper.AddCheckboxLocale("K45_VMC_IGNORE_DISTRICT_CONFIG", false);
     m_ignoreDistrict.relativePosition   = new Vector3(5f, 150f);
     m_ignoreDistrict.eventCheckChanged += delegate(UIComponent comp, bool value)
     {
         if (Singleton <BuildingManager> .exists && m_buildingIdSelecionado.Building != 0)
         {
             IEnumerable <ServiceSystemDefinition> ssds = ServiceSystemDefinition.from(Singleton <BuildingManager> .instance.m_buildings.m_buffer[m_buildingIdSelecionado.Building].Info);
             foreach (ServiceSystemDefinition ssd in ssds)
             {
                 ssd.GetBuildingExtension().SetIgnoreDistrict(m_buildingIdSelecionado.Building, value);
             }
             EventOnBuildingSelChanged?.Invoke(m_buildingIdSelecionado.Building);
         }
     };
     m_ignoreDistrict.label.textScale = 0.9f;
 }
示例#9
0
        public void Awake()
        {
            MainPanel = GetComponent <UIPanel>();
            MainPanel.relativePosition    = new Vector3(510f, 0.0f);
            MainPanel.width               = 350;
            MainPanel.height              = GetComponentInParent <UIComponent>().height;
            MainPanel.zOrder              = 50;
            MainPanel.color               = new Color32(255, 255, 255, 255);
            MainPanel.name                = "AssetSelectorWindow";
            MainPanel.autoLayoutPadding   = new RectOffset(5, 5, 10, 10);
            MainPanel.autoLayout          = true;
            MainPanel.autoLayoutDirection = LayoutDirection.Vertical;

            KlyteMonoUtils.CreateUIElement(out m_title, MainPanel.transform);
            m_title.textAlignment    = UIHorizontalAlignment.Center;
            m_title.autoSize         = false;
            m_title.autoHeight       = true;
            m_title.width            = MainPanel.width - 30f;
            m_title.relativePosition = new Vector3(5, 5);
            m_title.textScale        = 0.9f;
            m_title.localeID         = "K45_TLM_ASSETS_FOR_PREFIX";

            m_helper = new UIHelperExtension(MainPanel);

            TLMUtils.doLog("Name");
            m_prefixName = CreateMiniTextField("K45_TLM_PREFIX_NAME", OnPrefixNameChange);


            TLMUtils.doLog("ColorForModel");
            m_useColorForModel = m_helper.AddCheckboxLocale("K45_TLM_USE_PREFIX_COLOR_FOR_VEHICLE", false, OnUseColorVehicleChange);
            KlyteMonoUtils.LimitWidth(m_useColorForModel.label, 340, true);
            m_useColorForModel.label.textScale = 1;

            TLMUtils.doLog("ColorSel");
            CreateColorSelector();

            TLMUtils.doLog("Palette");
            m_paletteDD = CreateMiniDropdown("K45_TLM_PALETTE", SetPalettePrefix, new string[1]);
            ReloadPalettes();
            TLMPaletteOptionsTab.onPaletteReloaded += ReloadPalettes;

            TLMUtils.doLog("Format");
            m_formatDD = CreateMiniDropdown("K45_TLM_ICON", SetFormatPrefix, TLMLineIconExtension.getDropDownOptions(Locale.Get("K45_TLM_LINE_ICON_ENUM_TT_DEFAULT")));
        }
示例#10
0
 public void Update()
 {
     if (m_childControls.Count == 0 && m_bg.isVisible)
     {
         float heightCheck = 0f;
         if (!TLMController.IsRealTimeEnabled)
         {
             var        uiHelper = new UIHelperExtension(m_bg);
             UICheckBox m_checkChangeDateLabel = uiHelper.AddCheckboxLocale("K45_TLM_SHOW_DAYTIME_INSTEAD_DATE", false, (x) => m_showDayTime = x && SimulationManager.instance.m_enableDayNight);
             KlyteMonoUtils.LimitWidthAndBox(m_checkChangeDateLabel.label, m_bg.width - 50);
             heightCheck = m_checkChangeDateLabel.height;
         }
         KlyteMonoUtils.CreateTabsComponent(out m_reportTabstrip, out _, m_bg.transform, "LineConfig", new Vector4(0, 0, m_bg.width, 30), new Vector4(0, 30, m_bg.width, m_bg.height - heightCheck - 30));
         m_childControls.Add("FinanceReport", TabCommons.CreateTabLocalized <TLMLineFinanceReportTab>(m_reportTabstrip, "InfoPanelIconCurrency", "K45_TLM_WIP_FINANCE_REPORT_TAB", "FinanceReport", false));
         m_childControls.Add("PassengerAgeReport", TabCommons.CreateTabLocalized <TLMLinePassengerAgeReportTab>(m_reportTabstrip, "InfoIconAge", "K45_TLM_WIP_PASSENGER_AGE_REPORT_TAB", "PassengerAgeReport", false));
         m_childControls.Add("PassengerStudentTouristReport", TabCommons.CreateTabLocalized <TLMLinePassengerStudentTouristsReportTab>(m_reportTabstrip, "InfoIconTourism", "K45_TLM_WIP_PASSENGER_REPORT_TAB", "PassengerStudentTouristReport", false));
         m_childControls.Add("PassengerWealthReport", TabCommons.CreateTabLocalized <TLMLinePassengerWealthReportTab>(m_reportTabstrip, "InfoIconLandValue", "K45_TLM_WIP_PASSENGER_WEALTH_REPORT_TAB", "PassengerWealthReport", false));
         m_childControls.Add("PassengerGenderReport", TabCommons.CreateTabLocalized <TLMLinePassengerGenderReportTab>(m_reportTabstrip, "InfoIconPopulation", "K45_TLM_WIP_PASSENGER_GENDER_REPORT_TAB", "PassengerGenderReport", false));
     }
 }
        private void Awake()
        {
            SVMTabPanel.eventOnDistrictSelectionChanged += onDistrictChanged;


            mainPanel            = GetComponentInChildren <UIScrollablePanel>();
            mainPanel.autoLayout = false;
            m_uiHelper           = new UIHelperExtension(mainPanel);

            SVMUtils.createUIElement(out UILabel lbl, mainPanel.transform, "DistrictColorLabel", new Vector4(5, 5, 250, 40));

            allowColorChange = SVMConfigWarehouse.allowColorChanging(extension.ConfigIndexKey);
            if (allowColorChange)
            {
                SVMUtils.LimitWidth(lbl, 250);
                lbl.autoSize = true;
                lbl.localeID = "SVM_DISTRICT_COLOR_LABEL";

                m_districtColor = KlyteUtils.CreateColorField(mainPanel);
                m_districtColor.eventSelectedColorChanged += onChangeDistrictColor;

                SVMUtils.createUIElement(out UIButton resetColor, mainPanel.transform, "DistrictColorReset", new Vector4(290, 0, 0, 0));
                SVMUtils.initButton(resetColor, false, "ButtonMenu");
                SVMUtils.LimitWidth(resetColor, 200);
                resetColor.textPadding = new RectOffset(5, 5, 5, 2);
                resetColor.autoSize    = true;
                resetColor.localeID    = "SVM_RESET_COLOR";
                resetColor.eventClick += onResetColor;
            }
            if (extension.GetAllowDistrictServiceRestrictions())
            {
                m_districtAllowOutsiders = m_uiHelper.AddCheckboxLocale("SVM_ALLOW_OUTSIDERS", true, (x) =>
                {
                    if (!getCurrentSelectedId(out int currentDistrict) || isLoading)
                    {
                        return;
                    }
                    extension.SetAllowOutsiders((uint)currentDistrict, x);
                    m_districtAllowOutsiders.GetComponentInChildren <UILabel>().textColor = Color.white;
                });
        protected override void CreateGroup9(UIHelperExtension helper)
        {
            base.CreateGroup9(helper);
            var chk_lowSat = helper.AddCheckboxLocale("K45_CMNS_USE_LOW_BRIGHT_BUTTON", UseLowSaturationButton);

            helper.Self.eventVisibilityChanged += (x, y) =>
            {
                if (y)
                {
                    chk_lowSat.isChecked = UseLowSaturationButton;
                }
            };
            chk_lowSat.eventClicked += (x, y) =>
            {
                UseLowSaturationButton.value = chk_lowSat.isChecked;

                if (!(m_modPanelButton is null))
                {
                    ApplyButtonColor();
                }
            };
        }
示例#13
0
        internal void LoadSettingsUI(UIHelperExtension helper)
        {
            try
            {
                foreach (Transform child in helper.self.transform)
                {
                    GameObject.Destroy(child.gameObject);
                }
            }
            catch
            {
            }

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Options");
            }
            loadTLMLocale(false);
            string[] namingOptionsSufixo = new string[] {
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 0)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 1)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 2)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 3)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 4)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 5)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 6)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 14))
            };
            string[] namingOptionsPrefixo = new string[] {
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 0)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 1)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 2)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 3)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 4)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 5)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 6)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 7)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 8)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 9)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 10)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 11)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 12)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 13)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 14))
            };
            string[] namingOptionsSeparador = new string[] {
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 0)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 1)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 2)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 3)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 4)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 5)),
            };

            helper.self.eventVisibilityChanged += delegate(UIComponent component, bool b)
            {
                if (b)
                {
                    showVersionInfoPopup();
                }
            };

            overrideWorldInfoPanelLineOption = (UICheckBox)helper.AddCheckboxLocale("TLM_OVERRIDE_DEFAULT_LINE_INFO", m_savedOverrideDefaultLineInfoPanel.value, toggleOverrideDefaultLineInfoPanel);

            helper.AddSpace(10);

            configSelector = (UIDropDown)helper.AddDropdownLocalized("TLM_SHOW_CONFIG_FOR", optionsForLoadConfig, 0, reloadData);
            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 1");
            }
            foreach (TLMConfigWarehouse.ConfigIndex transportType in new TLMConfigWarehouse.ConfigIndex[] {
                TLMConfigWarehouse.ConfigIndex.PLANE_CONFIG,
                TLMConfigWarehouse.ConfigIndex.BLIMP_CONFIG,
                TLMConfigWarehouse.ConfigIndex.SHIP_CONFIG,
                TLMConfigWarehouse.ConfigIndex.FERRY_CONFIG,
                TLMConfigWarehouse.ConfigIndex.BUS_CONFIG,
                TLMConfigWarehouse.ConfigIndex.TRAM_CONFIG,
                TLMConfigWarehouse.ConfigIndex.MONORAIL_CONFIG,
                TLMConfigWarehouse.ConfigIndex.METRO_CONFIG,
                TLMConfigWarehouse.ConfigIndex.TRAIN_CONFIG
            })
            {
                UIHelperExtension group1 = helper.AddGroupExtended(string.Format(Locale.Get("TLM_CONFIGS_FOR"), TLMConfigWarehouse.getNameForTransportType(transportType)));
                lineTypesPanels[transportType]             = group1.self.GetComponentInParent <UIPanel>();
                ((UIPanel)group1.self).autoLayoutDirection = LayoutDirection.Horizontal;
                ((UIPanel)group1.self).backgroundSprite    = "EmptySprite";
                ((UIPanel)group1.self).wrapLayout          = true;
                var systemColor = TLMConfigWarehouse.getColorForTransportType(transportType);
                ((UIPanel)group1.self).color = new Color32((byte)(systemColor.r * 0.7f), (byte)(systemColor.g * 0.7f), (byte)(systemColor.b * 0.7f), 0xff);
                ((UIPanel)group1.self).width = 730;
                group1.AddSpace(30);
                UIDropDown prefixDD                 = generateDropdownConfig(group1, Locale.Get("TLM_PREFIX"), namingOptionsPrefixo, transportType | TLMConfigWarehouse.ConfigIndex.PREFIX);
                var        separatorContainer       = generateDropdownConfig(group1, Locale.Get("TLM_SEPARATOR"), namingOptionsSeparador, transportType | TLMConfigWarehouse.ConfigIndex.SEPARATOR).transform.parent.GetComponent <UIPanel>();
                UIDropDown suffixDD                 = generateDropdownConfig(group1, Locale.Get("TLM_SUFFIX"), namingOptionsSufixo, transportType | TLMConfigWarehouse.ConfigIndex.SUFFIX);
                var        suffixDDContainer        = suffixDD.transform.parent.GetComponent <UIPanel>();
                UIDropDown nonPrefixDD              = generateDropdownConfig(group1, Locale.Get("TLM_IDENTIFIER_NON_PREFIXED"), namingOptionsSufixo, transportType | TLMConfigWarehouse.ConfigIndex.NON_PREFIX);
                var        prefixedPaletteContainer = generateDropdownStringValueConfig(group1, Locale.Get("TLM_PALETTE_PREFIXED"), TLMAutoColorPalettes.paletteList, transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_MAIN).transform.parent.GetComponent <UIPanel>();
                var        paletteLabel             = generateDropdownStringValueConfig(group1, Locale.Get("TLM_PALETTE_UNPREFIXED"), TLMAutoColorPalettes.paletteList, transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_SUBLINE).transform.parent.GetComponentInChildren <UILabel>();
                var        zerosContainer           = generateCheckboxConfig(group1, Locale.Get("TLM_LEADING_ZEROS_SUFFIX"), transportType | TLMConfigWarehouse.ConfigIndex.LEADING_ZEROS);
                var        prefixAsSuffixContainer  = generateCheckboxConfig(group1, Locale.Get("TLM_INVERT_PREFIX_SUFFIX_ORDER"), transportType | TLMConfigWarehouse.ConfigIndex.INVERT_PREFIX_SUFFIX);
                generateCheckboxConfig(group1, Locale.Get("TLM_RANDOM_ON_PALETTE_OVERFLOW"), transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_RANDOM_ON_OVERFLOW);
                var autoColorBasedContainer = generateCheckboxConfig(group1, Locale.Get("TLM_AUTO_COLOR_BASED_ON_PREFIX"), transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_PREFIX_BASED);
                var prefixIncrement         = generateCheckboxConfig(group1, Locale.Get("TLM_LINENUMBERING_BASED_IN_PREFIX"), transportType | TLMConfigWarehouse.ConfigIndex.PREFIX_INCREMENT);
                PropertyChangedEventHandler <int> updateFunction = delegate(UIComponent c, int sel)
                {
                    bool isPrefixed = (ModoNomenclatura)sel != ModoNomenclatura.Nenhum;
                    separatorContainer.isVisible       = isPrefixed;
                    prefixedPaletteContainer.isVisible = isPrefixed;
                    prefixIncrement.isVisible          = isPrefixed;
                    suffixDDContainer.isVisible        = isPrefixed;
                    zerosContainer.isVisible           = isPrefixed && (ModoNomenclatura)suffixDD.selectedIndex == ModoNomenclatura.Numero;
                    prefixAsSuffixContainer.isVisible  = isPrefixed && (ModoNomenclatura)suffixDD.selectedIndex == ModoNomenclatura.Numero && (ModoNomenclatura)prefixDD.selectedIndex != ModoNomenclatura.Numero;
                    autoColorBasedContainer.isVisible  = isPrefixed;
                    paletteLabel.text = isPrefixed ? Locale.Get("TLM_PALETTE_UNPREFIXED") : Locale.Get("TLM_PALETTE");
                    if (TLMPublicTransportDetailPanel.instance != null && TLMPublicTransportDetailPanel.instance.prefixEditor.m_systemTypeDropDown != null)
                    {
                        TLMPublicTransportDetailPanel.instance.prefixEditor.m_systemTypeDropDown.selectedIndex = 0;
                    }
                };
                prefixDD.eventSelectedIndexChanged += updateFunction;
                suffixDD.eventSelectedIndexChanged += delegate(UIComponent c, int sel)
                {
                    bool isPrefixed = (ModoNomenclatura)prefixDD.selectedIndex != ModoNomenclatura.Nenhum;
                    zerosContainer.isVisible          = isPrefixed && (ModoNomenclatura)sel == ModoNomenclatura.Numero;
                    prefixAsSuffixContainer.isVisible = isPrefixed && (ModoNomenclatura)sel == ModoNomenclatura.Numero && (ModoNomenclatura)prefixDD.selectedIndex != ModoNomenclatura.Numero;
                };
                updateFunction.Invoke(null, prefixDD.selectedIndex);
            }

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 2");
            }
            UIHelperExtension group7 = helper.AddGroupExtended(Locale.Get("TLM_NEAR_LINES_CONFIG"));

            group7.AddCheckbox(Locale.Get("TLM_NEAR_LINES_SHOW_IN_SERVICES_BUILDINGS"), m_savedShowNearLinesInCityServicesWorldInfoPanel.value, toggleShowNearLinesInCityServicesWorldInfoPanel);
            group7.AddCheckbox(Locale.Get("TLM_NEAR_LINES_SHOW_IN_ZONED_BUILDINGS"), m_savedShowNearLinesInZonedBuildingWorldInfoPanel.value, toggleShowNearLinesInZonedBuildingWorldInfoPanel);
            group7.AddSpace(20);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_BUS"), TLMConfigWarehouse.ConfigIndex.BUS_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TRAM"), TLMConfigWarehouse.ConfigIndex.TRAM_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_METRO"), TLMConfigWarehouse.ConfigIndex.METRO_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TRAIN"), TLMConfigWarehouse.ConfigIndex.TRAIN_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_SHIP"), TLMConfigWarehouse.ConfigIndex.SHIP_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_PLANE"), TLMConfigWarehouse.ConfigIndex.PLANE_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_FERRY"), TLMConfigWarehouse.ConfigIndex.FERRY_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_BLIMP"), TLMConfigWarehouse.ConfigIndex.BLIMP_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TAXI"), TLMConfigWarehouse.ConfigIndex.TAXI_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_MONORAIL"), TLMConfigWarehouse.ConfigIndex.MONORAIL_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_CABLE_CAR"), TLMConfigWarehouse.ConfigIndex.CABLE_CAR_SHOW_IN_LINEAR_MAP);

            UIHelperExtension group8 = helper.AddGroupExtended(Locale.Get("TLM_AUTOMATION_CONFIG"));

            generateCheckboxConfig(group8, Locale.Get("TLM_AUTO_COLOR_ENABLED"), TLMConfigWarehouse.ConfigIndex.AUTO_COLOR_ENABLED);
            generateCheckboxConfig(group8, Locale.Get("TLM_AUTO_NAME_ENABLED"), TLMConfigWarehouse.ConfigIndex.AUTO_NAME_ENABLED);
            generateCheckboxConfig(group8, Locale.Get("TLM_USE_CIRCULAR_AUTO_NAME"), TLMConfigWarehouse.ConfigIndex.CIRCULAR_IN_SINGLE_DISTRICT_LINE);
            generateCheckboxConfig(group8, Locale.Get("TLM_ADD_LINE_NUMBER_AUTO_NAME"), TLMConfigWarehouse.ConfigIndex.ADD_LINE_NUMBER_IN_AUTONAME);

            UIHelperExtension group13 = helper.AddGroupExtended(Locale.Get("TLM_AUTO_NAME_SETTINGS_PUBLIC_TRANSPORT"));

            ((UIPanel)group13.self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIPanel)group13.self).wrapLayout          = true;
            ((UIPanel)group13.self).width = 730;

            group13.AddSpace(1);
            group13.AddLabel(Locale.Get("TLM_AUTO_NAME_SETTINGS_PUBLIC_TRANSPORT_DESC"));
            group13.AddSpace(1);
            foreach (TLMConfigWarehouse.ConfigIndex ci in TLMConfigWarehouse.configurableAutoNameTransportCategories)
            {
                generateCheckboxConfig(group13, TLMConfigWarehouse.getNameForTransportType(ci), TLMConfigWarehouse.ConfigIndex.PUBLICTRANSPORT_USE_FOR_AUTO_NAMING_REF | ci).width = 300;
                var textFieldPanel = generateTextFieldConfig(group13, Locale.Get("TLM_PREFIX_OPTIONAL"), TLMConfigWarehouse.ConfigIndex.PUBLICTRANSPORT_AUTO_NAMING_REF_TEXT | ci).GetComponentInParent <UIPanel>();
                textFieldPanel.autoLayoutDirection       = LayoutDirection.Horizontal;
                textFieldPanel.autoFitChildrenVertically = true;
                group13.AddSpace(1);
            }
            UIHelperExtension group14 = helper.AddGroupExtended(Locale.Get("TLM_AUTO_NAME_SETTINGS_OTHER"));

            ((UIPanel)group14.self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIPanel)group14.self).wrapLayout          = true;
            ((UIPanel)group14.self).width = 730;
            foreach (TLMConfigWarehouse.ConfigIndex ci in TLMConfigWarehouse.configurableAutoNameCategories)
            {
                generateCheckboxConfig(group14, TLMConfigWarehouse.getNameForServiceType(ci), TLMConfigWarehouse.ConfigIndex.USE_FOR_AUTO_NAMING_REF | ci).width = 300;
                var textFieldPanel = generateTextFieldConfig(group14, Locale.Get("TLM_PREFIX_OPTIONAL"), TLMConfigWarehouse.ConfigIndex.AUTO_NAMING_REF_TEXT | ci).GetComponentInParent <UIPanel>();
                textFieldPanel.autoLayoutDirection       = LayoutDirection.Horizontal;
                textFieldPanel.autoFitChildrenVertically = true;
                group14.AddSpace(2);
            }

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 3");
            }
            UIHelperExtension group6 = helper.AddGroupExtended(Locale.Get("TLM_CUSTOM_PALETTE_CONFIG") + " [" + UIHelperExtension.version + "]");

            ((group6.self) as UIPanel).autoLayoutDirection = LayoutDirection.Horizontal;
            ((group6.self) as UIPanel).wrapLayout          = true;

            UITextField           paletteName = null;
            DropDownColorSelector colorEditor = null;
            NumberedColorList     colorList   = null;

            editorSelector = group6.AddDropdown(Locale.Get("TLM_PALETTE_SELECT"), TLMAutoColorPalettes.paletteListForEditing, 0, delegate(int sel)
            {
                if (sel <= 0 || sel >= TLMAutoColorPalettes.paletteListForEditing.Length)
                {
                    paletteName.enabled = false;
                    colorEditor.Disable();
                    colorList.Disable();
                }
                else
                {
                    paletteName.enabled = true;
                    colorEditor.Disable();
                    colorList.colorList = TLMAutoColorPalettes.getColors(TLMAutoColorPalettes.paletteListForEditing[sel]);
                    colorList.Enable();
                    paletteName.text = TLMAutoColorPalettes.paletteListForEditing[sel];
                }
            }) as UIDropDown;

            group6.AddButton(Locale.Get("CREATE"), delegate()
            {
                string newName = TLMAutoColorPalettes.addPalette();
                updateDropDowns("", "");
                editorSelector.selectedValue = newName;
            });
            group6.AddButton(Locale.Get("TLM_DELETE"), delegate()
            {
                TLMAutoColorPalettes.removePalette(editorSelector.selectedValue);
                updateDropDowns("", "");
            });
            paletteName = group6.AddTextField(Locale.Get("TLM_PALETTE_NAME"), delegate(string val)
            {
            }, "", (string value) =>
            {
                string oldName   = editorSelector.selectedValue;
                paletteName.text = TLMAutoColorPalettes.renamePalette(oldName, value);
                updateDropDowns(oldName, value);
            });
            paletteName.parent.width = 500;

            colorEditor = group6.AddColorField(Locale.Get("TLM_COLORS"), Color.black, delegate(Color c)
            {
                TLMAutoColorPalettes.setColor(colorEditor.id, editorSelector.selectedValue, c);
                colorList.colorList = TLMAutoColorPalettes.getColors(editorSelector.selectedValue);
            }, delegate
            {
                TLMAutoColorPalettes.removeColor(editorSelector.selectedValue, colorEditor.id);
                colorList.colorList = TLMAutoColorPalettes.getColors(editorSelector.selectedValue);
            });

            colorList = group6.AddNumberedColorList(null, new List <Color32>(), delegate(int c)
            {
                colorEditor.id            = c;
                colorEditor.selectedColor = TLMAutoColorPalettes.getColor(c, editorSelector.selectedValue, false);
                colorEditor.title         = c.ToString();
                colorEditor.Enable();
            }, colorEditor.parent.GetComponentInChildren <UILabel>(), delegate()
            {
                TLMAutoColorPalettes.addColor(editorSelector.selectedValue);
            });

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 3½");
            }
            paletteName.enabled = false;
            colorEditor.Disable();
            colorList.Disable();

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 4");
            }
            UIHelperExtension group9 = helper.AddGroupExtended(Locale.Get("TLM_BETAS_EXTRA_INFO"));

            group9.AddDropdownLocalized("TLM_MOD_LANG", TLMLocaleUtils.getLanguageIndex(), currentLanguageId.value, delegate(int idx)
            {
                currentLanguageId.value = idx;
                loadTLMLocale(true);
            });
            group9.AddButton(Locale.Get("TLM_DRAW_CITY_MAP"), TLMMapDrawer.drawCityMap);
            group9.AddCheckbox(Locale.Get("TLM_DEBUG_MODE"), m_debugMode.value, delegate(bool val) { m_debugMode.value = val; });
            group9.AddLabel("Version: " + version + " rev" + typeof(TLMSingleton).Assembly.GetName().Version.Revision);
            group9.AddLabel(Locale.Get("TLM_ORIGINAL_KC_VERSION") + " " + string.Join(".", ResourceLoader.loadResourceString("TLMVersion.txt").Split(".".ToCharArray()).Take(3).ToArray()));
            group9.AddButton(Locale.Get("TLM_RELEASE_NOTES"), delegate()
            {
                showVersionInfoPopup(true);
            });

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("End Loading Options");
            }
        }
示例#14
0
        public void Awake()
        {
            MainContainer    = GetComponent <UIComponent>();
            m_uiHelperGlobal = new UIHelperExtension(MainContainer);

            ((UIScrollablePanel)m_uiHelperGlobal.Self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIScrollablePanel)m_uiHelperGlobal.Self).wrapLayout          = true;
            ((UIScrollablePanel)m_uiHelperGlobal.Self).width = 370;

            m_districtPrefixGenFile       = m_uiHelperGlobal.AddDropdownLocalized("K45_ADR_DISTRICT_GEN_PREFIX_FILE", new string[0], -1, OnChangeSelectedDistrictPrefix);
            m_districtPrefixGenFile.width = 370;
            m_uiHelperGlobal.AddSpace(1);
            KlyteMonoUtils.LimitWidth((UIButton)m_uiHelperGlobal.AddButton(Locale.Get("K45_ADR_DISTRICT_GEN_PREFIX_FILES_RELOAD"), ReloadDistrictPrefixesFiles), 380);
            m_uiHelperGlobal.AddSpace(20);

            m_districtNameGenFile       = m_uiHelperGlobal.AddDropdownLocalized("K45_ADR_DISTRICT_GEN_NAME_FILE", new string[0], -1, OnChangeSelectedDistrictName);
            m_districtNameGenFile.width = 370;
            m_uiHelperGlobal.AddSpace(1);
            KlyteMonoUtils.LimitWidth((UIButton)m_uiHelperGlobal.AddButton(Locale.Get("K45_ADR_DISTRICT_GEN_NAME_FILES_RELOAD"), ReloadDistrictNamesFiles), 380);
            m_uiHelperGlobal.AddSpace(20);

            ReloadDistrictPrefixesFiles();
            ReloadDistrictNamesFiles();

            m_prefixPostalCodeCity = m_uiHelperGlobal.AddTextField(Locale.Get("K45_ADR_CITY_POSTAL_CODE"), null, AdrController.CurrentConfig.GlobalConfig.AddressingConfig.ZipcodeCityPrefix.ToString("D3"), OnChangePostalCodePrefixCity);
            m_prefixPostalCodeCity.numericalOnly = true;
            m_prefixPostalCodeCity.maxLength     = 3;

            m_postalCodeFormat = m_uiHelperGlobal.AddTextField(Locale.Get("K45_ADR_POSTAL_CODE_FORMAT"), null, AdrController.CurrentConfig.GlobalConfig.AddressingConfig.ZipcodeFormat, OnChangePostalCodeFormat);
            m_prefixPostalCodeCity.maxLength = 3;

            string[] formatExplain = new string[12];
            for (int i = 0; i < formatExplain.Length; i++)
            {
                formatExplain[i] = Locale.Get("K45_ADR_POSTAL_CODE_FORMAT_LEGEND", i);
            }

            KlyteMonoUtils.CreateUIElement(out UILabel formatExplanation, m_uiHelperGlobal.Self.transform, "FormatText");
            formatExplanation.wordWrap   = true;
            formatExplanation.textScale  = 0.65f;
            formatExplanation.textColor  = Color.yellow;
            formatExplanation.autoSize   = false;
            formatExplanation.autoHeight = true;
            formatExplanation.width      = 370;

            string[] obs = new string[2];
            for (int i = 0; i < obs.Length; i++)
            {
                obs[i] = Locale.Get("K45_ADR_POSTAL_CODE_FORMAT_OBSERVATION", i);
            }

            KlyteMonoUtils.CreateUIElement(out UILabel obsExplanation, m_uiHelperGlobal.Self.transform, "ObsText");
            obsExplanation.wordWrap   = true;
            obsExplanation.textScale  = 0.65f;
            obsExplanation.textColor  = Color.gray;
            obsExplanation.autoSize   = false;
            obsExplanation.autoHeight = true;
            obsExplanation.width      = 370;


            formatExplanation.text = "∙ " + string.Join(Environment.NewLine + "∙ ", formatExplain);
            obsExplanation.text    = string.Join(Environment.NewLine, obs);

            m_uiHelperGlobal.AddSpace(20);
            m_uiHelperGlobal.AddLabel(Locale.Get("K45_ADR_ADDRESS_LINES"));
            m_addressLine1Format = m_uiHelperGlobal.AddTextField(Locale.Get("K45_ADR_ADDRESS_LINE1"), null, AdrController.CurrentConfig.GlobalConfig.AddressingConfig.AddressLine1, OnChangeAddressLine1);
            m_addressLine2Format = m_uiHelperGlobal.AddTextField(Locale.Get("K45_ADR_ADDRESS_LINE2"), null, AdrController.CurrentConfig.GlobalConfig.AddressingConfig.AddressLine2, OnChangeAddressLine2);
            m_addressLine3Format = m_uiHelperGlobal.AddTextField(Locale.Get("K45_ADR_ADDRESS_LINE3"), null, AdrController.CurrentConfig.GlobalConfig.AddressingConfig.AddressLine3, OnChangeAddressLine3);
            string[] formatExplainAddress = new string[6];
            for (int i = 0; i < formatExplainAddress.Length; i++)
            {
                formatExplainAddress[i] = Locale.Get("K45_ADR_ADDRESS_FORMAT_LEGEND", i);
            }

            KlyteMonoUtils.CreateUIElement(out UILabel formatExplainAddressLabel, m_uiHelperGlobal.Self.transform, "FormatText");
            formatExplainAddressLabel.wordWrap   = true;
            formatExplainAddressLabel.textScale  = 0.65f;
            formatExplainAddressLabel.textColor  = Color.yellow;
            formatExplainAddressLabel.autoSize   = false;
            formatExplainAddressLabel.autoHeight = true;
            formatExplainAddressLabel.width      = 370;

            formatExplainAddressLabel.text = "∙ " + string.Join(Environment.NewLine + "∙ ", formatExplainAddress);


            m_uiHelperGlobal.AddSpace(20);
            m_uiHelperGlobal.AddLabel(Locale.Get("K45_ADR_BUILDING_CONFIGURATIONS"));

            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_TRAIN_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.TrainsPassenger, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.TrainsPassenger = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_MONORAIL_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Monorail, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Monorail = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_METRO_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Metro, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Metro = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_CABLE_CAR_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.CableCar, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.CableCar = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_FERRY_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Ferry, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Ferry = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_SHIP_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.ShipPassenger, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.ShipPassenger = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_BLIMP_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Blimp, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.Blimp = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_AUTONAME_AIRPLANE_STATIONS", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.AirplanePassenger, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.AirplanePassenger = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });

            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_ENABLE_CUSTOM_NAMING_CARGO_SHIP", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.ShipCargo, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.ShipCargo = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_ENABLE_CUSTOM_NAMING_CARGO_TRAIN", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.TrainsCargo, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.TrainsCargo = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_ENABLE_CUSTOM_NAMING_CARGO_AIRPLANE", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.AirplaneCargo, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.StationsNameGenerationConfig.AirplaneCargo = x; AdrEvents.TriggerBuildingNameStrategyChanged(); });



            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_ENABLE_ADDRESS_NAMING_RES", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Residence == GenerationMethod.ADDRESS, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Residence = x ? GenerationMethod.ADDRESS : GenerationMethod.NONE; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_ENABLE_ADDRESS_NAMING_IND", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Industry == GenerationMethod.ADDRESS, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Industry = x ? GenerationMethod.ADDRESS : GenerationMethod.NONE; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_ENABLE_ADDRESS_NAMING_COM", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Commerce == GenerationMethod.ADDRESS, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Commerce = x ? GenerationMethod.ADDRESS : GenerationMethod.NONE; AdrEvents.TriggerBuildingNameStrategyChanged(); });
            m_uiHelperGlobal.AddCheckboxLocale("K45_ADR_ENABLE_ADDRESS_NAMING_OFF", AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Office == GenerationMethod.ADDRESS, (x) => { AdrController.CurrentConfig.GlobalConfig.BuildingConfig.RicoNamesGenerationConfig.Office = x ? GenerationMethod.ADDRESS : GenerationMethod.NONE; AdrEvents.TriggerBuildingNameStrategyChanged(); });
        }
        internal void LoadSettingsUI(UIHelperExtension helper)
        {
            try
            {
                foreach (Transform child in helper.self.transform)
                {
                    GameObject.Destroy(child.gameObject);
                }
            }
            catch
            {
            }

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Options");
            }
            loadTLMLocale(false);
            string[] namingOptionsSufixo = new string[] {
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 0)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 1)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 2)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 3)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 4)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 5)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 6)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 14))
            };
            string[] namingOptionsPrefixo = new string[] {
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 0)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 1)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 2)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 3)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 4)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 5)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 6)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 7)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 8)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 9)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 10)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 11)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 12)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 13)),
                Locale.Get("TLM_MODO_NOMENCLATURA", Enum.GetName(typeof(ModoNomenclatura), 14))
            };
            string[] namingOptionsSeparador = new string[] {
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 0)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 1)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 2)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 3)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 4)),
                Locale.Get("TLM_SEPARATOR", Enum.GetName(typeof(Separador), 5)),
            };

            helper.self.eventVisibilityChanged += delegate(UIComponent component, bool b)
            {
                if (b)
                {
                    showVersionInfoPopup();
                }
            };

            overrideWorldInfoPanelLineOption = (UICheckBox)helper.AddCheckboxLocale("TLM_OVERRIDE_DEFAULT_LINE_INFO", m_savedOverrideDefaultLineInfoPanel.value, toggleOverrideDefaultLineInfoPanel);

            helper.AddSpace(10);

            configSelector = (UIDropDown)helper.AddDropdownLocalized("TLM_SHOW_CONFIG_FOR", optionsForLoadConfig, 0, reloadData);
            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 1");
            }
            foreach (TLMConfigWarehouse.ConfigIndex transportType in new TLMConfigWarehouse.ConfigIndex[] {
                TLMConfigWarehouse.ConfigIndex.PLANE_CONFIG,
                TLMConfigWarehouse.ConfigIndex.BLIMP_CONFIG,
                TLMConfigWarehouse.ConfigIndex.SHIP_CONFIG,
                TLMConfigWarehouse.ConfigIndex.FERRY_CONFIG,
                TLMConfigWarehouse.ConfigIndex.BUS_CONFIG,
                TLMConfigWarehouse.ConfigIndex.TRAM_CONFIG,
                TLMConfigWarehouse.ConfigIndex.MONORAIL_CONFIG,
                TLMConfigWarehouse.ConfigIndex.METRO_CONFIG,
                TLMConfigWarehouse.ConfigIndex.TRAIN_CONFIG,
                TLMConfigWarehouse.ConfigIndex.TOUR_PED_CONFIG,
                TLMConfigWarehouse.ConfigIndex.TOUR_BUS_CONFIG
            })
            {
                UIHelperExtension group1 = helper.AddGroupExtended(string.Format(Locale.Get("TLM_CONFIGS_FOR"), TLMConfigWarehouse.getNameForTransportType(transportType)));
                lineTypesPanels[transportType]             = group1.self.GetComponentInParent <UIPanel>();
                ((UIPanel)group1.self).autoLayoutDirection = LayoutDirection.Horizontal;
                ((UIPanel)group1.self).backgroundSprite    = "EmptySprite";
                ((UIPanel)group1.self).wrapLayout          = true;
                var systemColor = TLMConfigWarehouse.getColorForTransportType(transportType);
                ((UIPanel)group1.self).color = new Color32((byte)(systemColor.r * 0.7f), (byte)(systemColor.g * 0.7f), (byte)(systemColor.b * 0.7f), 0xff);
                ((UIPanel)group1.self).width = 730;
                group1.AddSpace(30);
                UIDropDown prefixDD                 = generateDropdownConfig(group1, Locale.Get("TLM_PREFIX"), namingOptionsPrefixo, transportType | TLMConfigWarehouse.ConfigIndex.PREFIX);
                var        separatorContainer       = generateDropdownConfig(group1, Locale.Get("TLM_SEPARATOR"), namingOptionsSeparador, transportType | TLMConfigWarehouse.ConfigIndex.SEPARATOR).transform.parent.GetComponent <UIPanel>();
                UIDropDown suffixDD                 = generateDropdownConfig(group1, Locale.Get("TLM_SUFFIX"), namingOptionsSufixo, transportType | TLMConfigWarehouse.ConfigIndex.SUFFIX);
                var        suffixDDContainer        = suffixDD.transform.parent.GetComponent <UIPanel>();
                UIDropDown nonPrefixDD              = generateDropdownConfig(group1, Locale.Get("TLM_IDENTIFIER_NON_PREFIXED"), namingOptionsSufixo, transportType | TLMConfigWarehouse.ConfigIndex.NON_PREFIX);
                var        prefixedPaletteContainer = generateDropdownStringValueConfig(group1, Locale.Get("TLM_PALETTE_PREFIXED"), TLMAutoColorPalettes.paletteList, transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_MAIN).transform.parent.GetComponent <UIPanel>();
                var        paletteLabel             = generateDropdownStringValueConfig(group1, Locale.Get("TLM_PALETTE_UNPREFIXED"), TLMAutoColorPalettes.paletteList, transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_SUBLINE).transform.parent.GetComponentInChildren <UILabel>();
                var        zerosContainer           = generateCheckboxConfig(group1, Locale.Get("TLM_LEADING_ZEROS_SUFFIX"), transportType | TLMConfigWarehouse.ConfigIndex.LEADING_ZEROS);
                var        prefixAsSuffixContainer  = generateCheckboxConfig(group1, Locale.Get("TLM_INVERT_PREFIX_SUFFIX_ORDER"), transportType | TLMConfigWarehouse.ConfigIndex.INVERT_PREFIX_SUFFIX);
                generateCheckboxConfig(group1, Locale.Get("TLM_RANDOM_ON_PALETTE_OVERFLOW"), transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_RANDOM_ON_OVERFLOW);
                var autoColorBasedContainer = generateCheckboxConfig(group1, Locale.Get("TLM_AUTO_COLOR_BASED_ON_PREFIX"), transportType | TLMConfigWarehouse.ConfigIndex.PALETTE_PREFIX_BASED);
                var prefixIncrement         = generateCheckboxConfig(group1, Locale.Get("TLM_LINENUMBERING_BASED_IN_PREFIX"), transportType | TLMConfigWarehouse.ConfigIndex.PREFIX_INCREMENT);
                PropertyChangedEventHandler <int> updateFunction = delegate(UIComponent c, int sel)
                {
                    bool isPrefixed = (ModoNomenclatura)sel != ModoNomenclatura.Nenhum;
                    separatorContainer.isVisible       = isPrefixed;
                    prefixedPaletteContainer.isVisible = isPrefixed;
                    prefixIncrement.isVisible          = isPrefixed;
                    suffixDDContainer.isVisible        = isPrefixed;
                    zerosContainer.isVisible           = isPrefixed && (ModoNomenclatura)suffixDD.selectedIndex == ModoNomenclatura.Numero;
                    prefixAsSuffixContainer.isVisible  = isPrefixed && (ModoNomenclatura)suffixDD.selectedIndex == ModoNomenclatura.Numero && (ModoNomenclatura)prefixDD.selectedIndex != ModoNomenclatura.Numero;
                    autoColorBasedContainer.isVisible  = isPrefixed;
                    paletteLabel.text = isPrefixed ? Locale.Get("TLM_PALETTE_UNPREFIXED") : Locale.Get("TLM_PALETTE");
                };
                prefixDD.eventSelectedIndexChanged += updateFunction;
                suffixDD.eventSelectedIndexChanged += delegate(UIComponent c, int sel)
                {
                    bool isPrefixed = (ModoNomenclatura)prefixDD.selectedIndex != ModoNomenclatura.Nenhum;
                    zerosContainer.isVisible          = isPrefixed && (ModoNomenclatura)sel == ModoNomenclatura.Numero;
                    prefixAsSuffixContainer.isVisible = isPrefixed && (ModoNomenclatura)sel == ModoNomenclatura.Numero && (ModoNomenclatura)prefixDD.selectedIndex != ModoNomenclatura.Numero;
                };
                updateFunction.Invoke(null, prefixDD.selectedIndex);
            }
            UIHelperExtension group72 = helper.AddGroupExtended(Locale.Get("TLM_DEFAULT_PRICE"));

            ((UIPanel)group72.self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIPanel)group72.self).wrapLayout          = true;
            ((UIPanel)group72.self).width = 730;
            foreach (TLMConfigWarehouse.ConfigIndex ci in TLMConfigWarehouse.configurableTicketTransportCategories)
            {
                var textField      = generateNumberFieldConfig(group72, TLMConfigWarehouse.getNameForTransportType(ci), TLMConfigWarehouse.ConfigIndex.DEFAULT_TICKET_PRICE | ci);
                var textFieldPanel = textField.GetComponentInParent <UIPanel>();
                textFieldPanel.autoLayoutDirection       = LayoutDirection.Horizontal;
                textFieldPanel.autoFitChildrenVertically = true;
                textFieldPanel.GetComponentInChildren <UILabel>().minimumSize = new Vector2(420, 0);
                group72.AddSpace(2);
            }

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 2");
            }
            UIHelperExtension group7 = helper.AddGroupExtended(Locale.Get("TLM_NEAR_LINES_CONFIG"));

            group7.AddCheckbox(Locale.Get("TLM_NEAR_LINES_SHOW_IN_SERVICES_BUILDINGS"), m_savedShowNearLinesInCityServicesWorldInfoPanel.value, toggleShowNearLinesInCityServicesWorldInfoPanel);
            group7.AddCheckbox(Locale.Get("TLM_NEAR_LINES_SHOW_IN_ZONED_BUILDINGS"), m_savedShowNearLinesInZonedBuildingWorldInfoPanel.value, toggleShowNearLinesInZonedBuildingWorldInfoPanel);
            group7.AddSpace(20);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_BUS"), TLMConfigWarehouse.ConfigIndex.BUS_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_METRO"), TLMConfigWarehouse.ConfigIndex.METRO_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TRAIN"), TLMConfigWarehouse.ConfigIndex.TRAIN_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_SHIP"), TLMConfigWarehouse.ConfigIndex.SHIP_SHOW_IN_LINEAR_MAP);
            generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_PLANE"), TLMConfigWarehouse.ConfigIndex.PLANE_SHOW_IN_LINEAR_MAP);
            if (Singleton <LoadingManager> .instance.SupportsExpansion(ICities.Expansion.AfterDark))
            {
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TAXI"), TLMConfigWarehouse.ConfigIndex.TAXI_SHOW_IN_LINEAR_MAP);
            }
            if (Singleton <LoadingManager> .instance.SupportsExpansion(ICities.Expansion.Snowfall))
            {
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TRAM"), TLMConfigWarehouse.ConfigIndex.TRAM_SHOW_IN_LINEAR_MAP);
            }
            if (Singleton <LoadingManager> .instance.SupportsExpansion(ICities.Expansion.NaturalDisasters))
            {
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_EVAC_BUS"), TLMConfigWarehouse.ConfigIndex.EVAC_BUS_SHOW_IN_LINEAR_MAP);
            }
            if (Singleton <LoadingManager> .instance.SupportsExpansion(ICities.Expansion.InMotion))
            {
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_FERRY"), TLMConfigWarehouse.ConfigIndex.FERRY_SHOW_IN_LINEAR_MAP);
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_BLIMP"), TLMConfigWarehouse.ConfigIndex.BLIMP_SHOW_IN_LINEAR_MAP);
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_MONORAIL"), TLMConfigWarehouse.ConfigIndex.MONORAIL_SHOW_IN_LINEAR_MAP);
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_CABLE_CAR"), TLMConfigWarehouse.ConfigIndex.CABLE_CAR_SHOW_IN_LINEAR_MAP);
            }
            if (Singleton <LoadingManager> .instance.SupportsExpansion(ICities.Expansion.Parks))
            {
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TOUR_BUS"), TLMConfigWarehouse.ConfigIndex.TOUR_BUS_CONFIG_SHOW_IN_LINEAR_MAP);
                generateCheckboxConfig(group7, Locale.Get("TLM_NEAR_LINES_SHOW_TOUR_PED"), TLMConfigWarehouse.ConfigIndex.TOUR_PED_CONFIG_SHOW_IN_LINEAR_MAP);
            }

            UIHelperExtension group8 = helper.AddGroupExtended(Locale.Get("TLM_AUTOMATION_CONFIG"));

            generateCheckboxConfig(group8, Locale.Get("TLM_AUTO_COLOR_ENABLED"), TLMConfigWarehouse.ConfigIndex.AUTO_COLOR_ENABLED);
            generateCheckboxConfig(group8, Locale.Get("TLM_AUTO_NAME_ENABLED"), TLMConfigWarehouse.ConfigIndex.AUTO_NAME_ENABLED);
            generateCheckboxConfig(group8, Locale.Get("TLM_USE_CIRCULAR_AUTO_NAME"), TLMConfigWarehouse.ConfigIndex.CIRCULAR_IN_SINGLE_DISTRICT_LINE);
            generateCheckboxConfig(group8, Locale.Get("TLM_ADD_LINE_NUMBER_AUTO_NAME"), TLMConfigWarehouse.ConfigIndex.ADD_LINE_NUMBER_IN_AUTONAME);

            UIHelperExtension group13 = helper.AddGroupExtended(Locale.Get("TLM_AUTO_NAME_SETTINGS_PUBLIC_TRANSPORT"));

            ((UIPanel)group13.self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIPanel)group13.self).wrapLayout          = true;
            ((UIPanel)group13.self).width = 730;

            group13.AddSpace(1);
            group13.AddLabel(Locale.Get("TLM_AUTO_NAME_SETTINGS_PUBLIC_TRANSPORT_DESC"));
            group13.AddSpace(1);
            foreach (TLMConfigWarehouse.ConfigIndex ci in TLMConfigWarehouse.configurableAutoNameTransportCategories)
            {
                generateCheckboxConfig(group13, TLMConfigWarehouse.getNameForTransportType(ci), TLMConfigWarehouse.ConfigIndex.PUBLICTRANSPORT_USE_FOR_AUTO_NAMING_REF | ci).width = 300;
                var textFieldPanel = generateTextFieldConfig(group13, Locale.Get("TLM_PREFIX_OPTIONAL"), TLMConfigWarehouse.ConfigIndex.PUBLICTRANSPORT_AUTO_NAMING_REF_TEXT | ci).GetComponentInParent <UIPanel>();
                textFieldPanel.autoLayoutDirection       = LayoutDirection.Horizontal;
                textFieldPanel.autoFitChildrenVertically = true;
                group13.AddSpace(1);
            }

            UIHelperExtension group14 = helper.AddGroupExtended(Locale.Get("TLM_AUTO_NAME_SETTINGS_OTHER"));

            ((UIPanel)group14.self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIPanel)group14.self).wrapLayout          = true;
            ((UIPanel)group14.self).width = 730;
            foreach (TLMConfigWarehouse.ConfigIndex ci in TLMConfigWarehouse.configurableAutoNameCategories)
            {
                generateCheckboxConfig(group14, TLMConfigWarehouse.getNameForServiceType(ci), TLMConfigWarehouse.ConfigIndex.USE_FOR_AUTO_NAMING_REF | ci).width = 300;
                var textFieldPanel = generateTextFieldConfig(group14, Locale.Get("TLM_PREFIX_OPTIONAL"), TLMConfigWarehouse.ConfigIndex.AUTO_NAMING_REF_TEXT | ci).GetComponentInParent <UIPanel>();
                textFieldPanel.autoLayoutDirection       = LayoutDirection.Horizontal;
                textFieldPanel.autoFitChildrenVertically = true;
                group14.AddSpace(2);
            }

            UIHelperExtension group15 = helper.AddGroupExtended(Locale.Get("TLM_AUTO_NAME_SETTINGS_PUBLIC_AREAS"));

            ((UIPanel)group15.self).autoLayoutDirection = LayoutDirection.Horizontal;
            ((UIPanel)group15.self).wrapLayout          = true;
            ((UIPanel)group15.self).width = 730;
            foreach (TLMConfigWarehouse.ConfigIndex ci in TLMConfigWarehouse.extraAutoNameCategories)
            {
                generateCheckboxConfig(group15, TLMConfigWarehouse.getNameForServiceType(ci), TLMConfigWarehouse.ConfigIndex.USE_FOR_AUTO_NAMING_REF | ci).width = 300;
                var textFieldPanel = generateTextFieldConfig(group15, Locale.Get("TLM_PREFIX_OPTIONAL"), TLMConfigWarehouse.ConfigIndex.AUTO_NAMING_REF_TEXT | ci).GetComponentInParent <UIPanel>();
                textFieldPanel.autoLayoutDirection       = LayoutDirection.Horizontal;
                textFieldPanel.autoFitChildrenVertically = true;
                group15.AddSpace(2);
            }

            TLMUtils.doLog("Loading Group 3");

            var fiPalette = TLMUtils.EnsureFolderCreation(TLMSingleton.palettesFolder);

            UIHelperExtension group6 = helper.AddGroupExtended(Locale.Get("TLM_CUSTOM_PALETTE_CONFIG"));

            ((group6.self) as UIPanel).autoLayoutDirection = LayoutDirection.Horizontal;
            ((group6.self) as UIPanel).wrapLayout          = true;
            group6.AddLabel(Locale.Get("TLM_PALETTE_FOLDER_LABEL") + ":");
            var namesFilesButton = ((UIButton)group6.AddButton("/", () => { ColossalFramework.Utils.OpenInFileBrowser(fiPalette.FullName); }));

            namesFilesButton.textColor = Color.yellow;
            TLMUtils.LimitWidth(namesFilesButton, 710);
            namesFilesButton.text = fiPalette.FullName + Path.DirectorySeparatorChar;
            ((UIButton)group6.AddButton(Locale.Get("TLM_RELOAD_PALETTES"), delegate()
            {
                TLMAutoColorPalettes.Reload();
                updateDropDowns();
            })).width = 710;

            NumberedColorList colorList = null;

            editorSelector = group6.AddDropdown(Locale.Get("TLM_PALETTE_VIEW"), TLMAutoColorPalettes.paletteListForEditing, 0, delegate(int sel)
            {
                if (sel <= 0 || sel >= TLMAutoColorPalettes.paletteListForEditing.Length)
                {
                    colorList.Disable();
                }
                else
                {
                    colorList.colorList = TLMAutoColorPalettes.getColors(TLMAutoColorPalettes.paletteListForEditing[sel]);
                    colorList.Enable();
                }
            }) as UIDropDown;
            editorSelector.GetComponentInParent <UIPanel>().width = 710;
            editorSelector.width = 710;

            colorList = group6.AddNumberedColorList(null, new List <Color32>(), (c) => { }, null, null);
            colorList.m_atlasToUse = TLMController.taLineNumber;
            colorList.m_spriteName = "SubwayIcon";

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("Loading Group 4");
            }
            UIHelperExtension group9 = helper.AddGroupExtended(Locale.Get("TLM_BETAS_EXTRA_INFO"));

            group9.AddDropdownLocalized("TLM_MOD_LANG", TLMLocaleUtils.getLanguageIndex(), currentLanguageId.value, delegate(int idx)
            {
                currentLanguageId.value = idx;
                loadTLMLocale(true);
            });
            group9.AddButton(Locale.Get("TLM_DRAW_CITY_MAP"), TLMMapDrawer.drawCityMap);
            group9.AddCheckbox(Locale.Get("TLM_DEBUG_MODE"), m_debugMode.value, delegate(bool val) { m_debugMode.value = val; });
            group9.AddLabel("Version: " + version + " rev" + typeof(TLMSingleton).Assembly.GetName().Version.Revision);
            group9.AddLabel(Locale.Get("TLM_ORIGINAL_KC_VERSION") + " " + string.Join(".", TLMResourceLoader.instance.loadResourceString("TLMVersion.txt").Split(".".ToCharArray()).Take(3).ToArray()));
            group9.AddButton(Locale.Get("TLM_RELEASE_NOTES"), delegate()
            {
                showVersionInfoPopup(true);
            });

            if (TLMSingleton.instance != null && TLMSingleton.debugMode)
            {
                TLMUtils.doLog("End Loading Options");
            }
        }
        private void createToolbox()
        {
            TLMUtils.createUIElement(out mainContainer, m_controller.TransformLinearMap);
            mainContainer.absolutePosition = new Vector3(2f, TLMController.instance.uiView.fixedHeight - 300f);
            mainContainer.name             = "TLMLineCreationToolbox";
            mainContainer.height           = 190;
            mainContainer.width            = 180;
            mainContainer.backgroundSprite = "MenuPanel2";
            mainContainer.relativePosition = new Vector3(320f, 57f);

            uiHelper = new UIHelperExtension(mainContainer);

            TLMUtils.createUIElement(out UILabel title, mainContainer.transform);
            title.autoSize          = false;
            title.width             = mainContainer.width;
            title.height            = 30;
            title.color             = new Color(1, 0, 0, 1);
            title.pivot             = UIPivotPoint.MiddleLeft;
            title.textAlignment     = UIHorizontalAlignment.Center;
            title.verticalAlignment = UIVerticalAlignment.Middle;
            title.name             = "Title";
            title.relativePosition = new Vector3(0, 5);
            title.atlas            = TLMController.taLineNumber;
            title.localeID         = "TLM_PREFIX_SELECTOR_WIN_TITLE";
            TLMUtils.createDragHandle(title, mainContainer);


            GameObject lpddgo = GameObject.Instantiate(UITemplateManager.GetAsGameObject(UIHelperExtension.kDropdownTemplate).GetComponent <UIPanel>().Find <UIDropDown>("Dropdown").gameObject, mainContainer.transform);

            linePrefixDropDown                            = lpddgo.GetComponent <UIDropDown>();
            linePrefixDropDown.isLocalized                = false;
            linePrefixDropDown.autoSize                   = false;
            linePrefixDropDown.horizontalAlignment        = UIHorizontalAlignment.Center;
            linePrefixDropDown.text                       = "";
            linePrefixDropDown.width                      = 75;
            linePrefixDropDown.height                     = 30;
            linePrefixDropDown.name                       = "LinePrefixDropDown";
            linePrefixDropDown.textScale                  = 1.6f;
            linePrefixDropDown.itemHeight                 = 35;
            linePrefixDropDown.itemPadding                = new RectOffset(2, 2, 2, 2);
            linePrefixDropDown.textFieldPadding           = new RectOffset(2, 2, 2, 2);
            linePrefixDropDown.eventSelectedIndexChanged += setNextLinePrefix;
            linePrefixDropDown.relativePosition           = new Vector3(5f, 45f);
            linePrefixDropDown.normalBgSprite             = "OptionsDropboxListbox";
            linePrefixDropDown.horizontalAlignment        = UIHorizontalAlignment.Center;

            TLMUtils.createUIElement(out lineNumberTxtBox, mainContainer.transform);
            lineNumberTxtBox.autoSize            = false;
            lineNumberTxtBox.relativePosition    = new Vector3(85f, 45f);
            lineNumberTxtBox.horizontalAlignment = UIHorizontalAlignment.Center;
            lineNumberTxtBox.text           = "";
            lineNumberTxtBox.width          = 90;
            lineNumberTxtBox.height         = 30;
            lineNumberTxtBox.name           = "LineNumberLabel";
            lineNumberTxtBox.normalBgSprite = "EmptySprite";
            lineNumberTxtBox.textScale      = 1.6f;
            lineNumberTxtBox.padding        = new RectOffset(0, 0, 0, 0);
            lineNumberTxtBox.color          = new Color(0, 0, 0, 1);
            TLMUtils.uiTextFieldDefaults(lineNumberTxtBox);
            lineNumberTxtBox.numericalOnly   = true;
            lineNumberTxtBox.maxLength       = 4;
            lineNumberTxtBox.eventLostFocus += setNextLineNumber;;
            lineNumberTxtBox.zOrder          = 10;
            lineNumberTxtBox.text            = "0";

            TLMUtils.createUIElement(out lineFormat, mainContainer.transform);
            lineFormat.autoSize          = false;
            lineFormat.width             = 80;
            lineFormat.height            = 80;
            lineFormat.color             = new Color(1, 0, 0, 1);
            lineFormat.pivot             = UIPivotPoint.MiddleLeft;
            lineFormat.textAlignment     = UIHorizontalAlignment.Center;
            lineFormat.verticalAlignment = UIVerticalAlignment.Middle;
            lineFormat.name             = "LineFormat";
            lineFormat.relativePosition = new Vector3(55f, 80f);
            lineFormat.atlas            = TLMController.taLineNumber;
            TLMUtils.createDragHandle(lineFormat, mainContainer);

            TLMUtils.createUIElement(out lineNumber, lineFormat.transform);
            lineNumber.autoSize          = false;
            lineNumber.width             = lineFormat.width;
            lineNumber.pivot             = UIPivotPoint.MiddleCenter;
            lineNumber.name              = "LineNumber";
            lineNumber.width             = 80;
            lineNumber.height            = 80;
            lineNumber.relativePosition  = new Vector3(-0.5f, 0.5f);
            lineNumber.autoHeight        = false;
            lineNumber.textAlignment     = UIHorizontalAlignment.Center;
            lineNumber.verticalAlignment = UIVerticalAlignment.Middle;

            prefixIncrementChk = uiHelper.AddCheckboxLocale("TLM_AUTOINCREMENT_PREFIX", false, delegate(bool value)
            {
                if (TLMSingleton.debugMode)
                {
                    TLMUtils.doLog("Type = " + TLMConfigWarehouse.getConfigIndexForTransportInfo(transportTool.m_prefab) + "|prop=" + (TLMConfigWarehouse.getConfigIndexForTransportInfo(transportTool.m_prefab) | TLMConfigWarehouse.ConfigIndex.PREFIX_INCREMENT) + "|valToSet = " + value);
                }
                TLMConfigWarehouse.setCurrentConfigBool(TLMConfigWarehouse.getConfigIndexForTransportInfo(transportTool.m_prefab) | TLMConfigWarehouse.ConfigIndex.PREFIX_INCREMENT, value);
            });
            prefixIncrementChk.relativePosition = new Vector3(5f, 162.5f);
        }