diff --git a/pk3DS/Properties/Resources.Designer.cs b/pk3DS/Properties/Resources.Designer.cs index b8c84b1..a68c377 100644 --- a/pk3DS/Properties/Resources.Designer.cs +++ b/pk3DS/Properties/Resources.Designer.cs @@ -10451,7 +10451,20 @@ internal class Resources { } /// - /// Looks up a localized string similar to . + /// Looks up a localized string similar to pk3DS - By Kaphotics + ///http://projectpokemon.org/ + ///http://projectpokemon.org/forums/showthread.php?44950 + /// + ///A package of Pokémon X/Y/OR/AS tools by various contributors. + /// + ///GARCTool (Backbone): Kaphotics + ///Text Editing (xytext): Kaphotics + ///Wild Editor (**WE): SciresM & Kaphotics + ///Trainer Editor (**TE): SciresM, Kaphotics, and KazoWAR + ///Personal Editor: SciresM + ///Mega Evolution Editor (MEE): SciresM + ///Evolutions, Moves, Items, Maison, Title Screen Editors: Kaphotics + ///ExeFS Editors: Kaphotics (thanks Drayano and m [rest of string was truncated]";. /// internal static string changelog { get { @@ -10489,6 +10502,16 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap F { + get { + object obj = ResourceManager.GetObject("F", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -14719,6 +14742,16 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap N { + get { + object obj = ResourceManager.GetObject("N", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// @@ -14739,6 +14772,26 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap T1 { + get { + object obj = ResourceManager.GetObject("T1", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap T2 { + get { + object obj = ResourceManager.GetObject("T2", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -14749,6 +14802,16 @@ internal class Resources { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap W { + get { + object obj = ResourceManager.GetObject("W", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Byte[]. /// diff --git a/pk3DS/Properties/Resources.resx b/pk3DS/Properties/Resources.resx index 97e9e9d..c59aa8d 100644 --- a/pk3DS/Properties/Resources.resx +++ b/pk3DS/Properties/Resources.resx @@ -4525,4 +4525,19 @@ ..\Misc\changelog.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\Resources\img\F.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\N.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\T1.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\T2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\img\W.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/pk3DS/Resources/img/F.png b/pk3DS/Resources/img/F.png new file mode 100644 index 0000000..675286d Binary files /dev/null and b/pk3DS/Resources/img/F.png differ diff --git a/pk3DS/Resources/img/N.png b/pk3DS/Resources/img/N.png new file mode 100644 index 0000000..f649e7f Binary files /dev/null and b/pk3DS/Resources/img/N.png differ diff --git a/pk3DS/Resources/img/T1.png b/pk3DS/Resources/img/T1.png new file mode 100644 index 0000000..aae77c9 Binary files /dev/null and b/pk3DS/Resources/img/T1.png differ diff --git a/pk3DS/Resources/img/T2.png b/pk3DS/Resources/img/T2.png new file mode 100644 index 0000000..a592b64 Binary files /dev/null and b/pk3DS/Resources/img/T2.png differ diff --git a/pk3DS/Resources/img/W.png b/pk3DS/Resources/img/W.png new file mode 100644 index 0000000..3d126a3 Binary files /dev/null and b/pk3DS/Resources/img/W.png differ diff --git a/pk3DS/Subforms/MapPermView.cs b/pk3DS/Subforms/MapPermView.cs index 5f069c3..3a2a00e 100644 --- a/pk3DS/Subforms/MapPermView.cs +++ b/pk3DS/Subforms/MapPermView.cs @@ -2,6 +2,7 @@ using System.Drawing; using System.IO; using System.Windows.Forms; +using pk3DS.Properties; namespace pk3DS.Subforms { @@ -20,7 +21,7 @@ public void drawMap(int Map) DrawMap = Map; PB_Map.Image = (CHK_AutoDraw.Checked) ? getMapImage() : null; } - public Image getMapImage(bool crop = false) + public Image getMapImage(bool crop = false, bool entity = true) { // Load MM byte[][] MM = CTR.mini.unpackMini(File.ReadAllBytes(OWSE.MapMatrixes[DrawMap]), "MM"); @@ -34,10 +35,25 @@ public Image getMapImage(bool crop = false) byte[][] GR = CTR.mini.unpackMini(File.ReadAllBytes(OWSE.MapGRs[mm.EntryList[i]]), "GR"); mm.Entries[i] = new MapMatrix.Entry(GR[0]); } - Image img = mm.Preview((int)NUD_Scale.Value, (int)NUD_Flavor.Value); + mapScale = (int)NUD_Scale.Value; + Image img = mm.Preview(mapScale, (int)NUD_Flavor.Value); + + if (entity && mapScale == 8) + { + // Overlay every... overworld entity + foreach (var f in OWSE.CurrentZone.Entities.Furniture) + try { Util.LayerImage(img, Resources.F, f.X * mapScale, f.Y * mapScale, 0.8); } catch {} + foreach (var f in OWSE.CurrentZone.Entities.NPCs) + try { Util.LayerImage(img, Resources.N, f.X * mapScale, f.Y * mapScale, 0.8); } catch {} + foreach (var f in OWSE.CurrentZone.Entities.Warps) + try { Util.LayerImage(img, Resources.W, (int)(f.pX * mapScale), (int)(f.pY * mapScale), 0.8); } catch {} + foreach (var f in OWSE.CurrentZone.Entities.Triggers1) + try { Util.LayerImage(img, Resources.T1, f.X * mapScale, f.Y * mapScale, 0.8); } catch {} + foreach (var f in OWSE.CurrentZone.Entities.Triggers2) + try { Util.LayerImage(img, Resources.T2, f.X * mapScale, f.Y * mapScale, 0.8); } catch { } + } if (crop) img = Util.TrimBitmap((Bitmap)img); - mapScale = (int)NUD_Scale.Value; OWSE.mm = mm; return img; } @@ -48,6 +64,9 @@ private void hoverMap(object sender, MouseEventArgs e) if (mapScale < 0) return; + if (PB_Map.Image == null) + return; + int X = e.X / (mapScale); int Y = e.Y / (mapScale); diff --git a/pk3DS/Subforms/OWSE.cs b/pk3DS/Subforms/OWSE.cs index 5fc7ff2..0a5a969 100644 --- a/pk3DS/Subforms/OWSE.cs +++ b/pk3DS/Subforms/OWSE.cs @@ -28,7 +28,7 @@ public OWSE() private string[] filepaths; private string[] gameLocations = Main.getText((Main.oras) ? 90 : 72); private string[] zdLocations; - + internal static Random rand = new Random(); internal static uint rnd32() { @@ -67,8 +67,9 @@ private void openQuick(string[] encdata) NUD_WMap.Maximum = zdLocations.Length; // Cap map warp destinations to the amount of maps. } + internal static Zone CurrentZone; + internal static MapMatrix mm; private int entry = -1; - private Zone CurrentZone; private byte[][] locationData; private string[] rawLocations; private void CB_LocationID_SelectedIndexChanged(object sender, EventArgs e) @@ -560,7 +561,6 @@ private void B_DumpUnk_Click(object sender, EventArgs e) CB_LocationID.SelectedIndex = 0; } - internal static MapMatrix mm; private void B_DumpMaps_Click(object sender, EventArgs e) { if (Util.Prompt(MessageBoxButtons.YesNoCancel, "Export all MapImages?") != DialogResult.Yes) diff --git a/pk3DS/pk3DS.csproj b/pk3DS/pk3DS.csproj index 06ff86e..b5e2ac3 100644 --- a/pk3DS/pk3DS.csproj +++ b/pk3DS/pk3DS.csproj @@ -4749,6 +4749,21 @@ + + + + + + + + + + + + + + +