Ejemplo n.º 1
0
 private void x1ToolStripMenuItem_Click(object sender, EventArgs e)
 {
     IPC.StateCallback(State.GcCollect, () =>
     {
         //MessageBox.Show("Finish");
         return(0);
     });
 }
Ejemplo n.º 2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string newFileName     = Guid.NewGuid().ToString();//Path.GetRandomFileName()
            string pathToDll       = Path.GetDirectoryName(textBox1.Text) + "\\" + newFileName;
            string pathToReportTxt = pathToDll + ".txt";

            var asm = AssemblyDefinition.ReadAssembly(textBox1.Text);

            asm.Name = new AssemblyNameDefinition(newFileName, Version.Parse("1.0.0.0"));
            asm.Write(pathToDll);
            asm.Dispose();

            string functionResult = IPC.StateCallback(State.InjectDll, () => IPC.StringBuf, new InjectParameters
            {
                dllPath     = pathToDll,
                dllClass    = "DebugLibrary.__Class",
                dllFunction = "__Func"
            });

            try { File.Delete(pathToDll); } catch {}

            if (functionResult == "null")
            {
                MessageBox.Show("Finished with 'null' result");
                return;
            }

            File.WriteAllText(pathToReportTxt, functionResult);

            if (String.IsNullOrEmpty(textBox2.Text))
            {
                Process.Start(pathToReportTxt);
            }
            else
            {
                Process.Start(textBox2.Text, pathToReportTxt);
            }
        }
