Example #1
0
        void RefreshSkinsList()
        {
            if (_skinsDropdown != null)
            {
                _availableSkins = SkinLoader.FindAllSkins();
                _skinsDropdown.localizedItems = new string[0];

                _skinsDropdown.AddItem("Vanilla (by Colossal Order)");
                foreach (var skin in _availableSkins)
                {
                    _skinsDropdown.AddItem(String.Format("{0} (by {1})", skin.Name, skin.Author));
                }

                _skinsDropdown.selectedIndex = 0;
                _skinsDropdown.Invalidate();
            }
        }
Example #2
0
        void Start()
        {
            Debug.Log("Start ran!");
            if (!MyInfo().isEnabled)
            {
                Deinitialize();
                return;
            }
            SetCameraRectHelper.Initialize();

            if (!Directory.Exists(OverrideDirectory))
            {
                try
                {
                    Directory.CreateDirectory(OverrideDirectory);
                }
                catch (Exception ex)
                {
                    Debug.LogException(ex);
                }
            }

            InitializeInGamePanels();

            _availableSkins = SkinLoader.FindAllSkins();

            if (!string.IsNullOrEmpty(ConfigManager.SelectedSkinPath) && ConfigManager.ApplySkinOnStartup)
            {
                foreach (var metadata in _availableSkins)
                {
                    if (metadata.Path == ConfigManager.SelectedSkinPath)
                    {
                        _currentSkin            = Skin.FromXmlFile(Path.Combine(metadata.Path, "skin.xml"), false);
                        _needToApplyCurrentSkin = true;
                        break;
                    }
                }
            }

            CreateUI();

            _debugRenderer = gameObject.AddComponent <DebugRenderer>();
        }