mirror of
https://github.com/AdAstra-LD/DS-Pokemon-Rom-Editor.git
synced 2026-09-13 13:45:21 -05:00
Started merging changes
Co-authored-by: Cuddlyogre <cuddlyogre@users.noreply.github.com>
This commit is contained in:
committed by
Mixone-FinallyHere
parent
632c02dbfb
commit
12da61692f
@@ -45,7 +45,7 @@ namespace DSPRE {
|
||||
buildingOpenGLControl.MouseWheel += new MouseEventHandler(buildingOpenGLControl_MouseWheel);
|
||||
Gl.glEnable(Gl.GL_TEXTURE_2D);
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
interiorCheckBox.Enabled = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,9 @@
|
||||
<DependentUpon>EvolutionsEditor.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Extensions.cs" />
|
||||
<Compile Include="Filesystem.cs" />
|
||||
<Compile Include="GameCamera.cs" />
|
||||
<Compile Include="Helpers.cs" />
|
||||
<Compile Include="InputComboBox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace DSPRE {
|
||||
return new FileInfo(RomInfo.arm9Path).Length <= 0xBC000;
|
||||
}
|
||||
public static bool CheckCompressionMark() {
|
||||
return BitConverter.ToInt32(DSUtils.ARM9.ReadBytes((uint)(RomInfo.gameFamily == gFamEnum.DP ? 0xB7C : 0xBB4), 4), 0) != 0;
|
||||
return BitConverter.ToInt32(DSUtils.ARM9.ReadBytes((uint)(RomInfo.gameFamily == GameFamilies.DP ? 0xB7C : 0xBB4), 4), 0) != 0;
|
||||
}
|
||||
public static byte[] ReadBytes(uint startOffset, long numberOfBytes = 0) {
|
||||
return ReadFromFile(RomInfo.arm9Path, startOffset, numberOfBytes);
|
||||
|
||||
245
DS_Map/Filesystem.cs
Normal file
245
DS_Map/Filesystem.cs
Normal file
@@ -0,0 +1,245 @@
|
||||
using System.IO;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class Filesystem {
|
||||
public static string eventFiles { get { return RomInfo.gameDirs[RomInfo.DirNames.eventFiles].unpackedDir; } }
|
||||
public static string OWSprites { get { return RomInfo.gameDirs[RomInfo.DirNames.OWSprites].unpackedDir; } }
|
||||
public static string mapTextures { get { return RomInfo.gameDirs[RomInfo.DirNames.mapTextures].unpackedDir; } }
|
||||
public static string buildingTextures { get { return RomInfo.gameDirs[RomInfo.DirNames.buildingTextures].unpackedDir; } }
|
||||
public static string dynamicHeaders { get { return RomInfo.gameDirs[RomInfo.DirNames.dynamicHeaders].unpackedDir; } }
|
||||
public static string dynamicHeadersPacked { get { return RomInfo.gameDirs[RomInfo.DirNames.dynamicHeaders].packedDir; } }
|
||||
public static string scripts { get { return RomInfo.gameDirs[RomInfo.DirNames.scripts].unpackedDir; } }
|
||||
public static string maps { get { return RomInfo.gameDirs[RomInfo.DirNames.maps].unpackedDir; } }
|
||||
public static string matrices { get { return RomInfo.gameDirs[RomInfo.DirNames.matrices].unpackedDir; } }
|
||||
public static string buildingConfigFiles { get { return RomInfo.gameDirs[RomInfo.DirNames.buildingConfigFiles].unpackedDir; } }
|
||||
public static string areaData { get { return RomInfo.gameDirs[RomInfo.DirNames.areaData].unpackedDir; } }
|
||||
public static string textArchives { get { return RomInfo.gameDirs[RomInfo.DirNames.textArchives].unpackedDir; } }
|
||||
public static string trainerProperties { get { return RomInfo.gameDirs[RomInfo.DirNames.trainerProperties].unpackedDir; } }
|
||||
public static string trainerParty { get { return RomInfo.gameDirs[RomInfo.DirNames.trainerParty].unpackedDir; } }
|
||||
public static string trainerGraphics { get { return RomInfo.gameDirs[RomInfo.DirNames.trainerGraphics].unpackedDir; } }
|
||||
public static string encounters { get { return RomInfo.gameDirs[RomInfo.DirNames.encounters].unpackedDir; } }
|
||||
public static string headbutt { get { return RomInfo.gameDirs[RomInfo.DirNames.headbutt].unpackedDir; } }
|
||||
public static string safariZone { get { return RomInfo.gameDirs[RomInfo.DirNames.safariZone].unpackedDir; } }
|
||||
public static string monIcons { get { return RomInfo.gameDirs[RomInfo.DirNames.monIcons].unpackedDir; } }
|
||||
public static string synthOverlay { get { return RomInfo.gameDirs[RomInfo.DirNames.synthOverlay].unpackedDir; } }
|
||||
public static string interiorBuildingModels { get { return RomInfo.gameDirs[RomInfo.DirNames.interiorBuildingModels].unpackedDir; } }
|
||||
public static string exteriorBuildingModels { get { return RomInfo.gameDirs[RomInfo.DirNames.exteriorBuildingModels].unpackedDir; } }
|
||||
|
||||
public static string GetBuildingModelsDirPath(bool interior) {
|
||||
if (interior) {
|
||||
return interiorBuildingModels;
|
||||
} else {
|
||||
return exteriorBuildingModels;
|
||||
}
|
||||
}
|
||||
|
||||
public static string expArmPath { get { return Path.Combine(synthOverlay, ROMToolboxDialog.expandedARMfileID.ToString("D4")); } }
|
||||
|
||||
public static string GetPath(string path, int id, string format = "D4") {
|
||||
return Path.Combine(path, id.ToString(format));
|
||||
}
|
||||
|
||||
public static string GetPath(string path, string prefix, int id, string ext, string format = "D4") {
|
||||
return Path.Combine(path, prefix + id.ToString(format) + "." + ext);
|
||||
}
|
||||
|
||||
static string[] GetBuildingModelFiles(bool interior) {
|
||||
return Directory.GetFiles(Filesystem.GetBuildingModelsDirPath(interior));
|
||||
}
|
||||
|
||||
public static string GetBuildingModelPath(bool interior, int id) {
|
||||
return GetPath(Filesystem.GetBuildingModelsDirPath(interior), id);
|
||||
}
|
||||
|
||||
public static int GetBuildingCount(bool interior) {
|
||||
return GetBuildingModelFiles(interior).Length;
|
||||
}
|
||||
|
||||
public static string[] GetAreaDataFiles() {
|
||||
return Directory.GetFiles(Filesystem.areaData);
|
||||
}
|
||||
|
||||
public static string GetAreaDataPath(int id) {
|
||||
return GetPath(Filesystem.areaData, id);
|
||||
}
|
||||
|
||||
public static int GetAreaDataCount() {
|
||||
return GetAreaDataFiles().Length;
|
||||
}
|
||||
|
||||
public static string GetTexturePath(bool useMapTiles, int textureID) {
|
||||
string path = Filesystem.GetMapTexturePath(textureID);
|
||||
string path2 = Filesystem.GetBuildingTexturePath(textureID);
|
||||
string tilesetPath = useMapTiles ? path : path2;
|
||||
return tilesetPath;
|
||||
}
|
||||
|
||||
static string[] GetMapTextureFiles() {
|
||||
return Directory.GetFiles(Filesystem.mapTextures);
|
||||
}
|
||||
|
||||
public static string GetMapTexturePath(int id) {
|
||||
return GetPath(Filesystem.mapTextures, id);
|
||||
}
|
||||
|
||||
public static int GetMapTexturesCount() {
|
||||
return GetMapTextureFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetBuildingTextureFiles() {
|
||||
return Directory.GetFiles(Filesystem.buildingTextures);
|
||||
}
|
||||
|
||||
public static string GetBuildingTexturePath(int id) {
|
||||
return GetPath(Filesystem.buildingTextures, id);
|
||||
}
|
||||
|
||||
public static int GetBuildingTexturesCount() {
|
||||
return GetBuildingTextureFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetMatrixFiles() {
|
||||
return Directory.GetFiles(Filesystem.matrices);
|
||||
}
|
||||
|
||||
public static string GetMatrixPath(int id) {
|
||||
return GetPath(Filesystem.matrices, id);
|
||||
}
|
||||
|
||||
public static int GetMatrixCount() {
|
||||
return GetMatrixFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetTextArchiveFiles() {
|
||||
return Directory.GetFiles(Filesystem.textArchives);
|
||||
}
|
||||
|
||||
public static string GetTextArchivePath(int id) {
|
||||
return GetPath(Filesystem.textArchives, id);
|
||||
}
|
||||
|
||||
public static int GetTextArchivesCount() {
|
||||
return GetTextArchiveFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetMapFiles() {
|
||||
return Directory.GetFiles(Filesystem.maps);
|
||||
}
|
||||
|
||||
public static string GetMapPath(int id) {
|
||||
return GetPath(Filesystem.maps, id);
|
||||
}
|
||||
|
||||
public static int GetMapCount() {
|
||||
return GetMapFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetScriptFiles() {
|
||||
return Directory.GetFiles(Filesystem.scripts);
|
||||
}
|
||||
|
||||
public static string GetScriptPath(int id) {
|
||||
return GetPath(Filesystem.scripts, id);
|
||||
}
|
||||
|
||||
public static int GetScriptCount() {
|
||||
return GetScriptFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetEventFiles() {
|
||||
return Directory.GetFiles(Filesystem.eventFiles);
|
||||
}
|
||||
|
||||
public static string GetEventPath(int id) {
|
||||
return GetPath(Filesystem.eventFiles, id);
|
||||
}
|
||||
|
||||
public static int GetEventFileCount() {
|
||||
return GetEventFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetTrainerPropertiesFiles() {
|
||||
return Directory.GetFiles(Filesystem.trainerProperties);
|
||||
}
|
||||
|
||||
public static string GetTrainerPropertiesPath(int id) {
|
||||
return GetPath(Filesystem.trainerProperties, id);
|
||||
}
|
||||
|
||||
public static int GetTrainerPropertiesCount() {
|
||||
return GetTrainerPropertiesFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetDynamicHeaderFiles() {
|
||||
return Directory.GetFiles(Filesystem.dynamicHeaders);
|
||||
}
|
||||
|
||||
public static string GetDynamicHeaderPath(int id) {
|
||||
return GetPath(Filesystem.dynamicHeaders, id);
|
||||
}
|
||||
|
||||
public static int GetDynamicHeadersCount() {
|
||||
return GetDynamicHeaderFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetEncounterFiles() {
|
||||
return Directory.GetFiles(Filesystem.encounters);
|
||||
}
|
||||
|
||||
public static string GetEncounterPath(int id) {
|
||||
return GetPath(Filesystem.encounters, id);
|
||||
}
|
||||
|
||||
public static int GetEncountersCount() {
|
||||
return GetEncounterFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetSafariZoneFiles() {
|
||||
return Directory.GetFiles(Filesystem.safariZone);
|
||||
}
|
||||
|
||||
public static string GetSafariZonePath(int id) {
|
||||
return GetPath(Filesystem.safariZone, id);
|
||||
}
|
||||
|
||||
public static int GetSafariZoneCount() {
|
||||
return GetSafariZoneFiles().Length;
|
||||
}
|
||||
|
||||
static string[] GetHeadbuttFiles() {
|
||||
return Directory.GetFiles(Filesystem.headbutt);
|
||||
}
|
||||
|
||||
public static string GetHeadbuttPath(int id) {
|
||||
return GetPath(Filesystem.headbutt, id);
|
||||
}
|
||||
|
||||
public static int GetHeadbuttCount() {
|
||||
return GetHeadbuttFiles().Length;
|
||||
}
|
||||
|
||||
public static string GetOWSpritePath(int id) {
|
||||
return GetPath(Filesystem.OWSprites, id);
|
||||
}
|
||||
|
||||
public static string GetBuildingConfigPath(int id) {
|
||||
return GetPath(Filesystem.buildingConfigFiles, id);
|
||||
}
|
||||
|
||||
public static string GetTrainerPartyPath(int id) {
|
||||
return GetPath(Filesystem.trainerParty, id);
|
||||
}
|
||||
|
||||
public static string GetTrainerGraphicsPath(int id) {
|
||||
return GetPath(Filesystem.trainerGraphics, id);
|
||||
}
|
||||
|
||||
public static string GetMonIconPath(int id, string format = "D4") {
|
||||
return GetPath(Filesystem.monIcons, id, format);
|
||||
}
|
||||
|
||||
public static string GetSynthOerlayPath(int id) {
|
||||
return GetPath(Filesystem.synthOverlay, id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public class GameCamera {
|
||||
nearClip = b.ReadUInt32();
|
||||
farClip = b.ReadUInt32();
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
xOffset = b.ReadInt32();
|
||||
yOffset = b.ReadInt32();
|
||||
zOffset = b.ReadInt32();
|
||||
|
||||
397
DS_Map/Helpers.cs
Normal file
397
DS_Map/Helpers.cs
Normal file
@@ -0,0 +1,397 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using Tao.OpenGl;
|
||||
using LibNDSFormats.NSBMD;
|
||||
using LibNDSFormats.NSBTX;
|
||||
using DSPRE.ROMFiles;
|
||||
using Images;
|
||||
using Ekona.Images;
|
||||
using ScintillaNET;
|
||||
using ScintillaNET.Utils;
|
||||
using Tao.Platform.Windows;
|
||||
using NSMBe4.DSFileSystem;
|
||||
|
||||
namespace DSPRE {
|
||||
public static class Helpers {
|
||||
static MainProgram MainProgram;
|
||||
|
||||
public static RomInfo romInfo;
|
||||
public static bool hideBuildings = new bool();
|
||||
|
||||
public static NSBMDGlRenderer mapRenderer;
|
||||
|
||||
public static ToolStripProgressBar toolStripProgressBar { get { return MainProgram.toolStripProgressBar; } }
|
||||
|
||||
public static void Initialize(MainProgram mainProgram) {
|
||||
MainProgram = mainProgram;
|
||||
mapRenderer = new NSBMDGlRenderer();
|
||||
}
|
||||
|
||||
static bool disableHandlersOld;
|
||||
static bool disableHandlers;
|
||||
|
||||
public static bool HandlersDisabled { get { return disableHandlers == true; } }
|
||||
public static bool HandlersEnabled { get { return disableHandlers == false; } }
|
||||
|
||||
public static void BackUpDisableHandler() {
|
||||
disableHandlersOld = disableHandlers;
|
||||
}
|
||||
|
||||
public static void RestoreDisableHandler() {
|
||||
disableHandlers = disableHandlersOld;
|
||||
}
|
||||
|
||||
public static void DisableHandlers() {
|
||||
disableHandlers = true;
|
||||
}
|
||||
|
||||
public static void EnableHandlers() {
|
||||
disableHandlers = false;
|
||||
}
|
||||
|
||||
public static void statusLabelMessage(string msg = "Ready") {
|
||||
ToolStripStatusLabel statusLabel = MainProgram.statusLabel;
|
||||
statusLabel.Text = msg;
|
||||
statusLabel.Font = new Font(statusLabel.Font, FontStyle.Regular);
|
||||
statusLabel.ForeColor = Color.Black;
|
||||
statusLabel.Invalidate();
|
||||
}
|
||||
|
||||
public static void statusLabelError(string errorMsg, bool severe = true) {
|
||||
ToolStripStatusLabel statusLabel = MainProgram.statusLabel;
|
||||
statusLabel.Text = errorMsg;
|
||||
statusLabel.Font = new Font(statusLabel.Font, FontStyle.Bold);
|
||||
statusLabel.ForeColor = severe ? Color.Red : Color.DarkOrange;
|
||||
statusLabel.Invalidate();
|
||||
}
|
||||
|
||||
//Locate File - buttons
|
||||
public static void ExplorerSelect(string path) {
|
||||
if (System.IO.File.Exists(path)) {
|
||||
Process.Start("explorer.exe", "/select" + "," + "\"" + path + "\"");
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] GetTrainerNames() {
|
||||
List<string> trainerList = new List<string>();
|
||||
|
||||
/* Store all trainer names and classes */
|
||||
TextArchive trainerClasses = new TextArchive(RomInfo.trainerClassMessageNumber);
|
||||
TextArchive trainerNames = new TextArchive(RomInfo.trainerNamesMessageNumber);
|
||||
|
||||
int trainerCount = Filesystem.GetTrainerPropertiesCount();
|
||||
for (int i = 0; i < trainerCount; i++) {
|
||||
string path = Filesystem.GetTrainerPropertiesPath(i);
|
||||
int classMessageID = BitConverter.ToUInt16(DSUtils.ReadFromFile(path, startOffset: 1, 2), 0);
|
||||
string currentTrainerName;
|
||||
|
||||
if (i < trainerNames.messages.Count) {
|
||||
currentTrainerName = trainerNames.messages[i];
|
||||
} else {
|
||||
currentTrainerName = TrainerFile.NAME_NOT_FOUND;
|
||||
}
|
||||
|
||||
trainerList.Add("[" + i.ToString("D2") + "] " + trainerClasses.messages[classMessageID] + " " + currentTrainerName);
|
||||
}
|
||||
|
||||
return trainerList.ToArray();
|
||||
}
|
||||
|
||||
public static void MW_LoadModelTextures(NSBMD model, string textureFolder, int fileID) {
|
||||
if (fileID < 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
string texturePath = Filesystem.GetPath(textureFolder, fileID);
|
||||
model.materials = NSBTXLoader.LoadNsbtx(new MemoryStream(System.IO.File.ReadAllBytes(texturePath)), out model.Textures, out model.Palettes);
|
||||
try {
|
||||
model.MatchTextures();
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
|
||||
public static void MW_LoadModelTextures(MapFile mapFile, int fileID) {
|
||||
MW_LoadModelTextures(mapFile.mapModel, Filesystem.mapTextures, fileID);
|
||||
}
|
||||
|
||||
public static void MW_LoadModelTextures(Building building, int fileID) {
|
||||
MW_LoadModelTextures(building.NSBMDFile, Filesystem.buildingTextures, fileID);
|
||||
}
|
||||
|
||||
public static void SetupRenderer(float ang, float dist, float elev, float perspective, int width, int height) {
|
||||
//TODO: improve this
|
||||
Gl.glEnable(Gl.GL_RESCALE_NORMAL);
|
||||
Gl.glEnable(Gl.GL_COLOR_MATERIAL);
|
||||
Gl.glEnable(Gl.GL_DEPTH_TEST);
|
||||
Gl.glEnable(Gl.GL_NORMALIZE);
|
||||
Gl.glDisable(Gl.GL_CULL_FACE);
|
||||
Gl.glFrontFace(Gl.GL_CCW);
|
||||
Gl.glClearDepth(1);
|
||||
Gl.glEnable(Gl.GL_ALPHA_TEST);
|
||||
Gl.glBlendFunc(Gl.GL_SRC_ALPHA, Gl.GL_ONE_MINUS_SRC_ALPHA);
|
||||
Gl.glEnable(Gl.GL_BLEND);
|
||||
Gl.glAlphaFunc(Gl.GL_GREATER, 0f);
|
||||
Gl.glClearColor(51f / 255f, 51f / 255f, 51f / 255f, 1f);
|
||||
Gl.glViewport(0, 0, width, height);
|
||||
float aspect = width / height; //(vp[2] - vp[0]) / (vp[3] - vp[1]);
|
||||
Gl.glMatrixMode(Gl.GL_PROJECTION);
|
||||
Gl.glLoadIdentity();
|
||||
Glu.gluPerspective(perspective, aspect, 0.2f, 500.0f); //0.02f, 32.0f);
|
||||
Gl.glTranslatef(0, 0, -dist);
|
||||
Gl.glRotatef(elev, 1, 0, 0);
|
||||
Gl.glRotatef(ang, 0, 1, 0);
|
||||
Gl.glMatrixMode(Gl.GL_MODELVIEW);
|
||||
Gl.glLoadIdentity();
|
||||
Gl.glTranslatef(0, 0, -dist);
|
||||
Gl.glRotatef(elev, 1, 0, 0);
|
||||
Gl.glRotatef(-ang, 0, 1, 0);
|
||||
Gl.glLightfv(Gl.GL_LIGHT0, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLightfv(Gl.GL_LIGHT1, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLightfv(Gl.GL_LIGHT2, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLightfv(Gl.GL_LIGHT3, Gl.GL_POSITION, new float[] { 1, 1, 1, 0 });
|
||||
Gl.glLoadIdentity();
|
||||
Gl.glBindTexture(Gl.GL_TEXTURE_2D, 0);
|
||||
Gl.glColor3f(1.0f, 1.0f, 1.0f);
|
||||
Gl.glDepthMask(Gl.GL_TRUE);
|
||||
Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT);
|
||||
}
|
||||
|
||||
public static void RenderMap(ref MapFile mapFile, int width, int height, float ang, float dist, float elev, float perspective, bool mapTexturesON = true, bool buildingTexturesON = true) {
|
||||
#region Useless variables that the rendering API still needs
|
||||
|
||||
MKDS_Course_Editor.NSBTA.NSBTA.NSBTA_File ani = new MKDS_Course_Editor.NSBTA.NSBTA.NSBTA_File();
|
||||
MKDS_Course_Editor.NSBTP.NSBTP.NSBTP_File tp = new MKDS_Course_Editor.NSBTP.NSBTP.NSBTP_File();
|
||||
MKDS_Course_Editor.NSBCA.NSBCA.NSBCA_File ca = new MKDS_Course_Editor.NSBCA.NSBCA.NSBCA_File();
|
||||
int[] aniframeS = new int[0];
|
||||
|
||||
#endregion
|
||||
|
||||
/* Adjust rendering settings */
|
||||
SetupRenderer(ang, dist, elev, perspective, width, height);
|
||||
|
||||
/* Render the map model */
|
||||
NSBMD model = mapFile.mapModel;
|
||||
mapRenderer.Model = model.models[0];
|
||||
|
||||
// int scale = 64;
|
||||
float scale = 0.015625f;
|
||||
Gl.glScalef(mapRenderer.Model.modelScale * scale, mapRenderer.Model.modelScale * scale, mapRenderer.Model.modelScale * scale);
|
||||
|
||||
/* Determine if map textures must be rendered */
|
||||
if (mapTexturesON) {
|
||||
Gl.glEnable(Gl.GL_TEXTURE_2D);
|
||||
} else {
|
||||
Gl.glDisable(Gl.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
// Render map model
|
||||
mapRenderer.RenderModel("", ani, aniframeS, aniframeS, aniframeS, aniframeS, aniframeS, ca, false, -1, 0.0f, 0.0f, dist, elev, ang, true, tp, model);
|
||||
|
||||
if (hideBuildings) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (buildingTexturesON) {
|
||||
Gl.glEnable(Gl.GL_TEXTURE_2D);
|
||||
} else {
|
||||
Gl.glDisable(Gl.GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
for (int i = 0; i < mapFile.buildings.Count; i++) {
|
||||
Building building = mapFile.buildings[i];
|
||||
model = building.NSBMDFile;
|
||||
if (model is null) {
|
||||
Console.WriteLine("Null building can't be rendered");
|
||||
} else {
|
||||
mapRenderer.Model = model.models[0];
|
||||
ScaleTranslateRotateBuilding(building);
|
||||
mapRenderer.RenderModel("", ani, aniframeS, aniframeS, aniframeS, aniframeS, aniframeS, ca, false, -1, 0.0f, 0.0f, dist, elev, ang, true, tp, model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Bitmap GrabMapScreenshot(int width, int height) {
|
||||
Bitmap bmp = new Bitmap(width, height);
|
||||
System.Drawing.Imaging.BitmapData data = bmp.LockBits(new Rectangle(0, 0, width, height), System.Drawing.Imaging.ImageLockMode.WriteOnly, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
||||
Gl.glReadPixels(0, 0, width, height, Gl.GL_BGR, Gl.GL_UNSIGNED_BYTE, data.Scan0);
|
||||
bmp.UnlockBits(data);
|
||||
bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
return bmp;
|
||||
}
|
||||
|
||||
private static void ScaleTranslateRotateBuilding(Building building) {
|
||||
float fullXcoord = building.xPosition + building.xFraction / 65536f;
|
||||
float fullYcoord = building.yPosition + building.yFraction / 65536f;
|
||||
float fullZcoord = building.zPosition + building.zFraction / 65536f;
|
||||
|
||||
float scaleFactor = building.NSBMDFile.models[0].modelScale / 1024;
|
||||
float translateFactor = 256 / building.NSBMDFile.models[0].modelScale;
|
||||
|
||||
Gl.glScalef(scaleFactor * building.width, scaleFactor * building.height, scaleFactor * building.length);
|
||||
Gl.glTranslatef(fullXcoord * translateFactor / building.width, fullYcoord * translateFactor / building.height, fullZcoord * translateFactor / building.length);
|
||||
Gl.glRotatef(Building.U16ToDeg(building.xRotation), 1, 0, 0);
|
||||
Gl.glRotatef(Building.U16ToDeg(building.yRotation), 0, 1, 0);
|
||||
Gl.glRotatef(Building.U16ToDeg(building.zRotation), 0, 0, 1);
|
||||
}
|
||||
|
||||
public static Image GetPokePic(int species, int w, int h, PaletteBase paletteBase, ImageBase imageBase, SpriteBase spriteBase) {
|
||||
bool fiveDigits = false; // some extreme future proofing
|
||||
try {
|
||||
string path = Filesystem.GetMonIconPath(0);
|
||||
paletteBase = new NCLR(path, 0, Path.GetFileName(path));
|
||||
} catch (FileNotFoundException) {
|
||||
string path = Filesystem.GetMonIconPath(0, "D5");
|
||||
paletteBase = new NCLR(path, 0, Path.GetFileName(path));
|
||||
fiveDigits = true;
|
||||
}
|
||||
|
||||
// read arm9 table to grab pal ID
|
||||
int paletteId = 0;
|
||||
byte[] iconPalTableBuf;
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case RomInfo.GameFamilies.DP:
|
||||
iconPalTableBuf = DSUtils.ARM9.ReadBytes(0x6B838, 4);
|
||||
break;
|
||||
case RomInfo.GameFamilies.Plat:
|
||||
iconPalTableBuf = DSUtils.ARM9.ReadBytes(0x79F80, 4);
|
||||
break;
|
||||
case RomInfo.GameFamilies.HGSS:
|
||||
default:
|
||||
iconPalTableBuf = DSUtils.ARM9.ReadBytes(0x74408, 4);
|
||||
break;
|
||||
}
|
||||
|
||||
int iconPalTableAddress = (iconPalTableBuf[3] & 0xFF) << 24 | (iconPalTableBuf[2] & 0xFF) << 16 | (iconPalTableBuf[1] & 0xFF) << 8 | (iconPalTableBuf[0] & 0xFF) /* << 0 */;
|
||||
string iconTablePath;
|
||||
|
||||
int iconPalTableOffsetFromFileStart;
|
||||
if (iconPalTableAddress >= RomInfo.synthOverlayLoadAddress) {
|
||||
// if the pointer shows the table was moved to the synthetic overlay
|
||||
iconPalTableOffsetFromFileStart = iconPalTableAddress - (int)RomInfo.synthOverlayLoadAddress;
|
||||
iconTablePath = Filesystem.expArmPath;
|
||||
} else {
|
||||
iconPalTableOffsetFromFileStart = iconPalTableAddress - 0x02000000;
|
||||
iconTablePath = RomInfo.arm9Path;
|
||||
}
|
||||
|
||||
using (DSUtils.EasyReader idReader = new DSUtils.EasyReader(iconTablePath, iconPalTableOffsetFromFileStart + species)) {
|
||||
paletteId = idReader.ReadByte();
|
||||
}
|
||||
|
||||
if (paletteId != 0) {
|
||||
paletteBase.Palette[0] = paletteBase.Palette[paletteId]; // update pal 0 to be the new pal
|
||||
}
|
||||
|
||||
// grab tiles
|
||||
int spriteFileID = species + 7;
|
||||
if (fiveDigits) {
|
||||
string path = Filesystem.GetMonIconPath(spriteFileID, "D5");
|
||||
imageBase = new NCGR(path, spriteFileID, Path.GetFileName(path));
|
||||
} else {
|
||||
string path = Filesystem.GetMonIconPath(spriteFileID);
|
||||
imageBase = new NCGR(path, spriteFileID, Path.GetFileName(path));
|
||||
}
|
||||
|
||||
// grab sprite
|
||||
const int ncerFileId = 2;
|
||||
if (fiveDigits) {
|
||||
string path = Filesystem.GetMonIconPath(ncerFileId, "D5");
|
||||
spriteBase = new NCER(path, ncerFileId, Path.GetFileName(path));
|
||||
} else {
|
||||
string path = Filesystem.GetMonIconPath(ncerFileId);
|
||||
spriteBase = new NCER(path, ncerFileId, Path.GetFileName(path));
|
||||
}
|
||||
|
||||
// copy this from the trainer
|
||||
int bank0OAMcount = spriteBase.Banks[0].oams.Length;
|
||||
int[] OAMenabled = new int[bank0OAMcount];
|
||||
for (int i = 0; i < OAMenabled.Length; i++) {
|
||||
OAMenabled[i] = i;
|
||||
}
|
||||
|
||||
// finally compose image
|
||||
try {
|
||||
return spriteBase.Get_Image(imageBase, paletteBase, 0, w, h, false, false, false, true, true, -1, OAMenabled);
|
||||
} catch (FormatException) {
|
||||
return Properties.Resources.IconPokeball;
|
||||
}
|
||||
// default:
|
||||
//partyPokemonPictureBoxList[partyPos].Image = cb.SelectedIndex > 0 ? (Image)Properties.PokePics.ResourceManager.GetObject(FixPokenameString(PokeDatabase.System.pokeNames[(ushort)cb.SelectedIndex])) : global::DSPRE.Properties.Resources.IconPokeball;
|
||||
}
|
||||
|
||||
public static void GenerateKeystrokes(string keys, Scintilla textArea) {
|
||||
//Example
|
||||
//GenerateKeystrokes("+{TAB}");
|
||||
HotKeyManager.Enable = false;
|
||||
textArea.Focus();
|
||||
SendKeys.Send(keys);
|
||||
HotKeyManager.Enable = true;
|
||||
}
|
||||
|
||||
public static void PictureBoxDisable(object sender, PaintEventArgs e) {
|
||||
if (sender is PictureBox pict && pict.Image != null && (!pict.Enabled)) {
|
||||
using (Bitmap img = new Bitmap(pict.Image, pict.ClientSize)) {
|
||||
ControlPaint.DrawImageDisabled(e.Graphics, img, 0, 0, pict.BackColor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static List<string> getHeaderListBoxNames() {
|
||||
List<string> headerListBoxNames = new List<string>();
|
||||
|
||||
using (DSUtils.EasyReader reader = new DSUtils.EasyReader(RomInfo.internalNamesPath)) {
|
||||
int headerCount = RomInfo.GetHeaderCount();
|
||||
for (int i = 0; i < headerCount; i++) {
|
||||
byte[] row = reader.ReadBytes(RomInfo.internalNameLength);
|
||||
string internalName = Encoding.ASCII.GetString(row); //.TrimEnd();
|
||||
headerListBoxNames.Add(MapHeader.BuildName(i, internalName));
|
||||
}
|
||||
}
|
||||
|
||||
return headerListBoxNames;
|
||||
}
|
||||
|
||||
public static List<string> getInternalNames() {
|
||||
List<string> internalNames = new List<string>();
|
||||
|
||||
using (DSUtils.EasyReader reader = new DSUtils.EasyReader(RomInfo.internalNamesPath)) {
|
||||
int headerCount = RomInfo.GetHeaderCount();
|
||||
for (int i = 0; i < headerCount; i++) {
|
||||
byte[] row = reader.ReadBytes(RomInfo.internalNameLength);
|
||||
string internalName = Encoding.ASCII.GetString(row); //.TrimEnd();
|
||||
internalNames.Add(internalName.TrimEnd('\0'));
|
||||
}
|
||||
}
|
||||
|
||||
return internalNames;
|
||||
}
|
||||
|
||||
public static void OpenWildEditor(int encToOpen = 0) {
|
||||
Helpers.statusLabelMessage("Attempting to extract Wild Encounters NARC...");
|
||||
|
||||
DSUtils.TryUnpackNarcs(new List<RomInfo.DirNames>() { RomInfo.DirNames.encounters, RomInfo.DirNames.monIcons });
|
||||
|
||||
Helpers.statusLabelMessage("Passing control to Wild Pokémon Editor...");
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case RomInfo.GameFamilies.DP:
|
||||
case RomInfo.GameFamilies.Plat:
|
||||
using (WildEditorDPPt editor = new WildEditorDPPt(encToOpen))
|
||||
editor.ShowDialog();
|
||||
break;
|
||||
default:
|
||||
using (WildEditorHGSS editor = new WildEditorHGSS(encToOpen))
|
||||
editor.ShowDialog();
|
||||
break;
|
||||
}
|
||||
|
||||
Helpers.statusLabelMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
14
DS_Map/Main Window.Designer.cs
generated
14
DS_Map/Main Window.Designer.cs
generated
@@ -11167,14 +11167,14 @@
|
||||
// personalDataEditorToolStripMenuItem
|
||||
//
|
||||
this.personalDataEditorToolStripMenuItem.Name = "personalDataEditorToolStripMenuItem";
|
||||
this.personalDataEditorToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.personalDataEditorToolStripMenuItem.Size = new System.Drawing.Size(163, 22);
|
||||
this.personalDataEditorToolStripMenuItem.Text = "Pokemon Editor";
|
||||
this.personalDataEditorToolStripMenuItem.Click += new System.EventHandler(this.personalDataEditorToolStripMenuItem_Click);
|
||||
//
|
||||
// learnsetsEditorToolStripMenuItem
|
||||
//
|
||||
this.learnsetsEditorToolStripMenuItem.Name = "learnsetsEditorToolStripMenuItem";
|
||||
this.learnsetsEditorToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.learnsetsEditorToolStripMenuItem.Size = new System.Drawing.Size(163, 22);
|
||||
this.learnsetsEditorToolStripMenuItem.Text = "Learnsets Editor";
|
||||
this.learnsetsEditorToolStripMenuItem.Visible = false;
|
||||
this.learnsetsEditorToolStripMenuItem.Click += new System.EventHandler(this.learnsetsEditorToolStripMenuItem_Click);
|
||||
@@ -11182,7 +11182,7 @@
|
||||
// evolutionsEditorToolStripMenuItem
|
||||
//
|
||||
this.evolutionsEditorToolStripMenuItem.Name = "evolutionsEditorToolStripMenuItem";
|
||||
this.evolutionsEditorToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.evolutionsEditorToolStripMenuItem.Size = new System.Drawing.Size(163, 22);
|
||||
this.evolutionsEditorToolStripMenuItem.Text = "Evolutions Editor";
|
||||
this.evolutionsEditorToolStripMenuItem.Visible = false;
|
||||
this.evolutionsEditorToolStripMenuItem.Click += new System.EventHandler(this.evolutionsEditorToolStripMenuItem_Click);
|
||||
@@ -11241,16 +11241,16 @@
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.statusLabel,
|
||||
this.toolStripProgressBar});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 739);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 737);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1214, 22);
|
||||
this.statusStrip1.Size = new System.Drawing.Size(1214, 24);
|
||||
this.statusStrip1.TabIndex = 13;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// statusLabel
|
||||
//
|
||||
this.statusLabel.Name = "statusLabel";
|
||||
this.statusLabel.Size = new System.Drawing.Size(39, 17);
|
||||
this.statusLabel.Size = new System.Drawing.Size(39, 19);
|
||||
this.statusLabel.Text = "Ready";
|
||||
//
|
||||
// toolStripProgressBar
|
||||
@@ -12016,7 +12016,6 @@
|
||||
private System.Windows.Forms.RadioButton radio2D;
|
||||
private System.Windows.Forms.CheckBox wireframeCheckBox;
|
||||
private System.Windows.Forms.StatusStrip statusStrip1;
|
||||
private System.Windows.Forms.ToolStripStatusLabel statusLabel;
|
||||
private System.Windows.Forms.PictureBox collisionPictureBox;
|
||||
private System.Windows.Forms.PictureBox typePictureBox;
|
||||
private System.Windows.Forms.Label typeLabel;
|
||||
@@ -12332,7 +12331,6 @@
|
||||
private System.Windows.Forms.PictureBox rightClickPicture;
|
||||
private System.Windows.Forms.Label WheelClickLabel;
|
||||
private System.Windows.Forms.Label LeftClickLabel;
|
||||
private System.Windows.Forms.ToolStripProgressBar toolStripProgressBar;
|
||||
private System.Windows.Forms.ToolStripButton unpackAllButton;
|
||||
private System.Windows.Forms.Button pasteHeaderButton;
|
||||
private System.Windows.Forms.Button copyHeaderButton;
|
||||
|
||||
@@ -506,13 +506,13 @@ namespace DSPRE {
|
||||
if (forceUnpack) {
|
||||
DSUtils.ForceUnpackNarcs(toUnpack);
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
DSUtils.ForceUnpackNarcs(new List<DirNames> { DirNames.interiorBuildingModels });// Last = interior buildings dir
|
||||
}
|
||||
} else {
|
||||
DSUtils.TryUnpackNarcs(toUnpack);
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
DSUtils.TryUnpackNarcs(new List<DirNames> { DirNames.interiorBuildingModels });
|
||||
}
|
||||
}
|
||||
@@ -594,7 +594,11 @@ namespace DSPRE {
|
||||
gameIcon.Refresh(); // Paint game icon
|
||||
statusLabelMessage("Attempting to unpack NARCs from folder...");
|
||||
Update();
|
||||
|
||||
for (int i = 0; i < 128; i++) {
|
||||
if (DSUtils.OverlayIsCompressed(i)) {
|
||||
DSUtils.DecompressOverlay(i);
|
||||
}
|
||||
}
|
||||
ReadROMInitData();
|
||||
}
|
||||
|
||||
@@ -605,7 +609,7 @@ namespace DSPRE {
|
||||
versionLabel.Text = RomInfo.gameVersion.ToString() + " " + "[" + RomInfo.romID + "]";
|
||||
languageLabel.Text = "Lang: " + RomInfo.gameLanguage;
|
||||
|
||||
if (RomInfo.gameLanguage == gLangEnum.English) {
|
||||
if (RomInfo.gameLanguage == GameLanguages.English) {
|
||||
if (europeByte == 0x0A) {
|
||||
languageLabel.Text += " [Europe]";
|
||||
} else {
|
||||
@@ -654,7 +658,7 @@ namespace DSPRE {
|
||||
|
||||
private void ReadROMInitData() {
|
||||
if (DSUtils.ARM9.CheckCompressionMark()) {
|
||||
if (!RomInfo.gameFamily.Equals(gFamEnum.HGSS)) {
|
||||
if (!RomInfo.gameFamily.Equals(GameFamilies.HGSS)) {
|
||||
MessageBox.Show("Unexpected compressed ARM9. It is advised that you double check the ARM9.");
|
||||
}
|
||||
if (!DSUtils.ARM9.Decompress(RomInfo.arm9Path)) {
|
||||
@@ -724,7 +728,7 @@ namespace DSPRE {
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
|
||||
if (d == DialogResult.Yes) {
|
||||
DSUtils.ARM9.WriteBytes(new byte[4] { 0, 0, 0, 0 }, (uint)(RomInfo.gameFamily == gFamEnum.DP ? 0xB7C : 0xBB4));
|
||||
DSUtils.ARM9.WriteBytes(new byte[4] { 0, 0, 0, 0 }, (uint)(RomInfo.gameFamily == GameFamilies.DP ? 0xB7C : 0xBB4));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,9 +753,15 @@ namespace DSPRE {
|
||||
|
||||
Update();
|
||||
|
||||
for (int i = 0; i < 128; i++) {
|
||||
if (!DSUtils.OverlayIsCompressed(i)) {
|
||||
DSUtils.CompressOverlay(i);
|
||||
}
|
||||
}
|
||||
|
||||
DSUtils.RepackROM(saveRom.FileName);
|
||||
|
||||
if (RomInfo.gameFamily != gFamEnum.DP && RomInfo.gameFamily != gFamEnum.Plat) {
|
||||
if (RomInfo.gameFamily != GameFamilies.DP && RomInfo.gameFamily != GameFamilies.Plat) {
|
||||
if (eventEditorIsReady) {
|
||||
if (DSUtils.OverlayIsCompressed(1)) {
|
||||
DSUtils.DecompressOverlay(1);
|
||||
@@ -819,16 +829,16 @@ namespace DSPRE {
|
||||
}
|
||||
}
|
||||
private void diamondAndPearlToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.DP), RomInfo.BuildCommandParametersDatabase(gFamEnum.DP),
|
||||
RomInfo.BuildActionNamesDatabase(gFamEnum.DP), RomInfo.BuildComparisonOperatorsDatabase(gFamEnum.DP));
|
||||
OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(GameFamilies.DP), RomInfo.BuildCommandParametersDatabase(GameFamilies.DP),
|
||||
RomInfo.BuildActionNamesDatabase(GameFamilies.DP), RomInfo.BuildComparisonOperatorsDatabase(GameFamilies.DP));
|
||||
}
|
||||
private void platinumToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.Plat), RomInfo.BuildCommandParametersDatabase(gFamEnum.Plat),
|
||||
RomInfo.BuildActionNamesDatabase(gFamEnum.Plat), RomInfo.BuildComparisonOperatorsDatabase(gFamEnum.Plat));
|
||||
OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(GameFamilies.Plat), RomInfo.BuildCommandParametersDatabase(GameFamilies.Plat),
|
||||
RomInfo.BuildActionNamesDatabase(GameFamilies.Plat), RomInfo.BuildComparisonOperatorsDatabase(GameFamilies.Plat));
|
||||
}
|
||||
private void heartGoldAndSoulSilverToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(gFamEnum.HGSS), RomInfo.BuildCommandParametersDatabase(gFamEnum.HGSS),
|
||||
RomInfo.BuildActionNamesDatabase(gFamEnum.HGSS), RomInfo.BuildComparisonOperatorsDatabase(gFamEnum.HGSS));
|
||||
OpenCommandsDatabase(RomInfo.BuildCommandNamesDatabase(GameFamilies.HGSS), RomInfo.BuildCommandParametersDatabase(GameFamilies.HGSS),
|
||||
RomInfo.BuildActionNamesDatabase(GameFamilies.HGSS), RomInfo.BuildComparisonOperatorsDatabase(GameFamilies.HGSS));
|
||||
}
|
||||
private void mainTabControl_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (mainTabControl.SelectedTab == headerEditorTabPage) {
|
||||
@@ -915,8 +925,8 @@ namespace DSPRE {
|
||||
|
||||
string wildPokeUnpackedPath = gameDirs[DirNames.encounters].unpackedDir;
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
using (WildEditorDPPt editor = new WildEditorDPPt(wildPokeUnpackedPath, RomInfo.GetPokemonNames(), encToOpen, internalNames.Count))
|
||||
editor.ShowDialog();
|
||||
break;
|
||||
@@ -996,7 +1006,7 @@ namespace DSPRE {
|
||||
ReloadHeaderEditorLocationsList(currentTextArchive.messages);
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
areaIconComboBox.Enabled = false;
|
||||
areaIconPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject("dpareaicon");
|
||||
areaSettingsLabel.Text = "Show nametag:";
|
||||
@@ -1014,7 +1024,7 @@ namespace DSPRE {
|
||||
battleBackgroundLabel.Location = new Point(battleBackgroundLabel.Location.X - 25, battleBackgroundLabel.Location.Y - 8);
|
||||
battleBackgroundUpDown.Location = new Point(battleBackgroundUpDown.Location.X - 25, battleBackgroundUpDown.Location.Y - 8);
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
areaSettingsLabel.Text = "Show nametag:";
|
||||
areaIconComboBox.Items.Clear();
|
||||
cameraComboBox.Items.Clear();
|
||||
@@ -1134,9 +1144,9 @@ namespace DSPRE {
|
||||
|
||||
string imageName;
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
((HeaderPt)currentHeader).areaIcon = (byte)areaIconComboBox.SelectedIndex;
|
||||
imageName = "areaicon0" + areaIconComboBox.SelectedIndex.ToString();
|
||||
areaIconPictureBox.Image = (Image)Properties.Resources.ResourceManager.GetObject(imageName);
|
||||
@@ -1162,7 +1172,7 @@ namespace DSPRE {
|
||||
return;
|
||||
}
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
HeaderHGSS currentHeaderHGSS = (HeaderHGSS)currentHeader;
|
||||
currentHeaderHGSS.followMode = (byte)followModeComboBox.SelectedIndex;
|
||||
}
|
||||
@@ -1172,7 +1182,7 @@ namespace DSPRE {
|
||||
if (disableHandlers) {
|
||||
return;
|
||||
}
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
HeaderHGSS currentHeaderHGSS = (HeaderHGSS)currentHeader;
|
||||
currentHeaderHGSS.kantoFlag = kantoRadioButton.Checked;
|
||||
}
|
||||
@@ -1195,7 +1205,7 @@ namespace DSPRE {
|
||||
if (flag3CheckBox.Checked)
|
||||
flagVal += (byte)Math.Pow(2, 3);
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
if (flag4CheckBox.Checked)
|
||||
flagVal += (byte)Math.Pow(2, 4);
|
||||
if (flag5CheckBox.Checked)
|
||||
@@ -1243,7 +1253,7 @@ namespace DSPRE {
|
||||
cameraUpDown.Value = currentHeader.cameraAngleID;
|
||||
battleBackgroundUpDown.Value = currentHeader.battleBackground;
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
areaSettingsComboBox.SelectedIndex = ((HeaderHGSS)currentHeader).locationType;
|
||||
}
|
||||
|
||||
@@ -1252,7 +1262,7 @@ namespace DSPRE {
|
||||
/* Setup controls for fields with version-specific differences */
|
||||
try {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP: {
|
||||
case GameFamilies.DP: {
|
||||
HeaderDP h = (HeaderDP)currentHeader;
|
||||
|
||||
locationNameComboBox.SelectedIndex = h.locationName;
|
||||
@@ -1261,7 +1271,7 @@ namespace DSPRE {
|
||||
areaSettingsComboBox.SelectedIndex = areaSettingsComboBox.FindString("[" + $"{currentHeader.locationSpecifier:D3}");
|
||||
break;
|
||||
}
|
||||
case gFamEnum.Plat: {
|
||||
case GameFamilies.Plat: {
|
||||
HeaderPt h = (HeaderPt)currentHeader;
|
||||
|
||||
areaIconComboBox.SelectedIndex = h.areaIcon;
|
||||
@@ -1301,7 +1311,7 @@ namespace DSPRE {
|
||||
flag2CheckBox.Checked = ba[2];
|
||||
flag3CheckBox.Checked = ba[3];
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
flag4CheckBox.Checked = ba[4];
|
||||
flag5CheckBox.Checked = ba[5];
|
||||
flag6CheckBox.Checked = ba[6];
|
||||
@@ -1360,10 +1370,10 @@ namespace DSPRE {
|
||||
}
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
((HeaderDP)currentHeader).locationName = (ushort)locationNameComboBox.SelectedIndex;
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
((HeaderPt)currentHeader).locationName = (byte)locationNameComboBox.SelectedIndex;
|
||||
break;
|
||||
default:
|
||||
@@ -1382,10 +1392,10 @@ namespace DSPRE {
|
||||
return;
|
||||
}
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
currentHeader.musicDayID = (ushort)(musicDayUpDown.Value = PokeDatabase.MusicDB.DPMusicDict.Keys.ElementAt(musicDayComboBox.SelectedIndex));
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
currentHeader.musicDayID = (ushort)(musicDayUpDown.Value = PokeDatabase.MusicDB.PtMusicDict.Keys.ElementAt(musicDayComboBox.SelectedIndex));
|
||||
break;
|
||||
default:
|
||||
@@ -1399,10 +1409,10 @@ namespace DSPRE {
|
||||
}
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
currentHeader.musicNightID = (ushort)(musicNightUpDown.Value = PokeDatabase.MusicDB.DPMusicDict.Keys.ElementAt(musicNightComboBox.SelectedIndex));
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
currentHeader.musicNightID = (ushort)(musicNightUpDown.Value = PokeDatabase.MusicDB.PtMusicDict.Keys.ElementAt(musicNightComboBox.SelectedIndex));
|
||||
break;
|
||||
default:
|
||||
@@ -1420,10 +1430,10 @@ namespace DSPRE {
|
||||
currentHeader.musicDayID = updValue;
|
||||
try {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
musicDayComboBox.SelectedItem = PokeDatabase.MusicDB.DPMusicDict[updValue];
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
musicDayComboBox.SelectedItem = PokeDatabase.MusicDB.PtMusicDict[updValue];
|
||||
break;
|
||||
default:
|
||||
@@ -1445,10 +1455,10 @@ namespace DSPRE {
|
||||
currentHeader.musicNightID = updValue;
|
||||
try {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
musicNightComboBox.SelectedItem = PokeDatabase.MusicDB.DPMusicDict[updValue];
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
musicNightComboBox.SelectedItem = PokeDatabase.MusicDB.PtMusicDict[updValue];
|
||||
break;
|
||||
default:
|
||||
@@ -1475,10 +1485,10 @@ namespace DSPRE {
|
||||
disableHandlers = true;
|
||||
try {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
weatherComboBox.SelectedItem = PokeDatabase.Weather.DPWeatherDict[currentHeader.weatherID];
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
weatherComboBox.SelectedItem = PokeDatabase.Weather.PtWeatherDict[currentHeader.weatherID];
|
||||
break;
|
||||
default:
|
||||
@@ -1494,10 +1504,10 @@ namespace DSPRE {
|
||||
try {
|
||||
Dictionary<byte[], string> dict;
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
dict = PokeDatabase.System.WeatherPics.dpWeatherImageDict;
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
dict = PokeDatabase.System.WeatherPics.ptWeatherImageDict;
|
||||
break;
|
||||
default:
|
||||
@@ -1528,10 +1538,10 @@ namespace DSPRE {
|
||||
disableHandlers = true;
|
||||
try {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
cameraComboBox.SelectedItem = PokeDatabase.CameraAngles.DPPtCameraDict[currentHeader.cameraAngleID];
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
cameraComboBox.SelectedItem = PokeDatabase.CameraAngles.DPPtCameraDict[currentHeader.cameraAngleID];
|
||||
break;
|
||||
default:
|
||||
@@ -1547,11 +1557,11 @@ namespace DSPRE {
|
||||
string imageName;
|
||||
try {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
currentHeader.cameraAngleID = (byte)cameraComboBox.SelectedIndex;
|
||||
imageName = "dpcamera" + cameraUpDown.Value.ToString();
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
currentHeader.cameraAngleID = (byte)cameraComboBox.SelectedIndex;
|
||||
imageName = "ptcamera" + cameraUpDown.Value.ToString();
|
||||
break;
|
||||
@@ -1572,10 +1582,10 @@ namespace DSPRE {
|
||||
}
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
weatherUpDown.Value = PokeDatabase.Weather.DPWeatherDict.Keys.ElementAt(weatherComboBox.SelectedIndex);
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
weatherUpDown.Value = PokeDatabase.Weather.PtWeatherDict.Keys.ElementAt(weatherComboBox.SelectedIndex);
|
||||
break;
|
||||
default:
|
||||
@@ -1594,10 +1604,10 @@ namespace DSPRE {
|
||||
}
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
cameraUpDown.Value = PokeDatabase.CameraAngles.DPPtCameraDict.Keys.ElementAt(cameraComboBox.SelectedIndex);
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
cameraUpDown.Value = PokeDatabase.CameraAngles.DPPtCameraDict.Keys.ElementAt(cameraComboBox.SelectedIndex);
|
||||
break;
|
||||
default:
|
||||
@@ -1751,13 +1761,13 @@ namespace DSPRE {
|
||||
|
||||
string locationName = "";
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
locationName = locationNameComboBox.Items[((HeaderDP)h).locationName].ToString();
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
locationName = locationNameComboBox.Items[((HeaderPt)h).locationName].ToString();
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
locationName = locationNameComboBox.Items[((HeaderHGSS)h).locationName].ToString();
|
||||
break;
|
||||
}
|
||||
@@ -1792,13 +1802,13 @@ namespace DSPRE {
|
||||
|
||||
string[] locBuff = new string[2];
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
locBuff[1] = locationNameComboBox.Items[((HeaderDP)hBuff[1]).locationName].ToString();
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
locBuff[1] = locationNameComboBox.Items[((HeaderPt)hBuff[1]).locationName].ToString();
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
locBuff[1] = locationNameComboBox.Items[((HeaderHGSS)hBuff[1]).locationName].ToString();
|
||||
break;
|
||||
}
|
||||
@@ -1810,13 +1820,13 @@ namespace DSPRE {
|
||||
string lastName = locBuff[0]; //Kind of a locBuff[-1]
|
||||
locBuff[0] = locBuff[1];
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
locBuff[1] = locationNameComboBox.Items[((HeaderDP)hBuff[1]).locationName].ToString();
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
locBuff[1] = locationNameComboBox.Items[((HeaderPt)hBuff[1]).locationName].ToString();
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
locBuff[1] = locationNameComboBox.Items[((HeaderHGSS)hBuff[1]).locationName].ToString();
|
||||
break;
|
||||
}
|
||||
@@ -1854,11 +1864,11 @@ namespace DSPRE {
|
||||
}
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
currentHeader.locationSpecifier = Byte.Parse(areaSettingsComboBox.SelectedItem.ToString().Substring(1, 3));
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
HeaderHGSS ch = (HeaderHGSS)currentHeader;
|
||||
ch.locationType = (byte)areaSettingsComboBox.SelectedIndex;
|
||||
break;
|
||||
@@ -2124,11 +2134,11 @@ namespace DSPRE {
|
||||
wildPokeUpDown.Value = encountersIDCopy;
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
areaSettingsComboBox.SelectedIndex = shownameCopy;
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
areaSettingsComboBox.SelectedIndex = areaSettingsCopy;
|
||||
break;
|
||||
}
|
||||
@@ -2614,7 +2624,7 @@ namespace DSPRE {
|
||||
|
||||
statusLabelMessage("Multiple Headers are associated to this Matrix, including the last selected one [Header " + headerID + "]. Now using its textures.");
|
||||
} else {
|
||||
if (gameFamily.Equals(gFamEnum.DP)) {
|
||||
if (gameFamily.Equals(GameFamilies.DP)) {
|
||||
foreach (ushort r in result) {
|
||||
HeaderDP hdp;
|
||||
hdp = (HeaderDP)MapHeader.LoadFromARM9(r);
|
||||
@@ -2624,7 +2634,7 @@ namespace DSPRE {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (gameFamily.Equals(gFamEnum.Plat)) {
|
||||
} else if (gameFamily.Equals(GameFamilies.Plat)) {
|
||||
foreach (ushort r in result) {
|
||||
HeaderPt hpt;
|
||||
if (ROMToolboxDialog.flag_DynamicHeadersPatchApplied || ROMToolboxDialog.CheckFilesDynamicHeadersPatchApplied()) {
|
||||
@@ -3195,7 +3205,7 @@ namespace DSPRE {
|
||||
DirNames.areaData,
|
||||
});
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
DSUtils.TryUnpackNarcs(new List<DirNames> { DirNames.interiorBuildingModels });
|
||||
}
|
||||
|
||||
@@ -3204,8 +3214,8 @@ namespace DSPRE {
|
||||
collisionPainterPictureBox.Image = new Bitmap(100, 100);
|
||||
typePainterPictureBox.Image = new Bitmap(100, 100);
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
mapPartsTabControl.TabPages.Remove(bgsTabPage);
|
||||
break;
|
||||
default:
|
||||
@@ -3222,8 +3232,8 @@ namespace DSPRE {
|
||||
for (int i = 0; i < mapCount; i++) {
|
||||
using (DSUtils.EasyReader reader = new DSUtils.EasyReader(RomInfo.gameDirs[DirNames.maps].unpackedDir + "\\" + i.ToString("D4"))) {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
reader.BaseStream.Position = 0x10 + reader.ReadUInt32() + reader.ReadUInt32();
|
||||
break;
|
||||
default:
|
||||
@@ -3288,12 +3298,12 @@ namespace DSPRE {
|
||||
selectMapComboBox.SelectedIndex = 0;
|
||||
exteriorbldRadioButton.Checked = true;
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
mapTextureComboBox.SelectedIndex = 7;
|
||||
buildTextureComboBox.SelectedIndex = 1;
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
mapTextureComboBox.SelectedIndex = 3;
|
||||
buildTextureComboBox.SelectedIndex = 1;
|
||||
break;
|
||||
@@ -3328,12 +3338,12 @@ namespace DSPRE {
|
||||
UpdateMapBinAndRefresh(temp, "Map BIN imported successfully!");
|
||||
return;
|
||||
} else {
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
//If HGSS didn't work try reading as Platinum Map
|
||||
temp = new MapFile(of.FileName, gFamEnum.Plat, false);
|
||||
temp = new MapFile(of.FileName, GameFamilies.Plat, false);
|
||||
} else {
|
||||
//If Plat didn't work try reading as HGSS Map
|
||||
temp = new MapFile(of.FileName, gFamEnum.HGSS, false);
|
||||
temp = new MapFile(of.FileName, GameFamilies.HGSS, false);
|
||||
}
|
||||
|
||||
if (temp.correctnessFlag) {
|
||||
@@ -3723,7 +3733,7 @@ namespace DSPRE {
|
||||
modelSizeLBL.Text = currentMapFile.mapModelData.Length.ToString() + " B";
|
||||
terrainSizeLBL.Text = currentMapFile.bdhc.Length.ToString() + " B";
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
BGSSizeLBL.Text = currentMapFile.bgs.Length.ToString() + " B";
|
||||
}
|
||||
}
|
||||
@@ -4715,7 +4725,7 @@ namespace DSPRE {
|
||||
#region BDHC I/O
|
||||
private void bdhcImportButton_Click(object sender, EventArgs e) {
|
||||
OpenFileDialog it = new OpenFileDialog() {
|
||||
Filter = RomInfo.gameFamily == gFamEnum.DP ? MapFile.BDHCFilter : MapFile.BDHCamFilter
|
||||
Filter = RomInfo.gameFamily == GameFamilies.DP ? MapFile.BDHCFilter : MapFile.BDHCamFilter
|
||||
};
|
||||
|
||||
if (it.ShowDialog(this) != DialogResult.OK) {
|
||||
@@ -4729,7 +4739,7 @@ namespace DSPRE {
|
||||
private void bdhcExportButton_Click(object sender, EventArgs e) {
|
||||
SaveFileDialog sf = new SaveFileDialog {
|
||||
FileName = selectMapComboBox.SelectedItem.ToString(),
|
||||
Filter = RomInfo.gameFamily == gFamEnum.DP ? MapFile.BDHCFilter : MapFile.BDHCamFilter
|
||||
Filter = RomInfo.gameFamily == GameFamilies.DP ? MapFile.BDHCFilter : MapFile.BDHCamFilter
|
||||
};
|
||||
|
||||
if (sf.ShowDialog(this) != DialogResult.OK) {
|
||||
@@ -4852,7 +4862,7 @@ namespace DSPRE {
|
||||
|
||||
Dictionary<ushort, ushort> dict = new Dictionary<ushort, ushort>();
|
||||
|
||||
if (gameFamily.Equals(gFamEnum.DP)) {
|
||||
if (gameFamily.Equals(GameFamilies.DP)) {
|
||||
foreach (ushort headerID in result) {
|
||||
HeaderDP hdp = (HeaderDP)MapHeader.LoadFromARM9(headerID);
|
||||
|
||||
@@ -5082,7 +5092,7 @@ namespace DSPRE {
|
||||
MW_LoadModelTextures(eventMapFile.mapModel, RomInfo.gameDirs[DirNames.mapTextures].unpackedDir, areaData.mapTileset);
|
||||
|
||||
bool isInteriorMap = false;
|
||||
if ((RomInfo.gameVersion == gVerEnum.HeartGold || RomInfo.gameVersion == gVerEnum.SoulSilver) && areaData.areaType == 0x0)
|
||||
if ((RomInfo.gameVersion == GameVersions.HeartGold || RomInfo.gameVersion == GameVersions.SoulSilver) && areaData.areaType == 0x0)
|
||||
isInteriorMap = true;
|
||||
|
||||
for (int i = 0; i < eventMapFile.buildings.Count; i++) {
|
||||
@@ -5303,15 +5313,15 @@ namespace DSPRE {
|
||||
RomInfo.SetOWtable();
|
||||
RomInfo.Set3DOverworldsDict();
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
DSUtils.TryUnpackNarcs(new List<DirNames> { DirNames.interiorBuildingModels });
|
||||
}
|
||||
|
||||
disableHandlers = true;
|
||||
if (File.Exists(RomInfo.OWtablePath)) {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
break;
|
||||
default:
|
||||
// HGSS Overlay 1 must be decompressed in order to read the overworld table
|
||||
@@ -6381,13 +6391,13 @@ namespace DSPRE {
|
||||
|
||||
int locNum;
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP: {
|
||||
case GameFamilies.DP: {
|
||||
HeaderDP h = (HeaderDP)destHeader;
|
||||
|
||||
locNum = h.locationName;
|
||||
break;
|
||||
}
|
||||
case gFamEnum.Plat: {
|
||||
case GameFamilies.Plat: {
|
||||
HeaderPt h = (HeaderPt)destHeader;
|
||||
|
||||
locNum = h.locationName;
|
||||
@@ -8134,8 +8144,8 @@ namespace DSPRE {
|
||||
string[] lightTypes;
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
lightTypes = new string[3] { "Day/Night Light", "Model's light", "Unknown Light" };
|
||||
break;
|
||||
default:
|
||||
@@ -8363,7 +8373,7 @@ namespace DSPRE {
|
||||
areaDataLightTypeComboBox.SelectedIndex = currentAreaData.lightType;
|
||||
|
||||
disableHandlers = true;
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
areaDataDynamicTexturesNumericUpDown.Value = currentAreaData.dynamicTextureType;
|
||||
|
||||
bool interior = currentAreaData.areaType == 0;
|
||||
@@ -8540,7 +8550,7 @@ namespace DSPRE {
|
||||
|
||||
overlayCameraTblOffset = RAMaddresses[0] - DSUtils.GetOverlayRAMAddress(RomInfo.cameraTblOverlayNumber);
|
||||
using (DSUtils.EasyReader br = new DSUtils.EasyReader(camOverlayPath, overlayCameraTblOffset)) {
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
currentCameraTable = new GameCamera[17];
|
||||
for (int i = 0; i < currentCameraTable.Length; i++) {
|
||||
currentCameraTable[i] = new GameCamera(br.ReadUInt32(), br.ReadInt16(), br.ReadInt16(), br.ReadInt16(),
|
||||
@@ -8690,7 +8700,7 @@ namespace DSPRE {
|
||||
|
||||
uint entrySize = 4;
|
||||
uint tableSizeOffset = 10;
|
||||
if (gameFamily == gFamEnum.HGSS) {
|
||||
if (gameFamily == GameFamilies.HGSS) {
|
||||
entrySize += 2;
|
||||
tableSizeOffset += 2;
|
||||
encounterSSEQAltUpDown.Enabled = true;
|
||||
@@ -8702,7 +8712,7 @@ namespace DSPRE {
|
||||
uint entryOffset = (uint)ar.BaseStream.Position;
|
||||
byte tclass = (byte)ar.ReadUInt16();
|
||||
ushort musicD = ar.ReadUInt16();
|
||||
ushort? musicN = gameFamily == gFamEnum.HGSS ? ar.ReadUInt16() : (ushort?)null;
|
||||
ushort? musicN = gameFamily == GameFamilies.HGSS ? ar.ReadUInt16() : (ushort?)null;
|
||||
trainerClassEncounterMusicDict[tclass] = (entryOffset, musicD, musicN);
|
||||
}
|
||||
}
|
||||
@@ -8846,7 +8856,7 @@ namespace DSPRE {
|
||||
pokemonSpecies[i] = new SpeciesFile(new FileStream(RomInfo.gameDirs[DirNames.personalPokeData].unpackedDir + "\\" + i.ToString("D4"), FileMode.Open));
|
||||
}
|
||||
|
||||
if (gameFamily == gFamEnum.HGSS) {
|
||||
if (gameFamily == GameFamilies.HGSS) {
|
||||
foreach (ComboBox partyGenderComboBox in partyGenderComboBoxList) {
|
||||
partyGenderComboBox.Visible = true;
|
||||
partyGenderComboBox.Items.Add("Default Gender");
|
||||
@@ -8858,7 +8868,7 @@ namespace DSPRE {
|
||||
partyGenderComboBox.Visible = false;
|
||||
}
|
||||
|
||||
if (gameFamily == gFamEnum.DP) {
|
||||
if (gameFamily == GameFamilies.DP) {
|
||||
foreach (ComboBox partyFormComboBox in partyFormComboBoxList)
|
||||
partyFormComboBox.Visible = false;
|
||||
|
||||
@@ -9165,7 +9175,7 @@ namespace DSPRE {
|
||||
|
||||
currentTrainerFile.party[i].difficulty = (byte)partyIVUpdownList[i].Value;
|
||||
|
||||
if (hasMoreThanOneGender((int)currentTrainerFile.party[i].pokeID, pokemonSpecies) && gameFamily == gFamEnum.HGSS) {
|
||||
if (hasMoreThanOneGender((int)currentTrainerFile.party[i].pokeID, pokemonSpecies) && gameFamily == GameFamilies.HGSS) {
|
||||
switch (partyGenderComboBoxList[i].SelectedIndex) {
|
||||
case TRAINER_PARTY_POKEMON_GENDER_DEFAULT_INDEX:
|
||||
currentTrainerFile.party[i].genderAndAbilityFlags = PartyPokemon.GenderAndAbilityFlags.NO_FLAGS;
|
||||
@@ -9280,7 +9290,7 @@ namespace DSPRE {
|
||||
encounterSSEQMainUpDown.Value = 0;
|
||||
}
|
||||
|
||||
eyeContactMusicAltLabel.Enabled = encounterSSEQAltUpDown.Enabled = (encounterSSEQMainUpDown.Enabled && gameFamily == gFamEnum.HGSS);
|
||||
eyeContactMusicAltLabel.Enabled = encounterSSEQAltUpDown.Enabled = (encounterSSEQMainUpDown.Enabled && gameFamily == GameFamilies.HGSS);
|
||||
encounterSSEQAltUpDown.Value = output.musicN != null ? (ushort)output.musicN : 0;
|
||||
currentTrainerFile.trp.trainerClass = (byte)selection;
|
||||
}
|
||||
@@ -9294,7 +9304,7 @@ namespace DSPRE {
|
||||
string tilesFilename = tilesFileID.ToString("D4");
|
||||
trainerTile = new NCGR(gameDirs[DirNames.trainerGraphics].unpackedDir + "\\" + tilesFilename, tilesFileID, tilesFilename);
|
||||
|
||||
if (gameFamily == gFamEnum.DP) {
|
||||
if (gameFamily == GameFamilies.DP) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -9447,7 +9457,7 @@ namespace DSPRE {
|
||||
}
|
||||
disableHandlers = false;
|
||||
|
||||
if (gameFamily.Equals(gFamEnum.HGSS) && tableEditorIsReady) {
|
||||
if (gameFamily.Equals(GameFamilies.HGSS) && tableEditorIsReady) {
|
||||
pbEffectsTrainerCombobox.Items[selectedTrClass] = trainerClassListBox.Items[selectedTrClass];
|
||||
for (int i = 0; i < vsTrainerEffectsList.Count; i++) {
|
||||
if (vsTrainerEffectsList[i].trainerClass == selectedTrClass) {
|
||||
@@ -9483,7 +9493,7 @@ namespace DSPRE {
|
||||
partyAbilityComboBoxList[partyPokemonPosition].Items.Add(ability1);
|
||||
|
||||
//if the name " -" is returned for ability 2 then there is no ability 2
|
||||
if (ability2.Equals(" -") || ability2.Equals(ability1) || gameFamily != gFamEnum.HGSS) {
|
||||
if (ability2.Equals(" -") || ability2.Equals(ability1) || gameFamily != GameFamilies.HGSS) {
|
||||
partyAbilityComboBoxList[partyPokemonPosition].Enabled = false;
|
||||
} else {
|
||||
partyAbilityComboBoxList[partyPokemonPosition].Items.Add(ability2);
|
||||
@@ -9497,7 +9507,7 @@ namespace DSPRE {
|
||||
int currentPokemonGenderRatio = pokemonSpecies[partyPokemonComboboxList[partyPokemonPosition].SelectedIndex].GenderRatioMaleToFemale;
|
||||
PartyPokemon.GenderAndAbilityFlags currentPokemonGenderAndAbilityFlags = currentTrainerFile.party[partyPokemonPosition].genderAndAbilityFlags;
|
||||
|
||||
if (gameFamily == gFamEnum.HGSS) {
|
||||
if (gameFamily == GameFamilies.HGSS) {
|
||||
switch (currentPokemonGenderRatio) {
|
||||
case GENDER_RATIO_MALE:
|
||||
partyGenderComboBoxList[partyPokemonPosition].SelectedIndex = TRAINER_PARTY_POKEMON_GENDER_MALE_INDEX;
|
||||
@@ -9530,7 +9540,7 @@ namespace DSPRE {
|
||||
|
||||
switch (pokemonID) {
|
||||
case PICHU_ID_NUM:
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
pokemonFormNames.Add("Non-Spiky-Eared");
|
||||
pokemonFormNames.Add("Spiky-Eared");
|
||||
} else {
|
||||
@@ -9588,7 +9598,7 @@ namespace DSPRE {
|
||||
}
|
||||
|
||||
private void setTrainerPartyPokemonForm(int partyPokemonPosition) {
|
||||
if (gameFamily != gFamEnum.DP) {
|
||||
if (gameFamily != GameFamilies.DP) {
|
||||
partyFormComboBoxList[partyPokemonPosition].Items.Clear();
|
||||
List<string> currentPokemonFormName = getPokemonFormNames(partyPokemonComboboxList[partyPokemonPosition].SelectedIndex);
|
||||
foreach (string formName in currentPokemonFormName)
|
||||
@@ -9627,7 +9637,7 @@ namespace DSPRE {
|
||||
|
||||
private void SetupConditionalMusicTable() {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
RomInfo.SetConditionalMusicTableOffsetToRAMAddress();
|
||||
conditionalMusicTable = new List<(ushort, ushort, ushort)>();
|
||||
|
||||
@@ -9656,7 +9666,7 @@ namespace DSPRE {
|
||||
}
|
||||
break;
|
||||
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
pbEffectsMonGroupBox.Enabled = false;
|
||||
pbEffectsTrainerGroupBox.Enabled = false;
|
||||
conditionalMusicGroupBox.Enabled = false;
|
||||
@@ -9671,7 +9681,7 @@ namespace DSPRE {
|
||||
}
|
||||
}
|
||||
private void SetupBattleEffectsTables() {
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS || RomInfo.gameFamily == gFamEnum.Plat) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS || RomInfo.gameFamily == GameFamilies.Plat) {
|
||||
DSUtils.TryUnpackNarcs(new List<DirNames> {
|
||||
DirNames.trainerGraphics,
|
||||
DirNames.textArchives,
|
||||
@@ -9688,7 +9698,7 @@ namespace DSPRE {
|
||||
|
||||
byte comboTableEntriesCount;
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
comboTableEntriesCount = DSUtils.ARM9.ReadByte(RomInfo.effectsComboTableOffsetToSizeLimiter);
|
||||
|
||||
vsPokemonEffectsList = new List<(int pokemonID, int comboID)>();
|
||||
@@ -9721,7 +9731,7 @@ namespace DSPRE {
|
||||
|
||||
String expArmPath = RomInfo.gameDirs[DirNames.synthOverlay].unpackedDir + '\\' + ROMToolboxDialog.expandedARMfileID.ToString("D4");
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
using (DSUtils.EasyReader ar = new DSUtils.EasyReader(ROMToolboxDialog.flag_TrainerClassBattleTableRepointed ? expArmPath : RomInfo.arm9Path, vsTrainerTableStartAddress)) {
|
||||
byte trainerTableEntriesCount = DSUtils.ARM9.ReadByte(RomInfo.vsTrainerEntryTableOffsetToSizeLimiter);
|
||||
|
||||
@@ -9763,7 +9773,7 @@ namespace DSPRE {
|
||||
}
|
||||
}
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
var items = pbEffectsCombosListbox.Items.Cast<Object>().ToArray();
|
||||
|
||||
pbEffectsPokemonChooseMainCombobox.Items.Clear();
|
||||
@@ -9818,13 +9828,13 @@ namespace DSPRE {
|
||||
|
||||
MapHeader selected = MapHeader.LoadFromARM9(newTuple.header);
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
locationNameConditionalMusicLBL.Text = RomInfo.GetLocationNames()[(selected as HeaderDP).locationName];
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
locationNameConditionalMusicLBL.Text = RomInfo.GetLocationNames()[(selected as HeaderPt).locationName];
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
locationNameConditionalMusicLBL.Text = RomInfo.GetLocationNames()[(selected as HeaderHGSS).locationName];
|
||||
break;
|
||||
}
|
||||
@@ -9880,7 +9890,7 @@ namespace DSPRE {
|
||||
string updatedEntry = "Combo " + index.ToString("D2") + " - " + "Effect #" + battleIntroEffect + ", " + "Music #" + battleMusic;
|
||||
pbEffectsCombosListbox.Items[index] = updatedEntry;
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
pbEffectsTrainerChooseMainCombobox.Items[index] = pbEffectsPokemonChooseMainCombobox.Items[index] = updatedEntry;
|
||||
}
|
||||
disableHandlers = false;
|
||||
@@ -9921,7 +9931,7 @@ namespace DSPRE {
|
||||
|
||||
private void HOWpbEffectsTableButton_Click(object sender, EventArgs e) {
|
||||
MessageBox.Show("An entry of this table is a combination of VS. Graphics + Battle Theme.\n\n" +
|
||||
(RomInfo.gameFamily.Equals(gFamEnum.HGSS) ? "Each entry can be \"inherited\" by one or more Pokémon or Trainer classes." : ""),
|
||||
(RomInfo.gameFamily.Equals(GameFamilies.HGSS) ? "Each entry can be \"inherited\" by one or more Pokémon or Trainer classes." : ""),
|
||||
"How this table works", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
|
||||
|
||||
@@ -1036,96 +1036,6 @@
|
||||
p3S+M+m1V1me9QgCUQNXX2YRT1sYHBiEP3wHVbp3PF3cB40GbrzN86xHENrScf1NDsl8FaI4jODMHOgS
|
||||
SOacfYAmbr5XeNYjGH7yDReXv+JeNIUhUYwFpmZjDz+nMLf5B3b2rcZ5tju4ntjtFw4T54j+v2g/t9NH
|
||||
9AiCIPwGJelqUAd/T3AAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="mainTabImageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>239, 17</value>
|
||||
</metadata>
|
||||
<data name="mainTabImageList.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAACM
|
||||
EgAAAk1TRnQBSQFMAgEBCgEAAaABGwGgARsBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAATADAAEBAQABCAYAAQwYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm
|
||||
AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM
|
||||
AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA
|
||||
ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz
|
||||
AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ
|
||||
AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM
|
||||
AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA
|
||||
AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA
|
||||
AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ
|
||||
AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/
|
||||
AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA
|
||||
AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm
|
||||
ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ
|
||||
Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz
|
||||
AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA
|
||||
AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM
|
||||
AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM
|
||||
ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM
|
||||
Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA
|
||||
AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM
|
||||
AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ
|
||||
AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz
|
||||
AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm
|
||||
AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw
|
||||
AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/xMABLwEAAS8KwAGvAIA
|
||||
BOkBvAMABOkBvCoAASYBHgQAArwBAATpBAAE6QG8KgABJgEeAgABJgEeAQABvAEAAukBvAIABLwBAALp
|
||||
AbwtAAG8ASYBHgMAAukBvAEABAsCvALpAbwsAAEmAR4CAAG8AgAC6QG8AgsBvAEAAgsBvALpAbwmAAO8
|
||||
AgABJgEeAgABvAMAAukBvAILArwCCwEAAukBvCUAAc0BCgEAAbwBAAEmAR4BAAHsAwABvAEAAukBvAUL
|
||||
AgAC6QG8JQABzQEKAQACvAEmAR4BAAESArwBAAG8AQAC6QG8AgsCvAMAAukBvCQAAc0BCgMAAbwBAAEm
|
||||
AR4GAALpAbwBAAILA7wBAALpAbwkAAHNAQoBEgHsAQABEgG8CAAC6QG8AgADCwIAAukBvCQAAc0BCgES
|
||||
AgABEgG8CAAC6QO8BAABvALpAbwjAAHNAQoBAAG8AwABvAgABOkBvAMABOkBvAEAAbwhAAHNAQoBAAG8
|
||||
AwAB7AG8BwAE6QQABOkBGwExAZkhAAFlGwADMT0AARsBMQEbKQAB7AESAe8FAAH0EQAKEhgAAvMC6wHv
|
||||
AewB6wHzBQAB6gH0BQAC8gH0BgADEgZKAxIUAAHzAfEBvALsAQcBvAEHAewB6wEHBAABDgESAe0EAAHw
|
||||
ASIBKQHrAfMFAAESAkoGbgJKARIDAAEPBwABDwUAAQ8BAAG8AfcB7QGSAe8BvAEHAfAB9AHyAesB6gQA
|
||||
AQ4BbQHtAwABBwEjAisBKgHrAfMDAAESAUoBbgFKBm4BSgFuAUoBEgEAAQ8J7wEPAwAB7wIAAW0C9wHw
|
||||
AbwB8wLyAvQB7QHrAQcDAAEHARUB6gPtASkBKwElAR8BJQEqAesB9AIAARIBSgFuAUoGkwFKAW4BSgES
|
||||
AgAB7wEBAR8G7wMAAu8CAAG8Ae8B8QH0AfYB8gLwAfQB9gHvAewBbQMAAfQBEAHrAUoBMAEDASUBFwH5
|
||||
AiABJQEqAeoCAAESAUoBkwFuBkkBbgGTAUoBEgIAAe8CAQEfBe8BAAIPAu8CAAHyAe8C9gH3AW0B6wHy
|
||||
AfQB9gHzAesB7AEHAgAB9AEQAXMBRQEkASAB+QEXAfkBIAEfASABMQEiAfQBAAESAZMBbgFJBmwBSQFu
|
||||
AZMBEgIAAe8BAQEfBu8DAALvAwAB7wHzAbwBkgHwAfcB9gH3Ae0BBwHrAewB7wMAAfIBEQFFAR8CIAH5
|
||||
ARcB+QEgAR8BMQEiAfQBAAESAZMBSQJsBHECbAFJAZMBEgEAAQ8J7wEPAwAB7wMAAQcB8AFEASUBGgKS
|
||||
AfIC8wH0ARIB6wHyAgAB8gFDAewBRQEfASAB+QEXASYBMQE3ATABFAIAAUkBbgFsAXEBlwRxAZcBcQFs
|
||||
AW4BEgIAAQ8HAAEPBQABDwIAAfQBbQEsASUB6wH0AvEC7wHyAusBvAIAAfMBbQHrAUUBHwIgAfkBMQFR
|
||||
Am0B8wIAAUkCbAGXAnEClwJxAZcCbAFJAgABFQEPARUDAAEVAQ8BFQgAARwBLAErAeoBBwG8Au8B9AK8
|
||||
AfMCbQMAAfABEwFFAR8BJAIrAVEBvAUAAUkBbAJxBpcCcQFsAUkBAAEVAfcBBwH3ARUBAAEVAfcBBwH3
|
||||
ARUGAAHvAisBSwHvAQcBvAHxBAcB9AGLAeoDAAHwAREBSwEkASMBAwFKAfAHAAFsAXEDlwJ4A5cBcQFs
|
||||
AgABDwEHAQABBwEPAQABDwEHAQABBwEPBQAB7wErASwBRQK8AQcB7wEHAbwB8AEZAtsBbAEHAwAB8AEj
|
||||
AisBDgHwAfEIAAFJAXEClwF4BZcBcQFJAgABFQH3AQcB9wEVAQABFQH3AQcB9wEVBQABEgEsAUUB8gHz
|
||||
Ae8B8gHxAbsC2gGzAosB8wQAAfABIwE3ATEBDgsAAUkBcQKXAXgDlwFxAUkEAAEVAQ8BFQMAARUBDwEV
|
||||
BwABEgG8AgABBwGzAdQBswJsAe8IAAHvAg4B8wwAAWwBcQSXAXEBbBkAAQcCEgG8HQAEcRcAAfQL8wH0
|
||||
EwAN8xMAAQcL7wEHAgAPEAEAAQcNswEHBwAEQwcAAe8BAAG7BrMBuwIAAe8CAAEQBjgBEAbTARABAAGz
|
||||
DQABswUAAkME8AJDBQAB7wEAAbMGAAGzAgAB7wIAARACOAMAATgBEALTAgAC0wEQAQABsw0AAbMEAAFD
|
||||
CPABQwQAAe8BAAGtAQABlwJWAZcBAAGzAgAB7wIAARADOAEAAjgBEAHTAQAC0wEAAdMBEAEAAbMBAAFW
|
||||
CVABVgEAAbMDAAFDA/ABkgJDAZID8AFDAwAB7wEAAa0BAARWAQABswH0AQAB7wIAARACOAIAAjgBEAHT
|
||||
AQAC0wEAAdMBEAEAAbMBAAtWAQABswMAAUMB8AGSARIBQwHwAZIBQwESAZIB8AFDAwAB7wEAAa0BAARW
|
||||
AQABswH0AQAB7wIAARADOAEAAjgBEALTAgAC0wEQAQABswEAC1YBAAGzAgABQwHwARICYwFDAQAB8AFD
|
||||
AmMBEgHwAUMCAAHvAQABrQEABHgBAAGzAfQBAAHvAgABEAY4ARAG0wEQAQABswEAC1YBAAGzAgABQwES
|
||||
BEcCQwRHARIBQwIAAe8BAAGtBgABswHzAQAB7wIADxABAAGzAQALVgEAAbMCAAFDDEcBQwIAAe8BAAG7
|
||||
Aq0EswG7AfMBAAHvAgABEAZHARAGAAEQAQABswEAC1YBAAGzAgABQwxHAUMCAAHvAQAB8wP0AfMB9AQA
|
||||
Ae8CAAEQAkcCAAJHARAGAAEQAQABswEAC1YBAAGzAwABQwJHApQGRwFDAwAB7wEAAXQCMgEsAXQBAAG8
|
||||
AvcBAAHvAgABEAFHAQACRwEAAUcBEAYAARABAAGzAQABVgl4AVYBAAGzAwABQwFHBJQFRwFDAwAB7wEA
|
||||
ASwDwwFTAQAB9wIAAfMB8AIAARABRwEAAkcBAAFHARAGAAEQAQABswEAC3gBAAGzBAABQwSUBEcBQwQA
|
||||
Ae8BAAF0AywBdAEAAfcBAAHzAfADAAEQAkcCAAJHARAGAAEQAQABswEAC3gBAAGzBQACQwGUA0cCQwUA
|
||||
Ae8IAAHzAfAEAAEQBkcBEAYAARABAAGzDQABswcABEMHAAEHCO8BBwUADxABAAEJDbMBCREAAUIBTQE+
|
||||
BwABPgMAASgDAAFAAwABMAMAAQEBAAEBBQABgAEBFgAD/wEAAv8CwwQAAf8BgQKDBAAB/wEAAYcBgwQA
|
||||
Af8BMAGMASMEAAH/AeEBiAEDBAAB/wHBAYEBAwQAAfEBgwGAASMEAAHhAQ4BgAFjBAAB4AEAAYAB4wQA
|
||||
AcABgQGIASMEAAHAAX8BjAFjBAABxAF/AYMBwwQAAYQBfwGDAYIEAAGEAT8BhwGABAABjAF/Af8B+AQA
|
||||
A/8B+AQAAf8BjwG/Af8B4AEHAv8B+AEHAo8BwAEDAv8BwAEHAY8BBwHAAQMBgAE8AYABBwGOAQMBgAEB
|
||||
AQABGAGAAQMBgAEBAYABAQIAAYABAwGAAQEBgAEBAgABgAEBAYABAAGAAQECAAHAAQEBwAEAAYABAQEA
|
||||
ARgBwAEAAcABAQGAAQEBgAE8AcABAAHAAQEBgAEBAY4BPwHAAQAB4AEPAYABAQEEAR8BgAEAAeABHwHA
|
||||
AQMBJAGfAgAB4AE/AcABAwEEAR8BAAEBAeAB/wHgAQcBjgE/AZgBDwHwAf8B8AEPAv8B+AF/Av8B/AE/
|
||||
Av8BgAEDAv8BgAEDAv8BgAEDAQABAQEAAQEB/AE/AaABGwEAAQEBfwH9AfABDwGvAdsBAAExAX8B/QHg
|
||||
AQcBqAFbAQABSQFAAQUBwAEDAagBSwEAAUkBQAEFAcABAwGoAUsBAAExAUABBQGBAQEBqAFLAQABAQFA
|
||||
AQUBgAEBAa8BywEAAQEBQAEFAYABAQGgAQsBAAH9AUABBQGAAQEBoAF7ARgBxQFAAQUBwAEDAaABiwEk
|
||||
Ae0BQAEFAcABAwGgAbMBJAHNAUABBQHgAQcBoAGnARgB7QFAAQUB8AEPAb8BzwEAAf0BfwH9AfwBPwGA
|
||||
AR8BAAEBAQABAQL/Cw==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
|
||||
@@ -14,12 +14,6 @@ namespace DSPRE {
|
||||
public partial class PokemonEditor : Form {
|
||||
public PokemonEditor(string[] itemNames, string[] abilityNames, string[] moveNames) {
|
||||
InitializeComponent();
|
||||
foreach (var cb in Controls.OfType<ComboBox>()) {
|
||||
cb.Resize += (sender, e) => {
|
||||
if (!cb.Focused)
|
||||
cb.SelectionLength = 0;
|
||||
};
|
||||
}
|
||||
IsMdiContainer = true;
|
||||
|
||||
PersonalDataEditor personalEditor = new PersonalDataEditor(itemNames, abilityNames, evoPage);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace DSPRE.ROMFiles {
|
||||
buildingsTileset = reader.ReadUInt16();
|
||||
mapTileset = reader.ReadUInt16();
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
dynamicTextureType = reader.ReadUInt16();
|
||||
areaType = reader.ReadByte();
|
||||
lightType = reader.ReadByte();
|
||||
@@ -44,7 +44,7 @@ namespace DSPRE.ROMFiles {
|
||||
writer.Write(buildingsTileset);
|
||||
writer.Write(mapTileset);
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
writer.Write(dynamicTextureType);
|
||||
writer.Write(areaType);
|
||||
writer.Write((byte)lightType);
|
||||
|
||||
@@ -76,9 +76,9 @@ namespace DSPRE.ROMFiles {
|
||||
#endregion
|
||||
|
||||
#region Constructors (1)
|
||||
public MapFile(string path, gFamEnum gFamily, bool discardMoveperms = false, bool showMessages = true) : this (new FileStream(path, FileMode.Open), gFamily, discardMoveperms, showMessages) {}
|
||||
public MapFile(int mapNumber, gFamEnum gFamily, bool discardMoveperms = false, bool showMessages = true) : this(RomInfo.gameDirs[DirNames.maps].unpackedDir + "\\" + mapNumber.ToString("D4"), gFamily, discardMoveperms, showMessages) { }
|
||||
public MapFile(Stream data, gFamEnum gFamily, bool discardMoveperms = false, bool showMessages = true) {
|
||||
public MapFile(string path, GameFamilies gFamily, bool discardMoveperms = false, bool showMessages = true) : this (new FileStream(path, FileMode.Open), gFamily, discardMoveperms, showMessages) {}
|
||||
public MapFile(int mapNumber, GameFamilies gFamily, bool discardMoveperms = false, bool showMessages = true) : this(RomInfo.gameDirs[DirNames.maps].unpackedDir + "\\" + mapNumber.ToString("D4"), gFamily, discardMoveperms, showMessages) { }
|
||||
public MapFile(Stream data, GameFamilies gFamily, bool discardMoveperms = false, bool showMessages = true) {
|
||||
using (BinaryReader reader = new BinaryReader(data)) {
|
||||
/* Read sections lengths */
|
||||
int permissionsSectionLength = reader.ReadInt32();
|
||||
@@ -87,7 +87,7 @@ namespace DSPRE.ROMFiles {
|
||||
int bdhcSectionLength = reader.ReadInt32();
|
||||
|
||||
/* Read background sounds section */
|
||||
if (gFamily == gFamEnum.HGSS) { //Map must be loaded as HGSS
|
||||
if (gFamily == GameFamilies.HGSS) { //Map must be loaded as HGSS
|
||||
ushort bgsSignature = reader.ReadUInt16();
|
||||
if (bgsSignature == 0x1234) {
|
||||
ushort bgsDataLength = reader.ReadUInt16();
|
||||
@@ -227,7 +227,7 @@ namespace DSPRE.ROMFiles {
|
||||
writer.Write(bdhc.Length);
|
||||
|
||||
/* Write soundplate section for HG/SS */
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
writer.Write(bgs);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,32 +128,32 @@ namespace DSPRE.ROMFiles {
|
||||
#endregion Fields
|
||||
|
||||
#region Methods (1)
|
||||
public static MapHeader LoadFromByteArray(byte[] headerData, ushort headerNumber, gFamEnum gameFamily = gFamEnum.NULL) {
|
||||
public static MapHeader LoadFromByteArray(byte[] headerData, ushort headerNumber, GameFamilies gameFamily = GameFamilies.NULL) {
|
||||
/* Encapsulate header data into the class appropriate for the gameVersion */
|
||||
if (headerData.Length < MapHeader.length) {
|
||||
MessageBox.Show("File of header " + headerNumber + " is too small and can't store header data.", "Header file too small", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return null;
|
||||
}
|
||||
|
||||
if (gameFamily == gFamEnum.NULL) {
|
||||
if (gameFamily == GameFamilies.NULL) {
|
||||
gameFamily = RomInfo.gameFamily;
|
||||
}
|
||||
|
||||
switch (gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
return new HeaderDP(headerNumber, new MemoryStream(headerData));
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
return new HeaderPt(headerNumber, new MemoryStream(headerData));
|
||||
default:
|
||||
return new HeaderHGSS(headerNumber, new MemoryStream(headerData));
|
||||
}
|
||||
}
|
||||
public static MapHeader LoadFromFile(string filename, ushort headerNumber, long offsetInFile, gFamEnum gameFamily = gFamEnum.NULL) {
|
||||
public static MapHeader LoadFromFile(string filename, ushort headerNumber, long offsetInFile, GameFamilies gameFamily = GameFamilies.NULL) {
|
||||
/* Calculate header offset and load data */
|
||||
byte[] headerData = DSUtils.ReadFromFile(filename, offsetInFile, MapHeader.length);
|
||||
return LoadFromByteArray(headerData, headerNumber, gameFamily);
|
||||
}
|
||||
public static MapHeader LoadFromARM9(ushort headerNumber, gFamEnum gameFamily = gFamEnum.NULL) {
|
||||
public static MapHeader LoadFromARM9(ushort headerNumber, GameFamilies gameFamily = GameFamilies.NULL) {
|
||||
long headerOffset = RomInfo.headerTableOffset + MapHeader.length * headerNumber;
|
||||
return LoadFromFile(RomInfo.arm9Path, headerNumber, headerOffset, gameFamily);
|
||||
}
|
||||
|
||||
@@ -90,42 +90,42 @@ namespace DSPRE.ROMFiles {
|
||||
break;
|
||||
|
||||
case 0x00B0: // Warp [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.HGSS)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Warp(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0152: // SetOverworldDefaultPosition [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.HGSS)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_TwoParams(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0153: // SetOverworldPosition [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.HGSS)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_3Coords_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0154: // SetOverworldDefaultMovement [HGSS]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.HGSS)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_Move(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0155: // SetOverworldDefaultDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.HGSS)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0158: // SetOverworldDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.HGSS)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.HGSS)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
@@ -133,42 +133,42 @@ namespace DSPRE.ROMFiles {
|
||||
break;
|
||||
|
||||
case 0x00BE: // Warp [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.DP) || RomInfo.gameFamily.Equals(RomInfo.gFamEnum.Plat)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Warp(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0186: // SetOverworldDefaultPosition [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.DP) || RomInfo.gameFamily.Equals(RomInfo.gFamEnum.Plat)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_TwoParams(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0187: // SetOverworldPosition [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.DP) || RomInfo.gameFamily.Equals(RomInfo.gFamEnum.Plat)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_3Coords_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0188: // SetOverworldDefaultMovement [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.DP) || RomInfo.gameFamily.Equals(RomInfo.gFamEnum.Plat)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_Move(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x0189: // SetOverworldDefaultDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.DP) || RomInfo.gameFamily.Equals(RomInfo.gFamEnum.Plat)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
break;
|
||||
case 0x018C: // SetOverworldDirection [DPPt]
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.gFamEnum.DP) || RomInfo.gameFamily.Equals(RomInfo.gFamEnum.Plat)) {
|
||||
if (RomInfo.gameFamily.Equals(RomInfo.GameFamilies.DP) || RomInfo.gameFamily.Equals(RomInfo.GameFamilies.Plat)) {
|
||||
name += FormatCmd_Overworld_Dir(parametersList);
|
||||
} else {
|
||||
goto default;
|
||||
|
||||
@@ -211,8 +211,8 @@ namespace DSPRE.ROMFiles {
|
||||
|
||||
/* How to read parameters for different commands for DPPt*/
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.DP:
|
||||
case GameFamilies.Plat:
|
||||
switch (id) {
|
||||
case 0x16: //Jump
|
||||
case 0x1A: //Call
|
||||
@@ -318,7 +318,7 @@ namespace DSPRE.ROMFiles {
|
||||
}
|
||||
break;
|
||||
case 0x2C5: {
|
||||
if (RomInfo.gameVersion == gVerEnum.Platinum) {
|
||||
if (RomInfo.gameVersion == GameVersions.Platinum) {
|
||||
parameterList.Add(dataReader.ReadBytes(2));
|
||||
parameterList.Add(dataReader.ReadBytes(2));
|
||||
} else {
|
||||
@@ -330,13 +330,13 @@ namespace DSPRE.ROMFiles {
|
||||
case 0x2C9:
|
||||
case 0x2CA:
|
||||
case 0x2CD:
|
||||
if (RomInfo.gameVersion == gVerEnum.Platinum) {
|
||||
if (RomInfo.gameVersion == GameVersions.Platinum) {
|
||||
break;
|
||||
} else {
|
||||
goto default;
|
||||
}
|
||||
case 0x2CF:
|
||||
if (RomInfo.gameVersion == gVerEnum.Platinum) {
|
||||
if (RomInfo.gameVersion == GameVersions.Platinum) {
|
||||
parameterList.Add(dataReader.ReadBytes(2));
|
||||
parameterList.Add(dataReader.ReadBytes(2));
|
||||
} else {
|
||||
@@ -348,7 +348,7 @@ namespace DSPRE.ROMFiles {
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
switch (id) {
|
||||
case 0x16: //Jump
|
||||
case 0x1A: //Call
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace DSPRE.ROMFiles {
|
||||
writer.Write(move);
|
||||
}
|
||||
}
|
||||
if (RomInfo.gameFamily == RomInfo.gFamEnum.HGSS || RomInfo.gameFamily == RomInfo.gFamEnum.Plat)
|
||||
if (RomInfo.gameFamily == RomInfo.GameFamilies.HGSS || RomInfo.gameFamily == RomInfo.GameFamilies.Plat)
|
||||
writer.Write(ballSeals); // Diamond and Pearl apparently dont save ball capsule data in enemy trainer pokedata!!!
|
||||
}
|
||||
return newData.ToArray();
|
||||
@@ -249,7 +249,7 @@ namespace DSPRE.ROMFiles {
|
||||
}
|
||||
|
||||
|
||||
if (RomInfo.gameFamily == RomInfo.gFamEnum.HGSS || RomInfo.gameFamily == RomInfo.gFamEnum.Plat)
|
||||
if (RomInfo.gameFamily == RomInfo.GameFamilies.HGSS || RomInfo.gameFamily == RomInfo.GameFamilies.Plat)
|
||||
content[i] = new PartyPokemon(difficulty, genderAndAbilityFlags, level, pokemon, form_no, reader.ReadUInt16(), heldItem, moves);
|
||||
else
|
||||
content[i] = new PartyPokemon(difficulty, level, pokemon, heldItem, moves); // Diamond and Pearl apparently dont save ball capsule data in enemy trainer pokedata!!!
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace DSPRE {
|
||||
|
||||
CheckStandardizedItems();
|
||||
|
||||
if (RomInfo.gameLanguage == gLangEnum.English || RomInfo.gameLanguage == gLangEnum.Spanish) {
|
||||
if (RomInfo.gameLanguage == GameLanguages.English || RomInfo.gameLanguage == GameLanguages.Spanish) {
|
||||
CheckARM9ExpansionApplied();
|
||||
} else {
|
||||
DisableARM9patch("Unsupported\nlanguage");
|
||||
@@ -50,31 +50,31 @@ namespace DSPRE {
|
||||
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
DisableOverlay1patch("Unsupported");
|
||||
DisableDynamicHeadersPatch("Unsupported");
|
||||
DisableMatrixExpansionPatch("Unsupported");
|
||||
DisableScrcmdRepointPatch("Unsupported");
|
||||
DisableKillTextureAnimationsPatch("Unsupported");
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
DisableOverlay1patch("Unsupported");
|
||||
DisableMatrixExpansionPatch("Unsupported");
|
||||
DisableScrcmdRepointPatch("Unsupported");
|
||||
DisableKillTextureAnimationsPatch("Unsupported");
|
||||
|
||||
if (RomInfo.gameLanguage == gLangEnum.English || RomInfo.gameLanguage == gLangEnum.Spanish) {
|
||||
if (RomInfo.gameLanguage == GameLanguages.English || RomInfo.gameLanguage == GameLanguages.Spanish) {
|
||||
CheckBDHCamPatchApplied();
|
||||
}
|
||||
CheckDynamicHeadersPatchApplied();
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
if (!DSUtils.CheckOverlayHasCompressionFlag(1)) {
|
||||
DisableOverlay1patch("Already applied");
|
||||
overlay1CB.Visible = true;
|
||||
}
|
||||
|
||||
if (RomInfo.gameLanguage == gLangEnum.English || RomInfo.gameLanguage == gLangEnum.Spanish) {
|
||||
if (RomInfo.gameLanguage == GameLanguages.English || RomInfo.gameLanguage == GameLanguages.Spanish) {
|
||||
CheckBDHCamPatchApplied();
|
||||
CheckMatrixExpansionApplied();
|
||||
CheckScrcmdRepointPatchApplied();
|
||||
@@ -264,8 +264,8 @@ namespace DSPRE {
|
||||
DisableARM9patch("Already applied");
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.Plat:
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.Plat:
|
||||
case GameFamilies.HGSS:
|
||||
BDHCamARM9requiredLBL.Visible = false;
|
||||
BDHCamPatchButton.Enabled = true;
|
||||
BDHCamPatchLBL.Enabled = true;
|
||||
@@ -364,7 +364,7 @@ namespace DSPRE {
|
||||
private void BDHCAMPatchButton_Click(object sender, EventArgs e) {
|
||||
BDHCAMPatchData data = new BDHCAMPatchData();
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
if (DSUtils.CheckOverlayHasCompressionFlag(data.overlayNumber)) {
|
||||
DialogResult d1 = MessageBox.Show("It is STRONGLY recommended to configure Overlay1 as uncompressed before proceeding.\n\n" +
|
||||
"More details in the following dialog.\n\n" + "Do you want to know more?",
|
||||
@@ -513,7 +513,7 @@ namespace DSPRE {
|
||||
};
|
||||
|
||||
//Distortion world - turnback cave Griseous Orb fix
|
||||
if (gameFamily.Equals(gFamEnum.Plat)) {
|
||||
if (gameFamily.Equals(GameFamilies.Plat)) {
|
||||
string ow9path = DSUtils.GetOverlayPath(9);
|
||||
int ow9offs = 0x8E20 + 10;
|
||||
|
||||
@@ -590,8 +590,8 @@ namespace DSPRE {
|
||||
ROMToolboxDialog.flag_arm9Expanded = true;
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.Plat:
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.Plat:
|
||||
case GameFamilies.HGSS:
|
||||
BDHCamPatchButton.Text = "Apply Patch";
|
||||
BDHCamPatchButton.Enabled = true;
|
||||
BDHCamPatchLBL.Enabled = true;
|
||||
@@ -660,7 +660,7 @@ namespace DSPRE {
|
||||
DynamicHeadersPatchData data = new DynamicHeadersPatchData();
|
||||
var headersDir = RomInfo.gameDirs[DirNames.dynamicHeaders];
|
||||
|
||||
bool specialCase = RomInfo.gameFamily == gFamEnum.HGSS && RomInfo.gameLanguage != gLangEnum.Japanese && RomInfo.gameLanguage != gLangEnum.Spanish;
|
||||
bool specialCase = RomInfo.gameFamily == GameFamilies.HGSS && RomInfo.gameLanguage != GameLanguages.Japanese && RomInfo.gameLanguage != GameLanguages.Spanish;
|
||||
string specialCaseChanges = "";
|
||||
|
||||
if (specialCase) {
|
||||
|
||||
@@ -612,42 +612,42 @@ namespace DSPRE.Resources {
|
||||
}
|
||||
}
|
||||
public static class System {
|
||||
public static Dictionary<string, gVerEnum> versionsDict = new Dictionary<string, gVerEnum>() {
|
||||
["ADAE"] = gVerEnum.Diamond,
|
||||
["ADAS"] = gVerEnum.Diamond,
|
||||
["ADAI"] = gVerEnum.Diamond,
|
||||
["ADAF"] = gVerEnum.Diamond,
|
||||
["ADAD"] = gVerEnum.Diamond,
|
||||
["ADAJ"] = gVerEnum.Diamond,
|
||||
public static Dictionary<string, GameVersions> versionsDict = new Dictionary<string, GameVersions>() {
|
||||
["ADAE"] = GameVersions.Diamond,
|
||||
["ADAS"] = GameVersions.Diamond,
|
||||
["ADAI"] = GameVersions.Diamond,
|
||||
["ADAF"] = GameVersions.Diamond,
|
||||
["ADAD"] = GameVersions.Diamond,
|
||||
["ADAJ"] = GameVersions.Diamond,
|
||||
|
||||
["APAE"] = gVerEnum.Pearl,
|
||||
["APAS"] = gVerEnum.Pearl,
|
||||
["APAI"] = gVerEnum.Pearl,
|
||||
["APAF"] = gVerEnum.Pearl,
|
||||
["APAD"] = gVerEnum.Pearl,
|
||||
["APAJ"] = gVerEnum.Pearl,
|
||||
["APAE"] = GameVersions.Pearl,
|
||||
["APAS"] = GameVersions.Pearl,
|
||||
["APAI"] = GameVersions.Pearl,
|
||||
["APAF"] = GameVersions.Pearl,
|
||||
["APAD"] = GameVersions.Pearl,
|
||||
["APAJ"] = GameVersions.Pearl,
|
||||
|
||||
["CPUE"] = gVerEnum.Platinum,
|
||||
["CPUS"] = gVerEnum.Platinum,
|
||||
["CPUI"] = gVerEnum.Platinum,
|
||||
["CPUF"] = gVerEnum.Platinum,
|
||||
["CPUD"] = gVerEnum.Platinum,
|
||||
["CPUJ"] = gVerEnum.Platinum,
|
||||
["CPUP"] = gVerEnum.Platinum,
|
||||
["CPUE"] = GameVersions.Platinum,
|
||||
["CPUS"] = GameVersions.Platinum,
|
||||
["CPUI"] = GameVersions.Platinum,
|
||||
["CPUF"] = GameVersions.Platinum,
|
||||
["CPUD"] = GameVersions.Platinum,
|
||||
["CPUJ"] = GameVersions.Platinum,
|
||||
["CPUP"] = GameVersions.Platinum,
|
||||
|
||||
["IPKE"] = gVerEnum.HeartGold,
|
||||
["IPKS"] = gVerEnum.HeartGold,
|
||||
["IPKI"] = gVerEnum.HeartGold,
|
||||
["IPKF"] = gVerEnum.HeartGold,
|
||||
["IPKD"] = gVerEnum.HeartGold,
|
||||
["IPKJ"] = gVerEnum.HeartGold,
|
||||
["IPKE"] = GameVersions.HeartGold,
|
||||
["IPKS"] = GameVersions.HeartGold,
|
||||
["IPKI"] = GameVersions.HeartGold,
|
||||
["IPKF"] = GameVersions.HeartGold,
|
||||
["IPKD"] = GameVersions.HeartGold,
|
||||
["IPKJ"] = GameVersions.HeartGold,
|
||||
|
||||
["IPGE"] = gVerEnum.SoulSilver,
|
||||
["IPGS"] = gVerEnum.SoulSilver,
|
||||
["IPGI"] = gVerEnum.SoulSilver,
|
||||
["IPGF"] = gVerEnum.SoulSilver,
|
||||
["IPGD"] = gVerEnum.SoulSilver,
|
||||
["IPGJ"] = gVerEnum.SoulSilver
|
||||
["IPGE"] = GameVersions.SoulSilver,
|
||||
["IPGS"] = GameVersions.SoulSilver,
|
||||
["IPGI"] = GameVersions.SoulSilver,
|
||||
["IPGF"] = GameVersions.SoulSilver,
|
||||
["IPGD"] = GameVersions.SoulSilver,
|
||||
["IPGJ"] = GameVersions.SoulSilver
|
||||
};
|
||||
|
||||
public static Dictionary<byte, string> MapCollisionPainters = new Dictionary<byte, string>() {
|
||||
|
||||
@@ -14,36 +14,36 @@ namespace DSPRE.Resources.ROMToolboxDB {
|
||||
internal uint initOffset;
|
||||
|
||||
public static Dictionary<string, string> arm9ExpansionCodeDB = new Dictionary<string, string>() {
|
||||
["branchString" + "_" + RomInfo.gFamEnum.DP + "_" + RomInfo.gLangEnum.English] = "05 F1 34 FC",
|
||||
["branchString" + "_" + RomInfo.gFamEnum.DP + "_" + RomInfo.gLangEnum.Spanish] = "05 F1 04 FD",
|
||||
["branchString" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.English] = "00 F1 B4 F8",
|
||||
["branchString" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.Spanish] = "00 F1 B2 F9",
|
||||
["branchString" + "_" + RomInfo.gFamEnum.HGSS + "_" + RomInfo.gLangEnum.English] = "0F F1 30 FB",
|
||||
["branchString" + "_" + RomInfo.gFamEnum.HGSS + "_" + RomInfo.gLangEnum.Spanish] = "0F F1 40 FB",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.DP + "_" + RomInfo.GameLanguages.English] = "05 F1 34 FC",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.DP + "_" + RomInfo.GameLanguages.Spanish] = "05 F1 04 FD",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.English] = "00 F1 B4 F8",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.Spanish] = "00 F1 B2 F9",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.HGSS + "_" + RomInfo.GameLanguages.English] = "0F F1 30 FB",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.HGSS + "_" + RomInfo.GameLanguages.Spanish] = "0F F1 40 FB",
|
||||
|
||||
["initString" + "_" + RomInfo.gFamEnum.DP] = "FC B5 05 48 C0 46 41 21 09 22 02 4D A8 47 00 20 03 21 FC BD F1 64 00 02 00 80 3C 02", //Valid for ENG and ESP, also for P
|
||||
["initString" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.English] = "FC B5 05 48 C0 46 41 21 09 22 02 4D A8 47 00 20 03 21 FC BD A5 6A 00 02 00 80 3C 02",
|
||||
["initString" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.Spanish] = "FC B5 05 48 C0 46 41 21 09 22 02 4D A8 47 00 20 03 21 FC BD B9 6A 00 02 00 80 3C 02",
|
||||
["initString" + "_" + RomInfo.gFamEnum.HGSS] = "FC B5 05 48 C0 46 1C 21 00 22 02 4D A8 47 00 20 03 21 FC BD 09 75 00 02 00 80 3C 02" //Valid for ENG and ESP, also for SS
|
||||
["initString" + "_" + RomInfo.GameFamilies.DP] = "FC B5 05 48 C0 46 41 21 09 22 02 4D A8 47 00 20 03 21 FC BD F1 64 00 02 00 80 3C 02", //Valid for ENG and ESP, also for P
|
||||
["initString" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.English] = "FC B5 05 48 C0 46 41 21 09 22 02 4D A8 47 00 20 03 21 FC BD A5 6A 00 02 00 80 3C 02",
|
||||
["initString" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.Spanish] = "FC B5 05 48 C0 46 41 21 09 22 02 4D A8 47 00 20 03 21 FC BD B9 6A 00 02 00 80 3C 02",
|
||||
["initString" + "_" + RomInfo.GameFamilies.HGSS] = "FC B5 05 48 C0 46 1C 21 00 22 02 4D A8 47 00 20 03 21 FC BD 09 75 00 02 00 80 3C 02" //Valid for ENG and ESP, also for SS
|
||||
};
|
||||
public static Dictionary<string, uint> arm9ExpansionOffsetsDB = new Dictionary<string, uint>() {
|
||||
["branchOffset" + "_" + RomInfo.gFamEnum.DP] = 0x02000C80, //Valid also for P
|
||||
["branchOffset" + "_" + RomInfo.gFamEnum.Plat] = 0x02000CB4,
|
||||
["branchOffset" + "_" + RomInfo.gFamEnum.HGSS] = 0x02000CD0, //Valid also for SS
|
||||
["branchOffset" + "_" + RomInfo.GameFamilies.DP] = 0x02000C80, //Valid also for P
|
||||
["branchOffset" + "_" + RomInfo.GameFamilies.Plat] = 0x02000CB4,
|
||||
["branchOffset" + "_" + RomInfo.GameFamilies.HGSS] = 0x02000CD0, //Valid also for SS
|
||||
|
||||
["initOffset" + "_" + RomInfo.gFamEnum.DP + "_" + RomInfo.gLangEnum.English] = 0x021064EC,
|
||||
["initOffset" + "_" + RomInfo.gFamEnum.DP + "_" + RomInfo.gLangEnum.Spanish] = 0x0210668C,
|
||||
["initOffset" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.English] = 0x02100E20,
|
||||
["initOffset" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.Spanish] = 0x0210101C,
|
||||
["initOffset" + "_" + RomInfo.gFamEnum.HGSS + "_" + RomInfo.gLangEnum.English] = 0x02110334,
|
||||
["initOffset" + "_" + RomInfo.gFamEnum.HGSS + "_" + RomInfo.gLangEnum.Spanish] = 0x02110354
|
||||
["initOffset" + "_" + RomInfo.GameFamilies.DP + "_" + RomInfo.GameLanguages.English] = 0x021064EC,
|
||||
["initOffset" + "_" + RomInfo.GameFamilies.DP + "_" + RomInfo.GameLanguages.Spanish] = 0x0210668C,
|
||||
["initOffset" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.English] = 0x02100E20,
|
||||
["initOffset" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.Spanish] = 0x0210101C,
|
||||
["initOffset" + "_" + RomInfo.GameFamilies.HGSS + "_" + RomInfo.GameLanguages.English] = 0x02110334,
|
||||
["initOffset" + "_" + RomInfo.GameFamilies.HGSS + "_" + RomInfo.GameLanguages.Spanish] = 0x02110354
|
||||
};
|
||||
internal ARM9PatchData() {
|
||||
branchOffset = arm9ExpansionOffsetsDB[nameof(branchOffset) + "_" + RomInfo.gameFamily] - DSUtils.ARM9.address;
|
||||
initOffset = arm9ExpansionOffsetsDB[nameof(initOffset) + "_" + RomInfo.gameFamily + "_" + RomInfo.gameLanguage] - DSUtils.ARM9.address;
|
||||
branchString = arm9ExpansionCodeDB[nameof(branchString) + "_" + RomInfo.gameFamily + "_" + RomInfo.gameLanguage];
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.Plat) {
|
||||
if (RomInfo.gameFamily == GameFamilies.Plat) {
|
||||
initString = arm9ExpansionCodeDB[nameof(initString) + "_" + RomInfo.gameFamily + "_" + RomInfo.gameLanguage];
|
||||
} else {
|
||||
initString = arm9ExpansionCodeDB[nameof(initString) + "_" + RomInfo.gameFamily];
|
||||
@@ -65,32 +65,32 @@ namespace DSPRE.Resources.ROMToolboxDB {
|
||||
internal byte[] subroutine;
|
||||
|
||||
public static Dictionary<string, string> BDHCamCodeDB = new Dictionary<string, string>() {
|
||||
["branchString" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.English] = "B9 F3 E2 F8",
|
||||
["branchString" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.Spanish] = "B9 F3 AA F8",
|
||||
["branchString" + "_" + RomInfo.gFamEnum.HGSS] = "B6 F3 2E FA", //Also valid for SS, both ESP and ENG
|
||||
["branchString" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.English] = "B9 F3 E2 F8",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.Spanish] = "B9 F3 AA F8",
|
||||
["branchString" + "_" + RomInfo.GameFamilies.HGSS] = "B6 F3 2E FA", //Also valid for SS, both ESP and ENG
|
||||
|
||||
["overlayString1"] = "00 4B 18 47 41 9C 3D 02",
|
||||
["overlayString2"] = "00 4B 18 47 01 9C 3D 02",
|
||||
};
|
||||
public static Dictionary<string, uint> BDHCamOffsetsDB = new Dictionary<string, uint>() {
|
||||
["branchOffset" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.English] = 0x0202040C,
|
||||
["branchOffset" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.Spanish] = 0x0202047C,
|
||||
["branchOffset" + "_" + RomInfo.gFamEnum.HGSS] = 0x02023174, //Also valid for SS, both ESP and ENG
|
||||
["branchOffset" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.English] = 0x0202040C,
|
||||
["branchOffset" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.Spanish] = 0x0202047C,
|
||||
["branchOffset" + "_" + RomInfo.GameFamilies.HGSS] = 0x02023174, //Also valid for SS, both ESP and ENG
|
||||
|
||||
["overlayOffset1" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.English] = 0x0001E1B4,
|
||||
["overlayOffset1" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.Spanish] = 0x0001E1BC,
|
||||
["overlayOffset1" + "_" + RomInfo.gFamEnum.HGSS] = 0x0001574C,
|
||||
["overlayOffset1" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.English] = 0x0001E1B4,
|
||||
["overlayOffset1" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.Spanish] = 0x0001E1BC,
|
||||
["overlayOffset1" + "_" + RomInfo.GameFamilies.HGSS] = 0x0001574C,
|
||||
|
||||
["overlayOffset2" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.English] = 0x0001E2CC,
|
||||
["overlayOffset2" + "_" + RomInfo.gFamEnum.Plat + "_" + RomInfo.gLangEnum.Spanish] = 0x0001E2D4,
|
||||
["overlayOffset2" + "_" + RomInfo.gFamEnum.HGSS] = 0x00015864,
|
||||
["overlayOffset2" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.English] = 0x0001E2CC,
|
||||
["overlayOffset2" + "_" + RomInfo.GameFamilies.Plat + "_" + RomInfo.GameLanguages.Spanish] = 0x0001E2D4,
|
||||
["overlayOffset2" + "_" + RomInfo.GameFamilies.HGSS] = 0x00015864,
|
||||
};
|
||||
|
||||
public static uint BDHCamSubroutineOffset = 0x000115B0;
|
||||
|
||||
internal BDHCAMPatchData() {
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
overlayNumber = 5;
|
||||
branchString = BDHCamCodeDB[nameof(branchString) + "_" + RomInfo.gameFamily + "_" + RomInfo.gameLanguage];
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace DSPRE.Resources.ROMToolboxDB {
|
||||
overlayOffset1 = BDHCamOffsetsDB[nameof(overlayOffset1) + "_" + RomInfo.gameFamily + "_" + RomInfo.gameLanguage];
|
||||
overlayOffset2 = BDHCamOffsetsDB[nameof(overlayOffset2) + "_" + RomInfo.gameFamily + "_" + RomInfo.gameLanguage];
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
overlayNumber = 1;
|
||||
branchString = BDHCamCodeDB[nameof(branchString) + "_" + RomInfo.gameFamily];
|
||||
|
||||
@@ -167,9 +167,9 @@ namespace DSPRE.Resources.ROMToolboxDB {
|
||||
return "00 B5 01 1C 32 20 00 22 CC F7 58 F9 03 1C DF F7 49 FC 00 BD";
|
||||
}
|
||||
}
|
||||
public static Dictionary<gFamEnum, Tuple<uint, uint>[]> dynamicHeadersPointersDB = new Dictionary<gFamEnum, Tuple<uint, uint>[]>() {
|
||||
public static Dictionary<GameFamilies, Tuple<uint, uint>[]> dynamicHeadersPointersDB = new Dictionary<GameFamilies, Tuple<uint, uint>[]>() {
|
||||
// format: headerID*18 offset, (ARM9_HEADER_TABLE_OFFSET + n) offset
|
||||
[gFamEnum.Plat] = new Tuple<uint, uint>[] {
|
||||
[GameFamilies.Plat] = new Tuple<uint, uint>[] {
|
||||
new Tuple<uint, uint>(0x3A03E, 0x3A048),
|
||||
new Tuple<uint, uint>(0x3A052, 0x3A05C),
|
||||
new Tuple<uint, uint>(0x3A066, 0x3A080),
|
||||
@@ -191,7 +191,7 @@ namespace DSPRE.Resources.ROMToolboxDB {
|
||||
new Tuple<uint, uint>(0x3A1F6, 0x3A208),
|
||||
new Tuple<uint, uint>(0x3A212, 0x3A224),
|
||||
},
|
||||
[gFamEnum.HGSS] = new Tuple<uint, uint>[] {
|
||||
[GameFamilies.HGSS] = new Tuple<uint, uint>[] {
|
||||
new Tuple<uint, uint>(0x3B282, 0x3B28C),
|
||||
new Tuple<uint, uint>(0x3B296, 0x3B2A8),
|
||||
new Tuple<uint, uint>(0x3B2B2, 0x3B2BC),
|
||||
@@ -225,7 +225,7 @@ namespace DSPRE.Resources.ROMToolboxDB {
|
||||
initOffset = getDynamicHeadersInitOffset(RomInfo.romID);
|
||||
initString = getDynamicHeadersInitString(RomInfo.romID);
|
||||
|
||||
if (RomInfo.gameFamily == gFamEnum.HGSS) {
|
||||
if (RomInfo.gameFamily == GameFamilies.HGSS) {
|
||||
pointerDiff = (int)(initOffset - getDynamicHeadersInitOffset("IPKE"));
|
||||
} else {
|
||||
pointerDiff = (int)(initOffset - getDynamicHeadersInitOffset("CPUE"));
|
||||
@@ -233,10 +233,10 @@ namespace DSPRE.Resources.ROMToolboxDB {
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<gFamEnum, uint> syntheticOverlayFileNumbersDB = new Dictionary<gFamEnum, uint>() {
|
||||
[gFamEnum.DP] = 9,
|
||||
[gFamEnum.Plat] = 9,
|
||||
[gFamEnum.HGSS] = 0,
|
||||
public static Dictionary<GameFamilies, uint> syntheticOverlayFileNumbersDB = new Dictionary<GameFamilies, uint>() {
|
||||
[GameFamilies.DP] = 9,
|
||||
[GameFamilies.Plat] = 9,
|
||||
[GameFamilies.HGSS] = 0,
|
||||
};
|
||||
|
||||
public static Dictionary<uint[], string> matrixExpansionDB = new Dictionary<uint[], string>() {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -120,13 +120,13 @@ namespace DSPRE {
|
||||
matrixyUpDown.Maximum = headerMatrix.maps.GetLength(0) - 1;
|
||||
|
||||
switch (RomInfo.gameFamily) {
|
||||
case gFamEnum.DP:
|
||||
case GameFamilies.DP:
|
||||
locationNameLBL.Text = locations[((HeaderDP)currentHeader).locationName];
|
||||
break;
|
||||
case gFamEnum.Plat:
|
||||
case GameFamilies.Plat:
|
||||
locationNameLBL.Text = locations[((HeaderPt)currentHeader).locationName];
|
||||
break;
|
||||
case gFamEnum.HGSS:
|
||||
case GameFamilies.HGSS:
|
||||
locationNameLBL.Text = locations[((HeaderHGSS)currentHeader).locationName];
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace DSPRE {
|
||||
}
|
||||
|
||||
if (tempMapHeader.wildPokemon != MapHeader.DPPT_NULL_ENCOUNTER_FILE_ID) {
|
||||
if (RomInfo.gameFamily == gFamEnum.DP) {
|
||||
if (RomInfo.gameFamily == GameFamilies.DP) {
|
||||
EncounterFileLocationName.Add(tempMapHeader.wildPokemon, locationNames[((HeaderDP)tempMapHeader).locationName]);
|
||||
} else {
|
||||
EncounterFileLocationName.Add(tempMapHeader.wildPokemon, locationNames[((HeaderPt)tempMapHeader).locationName]);
|
||||
|
||||
Reference in New Issue
Block a user