Refactoring of new UI

This commit is contained in:
Maruno17
2025-01-23 23:47:20 +00:00
parent 6f37cb7e33
commit 39a11e8ea8
12 changed files with 170 additions and 208 deletions

View File

@@ -5,15 +5,22 @@ module UI
module SpriteContainerMixin
UI_FOLDER = "Graphics/UI/"
GRAPHICS_FOLDER = "" # Subfolder in UI_FOLDER
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(72, 72, 72), Color.new(160, 160, 160)] # Base and shadow colour
DEFAULT_TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(88, 88, 80), Color.new(168, 184, 184)], # Base and shadow colour
:black => [Color.new(64, 64, 64), Color.new(176, 176, 176)],
:white => [Color.new(248, 248, 248), Color.new(40, 40, 40)],
:gray => [Color.new(88, 88, 80), Color.new(168, 184, 184)],
:male => [Color.new(24, 112, 216), Color.new(136, 168, 208)],
:female => [Color.new(248, 56, 32), Color.new(224, 152, 144)]
}
TEXT_COLOR_THEMES = {} # Extra color themes to be defined in child classes
def add_overlay(overlay, overlay_width = -1, overlay_height = -1)
overlay_width = Graphics.width if overlay_width < 0
overlay_height = Graphics.height if overlay_height < 0
@sprites[overlay] = BitmapSprite.new(overlay_width, overlay_height, @viewport)
@sprites[overlay].z = 1000
DEFAULT_TEXT_COLOR_THEMES.each_pair { |key, values| @sprites[overlay].add_text_theme(key, *values) }
self.class::TEXT_COLOR_THEMES.each_pair { |key, values| @sprites[overlay].add_text_theme(key, *values) }
pbSetSystemFont(@sprites[overlay].bitmap)
end
@@ -77,6 +84,10 @@ module UI
return base_filename
end
def get_text_color_theme(theme)
return self.class::TEXT_COLOR_THEMES[theme] || DEFAULT_TEXT_COLOR_THEMES[theme] || DEFAULT_TEXT_COLOR_THEMES[:default]
end
#---------------------------------------------------------------------------
# NOTE: max_width should include the width of the text shadow at the end of
@@ -103,14 +114,14 @@ module UI
def draw_paragraph_text(string, text_x, text_y, text_width, num_lines, theme: :default, overlay: :overlay)
drawTextEx(@sprites[overlay].bitmap, text_x, text_y, text_width, num_lines,
string, *self.class::TEXT_COLOR_THEMES[theme])
string, *get_text_color_theme(theme))
end
# NOTE: This also draws string in a paragraph, but with no limit on the
# number of lines.
def draw_formatted_text(string, text_x, text_y, text_width, theme: :default, overlay: :overlay)
drawFormattedTextEx(@sprites[overlay].bitmap, text_x, text_y, text_width,
string, *self.class::TEXT_COLOR_THEMES[theme])
string, *get_text_color_theme(theme))
end
def draw_image(filename, image_x, image_y, src_x = 0, src_y = 0, src_width = -1, src_height = -1, overlay: :overlay)
@@ -307,13 +318,14 @@ module UI
#=============================================================================
class BaseVisuals
attr_reader :sprites
attr_reader :mode
attr_reader :mode, :sub_mode
BACKGROUND_FILENAME = "bg"
include SpriteContainerMixin
def initialize
@sub_mode = :none
@bitmaps = {}
@sprites = {}
initialize_viewport
@@ -407,6 +419,10 @@ module UI
return 0
end
def set_sub_mode(sub_mode = :none)
@sub_mode = sub_mode
end
#---------------------------------------------------------------------------
def position_speech_box(text = "")
@@ -750,6 +766,10 @@ module UI
return @visuals.index
end
def set_sub_mode(sub_mode = :none)
@visuals.set_sub_mode(sub_mode)
end
#-----------------------------------------------------------------------------
def show_message(text, &block)

View File