Ejemplo n.º 3
0
        void InitializeGui(string langFileName)
        {
            if (!Localization.TryLoadFromFile(langFileName, out Exception ex))
            {
                MessageBox.Show($"Error: {ex.Message}", langFileName);
                Environment.Exit(1);
            }

            LanguageChangedMessage                    = "Message_LangChanged".Translate();
            инцидентыToolStripMenuItem.Text           = "Menu_Incidents".Translate();
            pawnHediffsToolStripMenuItem.Text         = "Menu_PawnHediffs".Translate();
            отображениеКолонокToolStripMenuItem.Text  = "Menu_VisibleColumns".Translate();
            скрытьПустыеСтолбцыToolStripMenuItem.Text = "Menu_HideNullColumns".Translate();
            корзинаToolStripMenuItem.Text             = toolStripMenuItem1.Text = "Menu_Cart".Translate();
            добавитьВКорзинуToolStripMenuItem.Text    = "Menu_AddInCart".Translate();
            удалитьИзКорзиныToolStripMenuItem.Text    = "Menu_RemoveFromCart".Translate();
            очиститьКорзинуToolStripMenuItem.Text     = "Menu_ClearCart".Translate();
            языкToolStripMenuItem.Text                = "Menu_Language".Translate();
            exportToolStripMenuItem.Text              = "Menu_Export".Translate();
            exportTabToolStripMenuItem.Text           = "Menu_ExportTab".Translate();
            exportAllTabsToolStripMenuItem.Text       = "Menu_ExportAllTabs".Translate();
            injectDllAndRunToolStripMenuItem.Text     = "Menu_InjectDllAndRun".Translate();

            new ToolTip().SetToolTip(btnResetCache, "Button_ClearTabsCache_Tooltip".Translate());

            ColumnFilter.btnAllText     = "Button_All".Translate();
            ColumnFilter.btnNothingText = "Button_Nothing".Translate();

            button2.Text = "Button_OpenFilterForm".Translate();

            var tabs = cbTabs.Items;

            // Materials
            tabs.Add(new RimHelper.TabControl <Material>("Tab_Materials".Translate(), () =>
                                                         IPC.StateCallback(State.GetMaterials, () => IPC.GetObjectBuf <List <Material> >()),
                                                         dgv, comboBox1, textBox4, pictureBox1));

            // WeaponsRanged
            tabs.Add(new RimHelper.TabControl <WeaponRanged>("Tab_WeaponsRanged".Translate(), () =>
                                                             IPC.StateCallback(State.GetWeaponsRanged, () => IPC.GetObjectBuf <List <WeaponRanged> >()),
                                                             dgv, comboBox1, textBox4, pictureBox1));

            // WeaponsMelee
            tabs.Add(new RimHelper.TabControl <WeaponMelee>("Tab_WeaponsMelee".Translate(), () =>
                                                            IPC.StateCallback(State.GetWeaponsMelee, () => IPC.GetObjectBuf <List <WeaponMelee> >()),
                                                            dgv, comboBox1, textBox4, pictureBox1));

            // Apparels
            tabs.Add(new RimHelper.TabApparel("Tab_Apparel".Translate(), () =>
                                              IPC.StateCallback(State.GetApparels, () => IPC.GetObjectBuf <List <Apparel> >()),
                                              dgv, comboBox1, textBox4, pictureBox1));

            // Buildings From Materials
            tabs.Add(new RimHelper.TabControl <BuildingsFromMaterial>("Tab_BuildingsFromMaterial".Translate(), () =>
                                                                      IPC.StateCallback(State.GetBuildingsFromMaterials,
                                                                                        () => IPC.GetObjectBuf <List <BuildingsFromMaterial> >()),
                                                                      dgv, comboBox1, textBox4, pictureBox1));

            // Animals
            tabs.Add(new RimHelper.TabControl <Animal>("Tab_Animals".Translate(), () =>
                                                       IPC.StateCallback(State.GetAnimals, () => IPC.GetObjectBuf <List <Animal> >()),
                                                       dgv, comboBox1, textBox4, pictureBox1));

            // Debuffs
            tabs.Add(new RimHelper.TabControl <Debuff>("Tab_Debuffs".Translate(), () =>
                                                       IPC.StateCallback(State.GetDebuffs, () => IPC.GetObjectBuf <List <Debuff> >()),
                                                       dgv, comboBox1, textBox4, pictureBox1));

            // Drugs
            tabs.Add(new RimHelper.TabControl <Drug>("Tab_Drugs".Translate(), () =>
                                                     IPC.StateCallback(State.GetDrugs, () => IPC.GetObjectBuf <List <Drug> >()),
                                                     dgv, comboBox1, textBox4, pictureBox1));

            // Foods
            tabs.Add(new RimHelper.TabControl <Food>("Tab_Foods".Translate(), () =>
                                                     IPC.StateCallback(State.GetFoods, () => IPC.GetObjectBuf <List <Food> >()),
                                                     dgv, comboBox1, textBox4, pictureBox1));

            // BodyParts
            tabs.Add(new RimHelper.TabControl <BodyPart>("Tab_BodyParts".Translate(), () =>
                                                         IPC.StateCallback(State.GetBodyParts, () => IPC.GetObjectBuf <List <BodyPart> >()),
                                                         dgv, comboBox1, textBox4, pictureBox1));

            // Facilities
            tabs.Add(new RimHelper.TabControl <Facility>("Tab_Facilities".Translate(), () =>
                                                         IPC.StateCallback(State.GetFacilities, () => IPC.GetObjectBuf <List <Facility> >()),
                                                         dgv, comboBox1, textBox4, pictureBox1));

            // Plants
            tabs.Add(new RimHelper.TabControl <Plant>("Tab_Plant".Translate(), () =>
                                                      IPC.StateCallback(State.GetPlants, () => IPC.GetObjectBuf <List <Plant> >()),
                                                      dgv, comboBox1, textBox4, pictureBox1));

            // Backstorys
            tabs.Add(new RimHelper.TabControl <Backstory>("Tab_Backstorys".Translate(), () =>
                                                          IPC.StateCallback(State.GetBackstorys, () => IPC.GetObjectBuf <List <Backstory> >()),
                                                          dgv, comboBox1, textBox4, pictureBox1));

            // Traits
            tabs.Add(new RimHelper.TabControl <Trait>("Tab_Traits".Translate(), () =>
                                                      IPC.StateCallback(State.GetTraits, () => IPC.GetObjectBuf <List <Trait> >()),
                                                      dgv, comboBox1, textBox4, pictureBox1));

            // CEAmmos
            tabs.Add(new RimHelper.TabControl <CEAmmo>("Tab_CEAmmos".Translate(), () =>
                                                       IPC.StateCallback(State.GetCEAmmos, () => IPC.GetObjectBuf <List <CEAmmo> >()),
                                                       dgv, comboBox1, textBox4, pictureBox1));

            // Tools
            tabs.Add(new RimHelper.TabControl <ST_Tool>("Tab_Tools".Translate(), () =>
                                                        IPC.StateCallback(State.GetTools, () => IPC.GetObjectBuf <List <ST_Tool> >()),
                                                        dgv, comboBox1, textBox4, pictureBox1));

            Localization.LoadColumns();
            Localization.Finalize();
        }
Ejemplo n.º 4
0
 private void pawnHediffsToolStripMenuItem_Click_1(object sender, EventArgs e)
 {
     IPC.StateCallback(State.GetPawnsHeddifs, () => MessageBox.Show(IPC.StringBuf));
 }
Ejemplo n.º 5
0
 private void дампОружияИОдеждыToolStripMenuItem_Click(object sender, EventArgs e)
 {
     IPC.StateCallback(State.WeaponApparelDump, () => MessageBox.Show(IPC.StringBuf));
 }
Ejemplo n.º 6
0
 private void дампМатериаловИХарактеристикToolStripMenuItem_Click(object sender, EventArgs e)
 {
     IPC.StateCallback(State.BuildingStuffDump, () => MessageBox.Show("Finished"));
 }
Ejemplo n.º 7
0
 void GetActiveIncidents()
 {
     IPC.StateCallback(State.GetActiveIncidents, () => MessageBox.Show(IPC.StringBuf));
 }