diff --git a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb index cb1f1592c..d80d9e709 100644 --- a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb @@ -369,9 +369,15 @@ def get_text_colors_for_windowskin(windowskin, color, isDarkSkin) end # Special colour as listed above if isDarkSkin && color != 12 # Dark background, light text + if textcolors[(2 * (color - 1))].is_a?(Color) + return textcolors[(2 * (color - 1)) + 1], textcolors[2 * (color - 1)] + end return Color.new(*textcolors[(2 * (color - 1)) + 1]), Color.new(*textcolors[2 * (color - 1)]) end # Light background, dark text + if textcolors[(2 * (color - 1))].is_a?(Color) + return textcolors[(2 * (color - 1))], textcolors[2 * (color - 1) + 1] + end return Color.new(*textcolors[2 * (color - 1)]), Color.new(*textcolors[(2 * (color - 1)) + 1]) end diff --git a/Data/Scripts/007_Objects and windows/011_Messages.rb b/Data/Scripts/007_Objects and windows/011_Messages.rb index e4db675f0..82702d437 100644 --- a/Data/Scripts/007_Objects and windows/011_Messages.rb +++ b/Data/Scripts/007_Objects and windows/011_Messages.rb @@ -304,6 +304,44 @@ def pbCsvPosInt!(str) return ret.to_i end +def pbReplaceMessageText(text, msg_window) + # \sign[something] gets turned into \op\cl\ts[]\w[something] + text.gsub!(/\\sign\[([^\]]*)\]/i) { next "\\op\\cl\\ts[]\\w[" + $1 + "]" } + # Escaped characters + text.gsub!(/\\\\/, "\5") + text.gsub!(/\\1/, "\1") + text.gsub!(/\\n/i, "\n") + # Text placeholders + text.gsub!(/\\pn/i, $player.name) if $player + text.gsub!(/\\pm/i, _INTL("${1}", $player.money.to_s_formatted)) if $player + loop do + last_text = text.clone + text.gsub!(/\\v\[([0-9]+)\]/i) { $game_variables[$1.to_i] } + break if text == last_text + end + if $game_actors + text.gsub!(/\\n\[([1-8])\]/i) { next $game_actors[$1.to_i].name } + end + # Male/female text colors + text.gsub!(/\\pg/i, "\\b") if $player&.male? + text.gsub!(/\\pg/i, "\\r") if $player&.female? + text.gsub!(/\\pog/i, "\\r") if $player&.male? + text.gsub!(/\\pog/i, "\\b") if $player&.female? + text.gsub!(/\\pg/i, "") + text.gsub!(/\\pog/i, "") + male_text_tag = shadowc3tag(MessageConfig::MALE_TEXT_MAIN_COLOR, MessageConfig::MALE_TEXT_SHADOW_COLOR) + female_text_tag = shadowc3tag(MessageConfig::FEMALE_TEXT_MAIN_COLOR, MessageConfig::FEMALE_TEXT_SHADOW_COLOR) + text.gsub!(/\\b/i, male_text_tag) + text.gsub!(/\\r/i, female_text_tag) + # Other text colors + text.gsub!(/\\\[([0-9a-f]{8,8})\]/i) { "" } + isDarkSkin = isDarkWindowskin(msg_window.windowskin) + text.gsub!(/\\c\[([0-9]+)\]/i) do + main_color, shadow_color = get_text_colors_for_windowskin(msg_window.windowskin, $1.to_i, isDarkSkin) + next shadowc3tag(main_color, shadow_color) + end +end + #=============================================================================== # Money and coins windows. #=============================================================================== @@ -419,28 +457,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni text = message.clone linecount = (Graphics.height > 400) ? 3 : 2 ### Text replacement - text.gsub!(/\\sign\[([^\]]*)\]/i) do # \sign[something] gets turned into - next "\\op\\cl\\ts[]\\w[" + $1 + "]" # \op\cl\ts[]\w[something] - end - text.gsub!(/\\\\/, "\5") - text.gsub!(/\\1/, "\1") - if $game_actors - text.gsub!(/\\n\[([1-8])\]/i) { next $game_actors[$1.to_i].name } - end - text.gsub!(/\\pn/i, $player.name) if $player - text.gsub!(/\\pm/i, _INTL("${1}", $player.money.to_s_formatted)) if $player - text.gsub!(/\\n/i, "\n") - text.gsub!(/\\\[([0-9a-f]{8,8})\]/i) { "" } - text.gsub!(/\\pg/i, "\\b") if $player&.male? - text.gsub!(/\\pg/i, "\\r") if $player&.female? - text.gsub!(/\\pog/i, "\\r") if $player&.male? - text.gsub!(/\\pog/i, "\\b") if $player&.female? - text.gsub!(/\\pg/i, "") - text.gsub!(/\\pog/i, "") - male_text_tag = shadowc3tag(MessageConfig::MALE_TEXT_MAIN_COLOR, MessageConfig::MALE_TEXT_SHADOW_COLOR) - female_text_tag = shadowc3tag(MessageConfig::FEMALE_TEXT_MAIN_COLOR, MessageConfig::FEMALE_TEXT_SHADOW_COLOR) - text.gsub!(/\\b/i, male_text_tag) - text.gsub!(/\\r/i, female_text_tag) + pbReplaceMessageText(text, msgwindow) text.gsub!(/\\[Ww]\[([^\]]*)\]/) do w = $1.to_s if w == "" @@ -450,16 +467,6 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni end next "" end - isDarkSkin = isDarkWindowskin(msgwindow.windowskin) - text.gsub!(/\\c\[([0-9]+)\]/i) do - main_color, shadow_color = get_text_colors_for_windowskin(msgwindow.windowskin, $1.to_i, isDarkSkin) - next shadowc3tag(main_color, shadow_color) - end - loop do - last_text = text.clone - text.gsub!(/\\v\[([0-9]+)\]/i) { $game_variables[$1.to_i] } - break if text == last_text - end loop do last_text = text.clone text.gsub!(/\\l\[([0-9]+)\]/i) do @@ -473,6 +480,7 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni main_color, shadow_color = get_text_colors_for_windowskin(msgwindow.windowskin, 0, true) colortag = shadowc3tag(main_color, shadow_color) else + isDarkSkin = isDarkWindowskin(msgwindow.windowskin) main_color, shadow_color = get_text_colors_for_windowskin(msgwindow.windowskin, 0, isDarkSkin) colortag = shadowc3tag(main_color, shadow_color) end diff --git a/Data/Scripts/016b_UI redesign/006_UI_Summary.rb b/Data/Scripts/016b_UI redesign/006_UI_Summary.rb index bcd57e4d8..e841968fb 100644 --- a/Data/Scripts/016b_UI redesign/006_UI_Summary.rb +++ b/Data/Scripts/016b_UI redesign/006_UI_Summary.rb @@ -743,7 +743,7 @@ class UI::PokemonSummaryVisuals < UI::BaseVisuals # Draw move name move_name = move.name move_name = crop_text(move_name, (showing_detailed_move_page?) ? 230 : 262) - draw_text(move.name, x + 8, y + 6, theme: :black) + draw_text(move_name, x + 8, y + 6, theme: :black) # Draw move type icon type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position draw_image(@bitmaps[:types], x + 8, y + 32, diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016c_UI_old/005_UI_old_Party.rb similarity index 99% rename from Data/Scripts/016_UI/005_UI_Party.rb rename to Data/Scripts/016c_UI_old/005_UI_old_Party.rb index b9b522bd1..7a62281c4 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016c_UI_old/005_UI_old_Party.rb @@ -1,3 +1,4 @@ +=begin #=============================================================================== # Pokémon party buttons and menu. #=============================================================================== @@ -1477,3 +1478,4 @@ MenuHandlers.add(:party_menu_item, :move, { screen.scene.pbSelect(old_party_idx) if !moved } }) +=end