@@ -9,8 +9,7 @@ class UI::PartyVisualsPanel < UI::SpriteContainer
attr_reader :pokemon, :text
GRAPHICS_FOLDER = "Party/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 248), Color.new(40, 40, 40)], # Base and shadow colour
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:male => [Color.new(0, 112, 248), Color.new(120, 184, 232)],
:female => [Color.new(232, 32, 16), Color.new(248, 168, 184)]
}
@@ -198,7 +197,7 @@ class UI::PartyVisualsPanel < UI::SpriteContainer
pokemon_name = @pokemon.name
pokemon_name = crop_text(pokemon_name, 144)
name_width = @sprites[:overlay].bitmap.text_size(pokemon_name).width
draw_text(pokemon_name, 94 - [name_width - 130, 0].max, 22)
draw_text(pokemon_name, 94 - [name_width - 130, 0].max, 22, theme: :white)
end
def draw_level
@@ -221,6 +220,7 @@ class UI::PartyVisualsPanel < UI::SpriteContainer
bar_x = 136
bar_y = 52
bar_total_width = 96
bar_height = 8
bar_width = [@pokemon.hp * bar_total_width / @pokemon.totalhp.to_f, 1.0].max
bar_width = ((bar_width / 2).round) * 2 # Make the bar's length a multiple of 2 pixels
bar_width -= 2 if bar_width == bar_total_width && @pokemon.hp < @pokemon.totalhp
@@ -228,7 +228,7 @@ class UI::PartyVisualsPanel < UI::SpriteContainer
hp_zone = 1 if @pokemon.hp <= (@pokemon.totalhp / 2).floor # Yellow
hp_zone = 2 if @pokemon.hp <= (@pokemon.totalhp / 4).floor # Red
draw_image(graphics_folder + "hp_bar_fill", bar_x, bar_y,
0, hp_zone * 8, bar_width, 8)
0, hp_zone * bar_height, bar_width, bar_height)
end
def draw_hp_numbers
@@ -259,7 +259,7 @@ class UI::PartyVisualsPanel < UI::SpriteContainer
end
def draw_annotation
draw_text(@text, 94, 62) if @text && @text.length > 0
draw_text(@text, 94, 62, theme: :white) if @text && @text.length > 0
end
end
@@ -268,9 +268,6 @@ end
#===============================================================================
class UI::PartyVisualsButton < UI::SpriteContainer
GRAPHICS_FOLDER = "Party/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 248), Color.new(40, 40, 40)] # Base and shadow colour
}
def initialize(text, x, y, narrow, viewport)
@text = text
@@ -319,7 +316,7 @@ class UI::PartyVisualsButton < UI::SpriteContainer
def refresh_overlay
super
draw_text(@text, @sprites[:overlay].width / 2, (@narrow) ? 8 : 14, align: :center)
draw_text(@text, @sprites[:overlay].width / 2, (@narrow) ? 8 : 14, align: :center, theme: :white)
end
end
@@ -328,7 +325,6 @@ end
#===============================================================================
class UI::PartyVisuals < UI::BaseVisuals
attr_reader :index
attr_reader :sub_mode
GRAPHICS_FOLDER = "Party/" # Subfolder in Graphics/UI
@@ -432,10 +428,6 @@ class UI::PartyVisuals < UI::BaseVisuals
end
end
def set_sub_mode(sub_mode = :normal)
@sub_mode = sub_mode
end
#-----------------------------------------------------------------------------
def switch_index
@@ -660,6 +652,7 @@ class UI::PartyVisuals < UI::BaseVisuals
return :switch_pokemon_start
elsif @sub_mode == :switch_items
return :item_move if @party[@index].hasItem?
return nil
end
pbPlayDecisionSE
return :interact_menu
@@ -670,7 +663,7 @@ class UI::PartyVisuals < UI::BaseVisuals
end
when Input::BACK
return :switch_pokemon_cancel if switching?
return :clear_sub_mode if (@sub_mode || :normal) != :normal
return :clear_sub_mode if (@sub_mode || :none) != :none
pbPlayCloseMenuSE
return :quit
end
@@ -800,10 +793,6 @@ class UI::Party < UI::BaseScreen
@visuals.set_annotations(nil)
end
def set_sub_mode(sub_mode = :normal)
@visuals.set_sub_mode(sub_mode)
end
#-----------------------------------------------------------------------------
def switch_index
@@ -1290,7 +1279,7 @@ UIActionHandlers.add(UI::Party::SCREEN_ID, :mail_take, {
UIActionHandlers.add(UI::Party::SCREEN_ID, :clear_sub_mode, {
:effect => proc { |screen|
pbPlayCancelSE
screen.set_sub_mode(:normal)
screen.set_sub_mode
}
})

View File

@@ -81,15 +81,10 @@ end
#===============================================================================
class UI::PokemonSummaryVisuals < UI::BaseVisuals
GRAPHICS_FOLDER = "Summary/" # Subfolder in Graphics/UI
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 248), Color.new(104, 104, 104)], # Base and shadow colour
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:white => [Color.new(248, 248, 248), Color.new(104, 104, 104)],
:raised_stat => [Color.new(248, 248, 248), Color.new(136, 96, 72)],
:lowered_stat => [Color.new(248, 248, 248), Color.new(64, 120, 152)],
:black => [Color.new(64, 64, 64), Color.new(176, 176, 176)],
:faded => [Color.new(192, 200, 208), Color.new(208, 216, 224)],
:male => [Color.new(24, 112, 216), Color.new(136, 168, 208)],
:female => [Color.new(248, 56, 32), Color.new(224, 152, 144)],
:shiny => [Color.new(248, 56, 32), Color.new(224, 152, 144)],
:pp_half => [Color.new(248, 192, 0), Color.new(144, 104, 0)],
:pp_quarter => [Color.new(248, 136, 32), Color.new(144, 72, 24)],
@@ -426,7 +421,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
end
def draw_page_name
draw_text(PAGE_HANDLERS[@page][:name].call, 30, 22)
draw_text(PAGE_HANDLERS[@page][:name].call, 30, 22, theme: :white)
end
def draw_page_icons
@@ -462,7 +457,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
def draw_pokemon_name
pokemon_name = @pokemon.name
pokemon_name = crop_text(pokemon_name, 152)
draw_text(pokemon_name, 42, 68)
draw_text(pokemon_name, 42, 68, theme: :white)
end
def draw_shiny_icon
@@ -603,7 +598,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
#-----------------------------------------------------------------------------
def draw_pokedex_number
draw_text(_INTL("Dex No."), 238, 86)
draw_text(_INTL("Dex No."), 238, 86, theme: :white)
# Figure out what the Dex number is
dex_num = 0
dex_num_shift = false
@@ -633,15 +628,15 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
end
def draw_species
draw_text(_INTL("Species"), 238, 118)
draw_text(_INTL("Species"), 238, 118, theme: :white)
species_name = @pokemon.speciesName
species_name = crop_text(species_name, 144)
draw_text(species_name, 428, 118, align: :center, theme: :black)
end
def draw_original_trainer_details
draw_text(_INTL("OT"), 238, 150)
draw_text(_INTL("ID No."), 238, 182)
draw_text(_INTL("OT"), 238, 150, theme: :white)
draw_text(_INTL("ID No."), 238, 182, theme: :white)
owner_name = (@pokemon.owner.name.empty?) ? _INTL("RENTAL") : @pokemon.owner.name
owner_name = crop_text(owner_name, 144)
owner_theme = [:male, :female][@pokemon.owner.gender || 99] || :black
@@ -653,7 +648,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
def draw_held_item
@sprites[:held_item_icon].visible = true
@sprites[:held_item_icon].item = @pokemon.item_id
draw_text(_INTL("Held Item"), 302, 230)
draw_text(_INTL("Held Item"), 302, 230, theme: :white)
# Write the held item's name
item_name = (@pokemon.hasItem?) ? @pokemon.item.name : _INTL("None")
item_name = crop_text(item_name, 192)
@@ -663,9 +658,9 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
def draw_exp
return if @pokemon.shadowPokemon?
# Draw text
draw_text(_INTL("Exp. Points"), 238, 310)
draw_text(_INTL("Exp. Points"), 238, 310, theme: :white)
draw_text(@pokemon.exp.to_s_formatted, 490, 310, align: :right, theme: :black)
draw_text(_INTL("To Next Lv."), 238, 342)
draw_text(_INTL("To Next Lv."), 238, 342, theme: :white)
end_exp = @pokemon.growth_rate.minimum_exp_for_level(@pokemon.level + 1)
draw_text((end_exp - @pokemon.exp).to_s_formatted, 490, 342, align: :right, theme: :black)
# Draw Exp bar
@@ -692,13 +687,13 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
_INTL("The door to its heart is opening wider."),
_INTL("The door to its heart is opening up."),
_INTL("The door to its heart is tightly shut.")][@pokemon.heartStage]
draw_formatted_text(heart_message, 232, 310, 268, theme: :black)
draw_paragraph_text(heart_message, 232, 310, 268, 2, theme: :black)
end
def draw_stats
# Determine which stats are boosted and lowered by the Pokémon's nature
stat_themes = {}
GameData::Stat.each_main { |s| stat_themes[s.id] = :default }
GameData::Stat.each_main { |s| stat_themes[s.id] = :white }
if !@pokemon.shadowPokemon? || @pokemon.heartStage <= 3
@pokemon.nature_for_stats.stat_changes.each do |change|
stat_themes[change[0]] = :raised_stat if change[1] > 0
@@ -716,7 +711,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
end
def draw_ability
draw_text(_INTL("Ability"), 224, 262)
draw_text(_INTL("Ability"), 224, 262, theme: :white)
ability = @pokemon.ability
return if !ability
ability_name = ability.name
@@ -778,13 +773,13 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
def draw_move_properties
selected_move = ((@move_index || 0) == Pokemon::MAX_MOVES) ? @new_move : @pokemon.moves[@move_index || 0]
# Power
draw_text(_INTL("POWER"), 20, 128)
draw_text(_INTL("POWER"), 20, 128, theme: :white)
power_text = selected_move.display_power(@pokemon)
power_text = "---" if power_text == 0 # Status move
power_text = "???" if power_text == 1 # Variable power move
draw_text(power_text, 222, 128, align: :right, theme: :black)
# Accuracy
draw_text(_INTL("ACCURACY"), 20, 160)
draw_text(_INTL("ACCURACY"), 20, 160, theme: :white)
accuracy = selected_move.display_accuracy(@pokemon)
if accuracy == 0
draw_text("---", 222, 160, align: :right, theme: :black)
@@ -824,7 +819,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
if ribbon_id
ribbon_data = GameData::Ribbon.get(ribbon_id)
# Draw name of selected ribbon
draw_text(ribbon_data.name, 18, 292)
draw_text(ribbon_data.name, 18, 292, theme: :white)
# Draw selected ribbon's description
draw_paragraph_text(ribbon_data.description, 18, 324, 480, 2, theme: :black)
end
@@ -832,8 +827,8 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
def draw_memo
# Set up memo
red_text_tag = shadowc3tag(*TEXT_COLOR_THEMES[:shiny])
black_text_tag = shadowc3tag(*TEXT_COLOR_THEMES[:black])
red_text_tag = shadowc3tag(*get_text_color_theme(:shiny))
black_text_tag = shadowc3tag(*get_text_color_theme(:black))
memo = ""
show_nature = (!@pokemon.shadowPokemon? || @pokemon.heartStage <= 3)
# Add nature to memo
@@ -938,8 +933,8 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
def draw_egg_memo
# Set up memo
red_text_tag = shadowc3tag(*TEXT_COLOR_THEMES[:shiny])
black_text_tag = shadowc3tag(*TEXT_COLOR_THEMES[:black])
red_text_tag = shadowc3tag(*get_text_color_theme(:shiny))
black_text_tag = shadowc3tag(*get_text_color_theme(:black))
memo = ""
# Add date received to memo
if @pokemon.timeReceived
@@ -964,7 +959,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
# Draw obtain text
draw_formatted_text(memo, 232, 86, 268)
# Add Egg Watch blurb to memo
draw_text(_INTL("The Egg Watch"), 238, 246)
draw_text(_INTL("The Egg Watch"), 238, 246, theme: :white)
egg_state = _INTL("It looks like this Egg will take a long time to hatch.")
egg_state = _INTL("What will hatch from this? It doesn't seem close to hatching.") if @pokemon.steps_to_hatch < 10_200
egg_state = _INTL("It appears to move occasionally. It may be close to hatching.") if @pokemon.steps_to_hatch < 2550
@@ -1040,9 +1035,9 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals
overlay: :marking_overlay)
end
# Draw text
draw_text(_INTL("Mark {1}", @pokemon.name), 368, 102, align: :center, overlay: :marking_overlay)
draw_text(_INTL("OK"), 368, 254, align: :center, overlay: :marking_overlay)
draw_text(_INTL("Cancel"), 368, 304, align: :center, overlay: :marking_overlay)
draw_text(_INTL("Mark {1}", @pokemon.name), 368, 102, align: :center, theme: :white, overlay: :marking_overlay)
draw_text(_INTL("OK"), 368, 254, align: :center, theme: :white, overlay: :marking_overlay)
draw_text(_INTL("Cancel"), 368, 304, align: :center, theme: :white, overlay: :marking_overlay)
end
#-----------------------------------------------------------------------------

