public void CreateTheme(string themeName) { if (BuildingThemesManager.instance.GetThemeByName(themeName) != null) { return; } var newTheme = new Configuration.Theme() { name = themeName }; BuildingThemesManager.instance.Configuration.themes.Add(newTheme); m_isDistrictThemesDirty = true; InitBuildingLists(); m_themeSelection.selectedIndex = -1; m_themeSelection.rowsData.m_buffer = m_themes.Keys.ToArray(); m_themeSelection.rowsData.m_size = m_themeSelection.rowsData.m_buffer.Length; for (int i = 0; i < m_themeSelection.rowsData.m_buffer.Length; i++) { if (m_themeSelection.rowsData.m_buffer[i] == newTheme) { m_themeSelection.DisplayAt(i); m_themeSelection.selectedIndex = i; } } ThemePolicyTab.RefreshThemesContainer(); }
public override void Update() { base.Update(); if (m_isDistrictThemesDirty) { ThemePolicyTab.RefreshThemesContainer(); BuildingThemesManager.instance.RefreshDistrictThemeInfos(); BuildingThemesManager.instance.SaveConfig(); m_isDistrictThemesDirty = false; } }
public override void Update() { base.Update(); if (m_isDistrictThemesDirty) { ThemePolicyTab.RefreshThemesContainer(); BuildingThemesManager.instance.RefreshDistrictThemeInfos(); BuildingThemesManager.instance.SaveConfig(); m_isDistrictThemesDirty = false; } if (BuildingVariationManager.Enabled != m_cloneBuilding.isVisible) { m_cloneBuilding.isVisible = BuildingVariationManager.Enabled; } }
public void DeleteTheme(Configuration.Theme theme) { if (!theme.isBuiltIn) { BuildingThemesManager.instance.Configuration.themes.Remove(theme); m_isDistrictThemesDirty = true; InitBuildingLists(); m_themeSelection.selectedIndex = -1; m_themeSelection.rowsData.m_buffer = m_themes.Keys.ToArray(); m_themeSelection.rowsData.m_size = m_themeSelection.rowsData.m_buffer.Length; m_themeSelection.DisplayAt(0); m_themeSelection.selectedIndex = 0; ThemePolicyTab.RefreshThemesContainer(); } }