Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public override void Update()
        {
            base.Update();

            if (m_isDistrictThemesDirty)
            {
                ThemePolicyTab.RefreshThemesContainer();
                BuildingThemesManager.instance.RefreshDistrictThemeInfos();
                BuildingThemesManager.instance.SaveConfig();
                m_isDistrictThemesDirty = false;
            }
        }
Exemplo n.º 3
0
        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;
            }
        }
Exemplo n.º 4
0
        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();
            }
        }