View File

@@ -167,10 +167,7 @@ class UI::BagVisuals < UI::BaseVisuals
attr_reader :pocket
GRAPHICS_FOLDER = "Bag/" # Subfolder in Graphics/UI
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 248), Color.new(56, 56, 56)], # Base and shadow colour
:white => [Color.new(248, 248, 248), Color.new(56, 56, 56)],
:black => [Color.new(88, 88, 80), Color.new(168, 184, 184)],
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:switching => [Color.new(224, 0, 0), Color.new(248, 144, 144)]
}
SLIDER_COORDS = { # Size of elements in slider graphic
@@ -236,10 +233,10 @@ class UI::BagVisuals < UI::BaseVisuals
def initialize_item_list
@sprites[:item_list] = UI::BagVisualsList.new(@bag, 166, 28, 332, 40 + 28 + (ITEMS_VISIBLE * 32), @viewport)
@sprites[:item_list].baseColor = TEXT_COLOR_THEMES[:black][0]
@sprites[:item_list].shadowColor = TEXT_COLOR_THEMES[:black][1]
@sprites[:item_list].switching_base_color = TEXT_COLOR_THEMES[:switching][0]
@sprites[:item_list].switching_shadow_color = TEXT_COLOR_THEMES[:switching][1]
@sprites[:item_list].baseColor = get_text_color_theme(:black)[0]
@sprites[:item_list].shadowColor = get_text_color_theme(:black)[1]
@sprites[:item_list].switching_base_color = get_text_color_theme(:switching)[0]
@sprites[:item_list].switching_shadow_color = get_text_color_theme(:switching)[1]
@sprites[:item_list].items = @bag.pockets[@pocket]
@sprites[:item_list].index = @bag.last_viewed_index(@pocket) if @mode != :choose_item
@sprites[:item_list].active = false
@@ -252,8 +249,8 @@ class UI::BagVisuals < UI::BaseVisuals
@sprites[:item_description] = Window_UnformattedTextPokemon.newWithSize(
"", 76, 272, Graphics.width - 98, 128, @viewport
)
@sprites[:item_description].baseColor = TEXT_COLOR_THEMES[:white][0]
@sprites[:item_description].shadowColor = TEXT_COLOR_THEMES[:white][1]
@sprites[:item_description].baseColor = get_text_color_theme(:white)[0]
@sprites[:item_description].shadowColor = get_text_color_theme(:white)[1]
@sprites[:item_description].visible = true
@sprites[:item_description].windowskin = nil
end
@@ -363,9 +360,9 @@ class UI::BagVisuals < UI::BaseVisuals
set_pocket(new_pocket)
end
def set_sub_mode(sub_mode = :normal)
@sub_mode = sub_mode
@sprites[:item_list].sort_mode = (sub_mode == :rearrange_items)
def set_sub_mode(sub_mode = :none)
super
@sprites[:item_list].sort_mode = (@sub_mode == :rearrange_items)
end
# All screen menu options are related to sorting.
@@ -457,7 +454,7 @@ class UI::BagVisuals < UI::BaseVisuals
draw_image(@bitmaps[:input_icons], action_icon_x, action_icon_y,
2 * @bitmaps[:input_icons].height, 0,
@bitmaps[:input_icons].height, @bitmaps[:input_icons].height)
draw_text(action_text, action_text_x, action_text_y)
draw_text(action_text, action_text_x, action_text_y, theme: :white)
end
end
@@ -577,34 +574,34 @@ class UI::BagVisuals < UI::BaseVisuals
move = GameData::Item.get(item).move
move_data = GameData::Move.get(move)
# Type
draw_text(_INTL("Type"), 4, 14, overlay: :move_details_overlay)
draw_text(_INTL("Type"), 4, 14, theme: :white, overlay: :move_details_overlay)
type_number = GameData::Type.get(move_data.type).icon_position
draw_image(@bitmaps[:types], 106, 10,
0, type_number * GameData::Type::ICON_SIZE[1], *GameData::Type::ICON_SIZE,
overlay: :move_details_overlay)
# Category
draw_text(_INTL("Category"), 4, 46, overlay: :move_details_overlay)
draw_text(_INTL("Category"), 4, 46, theme: :white, overlay: :move_details_overlay)
draw_image(@bitmaps[:categories], 106, 42,
0, move_data.category * GameData::Move::CATEGORY_ICON_SIZE[1], *GameData::Move::CATEGORY_ICON_SIZE,
overlay: :move_details_overlay)
# Power
draw_text(_INTL("Power"), 4, 78, overlay: :move_details_overlay)
draw_text(_INTL("Power"), 4, 78, theme: :white, overlay: :move_details_overlay)
power_text = move_data.power
power_text = "---" if power_text == 0 # Status move
power_text = "???" if power_text == 1 # Variable power move
draw_text(power_text, 156, 78, align: :right, overlay: :move_details_overlay)
draw_text(power_text, 156, 78, align: :right, theme: :white, overlay: :move_details_overlay)
# Accuracy
draw_text(_INTL("Accuracy"), 4, 110, overlay: :move_details_overlay)
draw_text(_INTL("Accuracy"), 4, 110, theme: :white, overlay: :move_details_overlay)
accuracy = move_data.accuracy
if accuracy == 0
draw_text("---", 156, 110, align: :right, overlay: :move_details_overlay)
draw_text("---", 156, 110, align: :right, theme: :white, overlay: :move_details_overlay)
else
draw_text(accuracy, 156, 110, align: :right, overlay: :move_details_overlay)
draw_text("%", 156, 110, overlay: :move_details_overlay)
draw_text(accuracy, 156, 110, align: :right, theme: :white, overlay: :move_details_overlay)
draw_text("%", 156, 110, theme: :white, overlay: :move_details_overlay)
end
# PP
draw_text(_INTL("PP"), 4, 142, overlay: :move_details_overlay)
draw_text(move_data.total_pp, 156, 142, align: :right, overlay: :move_details_overlay)
draw_text(_INTL("PP"), 4, 142, theme: :white, overlay: :move_details_overlay)
draw_text(move_data.total_pp, 156, 142, align: :right, theme: :white, overlay: :move_details_overlay)
end
def refresh_on_index_changed(old_index)
@@ -670,7 +667,7 @@ class UI::BagVisuals < UI::BaseVisuals
end
when Input::BACK
return :switch_item_cancel if switching?
return :clear_sub_mode if (@sub_mode || :normal) != :normal && pocket_sortable?
return :clear_sub_mode if (@sub_mode || :none) != :none && pocket_sortable?
pbPlayCloseMenuSE
return :quit
end
@@ -770,10 +767,6 @@ class UI::Bag < UI::BaseScreen
@visuals.set_filter_proc(filter_proc)
end
def set_sub_mode(sub_mode = :normal)
@visuals.set_sub_mode(sub_mode)
end
def switch_index
return @visuals.switch_index
end
@@ -876,7 +869,7 @@ UIActionHandlers.add(UI::Bag::SCREEN_ID, :rearrange_items_mode, {
UIActionHandlers.add(UI::Bag::SCREEN_ID, :clear_sub_mode, {
:effect => proc { |screen|
pbPlayCancelSE
screen.set_sub_mode(:normal)
screen.set_sub_mode
}
})

View File

@@ -11,17 +11,12 @@ class UI::TownMapVisuals < UI::BaseVisuals
CURSOR_MOVE_TIME = 0.08 # In seconds
ZOOM_TIME = 0.2 # In seconds
ZOOM_CURSOR_POSITION = [MAP_SIZE[0] / 4, MAP_SIZE[1] / 2]
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 248), Color.new(0, 0, 0)], # Base and shadow colour
:black => [Color.new(64, 64, 64), Color.new(176, 176, 176)]
}
MARKINGS_COUNT = 4 # Number of markings a point can have
MARKING_SPACING = 8 # In the markings panel (where markings are changed)
MARKINGS_COUNT = 4 # Number of markings a point can have
MARKING_SPACING = 8 # In the markings panel (where markings are changed)
def initialize(region = 0, mode = :normal)
@region = region
@mode = mode
@sub_mode = :none # Could be toggled to :fly
@cursor_offset = {:x => 0, :y => 0}
load_region_data
find_visited_regions
@@ -471,13 +466,13 @@ class UI::TownMapVisuals < UI::BaseVisuals
def start_fly_mode
return if @mode == :fly || @sub_mode == :fly
@sub_mode = :fly
set_sub_mode(:fly)
generate_fly_icons
refresh_input_helpers
end
def end_fly_mode
@sub_mode = :none
set_sub_mode
clear_fly_icons
refresh_input_helpers
end
@@ -554,7 +549,7 @@ class UI::TownMapVisuals < UI::BaseVisuals
name = pbGetMessageFromHash(MessageTypes::REGION_LOCATION_NAMES, point_data[:real_name])
name = name.gsub(/\\PN/, $player.name)
name = name.gsub(/\\v\[(\d+)\]/) { |num| $game_variables[$~[1].to_i].to_s }
theme = (@mode == :wall_map) ? :black : :default
theme = (@mode == :wall_map) ? :black : :white
draw_text(name, @sprites[:map_name_overlay].width / 2, 6, align: :center, theme: theme, overlay: :map_name_overlay)
end
end
@@ -571,7 +566,8 @@ class UI::TownMapVisuals < UI::BaseVisuals
number * @bitmaps[:input_icons].height, 0,
@bitmaps[:input_icons].height, @bitmaps[:input_icons].height,
overlay: :input_helpers_overlay)
draw_text(action_text, input_x + @bitmaps[:input_icons].height + icon_text_spacing, action_text_y, overlay: :input_helpers_overlay)
draw_text(action_text, input_x + @bitmaps[:input_icons].height + icon_text_spacing, action_text_y,
theme: :white, overlay: :input_helpers_overlay)
input_x += @bitmaps[:input_icons].height + icon_text_spacing
input_x += @sprites[:input_helpers_overlay].bitmap.text_size(action_text).width
input_x += input_spacing
@@ -636,7 +632,7 @@ class UI::TownMapVisuals < UI::BaseVisuals
description = pbGetMessageFromHash(MessageTypes::REGION_LOCATION_DESCRIPTIONS, point_data[:real_description])
description = description.gsub(/\\PN/, $player.name)
description = description.gsub(/\\v\[(\d+)\]/) { |num| $game_variables[$~[1].to_i].to_s }
draw_formatted_text(description, 18, 144, 210, overlay: :details_overlay)
draw_formatted_text(description, 18, 144, 210, theme: :white, overlay: :details_overlay)
end
end

