diff --git a/src/HexManiac.Core/Models/Code/tableReference.txt b/src/HexManiac.Core/Models/Code/tableReference.txt index a20a4f92..0d087b3e 100644 --- a/src/HexManiac.Core/Models/Code/tableReference.txt +++ b/src/HexManiac.Core/Models/Code/tableReference.txt @@ -284,7 +284,7 @@ data.battletower.items, 135098, 135098, 1350B8, 1350B8, 0E637C, 0 data.battletower.pokemon.level50, 134F54, 134F54, 134F74, 134F74, 0E6378, 0E6350, 0E638C, 0E6364, , [species:data.pokemon.names heldItem.data.battletower.items flags.|h move1:data.pokemon.moves.names move2:data.pokemon.moves.names move3:data.pokemon.moves.names move4:data.pokemon.moves.names evSpread|b[]battletowerEvFlags nature.data.pokemon.natures.names unused:]300 data.battletower.pokemon.level100, 134EFC, 134EFC, 134F1C, 134F1C, 0E631C, 0E62F4, 0E6330, 0E6308, , [species:data.pokemon.names heldItem.data.battletower.items flags.|h move1:data.pokemon.moves.names move2:data.pokemon.moves.names move3:data.pokemon.moves.names move4:data.pokemon.moves.names evSpread|b[]battletowerEvFlags nature.data.pokemon.natures.names unused:]300 data.battletower.prizes, , , , , 15E444, 15E420, 15E4BC, 15E498, , [item:data.items.stats]15 -data.trainers.trainertower.trainers, ,,,, 15DD24, 15DD00, 15DD9C, 15DD78, , [trainer<[id floor challengetype prize name""11 class. textColor. unused. beforeWord1:|h beforeWord2:|h beforeWord3:|h beforeWord4:|h beforeWord5:|h beforeWord6:|h winWord1:|h winWord2:|h winWord3:|h winWord4:|h winWord5:|h winWord6:|h lostWord1:|h lostWord2:|h lostWord3:|h lostWord4:|h lostWord5:|h lostWord6:|h afterWord1:|h afterWord2:|h afterWord3:|h afterWord4:|h afterWord5:|h afterWord6:|h unused: [species:data.pokemon.names heldItem:data.items.stats move1:data.pokemon.moves.names move2:data.pokemon.moves.names move3:data.pokemon.moves.names move4:data.pokemon.moves.names unknown: hpEv. atkEv. defEv. spdEv. spaEv. spdEv. otID::|h IVs::|t|hp::.|atk::.|def::.|spd::.|spatk::.|spdef::.|unused.|2ndAbility. personality:: nickname""11 friendship.]6]1>]32 +data.trainers.trainertower.trainers, ,,,, 15DD24, 15DD00, 15DD9C, 15DD78, , [trainer<[id. floor. challengetype. prize. name""11 class. textColor. unused. beforeWord1:|h beforeWord2:|h beforeWord3:|h beforeWord4:|h beforeWord5:|h beforeWord6:|h winWord1:|h winWord2:|h winWord3:|h winWord4:|h winWord5:|h winWord6:|h lostWord1:|h lostWord2:|h lostWord3:|h lostWord4:|h lostWord5:|h lostWord6:|h afterWord1:|h afterWord2:|h afterWord3:|h afterWord4:|h afterWord5:|h afterWord6:|h unused: [species:data.pokemon.names heldItem:data.items.stats move1:data.pokemon.moves.names move2:data.pokemon.moves.names move3:data.pokemon.moves.names move4:data.pokemon.moves.names unknown: hpEv. atkEv. defEv. speedEv. spatkEv. spdefEv. otID::|h IVs::|t|hp::.|atk::.|def::.|spd::.|spatk::.|spdef::.|unused.|2ndAbility. personality:: nickname""11 friendship.]6]1>]32 data.trainers.trainerhill.prizelist, ,,,, ,,,, 1D6718, [prizelist<[prizeoptions<[prize:data.items.stats]6>]10>]2 data.battlefrontier.items, ,,,, ,,,, 163440, [item:data.items.stats]63 data.battlefrontier.trainerclass, ,,,, ,,,, 068C10, [class.data.trainers.classes.names]82 diff --git a/src/HexManiac.Core/ViewModels/Map/BlockMapViewModel.cs b/src/HexManiac.Core/ViewModels/Map/BlockMapViewModel.cs index aa139876..2fb30499 100644 --- a/src/HexManiac.Core/ViewModels/Map/BlockMapViewModel.cs +++ b/src/HexManiac.Core/ViewModels/Map/BlockMapViewModel.cs @@ -119,6 +119,10 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map { } else { throw new NotImplementedException(); } + if (selectedCategory < 0) { + SelectedEvent = null; + return; + } selectedCategory %= categories.Count; selectionIndex %= categories[selectedCategory].Count; diff --git a/src/HexManiac.Core/ViewModels/Map/MapEditorViewModel.cs b/src/HexManiac.Core/ViewModels/Map/MapEditorViewModel.cs index 67ce04a3..6493bc89 100644 --- a/src/HexManiac.Core/ViewModels/Map/MapEditorViewModel.cs +++ b/src/HexManiac.Core/ViewModels/Map/MapEditorViewModel.cs @@ -685,7 +685,7 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map { private void EventMove(double x, double y) { var map = MapUnderCursor(x, y); - if (map != null) { + if (map == primaryMap) { CreateEventForCreationInteraction(eventCreationType); map.UpdateEventLocation(selectedEvent, x, y); Tutorials.Complete(Tutorial.DragEvent_MoveEvent); @@ -929,7 +929,9 @@ namespace HavenSoft.HexManiac.Core.ViewModels.Map { var canvas = new CanvasPixelViewModel(width * 16, height * 16) { SpriteScale = scale }; for (int xx = 0; xx < tilesToDraw.GetLength(0); xx++) { for (int yy = 0; yy < tilesToDraw.GetLength(1); yy++) { - canvas.Draw(primaryMap.BlockRenders[tilesToDraw[xx, yy] & 0x3FF], xx * 16, yy * 16); + var index = tilesToDraw[xx, yy] & 0x3FF; + if (index >= primaryMap.BlockRenders.Count) index = 0; + canvas.Draw(primaryMap.BlockRenders[index], xx * 16, yy * 16); } } MultiTileDrawRender = canvas; diff --git a/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs b/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs index 6cf8b68f..66d2c0c2 100644 --- a/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs +++ b/src/HexManiac.WPF/Implementations/WindowsFileSystem.cs @@ -408,7 +408,10 @@ namespace HavenSoft.HexManiac.WPF.Implementations { var decoder = new PngBitmapDecoder(fileStream, BitmapCreateOptions.None, BitmapCacheOption.None); frame = decoder.Frames[0]; } catch (FileFormatException) { - ShowCustomMessageBox("Could not decode bitmap. The file may not be a valid PNG."); + ShowCustomMessageBox("Could not decode bitmap. The file may not be a valid PNG.", false); + return default; + } catch (NotSupportedException) { + ShowCustomMessageBox("Could not decode bitmap. The file may not be a valid PNG.", false); return default; } var metadata = (BitmapMetadata)frame.Metadata;