Ejemplo n.º 1
0
        private void BTDBSaveModToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string save = Serializer.cfg.SavePathBTDB;

            if (!Guard.IsStringValid(save))
            {
                SaveEditor.TryFindSteam.FindSaveFiles();
                save = Serializer.cfg.SavePathBTDB;
                if (!Guard.IsStringValid(save))
                {
                    return;
                }
            }

            SaveEditor.SaveEditor.DecryptSave("BTDB", "");

            string btdbSave = SaveEditor.SaveEditor.savemodDir + "\\BTDB_Profile.save";

            if (File.Exists(btdbSave))
            {
                JsonEditorHandler.OpenFile(btdbSave);
            }
            else
            {
                ConsoleHandler.append("Decrypted save file not found");
            }
        }
Ejemplo n.º 2
0
        private void SpecialtyBuildingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string filepath = CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\SpecialtyDefinitions\\" + specialty;

            if (File.Exists(filepath))
            {
                JsonEditorHandler.OpenFile(filepath);
            }
        }
Ejemplo n.º 3
0
        private void UpgradeFIle_Button_Click(object sender, EventArgs e)
        {
            string filepath = CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\UpgradeDefinitions\\" + file + ".upgrades";

            if (File.Exists(filepath))
            {
                JsonEditorHandler.OpenFile(filepath);
            }
        }
Ejemplo n.º 4
0
        private void BrowseForSaveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string browsedSave = SaveEditor.TryFindSteam.BrowseForSave();

            SaveEditor.SaveEditor.DecryptSave("", browsedSave);

            string save = SaveEditor.SaveEditor.savemodDir + "\\UnknownGame_Profile.save";

            if (File.Exists(save))
            {
                JsonEditorHandler.OpenFile(save);
            }
            else
            {
                ConsoleHandler.append("Decrypted save file not found");
            }
        }
Ejemplo n.º 5
0
        private void Weapons_Button_Click(object sender, ToolStripItemClickedEventArgs e)
        {
            string weaponfile = e.ClickedItem.Text.Replace(".tower", "").Replace(".upgrades", "").Replace(".weapon", "").Replace(".json", "");
            string foldername = "";

            if (towerName != "")
            {
                foldername = towerName.Replace(".tower", "").Replace(".upgrades", "").Replace(".weapon", "").Replace(".json", "");
            }
            else
            {
                foldername = filename.Replace(".tower", "").Replace(".upgrades", "").Replace(".weapon", "").Replace(".json", "");
            }
            string filepath = CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\WeaponDefinitions\\" + foldername + "\\" + weaponfile + ".weapon";

            if (File.Exists(filepath))
            {
                JsonEditorHandler.OpenFile(filepath);
            }
        }
Ejemplo n.º 6
0
        private void OpenInText()
        {
            string selectedCard = "";

            if (openStarterCard == true)
            {
                selectedCard = CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\BattleCardDefinitions\\" + StartingCards_LB.SelectedItem.ToString();
            }

            else if (openTower == true)
            {
                if (card.Tower.TowerType != null)
                {
                    selectedCard = CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\TowerDefinitions\\" + card.Tower.TowerType + ".tower";
                }
                else
                {
                    ConsoleHandler.append("This card doesn't have a specified tower type");
                }
            }
            else if (openBloon == true)
            {
                if (card.Bloon.BloonType != null)
                {
                    selectedCard = CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\BloonDefinitions\\" + card.Bloon.BloonType + ".bloon";
                }
                else
                {
                    ConsoleHandler.append("This card doesn't have a specified bloon type");
                }
            }
            else
            {
                selectedCard = path;
            }

            JsonEditorHandler.OpenFile(selectedCard);
            this.Focus();
        }
Ejemplo n.º 7
0
        private void TowerSpriteUpgradeDef_Button_Click(object sender, EventArgs e)
        {
            if (towerSpriteUpgradeDef == "")
            {
                towerSpriteUpgradeDef = file;
            }
            string filepath = CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\TowerSpriteUpgradeDefinitions\\" + towerSpriteUpgradeDef;

            if (!filepath.EndsWith(".json"))
            {
                filepath = filepath + ".json";
            }

            if (File.Exists(filepath))
            {
                JsonEditorHandler.OpenFile(filepath);
            }
            else
            {
                ConsoleHandler.append("The TowerSpriteUpgradeDef  " + towerSpriteUpgradeDef + " was not found");
            }
        }
Ejemplo n.º 8
0
 public void RestoreToOriginal()
 {
     if (!filename.Contains(New_JsonEditor.readOnlyName))
     {
         DialogResult diag = MessageBox.Show("You are trying to restore this file to the original unmodded version. Are you sure you want to do this?", "Restore to original?", MessageBoxButtons.YesNo);
         if (diag == DialogResult.Yes)
         {
             string backupProj = Environment.CurrentDirectory + "\\Backups\\" + CurrentProjectVariables.GameName + "_BackupProject\\" + path.Replace(CurrentProjectVariables.PathToProjectFiles.Replace("\\\\", "\\"), "");
             if (File.Exists(backupProj))
             {
                 if (path.Contains("."))
                 {
                     if (File.Exists(path))
                     {
                         JsonEditorHandler.CloseFile(path);
                         File.Delete(path);
                     }
                     File.Copy(backupProj, path);
                     JsonEditorHandler.OpenFile(path);
                     ConsoleHandler.append_CanRepeat(filename + "has been restored");
                 }
             }
             else
             {
                 ConsoleHandler.append_CanRepeat("Could not find file in backup project... Unable to restore file");
             }
         }
         else
         {
             ConsoleHandler.append_CanRepeat("User cancelled restore");
         }
     }
     else
     {
         ConsoleHandler.append_Notice("You can't restore this file because it IS the original " + filename.Replace(New_JsonEditor.readOnlyName, "") + " and it is read only");
     }
 }
Ejemplo n.º 9
0
 private void TestForm_Click(object sender, EventArgs e)
 {
     JsonEditorHandler.OpenFile(CurrentProjectVariables.PathToProjectFiles + "\\Assets\\JSON\\TowerDefinitions\\DartMonkey.tower");
 }
Ejemplo n.º 10
0
 private void OpenText_Button_Click(object sender, EventArgs e)
 {
     JsonEditorHandler.OpenFile(path);
     this.Focus();
 }