View File

@@ -8,6 +8,9 @@ class UI::TrainerCardVisuals < UI::BaseVisuals
FIRST_BADGE_X = 72 # Left edge of the first Gym Badge
FIRST_BADGE_Y = 310 # Top edge of the first Gym Badge
BADGE_COUNT = 8 # Number of Gym Badges to show
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:gray => [Color.new(72, 72, 72), Color.new(160, 160, 160)]
}
def initialize_sprites
# Trainer card
@@ -34,10 +37,10 @@ class UI::TrainerCardVisuals < UI::BaseVisuals
# Draws the player's name and ID number onto the overlay.
def draw_ID
draw_text(_INTL("Name"), 34, 70)
draw_text($player.name, 302, 70, align: :right)
draw_text(_INTL("ID No."), 332, 70)
draw_text(sprintf("%05d", $player.public_ID), 468, 70, align: :right)
draw_text(_INTL("Name"), 34, 70, theme: :gray)
draw_text($player.name, 302, 70, align: :right, theme: :gray)
draw_text(_INTL("ID No."), 332, 70, theme: :gray)
draw_text(sprintf("%05d", $player.public_ID), 468, 70, align: :right, theme: :gray)
end
# Draws the player's money, Pokédex numbers, play time and start date onto the
@@ -66,14 +69,14 @@ class UI::TrainerCardVisuals < UI::BaseVisuals
$PokemonGlobal.startTime.year)
end
# Draw text
draw_text(_INTL("Money"), 34, 118)
draw_text(money_text, 302, 118, align: :right)
draw_text(_INTL("Pokédex"), 34, 166)
draw_text(pokedex_text, 302, 166, align: :right)
draw_text(_INTL("Time"), 34, 214)
draw_text(play_time_text, 302, 214, align: :right)
draw_text(_INTL("Started"), 34, 262)
draw_text(start_date_text, 302, 262, align: :right)
draw_text(_INTL("Money"), 34, 118, theme: :gray)
draw_text(money_text, 302, 118, align: :right, theme: :gray)
draw_text(_INTL("Pokédex"), 34, 166, theme: :gray)
draw_text(pokedex_text, 302, 166, align: :right, theme: :gray)
draw_text(_INTL("Time"), 34, 214, theme: :gray)
draw_text(play_time_text, 302, 214, align: :right, theme: :gray)
draw_text(_INTL("Started"), 34, 262, theme: :gray)
draw_text(start_date_text, 302, 262, align: :right, theme: :gray)
end
# Draws the player's owned Gym Badges onto the overlay.

