Example #1
0
        private ISettingsChannelA LoadProperties(string _ref)
        {
            ISettingsChannelA settings = null;

            switch (_ref)
            {
                case "gibbo_general":
                    settings = new GibboGeneralSettingsDynamic();
                    (settings as GibboGeneralSettingsDynamic).AutomaticProjectLoad = Properties.Settings.Default.LoadLastProject;
                    try
                    {
                        (settings as GibboGeneralSettingsDynamic).ScriptEditors = (GibboGeneralSettingsDynamic.ScriptingEditors)Enum.Parse(typeof(GibboGeneralSettingsDynamic.ScriptingEditors), Properties.Settings.Default.DefaultScriptEditor, true);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }
                    (settings as GibboGeneralSettingsDynamic).StartOnFullScreen = Properties.Settings.Default.StartOnFullScreen;
                    (settings as GibboGeneralSettingsDynamic).ShowDebugView = Properties.Settings.Default.ShowDebugView;
                    (settings as GibboGeneralSettingsDynamic).ReduceConsumption = Properties.Settings.Default.ReduceConsumption;
                    break;

                case "gibbo_tileset":
                    settings = new GibboTilesetSettingsDynamic();
                    (settings as GibboTilesetSettingsDynamic).HighlightActiveTileset = Properties.Settings.Default.HighlightActiveTileset;
                    break;

                case "game_general":
                    settings = new GameGeneralSettingsDynamic();
                    (settings as GameGeneralSettingsDynamic).ProjectName = SceneManager.GameProject.ProjectName;
                    break;

                case "game_grid":
                    settings = new GameGridSettingsDynamic();
                    (settings as GameGridSettingsDynamic).GridSpacing = SceneManager.GameProject.EditorSettings.GridSpacing;
                    (settings as GameGridSettingsDynamic).GridThickness = SceneManager.GameProject.EditorSettings.GridThickness;
                    (settings as GameGridSettingsDynamic).GridColor = SceneManager.GameProject.EditorSettings.GridColor;
                    (settings as GameGridSettingsDynamic).DisplayLines = SceneManager.GameProject.EditorSettings.GridNumberOfLines;
                    break;

                case "game_debug":
                    settings = new GameDebugDynamic();
                    (settings as GameDebugDynamic).ShowConsole = iniSettings.IniReadValue("Console", "Visible").ToLower().Trim().Equals("true") ? true : false;

                    try
                    {
                        (settings as GameDebugDynamic).DebugMode = (GameDebugDynamic.DebugModes)Enum.Parse(typeof(GameDebugDynamic.DebugModes), (SceneManager.GameProject.Debug ? "Debug" : "Release"), true);
                    }
                    catch (Exception ex)
                    {
                        Console.WriteLine(ex.Message);
                    }

                    break;

                case "game_screen":
                    settings = new GameScreenDynamic();
                    (settings as GameScreenDynamic).MouseVisible = iniSettings.IniReadValue("Mouse", "Visible").ToLower().Trim().Equals("true") ? true : false;
                    (settings as GameScreenDynamic).StartOnFullScreen = iniSettings.IniReadValue("Window", "StartFullScreen").ToLower().Trim().Equals("true") ? true : false;
                    (settings as GameScreenDynamic).ScreenWidth = SceneManager.GameProject.Settings.ScreenWidth;
                    (settings as GameScreenDynamic).ScreenHeight = SceneManager.GameProject.Settings.ScreenHeight;
                    //(settings as GameScreenDynamic).VSync = SceneManager.GameProject.ProjectSettings.VSyncEnabled;
                    break;
            }

            return settings;
        }
        private ISettingsChannelA LoadProperties(string _ref)
        {
            ISettingsChannelA settings = null;

            switch (_ref)
            {
            case "gibbo_general":
                settings = new GibboGeneralSettingsDynamic();
                (settings as GibboGeneralSettingsDynamic).AutomaticProjectLoad = Properties.Settings.Default.LoadLastProject;
                try
                {
                    (settings as GibboGeneralSettingsDynamic).ScriptEditors = (GibboGeneralSettingsDynamic.ScriptingEditors)Enum.Parse(typeof(GibboGeneralSettingsDynamic.ScriptingEditors), Properties.Settings.Default.DefaultScriptEditor, true);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
                (settings as GibboGeneralSettingsDynamic).StartOnFullScreen = Properties.Settings.Default.StartOnFullScreen;
                (settings as GibboGeneralSettingsDynamic).ShowDebugView     = Properties.Settings.Default.ShowDebugView;
                (settings as GibboGeneralSettingsDynamic).ReduceConsumption = Properties.Settings.Default.ReduceConsumption;
                break;

            case "gibbo_tileset":
                settings = new GibboTilesetSettingsDynamic();
                (settings as GibboTilesetSettingsDynamic).HighlightActiveTileset = Properties.Settings.Default.HighlightActiveTileset;
                break;

            case "game_general":
                settings = new GameGeneralSettingsDynamic();
                (settings as GameGeneralSettingsDynamic).ProjectName = SceneManager.GameProject.ProjectName;
                break;

            case "game_grid":
                settings = new GameGridSettingsDynamic();
                (settings as GameGridSettingsDynamic).GridSpacing   = SceneManager.GameProject.EditorSettings.GridSpacing;
                (settings as GameGridSettingsDynamic).GridThickness = SceneManager.GameProject.EditorSettings.GridThickness;
                (settings as GameGridSettingsDynamic).GridColor     = SceneManager.GameProject.EditorSettings.GridColor;
                (settings as GameGridSettingsDynamic).DisplayLines  = SceneManager.GameProject.EditorSettings.GridNumberOfLines;
                break;

            case "game_debug":
                settings = new GameDebugDynamic();
                (settings as GameDebugDynamic).ShowConsole = iniSettings.IniReadValue("Console", "Visible").ToLower().Trim().Equals("true") ? true : false;
                (settings as GameDebugDynamic).Attach      = Properties.Settings.Default.AttachVisualStudio;

                try
                {
                    (settings as GameDebugDynamic).DebugMode = (GameDebugDynamic.DebugModes)Enum.Parse(typeof(GameDebugDynamic.DebugModes), (SceneManager.GameProject.Debug ? "Debug" : "Release"), true);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }

                break;

            case "game_screen":
                settings = new GameScreenDynamic();
                (settings as GameScreenDynamic).MouseVisible      = iniSettings.IniReadValue("Mouse", "Visible").ToLower().Trim().Equals("true") ? true : false;
                (settings as GameScreenDynamic).StartOnFullScreen = iniSettings.IniReadValue("Window", "StartFullScreen").ToLower().Trim().Equals("true") ? true : false;
                (settings as GameScreenDynamic).ScreenWidth       = SceneManager.GameProject.Settings.ScreenWidth;
                (settings as GameScreenDynamic).ScreenHeight      = SceneManager.GameProject.Settings.ScreenHeight;
                //(settings as GameScreenDynamic).VSync = SceneManager.GameProject.ProjectSettings.VSyncEnabled;
                break;
            }

            return(settings);
        }