示例#1
0
 private void miReload_Click(object sender, EventArgs e)
 {
     try {
         mod = new Mod(mod.Folder);
         ReloadTabs();
         MessageBox.Show("Mod reloaded", "Mod reloading", MessageBoxButtons.OK, MessageBoxIcon.Information);
     } catch (Exception ex) {
         MessageBox.Show(ex.ToString(), "Error occurred while loading", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#2
0
 private void miLoad_Click(object sender, EventArgs e)
 {
     var df = new FolderBrowserDialog();
     df.SelectedPath = (string) Settings.Default["modPath"];
     df.Description = "Please select CA mod directory";
     df.ShowDialog();
     try {
         mod = new Mod(df.SelectedPath);
         Settings.Default["modPath"] = df.SelectedPath;
         Settings.Default.Save();
         MessageBox.Show("Mod loaded", "Mod loading", MessageBoxButtons.OK, MessageBoxIcon.Information);
         tabControl1.TabPages.Clear();
     } catch (Exception ex) {
         MessageBox.Show(ex.ToString(), "Error occurred while loading", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
示例#3
0
 public ModSearchUnitResult(string id, Mod mod)
 {
     this.id = id;
     description = id + " - " + mod.GetUnitDescription(id);
 }
示例#4
0
        private void FormMain_Load(object sender, EventArgs e)
        {
            if ((string) Settings.Default["modPath"] + "" != "") {
                try {
                    mod = new Mod((string) Settings.Default["modPath"]);
                    MessageBox.Show("Mod loaded", "Mod loading", MessageBoxButtons.OK, MessageBoxIcon.Information);
                } catch (Exception ex) {
                    MessageBox.Show(ex.ToString(), "Error occurred while loading mod", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            } else miLoad.PerformClick();

            LoadProcedures();
        }
示例#5
0
        public void GetChanges(Mod against, RichTextBox rb)
        {
            foreach (DictionaryEntry de in Units) {
                var ag = against.Units[de.Key] as LuaTable;
                if (ag != null) new TableProxy((LuaTable)de.Value, lua).Changes(rb, de.Key.ToString(), ag, against.lua);
                else {
                    rb.SelectionColor = Color.Green;
                    rb.SelectedText = "\r\n=== " + de.Key + "  added ===\r\n";
                }
            }

            foreach (DictionaryEntry de in against.Units) {
                var ag = Units[de.Key] as LuaTable;
                if (ag == null) {
                    rb.SelectionColor = Color.Red;
                    rb.SelectedText = "\r\n=== " + de.Key + "  deleted ===\r\n";
                }
            }
        }