View File

@@ -49,11 +49,8 @@ class UI::LoadPanel < UI::SpriteContainer
attr_writer :label
GRAPHICS_FOLDER = "Load/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(88, 88, 80), Color.new(168, 184, 184)] # Base and shadow colour
}
PANEL_WIDTH = 392
PANEL_HEIGHT = 56
PANEL_WIDTH = 392
PANEL_HEIGHT = 56
def initialize(label, viewport)
@label = label
@@ -111,7 +108,7 @@ class UI::LoadPanel < UI::SpriteContainer
def refresh
super
draw_text(@label, 18, 18)
draw_text(@label, 18, 18, theme: :gray)
end
end
@@ -122,8 +119,7 @@ class UI::LoadContinuePanel < UI::LoadPanel
attr_reader :sprites
GRAPHICS_FOLDER = "Load/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(88, 88, 80), Color.new(168, 184, 184)], # Base and shadow colour
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:male => [Color.new(0, 112, 248), Color.new(120, 184, 232)],
:female => [Color.new(232, 32, 16), Color.new(248, 168, 184)]
}
@@ -249,7 +245,7 @@ class UI::LoadContinuePanel < UI::LoadPanel
def draw_slot_number
return if @total_slots <= 1
draw_text(sprintf("%d/%d", @slot_index + 1, @total_slots), PANEL_WIDTH - 18, 18, align: :right)
draw_text(sprintf("%d/%d", @slot_index + 1, @total_slots), PANEL_WIDTH - 18, 18, align: :right, theme: :gray)
end
def draw_save_file_text
@@ -268,13 +264,13 @@ class UI::LoadContinuePanel < UI::LoadPanel
map_name = map_name.gsub(/\\v\[(\d+)\]/) { |num| @save_data[:variables][$~[1].to_i].to_s }
draw_text(map_name, 18, 114, theme: gender_theme)
# Gym Badges
draw_text(_INTL("Badges:"), 18, 146)
draw_text(_INTL("Badges:"), 18, 146, theme: :gray)
draw_text(@save_data[:player].badge_count.to_s, 156, 146, theme: gender_theme)
# Pokédex owned count
draw_text(_INTL("Pokédex:"), 18, 178)
draw_text(_INTL("Pokédex:"), 18, 178, theme: :gray)
draw_text(@save_data[:player].pokedex.seen_count.to_s, 156, 178, theme: gender_theme)
# Time played
draw_text(_INTL("Time played:"), 18, 210)
draw_text(_INTL("Time played:"), 18, 210, theme: :gray)
play_time = @save_data[:stats]&.play_time.to_i || 0
hour = (play_time / 60) / 60
min = (play_time / 60) % 60

View File

