Esempio n. 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();
        }
Esempio n. 2
0
        public frmModResourceBrowser(OraMod oraMod)
        {
            InitializeComponent();
            this.oraMod = oraMod;

            InitLanguageOptions();
        }
        public frmChromeEditorAddSub(OraMod oraMod, MiniYamlNode parentChromeNode)
        {
            InitializeComponent();
            this.oraMod           = oraMod;
            this.parentChromeNode = parentChromeNode;

            InitLanguageOptions();
        }
        public frmChromeEditorAdd(OraMod oraMod, MiniYaml chromeYaml)
        {
            InitializeComponent();
            this.oraMod     = oraMod;
            this.chromeYaml = chromeYaml;

            InitLanguageOptions();
        }
        public ctrlChromeEditor(OraMod oraMod, string chromeFile)
        {
            InitializeComponent();
            this.oraMod     = oraMod;
            this.chromeFile = chromeFile;
            dic             = new Dictionary <TreeNode, MiniYamlNode>();

            InitLanguageOptions();
        }
        public frmBasicInfoEditor(OraMod mod)
        {
            InitializeComponent();
            this.mod = mod;

            txtModID.Text                = mod.ModID;
            txtEngineVersion.Text        = mod.modConfig["ENGINE_VERSION"];
            txtModAssembly.Text          = mod.modConfig["WHITELISTED_MOD_ASSEMBLIES"];
            txtPackagingAuthor.Text      = mod.Author;
            txtPackingInstallerName.Text = mod.ModName;

            InitLanguageOptions();
        }
        private void BtnCreate_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtPath.Text))
            {
                MessageBox.Show("You must select a valid mod path!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (cmbVersionList.SelectedItem == null)
            {
                MessageBox.Show("You must select a valid openra version!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (string.IsNullOrEmpty(txtModID.Text))
            {
                MessageBox.Show("You must enter a valid mod id!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else if (string.IsNullOrEmpty(txtModName.Text))
            {
                MessageBox.Show("You must enter a valid mod name!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                DialogResult = DialogResult.OK;
                Close();

                string modFullPath = txtPath.Text + "\\" + txtModName.Text;
                if (!Directory.Exists(modFullPath))
                {
                    Directory.CreateDirectory(modFullPath);
                }

                mod         = new OraMod(txtPath.Text);
                mod.Version = cmbVersionList.SelectedItem.ToString();
                mod.Author  = txtModAuthor.Text;
                mod.ModID   = txtModID.Text;
                mod.ModName = txtModName.Text;
                mod.Create();

                DownloadTask downloadTask = new DownloadTask()
                {
                    FileName     = "OpenModSDK",
                    FileSavePath = System.Environment.GetEnvironmentVariable("TEMP") + "\\OpenModSDK-" + cmbVersionList.SelectedItem.ToString() + ".zip",
                    Url          = "https://github.com/OpenRA/OpenRAModSDK/archive/" + cmbVersionList.SelectedItem.ToString() + ".zip"
                };

                frmDownload downloadingWin = new frmDownload(downloadTask);
                downloadingWin.afterDownload += DownloadingWin_afterDownload;
                downloadingWin.ShowDialog();
            }
        }
Esempio n. 8
0
        private void BtnOpen_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();

            OraMod mod = new OraMod(txtModPath.Text);

            mod.ModID     = config["MOD_ID"];
            mod.ModName   = config["PACKAGING_WINDOWS_LAUNCHER_NAME"];
            mod.Version   = config["ENGINE_VERSION"];
            mod.Author    = config["PACKAGING_AUTHORS"];
            mod.modConfig = config;
            var project = mod.Open();

            mod.Init();

            frmMain mainWin = new frmMain(project);

            mainWin.Show();
        }
Esempio n. 9
0
 public OraModRuntime(OraMod mod)
 {
     this.mod      = mod;
     state         = RuntimeState.Stop;
     currentWorker = null;
 }