Added consts for icon sizes for status and category

This commit is contained in:
Maruno17
2024-06-26 16:26:53 +01:00
parent 03b0fa100a
commit 225549bfce
5 changed files with 10 additions and 6 deletions

View File

@@ -13,6 +13,8 @@ module GameData
DATA = {}
ICON_SIZE = [44, 16]
extend ClassMethodsSymbols
include InstanceMethods

View File

@@ -35,6 +35,8 @@ module GameData
"Description" => [:real_description, "q"]
}
CATEGORY_ICON_SIZE = [64, 28]
extend ClassMethodsSymbols
include InstanceMethods

View File

@@ -173,8 +173,6 @@ class PokemonPartyPanel < Sprite
TEXT_BASE_COLOR = Color.new(248, 248, 248)
TEXT_SHADOW_COLOR = Color.new(40, 40, 40)
HP_BAR_WIDTH = 96
STATUS_ICON_WIDTH = 44
STATUS_ICON_HEIGHT = 16
def initialize(pokemon, index, viewport = nil)
super(viewport)
@@ -427,7 +425,7 @@ class PokemonPartyPanel < Sprite
status = GameData::Status.count
end
return if status < 0
statusrect = Rect.new(0, STATUS_ICON_HEIGHT * status, STATUS_ICON_WIDTH, STATUS_ICON_HEIGHT)
statusrect = Rect.new(0, status * GameData::Status::ICON_SIZE[1], *GameData::Status::ICON_SIZE)
@overlaysprite.bitmap.blt(78, 68, @statuses.bitmap, statusrect)
end

View File

@@ -328,7 +328,8 @@ class PokemonSummary_Scene
status = GameData::Status.count
end
if status >= 0
imagepos.push([_INTL("Graphics/UI/statuses"), 124, 100, 0, 16 * status, 44, 16])
imagepos.push([_INTL("Graphics/UI/statuses"), 124, 100,
0, status * GameData::Status::ICON_SIZE[1], *GameData::Status::ICON_SIZE])
end
# Show Pokérus cured icon
if @pokemon.pokerusStage == 2
@@ -837,7 +838,8 @@ class PokemonSummary_Scene
# Draw all text
pbDrawTextPositions(overlay, textpos)
# Draw selected move's damage category icon
imagepos = [["Graphics/UI/category", 166, 124, 0, selected_move.display_category(@pokemon) * 28, 64, 28]]
imagepos = [["Graphics/UI/category", 166, 124,
0, selected_move.display_category(@pokemon) * CATEGORY_ICON_SIZE[1], *CATEGORY_ICON_SIZE]]
pbDrawImagePositions(overlay, imagepos)
# Draw selected move's description
drawTextEx(overlay, 4, 224, 230, 5, selected_move.description, base, shadow)

View File

@@ -95,7 +95,7 @@ class MoveRelearner_Scene
textpos.push([accuracy == 0 ? "---" : "#{accuracy}%", 468, 184, :center,
Color.new(64, 64, 64), Color.new(176, 176, 176)])
pbDrawTextPositions(overlay, textpos)
imagepos.push(["Graphics/UI/category", 436, 116, 0, category * 28, 64, 28])
imagepos.push(["Graphics/UI/category", 436, 116, 0, category * CATEGORY_ICON_SIZE[1], *CATEGORY_ICON_SIZE])
if @sprites["commands"].index < @moves.length - 1
imagepos.push(["Graphics/UI/Move Reminder/buttons", 48, 350, 0, 0, 76, 32])
end