@@ -5,11 +5,10 @@ class UI::SavePanel < UI::SpriteContainer
attr_reader :sprites
GRAPHICS_FOLDER = "Save/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(88, 88, 80), Color.new(168, 184, 184)], # Base and shadow colour
:white => [Color.new(248, 248, 248), Color.new(172, 188, 188)],
:male => [Color.new(0, 112, 248), Color.new(120, 184, 232)],
:female => [Color.new(232, 32, 16), Color.new(248, 168, 184)]
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:white => [Color.new(248, 248, 248), Color.new(172, 188, 188)],
:male => [Color.new(0, 112, 248), Color.new(120, 184, 232)],
:female => [Color.new(232, 32, 16), Color.new(248, 168, 184)]
}
PANEL_WIDTH = 384
PANEL_HEIGHT = 204
@@ -157,7 +156,7 @@ class UI::SavePanel < UI::SpriteContainer
def draw_save_file_text
if !@save_data
draw_text(_INTL("Create a new save file"), width / 2, (height / 2) - 10, align: :center)
draw_text(_INTL("Create a new save file"), width / 2, (height / 2) - 10, align: :center, theme: :gray)
return
end
gender_theme = :default
@@ -173,20 +172,20 @@ class UI::SavePanel < UI::SpriteContainer
map_name = pbGetMapNameFromId(map_id)
map_name = map_name.gsub(/\\PN/, @save_data[:player].name)
map_name = map_name.gsub(/\\v\[(\d+)\]/) { |num| @save_data[:variables][$~[1].to_i].to_s }
draw_text(map_name, 14, 78)
draw_text(map_name, 14, 78, theme: :gray)
# Gym Badges
draw_text(_INTL("Badges:"), 14, 110, theme: :white)
draw_text(@save_data[:player].badge_count.to_s, 222, 110, align: :right)
draw_text(@save_data[:player].badge_count.to_s, 222, 110, align: :right, theme: :gray)
# Pokédex owned count
draw_text(_INTL("Pokédex:"), 14, 142, theme: :white)
draw_text(@save_data[:player].pokedex.seen_count.to_s, 222, 142, align: :right)
draw_text(@save_data[:player].pokedex.seen_count.to_s, 222, 142, align: :right, theme: :gray)
# Time played
draw_text(_INTL("Play time:"), 14, 174, theme: :white)
play_time = @save_data[:stats]&.real_play_time.to_i || 0
hour = (play_time / 60) / 60
min = (play_time / 60) % 60
play_time_text = (hour > 0) ? _INTL("{1}h {2}m", hour, min) : _INTL("{1}m", min)
draw_text(play_time_text, 222, 174, align: :right)
draw_text(play_time_text, 222, 174, align: :right, theme: :gray)
save_time = @save_data[:stats]&.real_time_saved
if save_time
save_time = Time.at(save_time)
@@ -195,9 +194,9 @@ class UI::SavePanel < UI::SpriteContainer
else
save_text = save_time.strftime("%-d/%-m/%Y")
end
draw_text(save_text, PANEL_WIDTH - 14, 174, align: :right)
draw_text(save_text, PANEL_WIDTH - 14, 174, align: :right, theme: :gray)
else
draw_text("???", PANEL_WIDTH - 14, 174, align: :right)
draw_text("???", PANEL_WIDTH - 14, 174, align: :right, theme: :gray)
end
end
@@ -215,9 +214,6 @@ class UI::SaveVisuals < UI::BaseVisuals
attr_reader :index
GRAPHICS_FOLDER = "Save/" # Subfolder in Graphics/UI
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(80, 80, 88), Color.new(176, 192, 192)] # Base and shadow colour
}
PANEL_SPACING = 8
# save_data here is an array of [save filename, save data hash]. It has been
@@ -327,19 +323,19 @@ class UI::SaveVisuals < UI::BaseVisuals
hour = (delta_time / 60) / 60
min = (delta_time / 60) % 60
if hour > 0
draw_text(_INTL("Play time since save: {1}h {2}m", hour, min), 8, 4)
draw_text(_INTL("Play time since save: {1}h {2}m", hour, min), 8, 4, theme: :gray)
else
draw_text(_INTL("Play time since save: {1}m", min), 8, 4)
draw_text(_INTL("Play time since save: {1}m", min), 8, 4, theme: :gray)
end
else
draw_text(_INTL("Alternate version of your adventure!"), 8, 4)
draw_text(_INTL("Alternate version of your adventure!"), 8, 4, theme: :gray)
end
else
draw_text(_INTL("Different adventure!"), 8, 4)
draw_text(_INTL("Different adventure!"), 8, 4, theme: :gray)
end
end
if @save_data[@index]
draw_text(sprintf("%d/%d", @index + 1, @save_data.length), Graphics.width - 8, 4, align: :right)
draw_text(sprintf("%d/%d", @index + 1, @save_data.length), Graphics.width - 8, 4, align: :right, theme: :gray)
end
elsif $stats.save_count > 0 && $stats.real_time_saved
save_time = Time.at($stats.real_time_saved)
@@ -349,7 +345,7 @@ class UI::SaveVisuals < UI::BaseVisuals
date_text = save_time.strftime("%-d/%-m/%Y")
end
time_text = save_time.strftime("%H:%M")
draw_text(_INTL("Last saved on {1} at {2}", date_text, time_text), 8, 4)
draw_text(_INTL("Last saved on {1} at {2}", date_text, time_text), 8, 4, theme: :gray)
end
end

View File

