internal static void InitializePathHelper(SmashMod project) { if (project == null) { throw new Exception("Project null"); } _Project = project; }
public CreationProjectInfo(SmashMod config, SmashProjectManager project) { InitializeComponent(); _Config = config; _Project = project; ddpGameRegion.Items.Add("JPN (Zone 1)"); ddpGameRegion.Items.Add("USA (Zone 2)"); ddpGameRegion.Items.Add("??? (Zone 3)"); ddpGameRegion.Items.Add("EUR (Zone 4)"); }
public ProjectSettings(SmashMod project) { InitializeComponent(); _Project = project; textBoxExtractionFolder.Text = _Project.ProjectExtractFolder; textBoxExplorerFolder.Text = _Project.ProjectExplorerFolder; textBoxExportFolder.Text = _Project.ProjectExportFolder; textBoxWorkspaceFolder.Text = _Project.ProjectWorkspaceFolder; checkBoxForceOriginalFlags.Checked = _Project.KeepOriginalFlags; checkBoxSkipJunkEntries.Checked = _Project.SkipJunkEntries; checkBoxExportCSV.Checked = _Project.ExportCSVList; checkBoxIgnoreCompSize.Checked = _Project.ExportCSVIgnoreCompSize; checkBoxIgnoreFlags.Checked = _Project.ExportCSVIgnoreFlags; checkBoxIgnorePackOffsets.Checked = _Project.ExportCSVIgnorePackOffsets; checkBoxAddDateToExport.Checked = _Project.ExportWithDateFolder; checkBoxTextureIDFixing.Checked = _Project.AutoTextureIDFix; checkBoxLxxDuplication.Checked = _Project.OverrideLowPolyModels; checkBoxRegionDuplication.Checked = _Project.DuplicateToOtherRegions; checkBoxYoshiFix.Checked = _Project.YoshiFixActive; checkBoxFighterDB.Checked = _Project.EditorCharacterMenuDBActive; checkBoxFighterStrings.Checked = _Project.EditorCharacterStringsActive; checkBoxSoundMTB.Checked = _Project.EditorMTBFix; checkBoxTextureIDConflicts.Checked = _Project.SupressWarningTextureIDConflicts; checkBoxMissingPortraits.Checked = _Project.SupressWarningMissingPortraits; checkBoxModFileConflicts.Checked = _Project.SupressWarningModFileConflicts; checkBoxModelFilesMissing.Checked = _Project.SupressWarningSlotModModelFilesMissing; checkBoxUseMusic.Checked = _Project.EditorMusicActive; checkBoxUseExplorer.Checked = _Project.EditorExplorerChanges; checkBoxUnrestrictSlots.Checked = _Project.EnableMoreCustomSlots; }
public void RefreshRowData() { _RowData = new List <RowData>(); _Project = _SmashProjectManager.CurrentProject; if (_IsActiveList) { if (_ModListType == ModListType.CharacterGeneral) { for (int j = 0; j < _Project.ActiveCharacterGeneralMods.Count; ++j) { if (_Project.ActiveCharacterGeneralMods[j].CharacterID != _CurrentFighter.id) { continue; } RowData row = new RowData(); row.modFolder = _Project.ActiveCharacterGeneralMods[j].FolderName; CharacterGeneralModXML data = Globals.Utils.OpenCharacterGeneralKamiModFile(_CurrentFighter.name, row.modFolder); if (data != null) { row.name = data.DisplayName; row.wifiSafe = data.WifiSafe; } else { row.name = String.Format("{0} (Mod is missing!)", row.modFolder); row.modMissing = true; row.propertiesEnabled = false; } _RowData.Add(row); } } else if (_ModListType == ModListType.Stage) { for (int j = 0; j < _Project.ActiveStageMods.Count; ++j) { RowData row = new RowData(); row.modFolder = _Project.ActiveStageMods[j].FolderName; StageModXML data = Globals.Utils.OpenStageKamiModFile(row.modFolder); if (data != null) { row.name = data.DisplayName; row.wifiSafe = data.WifiSafe; } else { row.name = String.Format("{0} (Mod is missing!)", row.modFolder); row.modMissing = true; row.propertiesEnabled = false; } _RowData.Add(row); } } else if (_ModListType == ModListType.General) { for (int j = 0; j < _Project.ActiveGeneralMods.Count; ++j) { RowData row = new RowData(); row.modFolder = _Project.ActiveGeneralMods[j]; GeneralModXML data = Globals.Utils.OpenGeneralKamiModFile(row.modFolder); if (data != null) { row.name = data.DisplayName; row.wifiSafe = data.WifiSafe; } else { row.name = String.Format("{0} (Mod is missing!)", row.modFolder); row.modMissing = true; row.propertiesEnabled = false; } _RowData.Add(row); } } } else { string baseDirectory = String.Empty; switch (_ModListType) { case (ModListType.CharacterSlots): baseDirectory = PathHelper.FolderCharSlotsMods + _CurrentFighter.name + Path.DirectorySeparatorChar; break; case (ModListType.CharacterGeneral): baseDirectory = PathHelper.FolderCharGeneralMods + _CurrentFighter.name + Path.DirectorySeparatorChar; break; case (ModListType.Stage): baseDirectory = PathHelper.FolderStageMods; break; case (ModListType.General): baseDirectory = PathHelper.FolderGeneralMods; break; } string[] kamiFiles = Directory.GetFiles(baseDirectory, "kamimod.xml", SearchOption.AllDirectories); for (int i = 0; i < kamiFiles.Count(); ++i) { string modFolderName = kamiFiles[i].Replace(baseDirectory, String.Empty).Split(Path.DirectorySeparatorChar).First(); //Check if the mod is already active. If it is, don't include it in this list. bool modIsActive = false; switch (_ModListType) { case (ModListType.CharacterSlots): for (int j = 0; j < _Project.ActiveCharacterSlotMods.Count; ++j) { if (_Project.ActiveCharacterSlotMods[j].CharacterID == _CurrentFighter.id) { if (_Project.ActiveCharacterSlotMods[j].FolderName.Equals(modFolderName)) { modIsActive = true; break; } } } break; case (ModListType.CharacterGeneral): for (int j = 0; j < _Project.ActiveCharacterGeneralMods.Count; ++j) { if (_Project.ActiveCharacterGeneralMods[j].FolderName.Equals(modFolderName)) { modIsActive = true; break; } } break; case (ModListType.Stage): for (int j = 0; j < _Project.ActiveStageMods.Count; ++j) { if (_Project.ActiveStageMods[j].FolderName.Equals(modFolderName)) { modIsActive = true; break; } } break; case (ModListType.General): for (int j = 0; j < _Project.ActiveGeneralMods.Count; ++j) { if (_Project.ActiveGeneralMods[j].Equals(modFolderName)) { modIsActive = true; break; } } break; } if (modIsActive) { continue; } RowData row = new RowData(); row.modFolder = modFolderName; switch (_ModListType) { case (ModListType.CharacterSlots): CharacterSlotModXML data = Utils.DeserializeXML <CharacterSlotModXML>(kamiFiles[i]); row.name = data.DisplayName; row.missingPortraits = (!data.chr_00 || !data.chr_11 || !data.chr_13 || !data.stock_90); if (data.UseCustomName && !row.missingPortraits) { if (!data.chrn_11 || data.BoxingRingText == null) { row.missingPortraits = true; } else if (data.BoxingRingText.Equals(string.Empty)) { row.missingPortraits = true; } } row.metal = data.MetalModel; row.hasAudio = data.Sound || data.Voice; row.hasCustomName = data.UseCustomName; row.wifiSafe = data.WifiSafe; break; case (ModListType.CharacterGeneral): CharacterGeneralModXML data2 = Utils.DeserializeXML <CharacterGeneralModXML>(kamiFiles[i]); row.name = data2.DisplayName; row.wifiSafe = data2.WifiSafe; break; case (ModListType.Stage): StageModXML data3 = Utils.DeserializeXML <StageModXML>(kamiFiles[i]); row.name = data3.DisplayName; row.wifiSafe = data3.WifiSafe; break; case (ModListType.General): GeneralModXML data4 = Utils.DeserializeXML <GeneralModXML>(kamiFiles[i]); row.name = data4.DisplayName; row.wifiSafe = data4.WifiSafe; break; } _RowData.Add(row); } } PopulateRows(); }
public void RefreshRowData() { _RowData = new List <ModsList.RowData>(); _Project = _SmashProjectManager.CurrentProject; int maxSlots = _Project.EnableMoreCustomSlots ? _CurrentFighter.unrestrictedSlots : _CurrentFighter.maxSlots; for (int i = 0; i < maxSlots; ++i) { ModsList.RowData row = new ModsList.RowData(); bool modFound = false; row.slotNum = i; for (int j = 0; j < _Project.ActiveCharacterSlotMods.Count; ++j) { if (_Project.ActiveCharacterSlotMods[j].CharacterID != _CurrentFighter.id) { continue; } if (_Project.ActiveCharacterSlotMods[j].SlotID != i) { continue; } row.modFolder = _Project.ActiveCharacterSlotMods[j].FolderName; CharacterSlotModXML data = Globals.Utils.OpenCharacterSlotKamiModFile(_CurrentFighter.name, row.modFolder); if (data != null) { row.name = data.DisplayName; row.missingPortraits = (!data.chr_00 || !data.chr_11 || !data.chr_13 || !data.stock_90); if (data.UseCustomName && !row.missingPortraits) { if (!data.chrn_11 || data.BoxingRingText == null) { row.missingPortraits = true; } else if (data.BoxingRingText.Equals(string.Empty)) { row.missingPortraits = true; } } row.metal = data.MetalModel; row.hasAudio = data.Sound || data.Voice; row.hasCustomName = data.UseCustomName; row.wifiSafe = data.WifiSafe; } else { row.name = String.Format("{0} (Mod is missing!)", row.modFolder); row.modMissing = true; row.propertiesEnabled = false; } _RowData.Add(row); modFound = true; break; } if (modFound) { continue; } if (i < _CurrentFighter.defaultSlots) { row.name = "Default"; _RowData.Add(row); } else { break; } } PopulateRows(); }
public bool CreateProject(bool showLoadOption = true) { if (showLoadOption) { if (MessageBox.Show("Do you want to open an existing project?", "Open existing project", MessageBoxButtons.YesNo) == DialogResult.Yes) { DialogResult result = openFileDialog.ShowDialog(this); if (result == DialogResult.OK) { LogHelper.Info("Loading project file..."); LoadProject(openFileDialog.FileName); if (this._MainLoaded) { this.Enabled = false; _ConsoleProgress = new ConsoleRedirProgress(backgroundWorker); Console.SetOut(_ConsoleProgress); backgroundWorker.RunWorkerAsync(); } return(true); } } } MessageBox.Show(this, UIStrings.CREATE_PROJECT_FIND_FOLDER, UIStrings.CAPTION_CREATE_PROJECT); while (true) { DialogResult result = folderBrowserDialog.ShowDialog(this); if (result == System.Windows.Forms.DialogResult.OK) { string gameFolder = folderBrowserDialog.SelectedPath + Path.DirectorySeparatorChar; if (!PathHelper.IsItSmashFolder(gameFolder)) { MessageBox.Show(this, UIStrings.ERROR_LOADING_GAME_FOLDER, UIStrings.CAPTION_ERROR_LOADING_GAME_FOLDER); continue; } if (!PathHelper.DoesItHavePatchFolder(gameFolder)) { MessageBox.Show(this, UIStrings.ERROR_LOADING_GAME_PATCH_FOLDER, UIStrings.CAPTION_ERROR_LOADING_GAME_FOLDER); continue; } MessageBox.Show(this, UIStrings.CREATE_PROJECT_CHOOSE_NAME_LOCATION, UIStrings.CAPTION_CREATE_PROJECT); DialogResult saveResult = saveFileDialog.ShowDialog(this); if (saveResult == DialogResult.OK) { LogHelper.Info("Creating project file..."); SmashMod newProject = _ProjectManager.CreateNewProject(saveFileDialog.FileName, gameFolder); new Forms.CreationProjectInfo(newProject, _ProjectManager).ShowDialog(this); MessageBox.Show(this, UIStrings.CREATE_PROJECT_SUCCESS, UIStrings.CAPTION_CREATE_PROJECT); if (this._MainLoaded) { this.Enabled = false; _ConsoleProgress = new ConsoleRedirProgress(backgroundWorker); Console.SetOut(_ConsoleProgress); backgroundWorker.RunWorkerAsync(); } return(true); } else { return(false); } } else { return(false); } } }
internal static void InitializeLogHelper(SmashMod project, Config config) { _Project = project; _Config = config; }