Consolidated code for the player interacting in the overworld, fixed bad splash screen animations, added ShowQuantity property to items.txt, fixed Quick Draw and Aroma Veil, fixed text alignment in long list of regional Dexes in Pokédex, added better error message in load screen if player's charset is missing

This commit is contained in:
Maruno17
2023-06-12 22:32:41 +01:00
parent 20affb4345
commit 9c2a9130a5
20 changed files with 106 additions and 66 deletions

View File

@@ -17,10 +17,10 @@ class Window_DexesList < Window_CommandPokemon
def drawItem(index, count, rect)
super(index, count, rect)
if index >= 0 && index < @commands2.length
pbDrawShadowText(self.contents, rect.x + 254, rect.y, 64, rect.height,
@commands2[index][0].to_s, self.baseColor, self.shadowColor, 1)
pbDrawShadowText(self.contents, rect.x + 350, rect.y, 64, rect.height,
@commands2[index][1].to_s, self.baseColor, self.shadowColor, 1)
pbDrawShadowText(self.contents, rect.x + 254, rect.y + (self.contents.text_offset_y || 0),
64, rect.height, @commands2[index][0].to_s, self.baseColor, self.shadowColor, 1)
pbDrawShadowText(self.contents, rect.x + 350, rect.y + (self.contents.text_offset_y || 0),
64, rect.height, @commands2[index][1].to_s, self.baseColor, self.shadowColor, 1)
allseen = (@commands2[index][0] >= @commands2[index][2])
allown = (@commands2[index][1] >= @commands2[index][2])
pbDrawImagePositions(

View File

@@ -78,19 +78,24 @@ class Window_PokemonBag < Window_DrawableCommand
textpos.push(
[@adapter.getDisplayName(item), rect.x, rect.y + 2, :left, baseColor, shadowColor]
)
if GameData::Item.get(item).is_important?
item_data = GameData::Item.get(item)
showing_register_icon = false
if item_data.is_important?
if @bag.registered?(item)
pbDrawImagePositions(
self.contents,
[["Graphics/UI/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 0, -1, 24]]
)
showing_register_icon = true
elsif pbCanRegisterItem?(item)
pbDrawImagePositions(
self.contents,
[["Graphics/UI/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 24, -1, 24]]
)
showing_register_icon = true
end
else
end
if item_data.show_quantity? && !showing_register_icon
qty = (@filterlist) ? thispocket[@filterlist[@pocket][index]][1] : thispocket[index][1]
qtytext = _ISPRINTF("x{1: 3d}", qty)
xQty = rect.x + rect.width - self.contents.text_size(qtytext).width - 16

View File

@@ -168,11 +168,14 @@ class PokemonLoad_Scene
if meta
filename = pbGetPlayerCharset(meta.walk_charset, trainer, true)
@sprites["player"] = TrainerWalkingCharSprite.new(filename, @viewport)
if !@sprites["player"].bitmap
raise _INTL("Player character {1}'s walking charset was not found (filename: \"{2}\").", trainer.character_ID, filename)
end
charwidth = @sprites["player"].bitmap.width
charheight = @sprites["player"].bitmap.height
@sprites["player"].x = 112 - (charwidth / 8)
@sprites["player"].y = 112 - (charheight / 8)
@sprites["player"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4)
@sprites["player"].x = 112 - (charwidth / 8)
@sprites["player"].y = 112 - (charheight / 8)
@sprites["player"].z = 99999
end
trainer.party.each_with_index do |pkmn, i|
@sprites["party#{i}"] = PokemonIconSprite.new(pkmn, @viewport)

View File

@@ -38,7 +38,7 @@ class Window_PokemonItemStorage < Window_DrawableCommand
itemname = @adapter.getDisplayName(item)
baseColor = (index == @sortIndex) ? Color.new(248, 24, 24) : self.baseColor
textpos.push([itemname, rect.x, rect.y, :left, self.baseColor, self.shadowColor])
if !GameData::Item.get(item).is_important? # Not a Key item/HM/TM
if GameData::Item.get(item).show_quantity?
qty = _ISPRINTF("x{1: 2d}", @bag[index][1])
sizeQty = self.contents.text_size(qty).width
xQty = rect.x + rect.width - sizeQty - 2

View File

@@ -488,8 +488,7 @@ class BattlePointShopScreen
end
if added == quantity
$stats.battle_points_spent += price
# TODO: Add bpshop_items_bought to $stats?
# $stats.bpshop_items_bought += quantity
$stats.mart_items_bought += quantity
@adapter.setBP(@adapter.getBP - price)
@stock.delete_if { |itm| GameData::Item.get(itm).is_important? && $bag.has?(itm) }
pbDisplayPaused(_INTL("Here you are! Thank you!")) { pbSEPlay("Mart buy item") }