mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-05-09 12:51:54 -05:00
Added locations names to encounter files in the wild encounter editor
This commit is contained in:
parent
cda607dba8
commit
efeec1828c
|
|
@ -907,11 +907,11 @@ namespace DSPRE {
|
|||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
using (WildEditorDPPt editor = new WildEditorDPPt(wildPokeUnpackedPath, RomInfo.GetPokemonNames(), encToOpen))
|
||||
using (WildEditorDPPt editor = new WildEditorDPPt(wildPokeUnpackedPath, RomInfo.GetPokemonNames(), encToOpen, internalNames.Count))
|
||||
editor.ShowDialog();
|
||||
break;
|
||||
default:
|
||||
using (WildEditorHGSS editor = new WildEditorHGSS(wildPokeUnpackedPath, RomInfo.GetPokemonNames(), encToOpen))
|
||||
using (WildEditorHGSS editor = new WildEditorHGSS(wildPokeUnpackedPath, RomInfo.GetPokemonNames(), encToOpen, internalNames.Count))
|
||||
editor.ShowDialog();
|
||||
break;
|
||||
}
|
||||
|
|
@ -2935,16 +2935,6 @@ namespace DSPRE {
|
|||
#region Variables & Constants
|
||||
public const int mapEditorSquareSize = 19;
|
||||
|
||||
/* Trainer Editor */
|
||||
|
||||
private const int POKEMON_NUM_POSSIBLE_ABILITIES = 2;
|
||||
private const int TRAINER_PARTY_POKEMON_GENDER_DEFAULT_INDEX = 0;
|
||||
public const int TRAINER_PARTY_POKEMON_GENDER_MALE_INDEX = 1;
|
||||
public const int TRAINER_PARTY_POKEMON_GENDER_FEMALE_INDEX = 2;
|
||||
|
||||
public const int TRAINER_PARTY_POKEMON_ABILITY_SLOT1_INDEX = 0;
|
||||
public const int TRAINER_PARTY_POKEMON_ABILITY_SLOT2_INDEX = 1;
|
||||
|
||||
/* Map Rotation vars */
|
||||
public bool lRot;
|
||||
public bool rRot;
|
||||
|
|
@ -8534,6 +8524,12 @@ namespace DSPRE {
|
|||
private List<PictureBox> partyPokemonPictureBoxList = new List<PictureBox>();
|
||||
private List<PictureBox> partyPokemonItemIconList = new List<PictureBox>();
|
||||
|
||||
private const int TRAINER_PARTY_POKEMON_GENDER_DEFAULT_INDEX = 0;
|
||||
public const int TRAINER_PARTY_POKEMON_GENDER_MALE_INDEX = 1;
|
||||
public const int TRAINER_PARTY_POKEMON_GENDER_FEMALE_INDEX = 2;
|
||||
public const int TRAINER_PARTY_POKEMON_ABILITY_SLOT1_INDEX = 0;
|
||||
public const int TRAINER_PARTY_POKEMON_ABILITY_SLOT2_INDEX = 1;
|
||||
|
||||
string[] abilityNames;
|
||||
|
||||
private Tuple<int, int>[] pokemonSpeciesAbilities;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,8 @@ namespace DSPRE.ROMFiles {
|
|||
public ushort ID { get; set; }
|
||||
public static readonly byte length = 24;
|
||||
public static readonly string nameSeparator = " - ";
|
||||
public const int HGSS_NULL_ENCOUNTER_FILE_ID = 0xff;
|
||||
public const int DPPT_NULL_ENCOUNTER_FILE_ID = 0xffff;
|
||||
|
||||
public enum SearchableFields: byte {
|
||||
AreaDataID,
|
||||
|
|
@ -105,7 +107,7 @@ namespace DSPRE.ROMFiles {
|
|||
TextArchiveID,
|
||||
WeatherID,
|
||||
};
|
||||
/**/
|
||||
|
||||
|
||||
|
||||
#region Fields (10)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
using DSPRE.ROMFiles;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using static DSPRE.RomInfo;
|
||||
|
||||
namespace DSPRE {
|
||||
public partial class WildEditorDPPt : Form {
|
||||
|
|
@ -9,14 +11,40 @@ namespace DSPRE {
|
|||
EncounterFileDPPt currentFile;
|
||||
bool disableHandlers = false;
|
||||
|
||||
public WildEditorDPPt(string dirPath, string[] names, int encToOpen) {
|
||||
public WildEditorDPPt(string dirPath, string[] names, int encToOpen, int totalNumHeaderFiles) {
|
||||
InitializeComponent();
|
||||
encounterFileFolder = dirPath;
|
||||
|
||||
disableHandlers = true; //
|
||||
disableHandlers = true;
|
||||
|
||||
MapHeader tempMapHeader;
|
||||
List<string> locationNames = RomInfo.GetLocationNames();
|
||||
Dictionary<int, string> EncounterFileLocationName = new Dictionary<int, string>();
|
||||
|
||||
for (ushort i = 0; i < totalNumHeaderFiles; i++)
|
||||
{
|
||||
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied || ROMToolboxDialog.CheckFilesDynamicHeadersPatchApplied())
|
||||
{
|
||||
tempMapHeader = MapHeader.LoadFromFile(RomInfo.gameDirs[DirNames.dynamicHeaders].unpackedDir + "\\" + i.ToString("D4"), i, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
tempMapHeader = MapHeader.LoadFromARM9(i);
|
||||
}
|
||||
|
||||
if (tempMapHeader.wildPokemon != MapHeader.DPPT_NULL_ENCOUNTER_FILE_ID)
|
||||
if (RomInfo.gameFamily == gFamEnum.DP)
|
||||
EncounterFileLocationName.Add(tempMapHeader.wildPokemon, locationNames[((HeaderDP)tempMapHeader).locationName]);
|
||||
else
|
||||
EncounterFileLocationName.Add(tempMapHeader.wildPokemon, locationNames[((HeaderPt)tempMapHeader).locationName]);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < Directory.GetFiles(encounterFileFolder).Length; i++) {
|
||||
selectEncounterComboBox.Items.Add("Encounters File " + i.ToString());
|
||||
if (EncounterFileLocationName.ContainsKey(i))
|
||||
selectEncounterComboBox.Items.Add("[" + i + "] " + EncounterFileLocationName[i]);
|
||||
else
|
||||
selectEncounterComboBox.Items.Add("[" + i + "] " + " Unused");
|
||||
}
|
||||
|
||||
if (encToOpen > selectEncounterComboBox.Items.Count) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
using DSPRE.ROMFiles;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using static DSPRE.RomInfo;
|
||||
|
||||
namespace DSPRE {
|
||||
public partial class WildEditorHGSS : Form {
|
||||
|
|
@ -9,14 +11,37 @@ namespace DSPRE {
|
|||
EncounterFileHGSS currentFile;
|
||||
bool disableHandlers = false;
|
||||
|
||||
public WildEditorHGSS(string dirPath, string[] names, int encToOpen) {
|
||||
public WildEditorHGSS(string dirPath, string[] names, int encToOpen, int totalNumHeaderFiles) {
|
||||
InitializeComponent();
|
||||
encounterFileFolder = dirPath;
|
||||
|
||||
disableHandlers = true; //
|
||||
disableHandlers = true;
|
||||
|
||||
MapHeader tempMapHeader;
|
||||
List<string> locationNames = RomInfo.GetLocationNames();
|
||||
Dictionary<int, string> EncounterFileLocationName = new Dictionary<int, string>();
|
||||
|
||||
for (ushort i = 0; i < totalNumHeaderFiles; i++)
|
||||
{
|
||||
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied || ROMToolboxDialog.CheckFilesDynamicHeadersPatchApplied())
|
||||
{
|
||||
tempMapHeader = MapHeader.LoadFromFile(RomInfo.gameDirs[DirNames.dynamicHeaders].unpackedDir + "\\" + i.ToString("D4"), i, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
tempMapHeader = MapHeader.LoadFromARM9(i);
|
||||
}
|
||||
|
||||
if (tempMapHeader.wildPokemon != MapHeader.HGSS_NULL_ENCOUNTER_FILE_ID)
|
||||
EncounterFileLocationName.Add(tempMapHeader.wildPokemon, locationNames[((HeaderHGSS)tempMapHeader).locationName]);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < Directory.GetFiles(encounterFileFolder).Length; i++) {
|
||||
selectEncounterComboBox.Items.Add("Encounters File " + i.ToString());
|
||||
if (EncounterFileLocationName.ContainsKey(i))
|
||||
selectEncounterComboBox.Items.Add( "[" + i + "] " + EncounterFileLocationName[i]);
|
||||
else
|
||||
selectEncounterComboBox.Items.Add("[" + i + "] " + " Unused");
|
||||
}
|
||||
|
||||
if (encToOpen > selectEncounterComboBox.Items.Count) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user