Rewrote mkxp.json, fix crash when entering a map with no map metadata, fixed Battle Factory menu text misalignment

This commit is contained in:
Maruno17
2023-07-01 22:11:02 +01:00
parent 2078f6b116
commit 2986ab3ebb
4 changed files with 136 additions and 412 deletions

View File

@@ -2,7 +2,6 @@
# https://github.com/mkxp-z/mkxp-z/actions/runs/5107184579
$VERBOSE = nil
Font.default_shadow = false if Font.respond_to?(:default_shadow)
Graphics.frame_rate = 40
Encoding.default_internal = Encoding::UTF_8
Encoding.default_external = Encoding::UTF_8

View File

@@ -1351,11 +1351,11 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
rect = drawCursor(index, rect)
if toUnformattedText(@commands[index]).gsub(/\n/, "") == @commands[index]
# Use faster alternative for unformatted text without line breaks
pbDrawShadowText(self.contents, rect.x, rect.y, rect.width, rect.height,
@commands[index], self.baseColor, self.shadowColor)
pbDrawShadowText(self.contents, rect.x, rect.y + (self.contents.text_offset_y || 0),
rect.width, rect.height, @commands[index], self.baseColor, self.shadowColor)
else
chars = getFormattedText(self.contents, rect.x, rect.y + 4, rect.width, rect.height,
@commands[index], rect.height, true, true)
chars = getFormattedText(self.contents, rect.x, rect.y + (self.contents.text_offset_y || 0),
rect.width, rect.height, @commands[index], rect.height, true, true)
drawFormattedChars(self.contents, chars)
end
end

View File

@@ -257,7 +257,7 @@ def pbGetBasicMapNameFromId(id)
end
def pbGetMapNameFromId(id)
name = GameData::MapMetadata.get(id)&.name
name = GameData::MapMetadata.try_get(id)&.name
if nil_or_empty?(name)
name = pbGetBasicMapNameFromId(id)
name.gsub!(/\\PN/, $player.name) if $player