@@ -5,11 +5,8 @@ class UI::PokemonStorageVisualsSidePane < UI::SpriteContainer
attr_reader :pokemon
GRAPHICS_FOLDER = "Storage/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(88, 88, 80), Color.new(168, 184, 184)], # Base and shadow colour
:no_item => [Color.new(192, 200, 208), Color.new(212, 216, 220)],
:male => [Color.new(24, 112, 216), Color.new(136, 168, 208)],
:female => [Color.new(248, 56, 32), Color.new(224, 152, 144)]
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:no_item => [Color.new(192, 200, 208), Color.new(212, 216, 220)]
}
MARK_WIDTH = 16
MARK_HEIGHT = 16
@@ -83,7 +80,7 @@ class UI::PokemonStorageVisualsSidePane < UI::SpriteContainer
def draw_name
pokemon_name = @pokemon.name
pokemon_name = crop_text(pokemon_name, 158)
draw_text(pokemon_name, 8, 14)
draw_text(pokemon_name, 8, 14, theme: :gray)
end
def draw_level
@@ -130,7 +127,7 @@ class UI::PokemonStorageVisualsSidePane < UI::SpriteContainer
if @pokemon.hasItem?
item_name = @pokemon.item.name
item_name = crop_text(item_name, 166)
draw_text(item_name, 86, 316, align: :center)
draw_text(item_name, 86, 316, align: :center, theme: :gray)
else
draw_text(_INTL("No item"), 86, 316, align: :center, theme: :no_item)
end
@@ -311,9 +308,6 @@ class UI::PokemonStorageVisualsBox < UI::SpriteContainer
attr_reader :sprites
GRAPHICS_FOLDER = "Storage/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 240), Color.new(40, 48, 48)], # Base and shadow colour
}
def initialize(storage, box_number, viewport)
@storage = storage
@@ -423,7 +417,7 @@ class UI::PokemonStorageVisualsBox < UI::SpriteContainer
def draw_box_name
box_name = @storage[@box_number].name
box_name = crop_text(box_name, 216)
draw_text(box_name, 162, 14, align: :center)
draw_text(box_name, 162, 14, align: :center, theme: :white)
end
def refresh_existing_pokemon
@@ -440,9 +434,6 @@ class UI::PokemonStorageVisualsPartyPanel < UI::SpriteContainer
attr_reader :sprites
GRAPHICS_FOLDER = "Storage/"
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 240), Color.new(40, 48, 48)], # Base and shadow colour
}
def initialize(party, mode, viewport)
@party = party
@@ -524,7 +515,7 @@ class UI::PokemonStorageVisualsPartyPanel < UI::SpriteContainer
def draw_button_text
text = (@mode == :deposit) ? _INTL("Exit") : _INTL("Back")
draw_text(text, 86, 248, align: :center, outline: :outline)
draw_text(text, 86, 248, align: :center, outline: :outline, theme: :white)
end
def refresh_existing_pokemon
@@ -700,14 +691,10 @@ class UI::PokemonStorageVisuals < UI::BaseVisuals
# -1 = party
# 0+ = box number
attr_reader :box
attr_reader :sub_mode
GRAPHICS_FOLDER = "Storage/" # Subfolder in Graphics/UI
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 240), Color.new(40, 48, 48)], # Base and shadow colour
}
MARKING_WIDTH = 16
MARKING_HEIGHT = 16
GRAPHICS_FOLDER = "Storage/" # Subfolder in Graphics/UI
MARKING_WIDTH = 16
MARKING_HEIGHT = 16
def initialize(storage, mode = :normal)
@storage = storage
@@ -840,9 +827,9 @@ class UI::PokemonStorageVisuals < UI::BaseVisuals
refresh_on_index_changed(@index)
end
def set_sub_mode(sub_mode = :normal)
@sub_mode = sub_mode
@sprites[:cursor].quick_swap_mode = (@sub_mode != :normal)
def set_sub_mode(sub_mode = :none)
super
@sprites[:cursor].quick_swap_mode = (@sub_mode != :none)
@visible_proc = nil
if @sub_mode == :rearrange_items
@visible_proc = proc { |pkmn| pkmn.hasItem? }
@@ -1250,10 +1237,10 @@ class UI::PokemonStorageVisuals < UI::BaseVisuals
def refresh_buttons
if [:organize, :choose_pokemon].include?(@mode)
draw_text(_INTL("Party: {1}", @storage.party.length), 270, 334, align: :center, outline: :outline)
draw_text(_INTL("Party: {1}", @storage.party.length), 270, 334, align: :center, outline: :outline, theme: :white)
end
if @mode != :deposit
draw_text(_INTL("Exit"), 446, 334, align: :center, outline: :outline)
draw_text(_INTL("Exit"), 446, 334, align: :center, outline: :outline, theme: :white)
end
end
@@ -1329,8 +1316,8 @@ class UI::PokemonStorageVisuals < UI::BaseVisuals
overlay: :marking_overlay)
end
# Draw text
draw_text(_INTL("OK"), 400, 216, align: :center, outline: :outline, overlay: :marking_overlay)
draw_text(_INTL("Cancel"), 400, 280, align: :center, outline: :outline, overlay: :marking_overlay)
draw_text(_INTL("OK"), 400, 216, align: :center, outline: :outline, theme: :white, overlay: :marking_overlay)
draw_text(_INTL("Cancel"), 400, 280, align: :center, outline: :outline, theme: :white, overlay: :marking_overlay)
end
#-----------------------------------------------------------------------------
@@ -1482,7 +1469,7 @@ class UI::PokemonStorageVisuals < UI::BaseVisuals
if showing_party_panel?
return (@mode == :deposit) ? :exit_screen : :hide_party_panel
end
return :clear_sub_mode if (@sub_mode || :normal) != :normal
return :clear_sub_mode if (@sub_mode || :none) != :none
return :exit_screen
when Input::JUMPUP
pbPlayCursorSE
@@ -1671,10 +1658,6 @@ class UI::PokemonStorage < UI::BaseScreen
@visuals.set_index(new_index)
end
def set_sub_mode(sub_mode = :normal)
@visuals.set_sub_mode(sub_mode)
end
def party_able_count
return @storage.party.count { |pkmn| pkmn.able? }
end
@@ -1736,7 +1719,7 @@ UIActionHandlers.add(UI::PokemonStorage::SCREEN_ID, :clear_sub_mode, {
end
next
end
screen.set_sub_mode(:normal)
screen.set_sub_mode
}
})

View File

