Implemented redesign of summary screen

This commit is contained in:
Maruno17
2024-08-27 00:49:11 +01:00
parent 273e1bb565
commit 2abdf333db
4 changed files with 466 additions and 319 deletions

View File

@@ -95,7 +95,7 @@ GameData::Stat.register({
GameData::Stat.register({
:id => :SPECIAL_ATTACK,
:name => _INTL("Special Attack"),
:name_semi_brief => _INTL("Sp. Atk"),
:name_semi_brief => _INTL("Sp. Attack"),
:name_brief => _INTL("SpAtk"),
:type => :main_battle,
:pbs_order => 4
@@ -104,7 +104,7 @@ GameData::Stat.register({
GameData::Stat.register({
:id => :SPECIAL_DEFENSE,
:name => _INTL("Special Defense"),
:name_semi_brief => _INTL("Sp. Def"),
:name_semi_brief => _INTL("Sp. Defense"),
:name_brief => _INTL("SpDef"),
:type => :main_battle,
:pbs_order => 5

View File

@@ -1254,7 +1254,7 @@ class PokemonStorageScene
pbPartySetArrow(@sprites["arrow"], @selection)
pbUpdateOverlay(@selection, @storage.party)
else
screen = UI::PokemonSummary.new(@storage.boxes[selected[0]], selected[1])
screen = UI::PokemonSummary.new(@storage.boxes[selected[0]].pokemon, selected[1])
@selection = screen.result
pbSetArrow(@sprites["arrow"], @selection)
pbUpdateOverlay(@selection)

View File

@@ -263,6 +263,24 @@ module UI
@sprites[overlay].draw_image(filename, image_x, image_y, src_x, src_y, src_width, src_height)
end
# The image is assumed to be the digits 0-9 and then a "/", all the same
# width, in a horizontal row.
def draw_number_from_image(bitmap, string, text_x, text_y, align: :left, overlay: :overlay)
string = string.to_s
raise _INTL("Can't draw {1} as a number.", string) if !string.scan(/[^\d\/]/).empty?
char_width = bitmap.width / 11
char_height = bitmap.height
chars = string.split(//)
chars.reverse! if align == :right
chars.length.times do |i|
char = chars[i]
index = (char == "/") ? 10 : char.to_i
char_x = (align == :right) ? text_x - ((i + 1) * char_width) : text_x + (i * char_width)
draw_image(bitmap, char_x, text_y,
index * char_width, 0, char_width, char_height, overlay: overlay)
end
end
#---------------------------------------------------------------------------
# Redraw everything on the screen.

File diff suppressed because it is too large Load Diff