コード例 #1
0
        private static void Postfix(CM_PageSettings __instance)
        {
            int VR_SETTINGS_MENU_ID = 1001;

            List <iSettingsFieldData> pageSettings = VRConfig.InjectConfigIntoGame();

            __instance.CreateSubmenu("VR Settings", (eSettingsSubMenuId)VR_SETTINGS_MENU_ID, pageSettings, false, false);
        }
コード例 #2
0
 void CreateConfig()
 {
     RegistrySaver.RemoveAllRegistryValues(RegistrySaver.RegConfigName);
     CurrentConfig    = new VRConfig();
     this.DataContext = CurrentConfig;
     //crutch. for refactoring
     CurrentConfig.selectedSceneNodeView = null;
     //AppLogger.Add("New config initialized");
     UpdateTitle();
 }
コード例 #3
0
 void CreateConfig()
 {
     RegistrySaver.RemoveAllRegistryValues(RegistrySaver.configName);
     currentConfig    = new VRConfig();
     this.DataContext = currentConfig;
     //crutch. for refactoring
     currentConfig.selectedSceneNodeView = null;
     AppLogger.Add("New config initialized");
     SetTitle();
     SetViewportPreview();
 }
コード例 #4
0
        private static void Postfix(CM_SettingsStringArrayDropdownButton __instance, eCellSettingID id)
        {
            var stringValues = VRConfig.TryGetStringDropdownValues(id);

            if (stringValues != null)
            {
                __instance.m_values = stringValues;

                __instance.UpdateValueWithSelected();
            }
        }
コード例 #5
0
ファイル: Runner.cs プロジェクト: ragnarula/ActionRPGEngine
        private List <ClusterNode> GetClusterNodes()
        {
            VRConfig runningConfig = new VRConfig();

            return(Parser.Parse(SelectedConfig, runningConfig).clusterNodes);
        }
コード例 #6
0
        //Config file parser
        public static VRConfig Parse(string filePath, VRConfig currentConfig)
        {
            // refactoring needed
            List <string> inputLines       = new List <string>();
            List <string> sceneNodeLines   = new List <string>();
            List <string> screenLines      = new List <string>();
            List <string> viewportLines    = new List <string>();
            List <string> clusterNodeLines = new List <string>();
            List <string> cameraLines      = new List <string>();
            List <string> generalLines     = new List <string>();
            List <string> stereoLines      = new List <string>();
            List <string> debugLines       = new List <string>();

            try
            {
                foreach (string line in File.ReadLines(filePath))
                {
                    if (line == string.Empty || line.First() == '#')
                    {
                        //Do nothing
                    }
                    else
                    {
                        if (line.ToLower().Contains("[input]"))
                        {
                            inputLines.Add(line);
                        }
                        if (line.ToLower().Contains("[scene_node]"))
                        {
                            sceneNodeLines.Add(line);
                        }
                        if (line.ToLower().Contains("[screen]"))
                        {
                            screenLines.Add(line);
                        }
                        if (line.ToLower().Contains("[viewport]"))
                        {
                            viewportLines.Add(line);
                        }
                        if (line.ToLower().Contains("[cluster_node]"))
                        {
                            clusterNodeLines.Add(line);
                        }
                        if (line.ToLower().Contains("[camera]"))
                        {
                            cameraLines.Add(line);
                        }
                        if (line.ToLower().Contains("[general]"))
                        {
                            generalLines.Add(line);
                        }
                        if (line.ToLower().Contains("[stereo]"))
                        {
                            stereoLines.Add(line);
                        }
                        if (line.ToLower().Contains("[debug]"))
                        {
                            debugLines.Add(line);
                        }
                        if (line.ToLower().Contains("[render]"))
                        {
                            //todo
                        }
                        if (line.ToLower().Contains("[custom]"))
                        {
                            //todo
                        }
                    }
                }
                foreach (string line in viewportLines)
                {
                    currentConfig.ViewportParse(line);
                }
                foreach (string line in generalLines)
                {
                    currentConfig.GeneralParse(line);
                }
                foreach (string line in stereoLines)
                {
                    currentConfig.StereoParse(line);
                }
                foreach (string line in debugLines)
                {
                    currentConfig.DebugParse(line);
                }
                foreach (string line in inputLines)
                {
                    currentConfig.InputsParse(line);
                }
                foreach (string line in cameraLines)
                {
                    currentConfig.CameraParse(line);
                }
                foreach (string line in sceneNodeLines)
                {
                    currentConfig.SceneNodeParse(line);
                }
                foreach (string line in screenLines)
                {
                    currentConfig.ScreenParse(line);
                }
                foreach (string line in clusterNodeLines)
                {
                    currentConfig.ClusterNodeParse(line);
                }

                currentConfig.sceneNodesView = currentConfig.ConvertSceneNodeList(currentConfig.sceneNodes);
                currentConfig.name           = Path.GetFileNameWithoutExtension(filePath);
                AppLogger.Add("Config " + currentConfig.name + " loaded");
                RegistrySaver.AddRegistryValue(RegistrySaver.configName, filePath);
            }
            catch (FileNotFoundException)
            {
                AppLogger.Add("ERROR! Config " + currentConfig.name + "not found!");
            }
            catch (System.ArgumentException)
            {
                AppLogger.Add("ERROR! Config " + currentConfig.name + "not found!");
            }

            return(currentConfig);
        }
コード例 #7
0
 private static void Postfix(CM_PageSettings __instance, eCellSettingID setting, int value)
 {
     VRConfig.ConfigChanged(setting, value);
 }
コード例 #8
0
 private static void Postfix(CM_PageSettings __instance, eCellSettingID setting)
 {
     VRConfig.ConfigChanged(setting, __instance.GetToggleValue(setting));
 }