@@ -45,12 +45,12 @@ end
# Pokémon Mart.
#===============================================================================
class UI::MartVisualsList < Window_DrawableCommand
def initialize(stock, x, y, width, height, viewport = nil)
def initialize(stock, x, y, width, height, screen, viewport = nil)
@stock = stock
super(x, y, width, height, viewport)
@selarrow = AnimatedBitmap.new(bag_folder + "cursor")
@baseColor = UI::MartVisuals::TEXT_COLOR_THEMES[:black][0]
@shadowColor = UI::MartVisuals::TEXT_COLOR_THEMES[:black][1]
@baseColor = screen.get_text_color_theme(:gray)[0]
@shadowColor = screen.get_text_color_theme(:gray)[1]
self.windowskin = nil
end
@@ -128,10 +128,7 @@ class UI::MartVisuals < UI::BaseVisuals
attr_reader :pocket
GRAPHICS_FOLDER = "Mart/" # Subfolder in Graphics/UI
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 248), Color.new(56, 56, 56)], # Base and shadow colour
:white => [Color.new(248, 248, 248), Color.new(56, 56, 56)],
:black => [Color.new(88, 88, 80), Color.new(168, 184, 184)],
TEXT_COLOR_THEMES = { # Themes not in DEFAULT_TEXT_COLOR_THEMES
:expensive => [Color.new(224, 0, 0), Color.new(248, 144, 144)]
}
ITEMS_VISIBLE = 7
@@ -150,9 +147,9 @@ class UI::MartVisuals < UI::BaseVisuals
end
def initialize_item_list
@sprites[:item_list] = UI::MartVisualsList.new(@stock, 152, 10, 374, 38 + (ITEMS_VISIBLE * 32), @viewport)
@sprites[:item_list].expensive_base_color = TEXT_COLOR_THEMES[:expensive][0]
@sprites[:item_list].expensive_shadow_color = TEXT_COLOR_THEMES[:expensive][1]
@sprites[:item_list] = UI::MartVisualsList.new(@stock, 152, 10, 374, 38 + (ITEMS_VISIBLE * 32), self, @viewport)
@sprites[:item_list].expensive_base_color = get_text_color_theme(:expensive)[0]
@sprites[:item_list].expensive_shadow_color = get_text_color_theme(:expensive)[1]
@sprites[:item_list].active = false
end
@@ -163,8 +160,8 @@ class UI::MartVisuals < UI::BaseVisuals
@sprites[:item_description] = Window_UnformattedTextPokemon.newWithSize(
"", 80, 272, Graphics.width - 98, 128, @viewport
)
@sprites[:item_description].baseColor = TEXT_COLOR_THEMES[:white][0]
@sprites[:item_description].shadowColor = TEXT_COLOR_THEMES[:white][1]
@sprites[:item_description].baseColor = get_text_color_theme(:white)[0]
@sprites[:item_description].shadowColor = get_text_color_theme(:white)[1]
@sprites[:item_description].visible = true
@sprites[:item_description].windowskin = nil
end
@@ -172,8 +169,8 @@ class UI::MartVisuals < UI::BaseVisuals
def initialize_money_window
@sprites[:money_window] = Window_AdvancedTextPokemon.newWithSize("", 0, 0, 162, 96, @viewport)
@sprites[:money_window].setSkin("Graphics/Windowskins/goldskin")
@sprites[:money_window].baseColor = TEXT_COLOR_THEMES[:black][0]
@sprites[:money_window].shadowColor = TEXT_COLOR_THEMES[:black][1]
@sprites[:money_window].baseColor = get_text_color_theme(:gray)[0]
@sprites[:money_window].shadowColor = get_text_color_theme(:gray)[1]
@sprites[:money_window].letterbyletter = false
@sprites[:money_window].visible = true
end
@@ -183,8 +180,8 @@ class UI::MartVisuals < UI::BaseVisuals
_INTL("In Bag:<r>{1}", @bag.quantity(item)), 0, 0, 162, 64, @viewport
)
@sprites[:bag_quantity_window].setSkin("Graphics/Windowskins/goldskin")
@sprites[:bag_quantity_window].baseColor = TEXT_COLOR_THEMES[:black][0]
@sprites[:bag_quantity_window].shadowColor = TEXT_COLOR_THEMES[:black][1]
@sprites[:bag_quantity_window].baseColor = get_text_color_theme(:gray)[0]
@sprites[:bag_quantity_window].shadowColor = get_text_color_theme(:gray)[1]
@sprites[:bag_quantity_window].letterbyletter = false
@sprites[:bag_quantity_window].visible = true
@sprites[:bag_quantity_window].y = Graphics.height - 102 - @sprites[:bag_quantity_window].height
@@ -432,15 +429,15 @@ class UI::BagSellVisuals < UI::BagVisuals
@sprites[:money_window] = Window_AdvancedTextPokemon.newWithSize("", 0, 36, 184, 96, @viewport)
@sprites[:money_window].setSkin("Graphics/Windowskins/goldskin")
@sprites[:money_window].z = 2000
@sprites[:money_window].baseColor = TEXT_COLOR_THEMES[:black][0]
@sprites[:money_window].shadowColor = TEXT_COLOR_THEMES[:black][1]
@sprites[:money_window].baseColor = get_text_color_theme(:gray)[0]
@sprites[:money_window].shadowColor = get_text_color_theme(:gray)[1]
@sprites[:money_window].letterbyletter = false
@sprites[:money_window].visible = true
@sprites[:unit_price_window] = Window_AdvancedTextPokemon.newWithSize("", 0, 184, 184, 96, @viewport)
@sprites[:unit_price_window].setSkin("Graphics/Windowskins/goldskin")
@sprites[:unit_price_window].z = 2000
@sprites[:unit_price_window].baseColor = TEXT_COLOR_THEMES[:black][0]
@sprites[:unit_price_window].shadowColor = TEXT_COLOR_THEMES[:black][1]
@sprites[:unit_price_window].baseColor = get_text_color_theme(:gray)[0]
@sprites[:unit_price_window].shadowColor = get_text_color_theme(:gray)[1]
@sprites[:unit_price_window].letterbyletter = false
@sprites[:unit_price_window].visible = true
end

View File

@@ -31,8 +31,8 @@ end
class UI::BPShopVisuals < UI::MartVisuals
def initialize_item_list
@sprites[:item_list] = UI::BPShopVisualsList.new(@stock, 152, 10, 374, 38 + (ITEMS_VISIBLE * 32), @viewport)
@sprites[:item_list].expensive_base_color = TEXT_COLOR_THEMES[:expensive][0]
@sprites[:item_list].expensive_shadow_color = TEXT_COLOR_THEMES[:expensive][1]
@sprites[:item_list].expensive_base_color = get_text_color_theme(:expensive)[0]
@sprites[:item_list].expensive_shadow_color = get_text_color_theme(:expensive)[1]
@sprites[:item_list].active = false
end

View File

@@ -53,12 +53,6 @@ class UI::MoveReminderVisuals < UI::BaseVisuals
attr_reader :index
GRAPHICS_FOLDER = "Move Reminder/" # Subfolder in Graphics/UI
TEXT_COLOR_THEMES = { # These color themes are added to @sprites[:overlay]
:default => [Color.new(248, 248, 248), Color.new(0, 0, 0)], # Base and shadow colour
:white => [Color.new(248, 248, 248), Color.new(0, 0, 0)],
:black => [Color.new(64, 64, 64), Color.new(176, 176, 176)],
:header => [Color.new(88, 88, 80), Color.new(168, 184, 184)]
}
MOVE_LIST_X = 0
MOVE_LIST_Y = 84
MOVE_LIST_SPACING = 64 # Y distance between top of two adjacent move areas
@@ -111,7 +105,7 @@ class UI::MoveReminderVisuals < UI::BaseVisuals
end
def draw_header
draw_text(_INTL("Teach which move?"), 16, 14, theme: :header)
draw_text(_INTL("Teach which move?"), 16, 14, theme: :gray)
end
# x and y are the top left corner of the type icon if there is only one type.
@@ -139,7 +133,7 @@ class UI::MoveReminderVisuals < UI::BaseVisuals
# Draw move name
move_name = move_data.name
move_name = crop_text(move_name, 230)
draw_text(move_name, x + 10, y + 6)
draw_text(move_name, x + 10, y + 6, theme: :white)
# Draw move type icon
type_number = GameData::Type.get(move_data.display_type(@pokemon)).icon_position
draw_image(@bitmaps[:types], x + 10, y + 32,
@@ -158,13 +152,13 @@ class UI::MoveReminderVisuals < UI::BaseVisuals
move = @moves[@index]
move_data = GameData::Move.get(move)
# Power
draw_text(_INTL("POWER"), 278, 120)
draw_text(_INTL("POWER"), 278, 120, theme: :white)
power_text = move_data.display_power(@pokemon)
power_text = "---" if power_text == 0 # Status move
power_text = "???" if power_text == 1 # Variable power move
draw_text(power_text, 480, 120, align: :right, theme: :black)
# Accuracy
draw_text(_INTL("ACCURACY"), 278, 152)
draw_text(_INTL("ACCURACY"), 278, 152, theme: :white)
accuracy = move_data.display_accuracy(@pokemon)
if accuracy == 0
draw_text("---", 480, 152, align: :right, theme: :black)