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); }
public void Awake() { m_bg = component as UIPanel; m_bg.autoLayout = true; m_bg.autoLayoutDirection = LayoutDirection.Vertical; m_bg.clipChildren = true; var uiHelper = new UIHelperExtension(m_bg); UILabel titleLabel = uiHelper.AddLabel(""); titleLabel.autoSize = true; titleLabel.textAlignment = UIHorizontalAlignment.Center; titleLabel.minimumSize = new Vector2(m_bg.width, 0); titleLabel.localeID = TitleLocaleID; KlyteMonoUtils.CreateUIElement(out UIPanel listTitle, m_bg.transform, "LT"); L titleList = listTitle.gameObject.AddComponent <L>(); titleList.AsTitle(); KlyteMonoUtils.CreateUIElement(out UIPanel reportLinesContainer, m_bg.transform, "listContainer", new Vector4(0, 0, m_bg.width, m_bg.height - titleLabel.height - listTitle.height - 35)); reportLinesContainer.autoLayout = true; reportLinesContainer.autoLayoutDirection = LayoutDirection.Horizontal; KlyteMonoUtils.CreateScrollPanel(reportLinesContainer, out UIScrollablePanel reportLines, out _, reportLinesContainer.width - 10, reportLinesContainer.height, Vector3.zero); for (int i = 0; i < m_reportLines.Length; i++) { KlyteMonoUtils.CreateUIElement(out UIPanel line, reportLines.transform, $"L{i}"); m_reportLines[i] = line.gameObject.AddComponent <L>(); } KlyteMonoUtils.CreateUIElement(out UIPanel aggregateLine, m_bg.transform, $"L_AGG"); m_aggregateLine = aggregateLine.gameObject.AddComponent <L>(); }
public void Awake() { Instance = this; MainContainer = GetComponent <UIComponent>(); m_uiHelper = new UIHelperExtension(MainContainer); ((UIPanel)m_uiHelper.Self).autoLayoutDirection = LayoutDirection.Horizontal; ((UIPanel)m_uiHelper.Self).wrapLayout = true; ((UIPanel)m_uiHelper.Self).autoLayout = true; UILabel titleLabel = m_uiHelper.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_TICKET_PRICE_TITLE"; m_uiHelper.AddSpace(5); KlyteMonoUtils.CreateElement(out m_clockChart, m_uiHelper.Self.transform, "DailyClock"); m_uiHelper.AddSpace(20); KlyteMonoUtils.CreateElement(out m_titleContainer, m_uiHelper.Self.transform, "Title"); PopulateTitlePanel(m_titleContainer); KlyteMonoUtils.CreateScrollPanel(m_uiHelper.Self, out m_entryListContainer, out _, m_uiHelper.Self.width - 20f, m_uiHelper.Self.height - 150, Vector3.zero); }
private void CreateScrollPanel() { m_uiHelper = KlyteMonoUtils.CreateScrollPanel(m_mainPanel, out m_scrollablePanel, out m_scrollbar, m_mainPanel.width - 20f, m_mainPanel.height - 90f, new Vector3(5, 45)); m_scrollablePanel.eventMouseLeave += (x, y) => { m_previewPanel.isVisible = false; }; }
private static UIComponent CreateContentTemplate(float width, float height) { KlyteMonoUtils.CreateUIElement(out UIPanel contentContainer, null); contentContainer.name = "Container"; contentContainer.area = new Vector4(0, 0, width, height); KlyteMonoUtils.CreateScrollPanel(contentContainer, out UIScrollablePanel mcrollablePanel, out UIScrollbar sc, width - 20f, height); return(contentContainer); }
private void Awake() { parent = GetComponentInParent <UIComponent>(); var group6 = new UIHelperExtension(parent.GetComponentInChildren <UIScrollablePanel>()); ((UIScrollablePanel)group6.Self).autoLayoutDirection = LayoutDirection.Horizontal; ((UIScrollablePanel)group6.Self).wrapLayout = true; ((UIScrollablePanel)group6.Self).width = 730; group6.AddLabel(Locale.Get("K45_TLM_CUSTOM_PALETTE_CONFIG")); group6.AddSpace(15); FileInfo fiPalette = FileUtils.EnsureFolderCreation(TLMController.PalettesFolder); group6.AddLabel(Locale.Get("K45_TLM_PALETTE_FOLDER_LABEL") + ":"); var namesFilesButton = ((UIButton)group6.AddButton("/", () => ColossalFramework.Utils.OpenInFileBrowser(fiPalette.FullName))); namesFilesButton.textColor = Color.yellow; KlyteMonoUtils.LimitWidthAndBox(namesFilesButton, 710); namesFilesButton.text = fiPalette.FullName + Path.DirectorySeparatorChar; ((UIButton)group6.AddButton(Locale.Get("K45_TLM_RELOAD_PALETTES"), delegate() { TLMAutoColorPaletteContainer.Reload(); ReloadData(); OnPaletteReloaded?.Invoke(); })).width = 710; UIPanel m_listColorContainer = null; m_paletteSelect = group6.AddDropdown(Locale.Get("K45_TLM_PALETTE_VIEW"), TLMAutoColorPaletteContainer.PaletteListForEditing, 0, delegate(int sel) { if (sel <= 0 || sel >= TLMAutoColorPaletteContainer.PaletteListForEditing.Length) { m_listColorContainer?.Disable(); m_colorFieldTemplateListColors?.SetItemCount(0); } else { m_listColorContainer?.Enable(); UpdateColorList(TLMAutoColorPaletteContainer.GetColors(TLMAutoColorPaletteContainer.PaletteListForEditing[sel])); } }) as UIDropDown; m_paletteSelect.GetComponentInParent <UIPanel>().width = 720; m_paletteSelect.GetComponentInParent <UIPanel>().autoLayoutDirection = LayoutDirection.Horizontal; m_paletteSelect.GetComponentInParent <UIPanel>().wrapLayout = true; m_paletteSelect.width = 710; KlyteMonoUtils.CreateUIElement(out m_listColorContainer, group6.Self.transform, "listColors", new UnityEngine.Vector4(0, 0, group6.Self.width, group6.Self.height - 250)); KlyteMonoUtils.CreateScrollPanel(m_listColorContainer, out m_colorListScroll, out _, m_listColorContainer.width - 20, m_listColorContainer.height); m_colorListScroll.backgroundSprite = "OptionsScrollbarTrack"; m_colorListScroll.autoLayout = true; m_colorListScroll.autoLayoutDirection = LayoutDirection.Horizontal; m_colorListScroll.wrapLayout = true; }
protected void Awake() { MainContainer = GetComponent <UIPanel>(); CreateTitleRow(out titleLine, MainContainer); KlyteMonoUtils.CreateScrollPanel(MainContainer, out mainPanel, out UIScrollbar scrollbar, MainContainer.width - 30, MainContainer.height - 50, new Vector3(5, 40)); mainPanel.autoLayout = true; mainPanel.autoLayoutDirection = LayoutDirection.Vertical; mainPanel.eventVisibilityChanged += OnToggleVisible; }
private void CreateTab<T>(string sprite, string localeKey, string objectName) where T : UICustomControl { UIButton tab = CreateTabTemplate(); tab.normalFgSprite = sprite; tab.tooltip = Locale.Get(localeKey); KlyteMonoUtils.CreateUIElement(out UIPanel contentContainer, null); contentContainer.name = "Container"; contentContainer.area = new Vector4(15, 0, MainPanel.width - 30, MainPanel.height - 70); m_stripMain.AddTab(objectName, tab.gameObject, contentContainer.gameObject); KlyteMonoUtils.CreateScrollPanel(contentContainer, out _, out _, contentContainer.width - 20, contentContainer.height - 5, new Vector3()).Self.gameObject.AddComponent<T>(); }
protected override void AwakeActions() { KlyteMonoUtils.CreateScrollPanel(MainPanel, out _, out _, 450, base.MainPanel.height - 120, new Vector3(10, 110)); MainPanel.gameObject.AddComponent <VWVehicleList>(); CreateTitleRow(MainPanel); SetPreviewWindow(); CreateRemoveUnwantedButton(); KlyteMonoUtils.CreateUIElement(out UIPanel exportPanel, MainPanel.transform, "ImportExportPanel", new Vector4(480, 275, 380, 275)); exportPanel.gameObject.AddComponent <VWConfigFilesPanel>(); }
public void GenerateOptionsMenu(UIHelperExtension helper) { isLoading = true; TLMUtils.doLog("Loading Options"); KlyteMonoUtils.CreateUIElement(out UITabstrip strip, helper.Self.transform, "TabListTLMopt", new Vector4(5, 0, 730, 40)); float effectiveOffsetY = strip.height; KlyteMonoUtils.CreateUIElement(out UITabContainer tabContainer, helper.Self.transform, "TabContainerTLMopt", new Vector4(0, 40, 725, 710)); tabContainer.autoSize = true; strip.tabPages = tabContainer; helper.Self.eventVisibilityChanged += delegate(UIComponent component, bool b) { if (b) { TransportLinesManagerMod.Instance.ShowVersionInfoPopup(); } try { strip.selectedIndex = strip.tabCount - 1; } catch { } }; foreach (ConfigTabs tab in Enum.GetValues(typeof(ConfigTabs))) { UIButton superTab = CreateTabTemplate(); superTab.normalFgSprite = tab.GetTabFgSprite(); superTab.tooltip = tab.GetTabName(); KlyteMonoUtils.CreateUIElement(out UIPanel contentParent, null); KlyteMonoUtils.CreateScrollPanel(contentParent, out UIScrollablePanel content, out _, tabContainer.width, tabContainer.height, Vector3.zero); content.name = "Container"; content.area = new Vector4(0, 0, tabContainer.width, tabContainer.height); content.autoLayout = true; content.autoLayoutPadding = new RectOffset(2, 2, 2, 2); content.autoLayoutDirection = LayoutDirection.Vertical; strip.AddTab(tab.ToString(), superTab.gameObject, contentParent.gameObject, tab.GetTabGenericContentImpl()); } TLMUtils.doLog("End Loading Options"); isLoading = false; }
public void Awake() { MainContainer = GetComponent <UIPanel>(); MainContainer.autoLayout = true; MainContainer.clipChildren = true; MainContainer.autoLayoutDirection = LayoutDirection.Vertical; MainContainer.autoLayoutPadding = new RectOffset(0, 0, 4, 4); KlyteMonoUtils.CreateTabsComponent(out m_tabstrip, out UITabContainer m_tabContainer, MainContainer.transform, "TextEditor", new Vector4(0, 0, MainContainer.width, 40), new Vector4(0, 0, MainContainer.width, MainContainer.height - 40)); UIPanel m_tabSettings = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_Settings), "K45_ACE_BASICTAB_BASIC_SETTINGS", "RcSettings"); UIPanel m_tabAppearence = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_AutoColorIcon), "K45_ACE_BASICTAB_APPEARANCE_SETTINGS", "RcAppearence"); UIPanel m_tabLib = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_Load), "K45_ACE_BASICTAB_LIB_SETTINGS", "RcLib"); var helperSettings = new UIHelperExtension(m_tabSettings, LayoutDirection.Vertical); var helperAppearence = new UIHelperExtension(m_tabAppearence, LayoutDirection.Vertical); var helperLib = new UIHelperExtension(m_tabLib, LayoutDirection.Vertical); AddTextField(Locale.Get("K45_ACE_BASICTAB_NAME"), out m_name, helperSettings, OnSetName); helperSettings.AddSpace(5); AddDropdown(Locale.Get("K45_ACE_BASICTAB_RULEFILTER"), out m_ruleFilter, helperSettings, Enum.GetNames(typeof(RuleCheckTypeVehicle)).Select(x => Locale.Get("K45_ACE_RULECHECKTYPE", x)).ToArray(), OnChangeRuleCheckType); AddButtonInEditorRow(m_ruleFilter, CommonsSpriteNames.K45_QuestionMark, Help_RuleFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_SERVICEFILTER"), out m_service, helperSettings, (Enum.GetValues(typeof(ItemClass.Service)) as ItemClass.Service[]).OrderBy(x => (int)x).Select(x => x == 0 ? Locale.Get("K45_ACE_ANYSERVICE_OPTION") : $"{x}").ToArray(), OnChangeServiceFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_SUBSERVICEFILTER"), out m_subService, helperSettings, Enum.GetNames(typeof(ItemClass.SubService)).Select(x => $"{x}").ToArray(), OnChangeSubServiceFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_LEVELFILTER"), out m_level, helperSettings, (Enum.GetValues(typeof(ItemClass.Level)) as ItemClass.Level[]).OrderBy(x => (int)x).Select(x => $"{x}").ToArray(), OnChangeLevelFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_CLASSFILTER"), out m_class, helperSettings, new string[0], OnChangeClassFilter); AddTextField(Locale.Get("K45_ACE_VEHICLERULES_ASSETSELECTSELF"), out m_assetFilterSelf, helperSettings, null); KlyteMonoUtils.UiTextFieldDefaultsForm(m_assetFilterSelf); m_popupSelf = ConfigureListSelectionPopupForUITextField(m_assetFilterSelf, (text) => AssetColorExpanderMod.Controller?.AssetsCache.FilterVehiclesByText(text), OnAssetSelectedSelfChanged); m_popupSelf.height = 290; m_popupSelf.width -= 20; AddTextField(Locale.Get("K45_ACE_VEHICLERULES_ASSETSELECTOWNER"), out m_assetFilterOwner, helperSettings, null); KlyteMonoUtils.UiTextFieldDefaultsForm(m_assetFilterOwner); m_popupOwner = ConfigureListSelectionPopupForUITextField(m_assetFilterOwner, (text) => AssetColorExpanderMod.Controller?.AssetsCache.FilterBuildingsByText(text), OnAssetSelectedOwnerChanged); m_popupOwner.height = 290; m_popupOwner.width -= 20; ACECommonsUI.GenerateExportButtons(helperSettings, "Vehicle", out m_exportButtonContainer, out m_exportButton, OnExport, out m_exportButtonContainerLocal, out m_exportButtonLocal, OnExportLocal); AddLibBox <ACEVehcileRuleLib, VehicleCityDataRuleXml>(helperLib, out m_copySettings, OnCopyRule, out m_pasteSettings, OnPasteRule, out _, null, OnLoadRule, GetRuleSerialized); AddCheckboxLocale("K45_ACE_VEHICLERULES_ALLOWWAGONWITHDIFFERENTCOLORS", out m_allowWagonDifferentColors, helperAppearence, OnAllowWagonDifferentColors); AddCheckboxLocale("K45_ACE_VEHICLERULES_OVERRIDELINEPREFIXCOLOR", out m_overrideLineColor, helperAppearence, OnOverrideLineColorChange); AddDropdown(Locale.Get("K45_ACE_COLORMODE"), out m_colorMode, helperAppearence, Enum.GetNames(typeof(ColoringMode)).Select(x => Locale.Get("K45_ACE_COLORINGMODE", x)).ToArray(), OnChangeColoringMode); AddButtonInEditorRow(m_colorMode, CommonsSpriteNames.K45_QuestionMark, Help_ColorMode); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWREDTONES", out m_allowRed, helperAppearence, OnAllowRedChanged); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWGREENTONES", out m_allowGreen, helperAppearence, OnAllowGreenChanged); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWBLUETONES", out m_allowBlues, helperAppearence, OnAllowBlueChanged); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWNEUTRALTONES", out m_allowNeutral, helperAppearence, OnAllowNeutralChanged); KlyteMonoUtils.CreateUIElement(out m_listColorContainer, helperAppearence.Self.transform, "listColors", new UnityEngine.Vector4(0, 0, helperAppearence.Self.width, helperAppearence.Self.height - 120)); KlyteMonoUtils.CreateScrollPanel(m_listColorContainer, out m_colorListScroll, out _, m_listColorContainer.width - 20, m_listColorContainer.height); m_colorListScroll.backgroundSprite = "OptionsScrollbarTrack"; m_colorListScroll.autoLayout = true; m_colorListScroll.autoLayoutDirection = LayoutDirection.Horizontal; m_colorListScroll.wrapLayout = true; CreateTemplateColorItem(); m_colorFieldTemplateListColors = new UITemplateList <UIPanel>(m_colorListScroll, COLOR_SELECTOR_TEMPLATE); KlyteMonoUtils.InitCircledButton(m_colorListScroll, out m_addColor, CommonsSpriteNames.K45_Plus, (x, y) => AddColor(), "", 36); MainContainer.isVisible = false; m_pasteSettings.isVisible = false; }
public void Awake() { MainContainer = GetComponent <UIPanel>(); MainContainer.autoLayout = true; MainContainer.clipChildren = true; MainContainer.autoLayoutDirection = LayoutDirection.Vertical; MainContainer.autoLayoutPadding = new RectOffset(0, 0, 4, 4); KlyteMonoUtils.CreateTabsComponent(out m_tabstrip, out UITabContainer m_tabContainer, MainContainer.transform, "TextEditor", new Vector4(0, 0, MainContainer.width, 40), new Vector4(0, 0, MainContainer.width, MainContainer.height - 40)); UIPanel m_tabSettings = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_Settings), "K45_WTS_ROADCORNER_BASIC_SETTINGS", "RcSettings"); UIPanel m_tabRoads = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, "ToolbarIconRoads", "K45_WTS_ROADCORNER_ALLOWTITLE", "RcRoad"); UIPanel m_tabSpawning = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_Reload), "K45_WTS_ROADCORNER_SPAWNING_SETTINGS", "RcSpawning"); UIPanel m_tabAppearence = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_AutoColorIcon), "K45_WTS_ROADCORNER_APPEARANCE_SETTINGS", "RcAppearence"); UIPanel m_tabDistricts = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, "ToolbarIconDistrict", "K45_WTS_ROADCORNER_DISTRICT_SETTINGS", "RcDistricts"); var helperSettings = new UIHelperExtension(m_tabSettings, LayoutDirection.Vertical); var helperSpawning = new UIHelperExtension(m_tabSpawning, LayoutDirection.Vertical); var helperAppearence = new UIHelperExtension(m_tabAppearence, LayoutDirection.Vertical); var helperDistricts = new UIHelperExtension(m_tabDistricts, LayoutDirection.Vertical); var helperRoads = new UIHelperExtension(m_tabRoads, LayoutDirection.Vertical); AddTextField(Locale.Get("K45_WTS_ROADCORNER_NAME"), out m_name, helperSettings, OnSetName); helperSettings.AddSpace(5); AddFilterableInput(Locale.Get("K45_WTS_ROADCORNER_PROPLAYOUT"), helperSettings, out m_propLayoutSelect, out _, OnFilterLayouts, OnPropLayoutChange); AddVector3Field(Locale.Get("K45_WTS_ROADCORNER_POSITION"), out m_position, helperSettings, OnPositionChanged); AddVector3Field(Locale.Get("K45_WTS_ROADCORNER_ROTATION"), out m_rotation, helperSettings, OnRotationChanged); AddVector3Field(Locale.Get("K45_WTS_ROADCORNER_SCALE"), out m_scale, helperSettings, OnScaleChanged); AddLibBox <WTSLibRoadCornerRule, BoardInstanceRoadNodeXml>(helperSettings, out m_copySettings, OnCopyRule, out m_pasteSettings, OnPasteRule, out _, null, OnLoadRule, GetRuleSerialized); AddCheckboxLocale("K45_WTS_ROADCORNER_ALLOW_DIRTROADS", out m_allowDirty, helperRoads, (x) => ToggleAllow(Level.Level1, x)); AddCheckboxLocale("K45_WTS_ROADCORNER_ALLOW_ALLEYS", out m_allowAlleys, helperRoads, (x) => ToggleAllow((Level)5, x)); AddCheckboxLocale("K45_WTS_ROADCORNER_ALLOW_SMALLROADS", out m_allowSmallRoads, helperRoads, (x) => ToggleAllow(Level.Level2, x)); AddCheckboxLocale("K45_WTS_ROADCORNER_ALLOW_MEDIUMROADS", out m_allowMediumRoads, helperRoads, (x) => ToggleAllow(Level.Level3, x)); AddCheckboxLocale("K45_WTS_ROADCORNER_ALLOW_LARGEROADS", out m_allowLargeRoads, helperRoads, (x) => ToggleAllow(Level.Level4, x)); AddCheckboxLocale("K45_WTS_ROADCORNER_ALLOW_HIGHWAYS", out m_allowHighways, helperRoads, (x) => ToggleAllow(Level.Level5, x)); AddSlider(Locale.Get("K45_WTS_ROADCORNER_SPAWN_CHANCE"), out m_spawnChance, helperSpawning, OnChangeSpawnChance, 0, 255, 1, (x) => (x / 255).ToString("P0")); AddVector2Field(Locale.Get("K45_WTS_ROADCORNER_MINMAXHALFWIDTH"), out m_minMaxHalfWidth, helperSpawning, OnSetMinMaxHalfWidth); AddCheckboxLocale("K45_WTS_ROADCORNER_IGNOREEMPTYNAMES", out m_ignoreEmpty, helperSpawning, OnChangeIgnoreEmpty); KlyteMonoUtils.CreateUIElement(out m_spawnInCornerOptions, m_tabSpawning.transform, "spawnInCorner", new Vector4(0, 0, 620, 0)); var helperSpawningCorner = new UIHelperExtension(m_spawnInCornerOptions, LayoutDirection.Vertical); helperSpawningCorner.Self.width = 620; AddCheckboxLocale("K45_WTS_ROADCORNER_PLACEALSOONDISTRICTBORDER", out m_placeDistrictBorder, helperSpawningCorner, OnChangeSpawnOnDistrictBorder); AddCheckboxLocale("K45_WTS_ROADCORNER_PLACEONTUNNELBRIDGESTART", out m_placeRoadTransition, helperSpawningCorner, OnChangePlaceRoadTransition); AddCheckboxLocale("K45_WTS_ROADCORNER_USEDISTRICTCOLOR", out m_useDistrictColor, helperAppearence, OnChangeUseDistrictColor); AddCheckboxLocale("K45_WTS_ROADCORNER_DISTRICTSELECTIONASWHITELIST", out m_districtWhiteList, helperDistricts, OnSetDistrictsAsWhitelist); AddCheckboxLocale("K45_WTS_ROADCORNER_DISTRICTSELECTIONASBLACKLIST", out m_districtBlackList, helperDistricts, OnSetDistrictsAsBlacklist); AddDropdown(Locale.Get("K45_WTS_ROADCORNER_DISTRICTRESTRICTIONSOLVEORDER"), out m_districtResolutionOrder, helperDistricts, ColossalUIExtensions.GetDropdownOptions <DistrictRestrictionOrder>("K45_WTS_DISTRICTRESTRICTIONORDER"), OnChangeDistrictRestrictionOrder); KlyteMonoUtils.CreateUIElement(out m_listContainer, helperDistricts.Self.transform, "previewPanel", new UnityEngine.Vector4(0, 0, helperDistricts.Self.width, helperDistricts.Self.height - 160)); KlyteMonoUtils.CreateScrollPanel(m_listContainer, out m_districtList, out _, m_listContainer.width - 20, m_listContainer.height); m_districtList.backgroundSprite = "OptionsScrollbarTrack"; m_districtList.autoLayout = true; m_districtList.autoLayoutDirection = LayoutDirection.Vertical; CreateTemplateDistrict(); m_checkboxTemplateList = new UITemplateList <UIPanel>(m_districtList, DISTRICT_SELECTOR_TEMPLATE); WTSRoadCornerEditor.Instance.RuleList.EventSelectionChanged += OnChangeTab; MainContainer.isVisible = false; m_pasteSettings.isVisible = false; }
public void Awake() { m_isLoading = true; if (!(Instance is null)) { Destroy(Instance); } Instance = this; MainContainer = GetComponent <UIPanel>(); MainContainer.autoLayout = true; MainContainer.autoLayoutDirection = LayoutDirection.Vertical; MainContainer.clipChildren = true; m_uiHelperNeighbors = new UIHelperExtension(MainContainer); AddDropdown(Locale.Get("K45_ADR_REGION_CITIES_FILE"), out m_neighborFileSelect, m_uiHelperNeighbors, new string[0], OnChangeSelectedNeighborFile); AddButtonInEditorRow(m_neighborFileSelect, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Reload, ReloadOptionsFilesNeighbor, "K45_ADR_ROAD_NAME_FILES_RELOAD"); m_uiHelperNeighbors.AddSpace(10); KlyteMonoUtils.CreateUIElement(out UIPanel parentContainer, transform, "ParentContainer"); parentContainer.width = MainContainer.width - MainContainer.padding.left - MainContainer.padding.right; parentContainer.height = MainContainer.height - 70f; parentContainer.autoLayoutDirection = LayoutDirection.Horizontal; parentContainer.autoLayout = true; KlyteMonoUtils.CreateUIElement(out m_borderChartContainer, parentContainer.transform, "NeighborhoodContainer"); m_borderChartContainer.width = (parentContainer.width / 2f); m_borderChartContainer.height = parentContainer.height; m_borderChartContainer.autoLayout = false; m_borderChartContainer.useCenter = true; m_borderChartContainer.wrapLayout = false; m_borderChartContainer.tooltipLocaleID = "K45_ADR_CITY_NEIGHBORHOOD"; m_borderChart = m_borderChartContainer.gameObject.AddComponent <AdrMapBordersChart>(); //UILabel titleLabel = m_uiHelperNeighbors.AddLabel(""); //titleLabel.autoSize = true; //titleLabel.textAlignment = UIHorizontalAlignment.Center; //titleLabel.minimumSize = new Vector2(DefaultWidth, 0); //KlyteMonoUtils.LimitWidth(titleLabel, DefaultWidth); //titleLabel.localeID = "K45_ADR_AZIMUTH_EDITOR_TITLE"; KlyteMonoUtils.CreateUIElement(out UIPanel m_neighborEntryListPanel, parentContainer.transform, "NeighborhoodContainer"); m_neighborEntryListPanel.width = (parentContainer.width / 2f); m_neighborEntryListPanel.height = parentContainer.height; m_neighborEntryListPanel.autoLayout = true; m_neighborEntryListPanel.autoLayoutDirection = LayoutDirection.Vertical; KlyteMonoUtils.CreateUIElement(out UIPanel titleItem, m_neighborEntryListPanel.transform, "NeighborhoodContainer"); titleItem.gameObject.AddComponent <AdrAzimuthTitleLineNeighbor>(); UIHelperExtension.AddSpace(m_neighborEntryListPanel, 5); KlyteMonoUtils.CreateUIElement(out UIPanel listContainer, m_neighborEntryListPanel.transform, "listContainer"); listContainer.autoLayout = true; listContainer.autoLayoutDirection = LayoutDirection.Horizontal; listContainer.width = m_neighborEntryListPanel.width; listContainer.height = m_neighborEntryListPanel.height - 35; KlyteMonoUtils.CreateScrollPanel(listContainer, out m_neighborsList, out _, listContainer.width - 17.5f, listContainer.height); m_isLoading = false; ReloadOptionsFilesNeighbor(); }
protected override void AwakeActions() { CreateTopButton(MainPanel, "ExportAsDefault", "K45_ER_EXPORT_DEFAULT_BTN", CommonsSpriteNames.K45_Save.ToString(), new Vector2(10, 50), (x, y) => ClassesData.Instance.SaveAsDefault()); CreateTopButton(MainPanel, "ImportDefault", "K45_ER_IMPORT_DEFAULT_BTN", CommonsSpriteNames.K45_Load.ToString(), new Vector2(95, 50), (x, y) => ClassesData.Instance.LoadDefaults()); CreateTopButton(MainPanel, "SelectAll", "K45_ER_SELECT_ALL_BTN", "check-checked", new Vector2(180, 50), (x, y) => ClassesData.Instance.SelectAll()); CreateTopButton(MainPanel, "SelectNone", "K45_ER_SELECT_NONE_BTN", "check-unchecked", new Vector2(265, 50), (x, y) => ClassesData.Instance.UnselectAll()); CreateTopButton(MainPanel, "Reset", "K45_ER_RESET_BTN", CommonsSpriteNames.K45_Reload.ToString(), new Vector2(350, 50), (x, y) => ClassesData.Instance.SafeCleanAll(m_allClasses.Keys)); KlyteMonoUtils.CreateScrollPanel(MainPanel, out UIScrollablePanel scrollPanel, out _, MainPanel.width - 25, MainPanel.height - 105, new Vector3(5, 100)); scrollPanel.autoLayout = true; scrollPanel.autoLayoutDirection = LayoutDirection.Vertical; scrollPanel.autoLayoutPadding = new RectOffset(0, 0, 5, 5); scrollPanel.backgroundSprite = "ScrollbarTrack"; scrollPanel.scrollPadding = new RectOffset(5, 5, 5, 5); m_allClasses = ((FastList <PrefabCollection <NetInfo> .PrefabData>) typeof(PrefabCollection <NetInfo>).GetField("m_scenePrefabs", RedirectorUtils.allFlags).GetValue(null)) .m_buffer .Select(x => x.m_prefab) .Where(x => x?.m_class != null && (x.m_class.m_layer == ItemClass.Layer.Default || x.m_class.m_layer == ItemClass.Layer.MetroTunnels || x.m_class.m_layer == ItemClass.Layer.WaterPipes || x.m_class.m_layer == ItemClass.Layer.WaterStructures)) .GroupBy(x => x.m_class.name) .ToDictionary(x => x.First().m_class, x => x.ToList()); foreach (KeyValuePair <ItemClass, List <NetInfo> > clazz in m_allClasses) { List <NetInfo> itemList = clazz.Value; ItemClass clazzKey = clazz.Key; string className = clazzKey.name; KlyteMonoUtils.CreateUIElement(out UIPanel row, scrollPanel.transform, $"{clazz.Key.name}", new Vector4(0, 0, scrollPanel.width, 20)); row.autoLayout = true; row.padding = new RectOffset(5, 5, 0, 0); row.stringUserData = className; UICheckBox uiCheckbox = UIHelperExtension.AddCheckbox(row, $"{clazz.Key.name}", ClassesData.Instance.GetConductibility(clazzKey)); uiCheckbox.name = "ClassCheckbox"; uiCheckbox.height = 20f; uiCheckbox.width = 335f; uiCheckbox.label.processMarkup = true; uiCheckbox.label.textScale = 0.8f; uiCheckbox.objectUserData = clazzKey; uiCheckbox.eventCheckChanged += SetItemClassValue; KlyteMonoUtils.LimitWidthAndBox(uiCheckbox.label, 325); ClassesData.Instance.eventOnValueChanged += (x, y) => { if (x == className && y is bool b) { SetNewValue(uiCheckbox, b); } }; ClassesData.Instance.eventAllChanged += () => SetNewValue(uiCheckbox, ClassesData.Instance.GetConductibility(clazzKey)); KlyteMonoUtils.CreateUIElement(out UIButton help, row.transform, "?", new Vector4(0, 0, 20, 20)); help.text = "?"; help.hoveredTextColor = Color.blue; KlyteMonoUtils.InitButtonFull(help, false, "OptionBase"); help.eventClicked += (x, y) => { K45DialogControl.ShowModal(new K45DialogControl.BindProperties() { icon = ElectricRoadsMod.Instance.IconName, messageAlign = UIHorizontalAlignment.Left, showButton1 = true, showButton2 = true, showButton3 = true, showClose = true, textButton1 = Locale.Get("K45_ER_ACTIVATE_CLASS_BTN"), textButton2 = Locale.Get("K45_ER_DEACTIVATE_CLASS_BTN"), textButton3 = Locale.Get("K45_ER_RETURN_BTN"), title = string.Format(Locale.Get("K45_ER_TITLE_NET_LIST_WINDOW"), className), message = string.Format(Locale.Get(itemList.Count <= 20 ? "K45_ER_PATTERN_NET_LIST_FEW" : "K45_ER_PATTERN_NET_LIST_FULL"), string.Join("\n", itemList.Take(20).Select(x => $"\t- {x.GetLocalizedTitle()}").ToArray()), itemList.Count - 20) }, (x) => { if (x == 1) { uiCheckbox.isChecked = true; } else if (x == 2) { uiCheckbox.isChecked = false; } return(true); }); }; } Quicksort(scrollPanel.components, new Comparison <UIComponent>(CompareNames), false); }
public void Awake() { MainContainer = GetComponent <UIPanel>(); MainContainer.autoLayout = true; MainContainer.clipChildren = true; MainContainer.autoLayoutDirection = LayoutDirection.Vertical; MainContainer.autoLayoutPadding = new RectOffset(0, 0, 4, 4); KlyteMonoUtils.CreateTabsComponent(out m_tabstrip, out UITabContainer m_tabContainer, MainContainer.transform, "TextEditor", new Vector4(0, 0, MainContainer.width, 40), new Vector4(0, 0, MainContainer.width, MainContainer.height - 40)); UIPanel m_tabSettings = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_Settings), "K45_ACE_BASICTAB_BASIC_SETTINGS", "RcSettings"); UIPanel m_tabAppearence = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_AutoColorIcon), "K45_ACE_BASICTAB_APPEARANCE_SETTINGS", "RcAppearence"); UIPanel m_tabDistricts = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, "ToolbarIconDistrict", "K45_ACE_BASICTAB_DISTRICT_SETTINGS", "RcDistricts"); UIPanel m_tabLib = TabCommons.CreateNonScrollableTabLocalized(m_tabstrip, KlyteResourceLoader.GetDefaultSpriteNameFor(CommonsSpriteNames.K45_Load), "K45_ACE_BASICTAB_LIB_SETTINGS", "RcLib"); var helperSettings = new UIHelperExtension(m_tabSettings, LayoutDirection.Vertical); var helperAppearence = new UIHelperExtension(m_tabAppearence, LayoutDirection.Vertical); var helperDistricts = new UIHelperExtension(m_tabDistricts, LayoutDirection.Vertical); var helperLib = new UIHelperExtension(m_tabLib, LayoutDirection.Vertical); AddTextField(Locale.Get("K45_ACE_BASICTAB_NAME"), out m_name, helperSettings, OnSetName); helperSettings.AddSpace(5); AddDropdown(Locale.Get("K45_ACE_BASICTAB_RULEFILTER"), out m_ruleFilter, helperSettings, Enum.GetNames(typeof(RuleCheckTypeProp)).Select(x => Locale.Get("K45_ACE_RULECHECKTYPE", x)).ToArray(), OnChangeRuleCheckType); AddButtonInEditorRow(m_ruleFilter, CommonsSpriteNames.K45_QuestionMark, Help_RuleFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_SERVICEFILTER"), out m_service, helperSettings, (Enum.GetValues(typeof(ItemClass.Service)) as ItemClass.Service[]).OrderBy(x => (int)x).Select(x => x == 0 ? Locale.Get("K45_ACE_ANYSERVICE_OPTION") : $"{x}").ToArray(), OnChangeServiceFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_SUBSERVICEFILTER"), out m_subService, helperSettings, Enum.GetNames(typeof(ItemClass.SubService)).Select(x => $"{x}").ToArray(), OnChangeSubServiceFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_LEVELFILTER"), out m_level, helperSettings, (Enum.GetValues(typeof(ItemClass.Level)) as ItemClass.Level[]).OrderBy(x => (int)x).Select(x => $"{x}").ToArray(), OnChangeLevelFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_CLASSFILTER"), out m_class, helperSettings, new string[0], OnChangeClassFilter); AddDropdown(Locale.Get("K45_ACE_BASICTAB_CLASSFILTER"), out m_parentClass, helperSettings, new string[0], OnChangeParentClassFilter); AddTextField(Locale.Get("K45_ACE_PROPRULES_ASSETSELECT_BUILDING"), out m_assetFilterBuilding, helperSettings, null); KlyteMonoUtils.UiTextFieldDefaultsForm(m_assetFilterBuilding); m_popupBuilding = ConfigureListSelectionPopupForUITextField(m_assetFilterBuilding, (text) => AssetColorExpanderMod.Controller?.AssetsCache.FilterBuildingsByText(text), OnAssetSelectedBuildingChanged); m_popupBuilding.height = 290; m_popupBuilding.width -= 20; AddTextField(Locale.Get("K45_ACE_PROPRULES_ASSETSELECT_NET"), out m_assetFilterNet, helperSettings, null); KlyteMonoUtils.UiTextFieldDefaultsForm(m_assetFilterNet); m_popupNet = ConfigureListSelectionPopupForUITextField(m_assetFilterNet, (text) => AssetColorExpanderMod.Controller?.AssetsCache.FilterNetsByText(text), OnAssetSelectedNetChanged); m_popupNet.height = 290; m_popupNet.width -= 20; AddTextField(Locale.Get("K45_ACE_PROPRULES_ASSETSELECT"), out m_assetFilter, helperSettings, null); KlyteMonoUtils.UiTextFieldDefaultsForm(m_assetFilter); m_popup = ConfigureListSelectionPopupForUITextField(m_assetFilter, (text) => AssetColorExpanderMod.Controller?.AssetsCache.FilterPropsByText(text), OnAssetSelectedChanged); m_popup.height = 290; m_popup.width -= 20; GenerateExportButtons(helperSettings, "Building", out m_exportButtonContainer, out m_exportButton, OnExport, out m_exportButtonContainerLocal, out m_exportButtonLocal, OnExportLocal); AddLibBox <ACEPropRuleLib, PropCityDataRuleXml>(helperLib, out m_copySettings, OnCopyRule, out m_pasteSettings, OnPasteRule, out _, null, OnLoadRule, GetRuleSerialized); AddDropdown(Locale.Get("K45_ACE_COLORMODE"), out m_colorMode, helperAppearence, Enum.GetNames(typeof(ColoringMode)).Select(x => Locale.Get("K45_ACE_COLORINGMODE", x)).ToArray(), OnChangeColoringMode); AddButtonInEditorRow(m_colorMode, CommonsSpriteNames.K45_QuestionMark, Help_ColorMode); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWREDTONES", out m_allowRed, helperAppearence, OnAllowRedChanged); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWGREENTONES", out m_allowGreen, helperAppearence, OnAllowGreenChanged); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWBLUETONES", out m_allowBlues, helperAppearence, OnAllowBlueChanged); AddCheckboxLocale("K45_ACE_COLORMODE_ALLOWNEUTRALTONES", out m_allowNeutral, helperAppearence, OnAllowNeutralChanged); KlyteMonoUtils.CreateUIElement(out m_listColorContainer, helperAppearence.Self.transform, "listColors", new UnityEngine.Vector4(0, 0, helperAppearence.Self.width, helperAppearence.Self.height - 80)); KlyteMonoUtils.CreateScrollPanel(m_listColorContainer, out m_colorListScroll, out _, m_listColorContainer.width - 20, m_listColorContainer.height); m_colorListScroll.backgroundSprite = "OptionsScrollbarTrack"; m_colorListScroll.autoLayout = true; m_colorListScroll.autoLayoutDirection = LayoutDirection.Horizontal; m_colorListScroll.wrapLayout = true; CreateTemplateColorItem(); m_colorFieldTemplateListColors = new UITemplateList <UIPanel>(m_colorListScroll, COLOR_SELECTOR_TEMPLATE); KlyteMonoUtils.InitCircledButton(m_colorListScroll, out m_addColor, CommonsSpriteNames.K45_Plus, (x, y) => AddColor(), "", 36); AddCheckboxLocale("K45_ACE_BASICTAB_DISTRICTSELECTIONASWHITELIST", out m_districtWhiteList, helperDistricts, OnSetDistrictsAsWhitelist); AddCheckboxLocale("K45_ACE_BASICTAB_DISTRICTSELECTIONASBLACKLIST", out m_districtBlackList, helperDistricts, OnSetDistrictsAsBlacklist); AddDropdown(Locale.Get("K45_ACE_BASICTAB_DISTRICTRESTRICTIONSOLVEORDER"), out m_districtResolutionOrder, helperDistricts, Enum.GetNames(typeof(DistrictRestrictionOrder)).Select(x => Locale.Get("K45_ACE_DISTRICTRESTRICTIONORDER", x)).ToArray(), OnChangeDistrictRestrictionOrder); AddButtonInEditorRow(m_districtResolutionOrder, CommonsSpriteNames.K45_QuestionMark, Help_DistrictFilter); KlyteMonoUtils.CreateUIElement(out m_listContainer, helperDistricts.Self.transform, "previewPanel", new UnityEngine.Vector4(0, 0, helperDistricts.Self.width, helperDistricts.Self.height - 160)); KlyteMonoUtils.CreateScrollPanel(m_listContainer, out m_districtList, out _, m_listContainer.width - 20, m_listContainer.height); m_districtList.backgroundSprite = "OptionsScrollbarTrack"; m_districtList.autoLayout = true; m_districtList.autoLayoutDirection = LayoutDirection.Vertical; CreateTemplateDistrict(); m_checkboxTemplateListDistrict = new UITemplateList <UIPanel>(m_districtList, DISTRICT_SELECTOR_TEMPLATE); MainContainer.isVisible = false; m_pasteSettings.isVisible = false; }
public void Awake() { Instance = this; MainContainer = GetComponent <UIPanel>(); MainContainer.autoLayout = true; MainContainer.autoLayoutDirection = LayoutDirection.Vertical; MainContainer.autoLayoutPadding = new RectOffset(5, 5, 5, 5); MainContainer.clipChildren = true; KlyteMonoUtils.CreateUIElement(out m_topBar, MainContainer.transform, "topBar", new UnityEngine.Vector4(0, 0, MainContainer.width - MainContainer.padding.horizontal, 50)); m_topBar.autoLayout = true; m_topBar.autoLayoutDirection = LayoutDirection.Vertical; m_topBar.padding = new RectOffset(5, 5, 5, 5); m_topBar.autoFitChildrenVertically = true; var m_topHelper = new UIHelperExtension(m_topBar); AddFilterableInput(Locale.Get("K45_WTS_VEHICLEEDITOR_SELECTMODEL"), m_topHelper, out m_vehicleSearch, out _, VehiclesIndexes.instance.BasicInputFiltering, OnVehicleNameSelected); AddButtonInEditorRow(m_vehicleSearch, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Dropper, EnableVehiclePicker, null, true, 30); AddButtonInEditorRow(m_vehicleSearch, Commons.UI.SpriteNames.CommonsSpriteNames.K45_QuestionMark, Help_VehicleModel, null, true, 30); AddLabel("", m_topHelper, out m_labelSelectionDescription, out m_containerSelectionDescription); KlyteMonoUtils.LimitWidthAndBox(m_labelSelectionDescription, (m_topHelper.Self.width / 2), out UIPanel containerBoxDescription, true); m_labelSelectionDescription.prefix = Locale.Get("K45_WTS_CURRENTSELECTION") + ": "; m_btnReload = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Reload, OnReloadDescriptors, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_RELOADDESCRIPTORS", false); m_btnSteam = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Steam, OnExportAsAsset, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_EXPORTTOASSETFOLDER", false); m_btnExport = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Export, OnExportAsGlobal, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_EXPORTASGLOBAL", false); m_btnLoad = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Load, OnOpenGlobalFolder, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_OPENGLOBALSFOLDER", false); m_btnDelete = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Delete, OnDeleteFromCity, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_DELETEFROMCITY", false); m_btnCopyToCity = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Import, OnCopyToCity, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_COPYTOCITY", false); m_btnNew = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_New, OnCreateNewCity, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_NEWINCITY", false); m_btnCopy = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Copy, OnCopyToClipboard, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_COPYTOCLIPBOARD", false); m_btnPaste = AddButtonInEditorRow(containerBoxDescription, Commons.UI.SpriteNames.CommonsSpriteNames.K45_Paste, OnPasteFromClipboard, "K45_WTS_BUILDINGEDITOR_BUTTONROWACTION_PASTEFROMCLIPBOARD", false); m_btnPaste.isVisible = false; KlyteMonoUtils.CreateUIElement(out m_middleBar, MainContainer.transform, "previewBar", new Vector4(0, 0, MainContainer.width - MainContainer.padding.horizontal, 300)); m_middleBar.autoLayout = true; m_middleBar.autoLayoutDirection = LayoutDirection.Horizontal; KlyteMonoUtils.CreateUIElement(out UIPanel previewContainer, m_middleBar.transform, "previewContainer", new UnityEngine.Vector4(0, 0, m_middleBar.width * .6f, m_middleBar.height - m_middleBar.padding.vertical)); Preview = previewContainer.gameObject.AddComponent <WTSVehicleLayoutEditorPreview>(); KlyteMonoUtils.CreateScrollPanel(m_middleBar, out m_editTabstrip, out _, m_middleBar.width - previewContainer.width - m_middleBar.padding.horizontal - (m_middleBar.autoLayoutPadding.horizontal * 2) - 20, 300); m_editTabstrip.autoLayout = true; m_editTabstrip.autoLayoutDirection = LayoutDirection.Vertical; InitTabButton(m_editTabstrip, out _, Locale.Get("K45_WTS_BASIC_INFO_TAB_TITLE"), new Vector2(m_editTabstrip.size.x, 30), (x, y) => OnTabChange(x.zOrder)); KlyteMonoUtils.CreateUIElement(out m_orderedRulesList, m_editTabstrip.transform, "GenTabs", new Vector4(0, 0, m_editTabstrip.width, 0)); m_orderedRulesList.autoFitChildrenVertically = true; m_orderedRulesList.autoLayout = true; m_orderedRulesList.autoLayoutDirection = LayoutDirection.Vertical; InitTabButton(m_editTabstrip, out m_plusButton, Locale.Get("K45_WTS_ADD_NEW_TEXT_ENTRY"), new Vector2(m_editTabstrip.size.x, 30), null); m_plusButton.eventClicked += AddTabToItem; m_tabs = new UITemplateList <UIButton>(m_orderedRulesList, TAB_TEMPLATE_NAME); KlyteMonoUtils.CreateUIElement(out m_cantEditText, MainContainer.transform, "text", new UnityEngine.Vector4(0, 0, MainContainer.width - MainContainer.padding.horizontal, 315)); m_cantEditText.text = Locale.Get("K45_WTS_VEHICLEEDITOR_CANTEDITTEXT"); m_cantEditText.textAlignment = UIHorizontalAlignment.Center; m_cantEditText.wordWrap = true; KlyteMonoUtils.CreateUIElement(out m_editArea, MainContainer.transform, "editArea", new UnityEngine.Vector4(0, 0, MainContainer.width - MainContainer.padding.horizontal, MainContainer.height - m_middleBar.height - m_topBar.height - MainContainer.padding.vertical - (MainContainer.autoLayoutPadding.vertical * 2) - 5)); m_editArea.padding = new RectOffset(5, 5, 5, 5); KlyteMonoUtils.CreateUIElement(out m_basicInfoEditor, m_editArea.transform, "basicTab", new UnityEngine.Vector4(0, 0, m_editArea.width - m_editArea.padding.horizontal, m_editArea.height - m_editArea.padding.vertical)); m_basicInfoEditor.gameObject.AddComponent <WTSVehicleLayoutEditorBasics>(); KlyteMonoUtils.CreateUIElement(out m_textInfoEditor, m_editArea.transform, "textTab", new UnityEngine.Vector4(0, 0, m_editArea.width - m_editArea.padding.horizontal, m_editArea.height - m_editArea.padding.vertical)); m_textInfoEditor.gameObject.AddComponent <WTSVehicleLayoutEditorTexts>(); CreateTabTemplate(); ReloadVehicle(); OnTabChange(0); }