Example #1
0
        public frmMain(OraModEditorProject project)
        {
            InitializeComponent();
            this.project   = project;
            this.mod       = project.Mod;
            nodePathDic    = new Dictionary <TreeNode, string>();
            miniYamls      = new Dictionary <string, MiniYaml>();
            timer          = new Timer();
            timer.Interval = 100;
            timer.Tick    += Timer_Tick;
            timer.Start();
            runtime = new OraModRuntime(mod);
            runtime.RunStateChanged += Runtime_RunStateChanged;

            mnuLanguages.DropDownItems.Clear();
            foreach (var locate in LanguageManager.Instance.GetLocates())
            {
                var locateMenuItem = mnuLanguages.DropDownItems.Add(LanguageManager.Instance.GetTranslation(locate));
                locateMenuItem.Click += (o, e) =>
                {
                    LanguageManager.Instance.AppConfig.Localization = locateMenuItem.Text;
                    InitLanguageOptions();
                    LanguageManager.Instance.AppConfig.Save();
                };
            }

            InitializeMod();

            InitLanguageOptions();
        }
        public ctrlSettingExternalApplication(OraModEditorProject project)
        {
            InitializeComponent();
            this.project = project;

            InitLanguageOptions();
        }
Example #3
0
 public frmSettings(OraModEditorProject project)
 {
     InitializeComponent();
     this.project      = project;
     settingControlDic = new Dictionary <string, UserControl>();
     settingControlDic.Add("External Application", new ctrlSettingExternalApplication(project));
     settingCategories.SelectedNode = settingCategories.Nodes[0];
 }
Example #4
0
        public OraModEditorProject Open()
        {
            modsdkPath = path;
            modPath    = Path.Combine(modsdkPath, "mods\\" + ModID);
            OraModEditorProject project = OraModEditorProject.Load(modsdkPath + "\\.project");

            project.Mod = this;
            Project     = project;
            return(project);
        }
Example #5
0
        public void Create()
        {
            modsdkPath = Path.Combine(path, ModName);
            modPath    = Path.Combine(modsdkPath, "mods\\" + ModID);
            OraModEditorProject project = new OraModEditorProject();

            project.BasicInfo.ModID         = ModID;
            project.BasicInfo.Name          = ModName;
            project.BasicInfo.Author        = Author;
            project.BasicInfo.EngineVersion = Version;
            project.Mod = this;
            project.Save(modsdkPath + "\\.project");
            Project = project;
        }
Example #6
0
        private bool ValidModSDKPath(string path, out ModConfig config)
        {
            config = null;
            DirectoryInfo di     = new DirectoryInfo(path);
            var           result = di.EnumerateFiles("mod.config");

            if (result.Count() == 0)
            {
                return(false);
            }
            else
            {
                config = ModConfigEditor.Instance.ReadConfig(result.ElementAt(0).FullName);
                if (config != null && config["MOD_ID"] != null)
                {
                    string modID                = config["MOD_ID"];
                    string modPath              = path + "\\mods\\" + modID;
                    string modYamlPath          = modPath + "\\mod.yaml";
                    string modEditorProjectPath = path + "\\.project";
                    if (Directory.Exists(modPath) && File.Exists(modYamlPath))
                    {
                        if (!File.Exists(modEditorProjectPath))
                        {
                            OraModEditorProject editorProject = new OraModEditorProject();
                            editorProject.BasicInfo.ModID         = modID;
                            editorProject.BasicInfo.Name          = config["PACKAGING_WINDOWS_LAUNCHER_NAME"];
                            editorProject.BasicInfo.EngineVersion = config["ENGINE_VERSION"];
                            editorProject.BasicInfo.Author        = config["PACKAGING_AUTHORS"];
                            editorProject.Save(modEditorProjectPath);
                        }

                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
                else
                {
                    return(false);
                }
            }
        }