diff --git a/Data/Scripts/001_Settings.rb b/Data/Scripts/001_Settings.rb index 347c78a1b..073cf51bd 100644 --- a/Data/Scripts/001_Settings.rb +++ b/Data/Scripts/001_Settings.rb @@ -1,6 +1,6 @@ #==============================================================================# # Pokémon Essentials # -# Version 20.1 # +# Version 20.1.dev # # https://github.com/Maruno17/pokemon-essentials # #==============================================================================# @@ -132,6 +132,15 @@ module Settings # Whether overworld weather can set the default terrain effect in battle. # Storm weather sets Electric Terrain, and fog weather sets Misty Terrain. OVERWORLD_WEATHER_SETS_BATTLE_TERRAIN = (MECHANICS_GENERATION >= 8) + # The default setting for Phone.rematches_enabled, which determines whether + # trainers registered in the Phone can become ready for a rematch. If false, + # Phone.rematches_enabled = true will enable rematches at any point you want. + PHONE_REMATCHES_POSSIBLE_FROM_BEGINNING = false + # Whether the messages in a phone call with a trainer are colored blue or red + # depending on that trainer's gender. Note that this doesn't apply to contacts + # that are not trainers; they will need to be colored manually in their Common + # Events. + COLOR_PHONE_CALL_MESSAGES_BY_CONTACT_GENDER = true #============================================================================= @@ -237,11 +246,11 @@ module Settings # * Game Switch; the graphic is shown if this is ON (non-wall maps only). # * X coordinate of the graphic on the map, in squares. # * Y coordinate of the graphic on the map, in squares. - # * Name of the graphic, found in the Graphics/Pictures folder. + # * Name of the graphic, found in the Graphics/UI/Town Map folder. # * The graphic will always (true) or never (false) be shown on a wall map. REGION_MAP_EXTRAS = [ - [0, 51, 16, 15, "mapHiddenBerth", false], - [0, 52, 20, 14, "mapHiddenFaraday", false] + [0, 51, 16, 15, "hidden_Berth", false], + [0, 52, 20, 14, "hidden_Faraday", false] ] # Whether the player can use Fly while looking at the Town Map. This is only @@ -433,6 +442,6 @@ end # DO NOT EDIT THESE! module Essentials - VERSION = "20.1" + VERSION = "20.1.dev" ERROR_TEXT = "" end diff --git a/Data/Scripts/001_Technical/002_RubyUtilities.rb b/Data/Scripts/001_Technical/002_RubyUtilities.rb index 3a88c12e7..70e4b3bd4 100644 --- a/Data/Scripts/001_Technical/002_RubyUtilities.rb +++ b/Data/Scripts/001_Technical/002_RubyUtilities.rb @@ -23,7 +23,7 @@ end #=============================================================================== class String def starts_with_vowel? - return ["a", "e", "i", "o", "u"].include?(self[0, 1].downcase) + return ["a", "e", "i", "o", "u"].include?(self[0].downcase) end def first(n = 1); return self[0...n]; end @@ -52,7 +52,7 @@ class String end def numeric? - return !self[/^[+-]?([0-9]+)(?:\.[0-9]+)?$/].nil? + return !self[/\A[+-]?\d+(?:\.\d+)?\Z/].nil? end end @@ -188,17 +188,95 @@ class Color return init_original(*args) end - # Returns this color as a hex string like "#RRGGBB". - def to_hex - r = sprintf("%02X", self.red) - g = sprintf("%02X", self.green) - b = sprintf("%02X", self.blue) - return ("#" + r + g + b).upcase + def self.new_from_rgb(param) + return Font.default_color if !param + base_int = param.to_i(16) + case param.length + when 8 # 32-bit hex + return Color.new( + (base_int >> 24) & 0xFF, + (base_int >> 16) & 0xFF, + (base_int >> 8) & 0xFF, + (base_int) & 0xFF + ) + when 6 # 24-bit hex + return Color.new( + (base_int >> 16) & 0xFF, + (base_int >> 8) & 0xFF, + (base_int) & 0xFF + ) + when 4 # 15-bit hex + return Color.new( + ((base_int) & 0x1F) << 3, + ((base_int >> 5) & 0x1F) << 3, + ((base_int >> 10) & 0x1F) << 3 + ) + when 1, 2 # Color number + case base_int + when 0 then return Color.white + when 1 then return Color.blue + when 2 then return Color.red + when 3 then return Color.green + when 4 then return Color.cyan + when 5 then return Color.pink + when 6 then return Color.yellow + when 7 then return Color.gray + else return Font.default_color + end + end + return Font.default_color end - # Returns this color as a 24-bit color integer. + # @return [String] the 15-bit representation of this color in a string, ignoring its alpha + def to_rgb15 + ret = (self.red >> 3) + ret |= ((self.green >> 3) << 5) + ret |= ((self.blue >> 3) << 10) + return sprintf("%04X", ret) + end + + # @return [String] this color in the format "RRGGBB", ignoring its alpha + def to_rgb24 + return sprintf("%02X%02X%02X", self.red, self.green, self.blue) + end + + # @return [String] this color in the format "RRGGBBAA" (or "RRGGBB" if this color's alpha is 255) + def to_rgb32(always_include_alpha = false) + return sprintf("%02X%02X%02X", self.red, self.green, self.blue) if self.alpha == 255 && !always_include_alpha + return sprintf("%02X%02X%02X%02X", self.red, self.green, self.blue, self.alpha) + end + + # @return [String] this color in the format "#RRGGBB", ignoring its alpha + def to_hex + return "#" + to_rgb24 + end + + # @return [Integer] this color in RGB format converted to an integer def to_i - return self.to_hex.delete("#").to_i(16) + return self.to_rgb24.to_i(16) + end + + # @return [Color] the contrasting color to this one + def get_contrast_color + r = self.red + g = self.green + b = self.blue + yuv = [ + (r * 0.299) + (g * 0.587) + (b * 0.114), + (r * -0.1687) + (g * -0.3313) + (b * 0.500) + 0.5, + (r * 0.500) + (g * -0.4187) + (b * -0.0813) + 0.5 + ] + if yuv[0] < 127.5 + yuv[0] += (255 - yuv[0]) / 2 + else + yuv[0] = yuv[0] / 2 + end + return Color.new( + yuv[0] + (1.4075 * (yuv[2] - 0.5)), + yuv[0] - (0.3455 * (yuv[1] - 0.5)) - (0.7169 * (yuv[2] - 0.5)), + yuv[0] + (1.7790 * (yuv[1] - 0.5)), + self.alpha + ) end # Converts the provided hex string/24-bit integer to RGB values. @@ -223,18 +301,44 @@ class Color return nil end - # Returns color object for some commonly used colors - def self.red; return Color.new(255, 0, 0); end - def self.green; return Color.new( 0, 255, 0); end - def self.blue; return Color.new( 0, 0, 255); end - def self.black; return Color.new( 0, 0, 0); end - def self.white; return Color.new(255, 255, 255); end - def self.yellow; return Color.new(255, 255, 0); end + # Returns color object for some commonly used colors. + def self.red; return Color.new(255, 128, 128); end + def self.green; return Color.new(128, 255, 128); end + def self.blue; return Color.new(128, 128, 255); end + def self.yellow; return Color.new(255, 255, 128); end def self.magenta; return Color.new(255, 0, 255); end - def self.teal; return Color.new( 0, 255, 255); end + def self.cyan; return Color.new(128, 255, 255); end + def self.white; return Color.new(255, 255, 255); end + def self.gray; return Color.new(192, 192, 192); end + def self.black; return Color.new( 0, 0, 0); end + def self.pink; return Color.new(255, 128, 255); end def self.orange; return Color.new(255, 155, 0); end def self.purple; return Color.new(155, 0, 255); end def self.brown; return Color.new(112, 72, 32); end + + # TODO: These are from def getSkinColor. It isn't appropriate to make Color + # objects of these, though, as they're just converted straight back into + # hex strings. +# def self.text_blue; return Color.new( 0, 112, 248); end +# def self.text_blue_light; return Color.new(120, 184, 232); end +# def self.text_red; return Color.new(232, 32, 16); end +# def self.text_red_light; return Color.new(248, 168, 184); end +# def self.text_green; return Color.new( 96, 176, 72); end +# def self.text_green_light; return Color.new(174, 208, 144); end +# def self.text_cyan; return Color.new( 72, 216, 216); end +# def self.text_cyan_light; return Color.new(168, 224, 224); end +# def self.text_magenta; return Color.new(208, 56, 184); end +# def self.text_magenta_light; return Color.new(232, 160, 224); end +# def self.text_yellow; return Color.new(232, 208, 32); end +# def self.text_yellow_light; return Color.new(248, 232, 136); end +# def self.text_gray; return Color.new(160, 160, 168); end +# def self.text_gray_light; return Color.new(208, 208, 216); end +# def self.text_white; return Color.new(240, 240, 248); end +# def self.text_white_light; return Color.new(200, 200, 208); end # Intentionally darker than text_white +# def self.text_purple; return Color.new(114, 64, 232); end +# def self.text_purple_light; return Color.new(184, 168, 224); end +# def self.text_orange; return Color.new(248, 152, 24); end +# def self.text_orange_light; return Color.new(248, 200, 152); end end #=============================================================================== diff --git a/Data/Scripts/001_Technical/006_RPG_Sprite.rb b/Data/Scripts/001_Technical/006_RPG_Sprite.rb index eb535d402..ae6f0efa1 100644 --- a/Data/Scripts/001_Technical/006_RPG_Sprite.rb +++ b/Data/Scripts/001_Technical/006_RPG_Sprite.rb @@ -201,7 +201,7 @@ class SpriteAnimation sprite.y = sprite_y + cell_data[i, 2] next if quick_update sprite.visible = true - sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192) + sprite.src_rect.set((pattern % 5) * 192, (pattern / 5) * 192, 192, 192) case @_animation_height when 0 then sprite.z = 1 when 1 then sprite.z = sprite.y + (Game_Map::TILE_HEIGHT * 3 / 2) + 1 diff --git a/Data/Scripts/002_Save data/005_Game_SaveConversions.rb b/Data/Scripts/002_Save data/005_Game_SaveConversions.rb index aa1c59f93..f2bb653cd 100644 --- a/Data/Scripts/002_Save data/005_Game_SaveConversions.rb +++ b/Data/Scripts/002_Save data/005_Game_SaveConversions.rb @@ -348,3 +348,35 @@ SaveData.register_conversion(:v20_convert_pokemon_markings) do end end end + +#=============================================================================== + +SaveData.register_conversion(:v21_replace_phone_data) do + essentials_version 21 + display_title "Updating Phone data format" + to_value :global_metadata do |global| + if !global.phone + global.instance_eval do + @phone = Phone.new + @phoneTime = nil # Don't bother using this + if @phoneNumbers + @phoneNumbers.each do |contact| + if contact.length > 4 + # Trainer + # TODO: Is there any way to ensure the versions count is accurate? + Phone.add_silent(contact[6], contact[7], contact[1], contact[2], 0, [contact[5], 3].max) + new_contact = Phone.get(contact[1], contact[2], 0) + new_contact.visible = contact[0] + new_contact.version = contact[5] + new_contact.rematch_flag = [contact[4] - 1, 0].max + else + # Non-trainer + Phone.add_silent(contact[3], contact[2], contact[1]) + end + end + @phoneNumbers = nil + end + end + end + end +end diff --git a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb index ea9aa9e79..4fe30c145 100644 --- a/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb +++ b/Data/Scripts/005_Sprites/009_Sprite_DynamicShadows.rb @@ -87,7 +87,7 @@ class Sprite_Shadow < RPG::Sprite end @deltax = ScreenPosHelper.pbScreenX(@source) - self.x @deltay = ScreenPosHelper.pbScreenY(@source) - self.y - self.color = Color.new(0, 0, 0) + self.color = Color.black @distance = ((@deltax**2) + (@deltay**2)) self.opacity = @self_opacity * 13_000 / ((@distance * 370 / @distancemax) + 6000) self.angle = 57.3 * Math.atan2(@deltax, @deltay) diff --git a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb index d68041980..95680e76f 100644 --- a/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb +++ b/Data/Scripts/006_Map renderer/004_TileDrawingHelper.rb @@ -104,7 +104,7 @@ class TileDrawingHelper src = Rect.new(0, 0, 0, 0) 4.times do |i| tile_position = tiles[i] - 1 - src.set((tile_position % 6 * 16) + anim, tile_position / 6 * 16, 16, 16) + src.set(((tile_position % 6) * 16) + anim, (tile_position / 6) * 16, 16, 16) bitmap.stretch_blt(Rect.new((i % 2 * cxTile) + x, (i / 2 * cyTile) + y, cxTile, cyTile), autotile, src) end @@ -113,7 +113,7 @@ class TileDrawingHelper def bltSmallRegularTile(bitmap, x, y, cxTile, cyTile, id) return if id < 384 || !@tileset || @tileset.disposed? - rect = Rect.new((id - 384) % 8 * 32, (id - 384) / 8 * 32, 32, 32) + rect = Rect.new(((id - 384) % 8) * 32, ((id - 384) / 8) * 32, 32, 32) rect = TilemapRenderer::TilesetWrapper.getWrappedRect(rect) if @shouldWrap bitmap.stretch_blt(Rect.new(x, y, cxTile, cyTile), @tileset, rect) end @@ -150,7 +150,7 @@ def createMinimap(mapid) map = load_data(sprintf("Data/Map%03d.rxdata", mapid)) rescue nil return BitmapWrapper.new(32, 32) if !map bitmap = BitmapWrapper.new(map.width * 4, map.height * 4) - black = Color.new(0, 0, 0) + black = Color.black tilesets = $data_tilesets tileset = tilesets[map.tileset_id] return bitmap if !tileset @@ -196,7 +196,7 @@ end def getPassabilityMinimap(mapid) map = load_data(sprintf("Data/Map%03d.rxdata", mapid)) tileset = $data_tilesets[map.tileset_id] - minimap = AnimatedBitmap.new("Graphics/Pictures/minimap_tiles") + minimap = AnimatedBitmap.new("Graphics/UI/minimap_tiles") ret = Bitmap.new(map.width * 6, map.height * 6) passtable = Table.new(map.width, map.height) passages = tileset.passages @@ -221,6 +221,6 @@ def getPassabilityMinimap(mapid) bltMinimapAutotile(ret, i * 6, j * 6, minimap.bitmap, tile) end end - minimap.disposes + minimap.dispose return ret end diff --git a/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb b/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb index ed1d473fc..d42452c43 100644 --- a/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb +++ b/Data/Scripts/007_Objects and windows/001_RPG_Cache.rb @@ -67,7 +67,7 @@ module RPG ret.addRef else ret = BitmapWrapper.new(32 * width, 32 * height) - x = (tile_id - 384) % 8 * 32 + x = ((tile_id - 384) % 8) * 32 y = (((tile_id - 384) / 8) - height + 1) * 32 tileset = yield(filename) ret.blt(0, 0, tileset, Rect.new(x, y, 32 * width, 32 * height)) @@ -86,6 +86,10 @@ module RPG self.load_bitmap("Graphics/Transitions/", filename) end + def self.ui(filename) + self.load_bitmap("Graphics/UI/", filename) + end + def self.retain(folder_name, filename = "", hue = 0) path = folder_name + filename ret = fromCache(path) diff --git a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb index 7c7a16369..db1d6c8f5 100644 --- a/Data/Scripts/007_Objects and windows/002_MessageConfig.rb +++ b/Data/Scripts/007_Objects and windows/002_MessageConfig.rb @@ -342,10 +342,10 @@ def getSkinColor(windowskin, color, isDarkSkin) "F0F0F8", "C8C8D0", # 8 White "9040E8", "B8A8E0", # 9 Purple "F89818", "F8C898", # 10 Orange - colorToRgb32(MessageConfig::DARK_TEXT_MAIN_COLOR), - colorToRgb32(MessageConfig::DARK_TEXT_SHADOW_COLOR), # 11 Dark default - colorToRgb32(MessageConfig::LIGHT_TEXT_MAIN_COLOR), - colorToRgb32(MessageConfig::LIGHT_TEXT_SHADOW_COLOR) # 12 Light default + MessageConfig::DARK_TEXT_MAIN_COLOR.to_rgb24, + MessageConfig::DARK_TEXT_SHADOW_COLOR.to_rgb24, # 11 Dark default + MessageConfig::LIGHT_TEXT_MAIN_COLOR.to_rgb24, + MessageConfig::LIGHT_TEXT_SHADOW_COLOR.to_rgb24 # 12 Light default ] if color == 0 || color > textcolors.length / 2 # No special colour, use default if isDarkSkin # Dark background, light text @@ -365,7 +365,7 @@ def getSkinColor(windowskin, color, isDarkSkin) x = 64 + ((color % 8) * 8) y = 96 + ((color / 8) * 8) pixel = windowskin.get_pixel(x, y) - return shadowctagFromColor(pixel) + return shadowc3tag(pixel, pixel.get_contrast_color) end end @@ -717,12 +717,12 @@ end #=============================================================================== # Adds a background to the sprite hash. # _planename_ is the hash key of the background. -# _background_ is a filename within the Graphics/Pictures/ folder and can be +# _background_ is a filename within the Graphics/UI/ folder and can be # an animated image. # _viewport_ is a viewport to place the background in. def addBackgroundPlane(sprites, planename, background, viewport = nil) sprites[planename] = AnimatedPlane.new(viewport) - bitmapName = pbResolveBitmap("Graphics/Pictures/#{background}") + bitmapName = pbResolveBitmap("Graphics/UI/#{background}") if bitmapName.nil? # Plane should exist in any case sprites[planename].bitmap = nil @@ -739,12 +739,12 @@ end # Adds a background to the sprite hash. # _planename_ is the hash key of the background. -# _background_ is a filename within the Graphics/Pictures/ folder and can be +# _background_ is a filename within the Graphics/UI/ folder and can be # an animated image. # _color_ is the color to use if the background can't be found. # _viewport_ is a viewport to place the background in. def addBackgroundOrColoredPlane(sprites, planename, background, color, viewport = nil) - bitmapName = pbResolveBitmap("Graphics/Pictures/#{background}") + bitmapName = pbResolveBitmap("Graphics/UI/#{background}") if bitmapName.nil? # Plane should exist in any case sprites[planename] = ColoredPlane.new(color, viewport) diff --git a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb index e09de47db..3420d5c93 100644 --- a/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/007_Objects and windows/005_SpriteWindow_text.rb @@ -417,7 +417,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base def allocPause return if @pausesprite - @pausesprite = AnimatedSprite.create("Graphics/Pictures/pause", 4, 3) + @pausesprite = AnimatedSprite.create("Graphics/UI/pause_arrow", 4, 3) @pausesprite.z = 100000 @pausesprite.visible = false end @@ -447,13 +447,13 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base when 1 # Lower right pauseWidth = @pausesprite.bitmap ? @pausesprite.framewidth : 16 pauseHeight = @pausesprite.bitmap ? @pausesprite.frameheight : 16 - @pausesprite.x = self.x + self.width - (20 * 2) + (pauseWidth / 2) - @pausesprite.y = self.y + self.height - (30 * 2) + (pauseHeight / 2) + @pausesprite.x = self.x + self.width - 40 + (pauseWidth / 2) + @pausesprite.y = self.y + self.height - 60 + (pauseHeight / 2) when 2 # Lower middle pauseWidth = @pausesprite.bitmap ? @pausesprite.framewidth : 16 pauseHeight = @pausesprite.bitmap ? @pausesprite.frameheight : 16 @pausesprite.x = self.x + (self.width / 2) - (pauseWidth / 2) - @pausesprite.y = self.y + self.height - (18 * 2) + (pauseHeight / 2) + @pausesprite.y = self.y + self.height - 36 + (pauseHeight / 2) end end @@ -958,10 +958,10 @@ end #=============================================================================== module UpDownArrowMixin def initUpDownArrow - @uparrow = AnimatedSprite.create("Graphics/Pictures/uparrow", 8, 2, self.viewport) - @downarrow = AnimatedSprite.create("Graphics/Pictures/downarrow", 8, 2, self.viewport) - RPG::Cache.retain("Graphics/Pictures/uparrow") - RPG::Cache.retain("Graphics/Pictures/downarrow") + @uparrow = AnimatedSprite.create("Graphics/UI/up_arrow", 8, 2, self.viewport) + @downarrow = AnimatedSprite.create("Graphics/UI/down_arrow", 8, 2, self.viewport) + RPG::Cache.retain("Graphics/UI/up_arrow") + RPG::Cache.retain("Graphics/UI/down_arrow") @uparrow.z = 99998 @downarrow.z = 99998 @uparrow.visible = false @@ -1043,11 +1043,11 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx super(x, y, width, height) self.viewport = viewport if viewport if isDarkWindowskin(self.windowskin) - @selarrow = AnimatedBitmap.new("Graphics/Pictures/selarrow_white") - RPG::Cache.retain("Graphics/Pictures/selarrow_white") + @selarrow = AnimatedBitmap.new("Graphics/UI/sel_arrow_white") + RPG::Cache.retain("Graphics/UI/sel_arrow_white") else - @selarrow = AnimatedBitmap.new("Graphics/Pictures/selarrow") - RPG::Cache.retain("Graphics/Pictures/selarrow") + @selarrow = AnimatedBitmap.new("Graphics/UI/sel_arrow") + RPG::Cache.retain("Graphics/UI/sel_arrow") end @index = 0 colors = getDefaultTextColors(self.windowskin) diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index f3dc1b561..9917a92ef 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -1,118 +1,57 @@ #=============================================================================== # Text colours #=============================================================================== +# TODO: Unused. def ctag(color) - ret = (color.red.to_i << 24) - ret |= ((color.green.to_i) << 16) - ret |= ((color.blue.to_i) << 8) - ret |= ((color.alpha.to_i)) - return sprintf("", ret) + return sprintf("", color.to_rgb32(true)) end def shadowctag(base, shadow) - return sprintf("", colorToRgb16(base), colorToRgb16(shadow)) + return sprintf("", base.to_rgb15, shadow.to_rgb15) end def shadowc3tag(base, shadow) - return sprintf("", colorToRgb32(base), colorToRgb32(shadow)) + return sprintf("", base.to_rgb32, shadow.to_rgb32) end +# TODO: Unused. def shadowctagFromColor(color) - return shadowc3tag(color, getContrastColor(color)) + return shadowc3tag(color, color.get_contrast_color) end +# TODO: Unused. def shadowctagFromRgb(param) - return shadowctagFromColor(rgbToColor(param)) + return shadowctagFromColor(Color.new_from_rgb(param)) end +# @deprecated This method is slated to be removed in v22. def colorToRgb32(color) - return "" if !color - if color.alpha.to_i == 255 - return sprintf("%02X%02X%02X", color.red.to_i, color.green.to_i, color.blue.to_i) - else - return sprintf("%02X%02X%02X%02X", - color.red.to_i, color.green.to_i, color.blue.to_i, color.alpha.to_i) - end + Deprecation.warn_method("colorToRgb32", "v22", "color.to_rgb32") + return color.to_rgb32 end +# @deprecated This method is slated to be removed in v22. def colorToRgb16(color) - ret = (color.red.to_i >> 3) - ret |= ((color.green.to_i >> 3) << 5) - ret |= ((color.blue.to_i >> 3) << 10) - return sprintf("%04X", ret) + Deprecation.warn_method("colorToRgb16", "v22", "color.to_rgb15") + return color.to_rgb15 end +# @deprecated This method is slated to be removed in v22. def rgbToColor(param) - return Font.default_color if !param - baseint = param.to_i(16) - case param.length - when 8 # 32-bit hex - return Color.new( - (baseint >> 24) & 0xFF, - (baseint >> 16) & 0xFF, - (baseint >> 8) & 0xFF, - (baseint) & 0xFF - ) - when 6 # 24-bit hex - return Color.new( - (baseint >> 16) & 0xFF, - (baseint >> 8) & 0xFF, - (baseint) & 0xFF - ) - when 4 # 16-bit hex - return Color.new( - ((baseint) & 0x1F) << 3, - ((baseint >> 5) & 0x1F) << 3, - ((baseint >> 10) & 0x1F) << 3 - ) - when 1 # Color number - i = param.to_i - return Font.default_color if i >= 8 - return [ - Color.new(255, 255, 255, 255), - Color.new(128, 128, 255, 255), - Color.new(255, 128, 128, 255), - Color.new(128, 255, 128, 255), - Color.new(128, 255, 255, 255), - Color.new(255, 128, 255, 255), - Color.new(255, 255, 128, 255), - Color.new(192, 192, 192, 255) - ][i] - else - return Font.default_color - end + Deprecation.warn_method("rgbToColor", "v22", "Color.new_from_rgb(param)") + return Color.new_from_rgb(param) end -def Rgb16ToColor(param) - baseint = param.to_i(16) - return Color.new( - ((baseint) & 0x1F) << 3, - ((baseint >> 5) & 0x1F) << 3, - ((baseint >> 10) & 0x1F) << 3 - ) +# @deprecated This method is slated to be removed in v22. +def rgb15ToColor(param) + Deprecation.warn_method("rgb15ToColor", "v22", "Color.new_from_rgb(param)") + return Color.new_from_rgb(param) end +# @deprecated This method is slated to be removed in v22. def getContrastColor(color) - raise "No color given" if !color - r = color.red - g = color.green - b = color.blue - yuv = [ - (r * 0.299) + (g * 0.587) + (b * 0.114), - (r * -0.1687) + (g * -0.3313) + (b * 0.500) + 0.5, - (r * 0.500) + (g * -0.4187) + (b * -0.0813) + 0.5 - ] - if yuv[0] < 127.5 - yuv[0] += (255 - yuv[0]) / 2 - else - yuv[0] = yuv[0] / 2 - end - return Color.new( - yuv[0] + (1.4075 * (yuv[2] - 0.5)), - yuv[0] - (0.3455 * (yuv[1] - 0.5)) - (0.7169 * (yuv[2] - 0.5)), - yuv[0] + (1.7790 * (yuv[1] - 0.5)), - color.alpha - ) + Deprecation.warn_method("getContrastColor", "v22", "color.get_contrast_color") + return color.get_contrast_color end @@ -151,8 +90,8 @@ def itemIconTag(item) if item.respond_to?("icon_name") return sprintf("", item.icon_name) else - ix = item.icon_index % 16 * 24 - iy = item.icon_index / 16 * 24 + ix = (item.icon_index % 16) * 24 + iy = (item.icon_index / 16) * 24 return sprintf("", ix, iy) end end @@ -481,15 +420,15 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = if endtag colorstack.pop else - color = rgbToColor(param) + color = Color.new_from_rgb(param) colorstack.push([color, nil]) end when "c2" if endtag colorstack.pop else - base = Rgb16ToColor(param[0, 4]) - shadow = Rgb16ToColor(param[4, 4]) + base = Color.new_from_rgb(param[0, 4]) + shadow = Color.new_from_rgb(param[4, 4]) colorstack.push([base, shadow]) end when "c3" @@ -499,8 +438,8 @@ def getFormattedText(bitmap, xDst, yDst, widthDst, heightDst, text, lineheight = param = param.split(",") # get pure colors unaffected by opacity oldColors = getLastParam(colorstack, defaultcolors) - base = (param[0] && param[0] != "") ? rgbToColor(param[0]) : oldColors[0] - shadow = (param[1] && param[1] != "") ? rgbToColor(param[1]) : oldColors[1] + base = (param[0] && param[0] != "") ? Color.new_from_rgb(param[0]) : oldColors[0] + shadow = (param[1] && param[1] != "") ? Color.new_from_rgb(param[1]) : oldColors[1] colorstack.push([base, shadow]) end when "o" @@ -921,7 +860,7 @@ def getLineBrokenChunks(bitmap, value, width, dims, plain = false) end textcols = [] if ccheck[/" + text + text = shadowctag(base, shadow) + text chars = getFormattedText(bitmap, x, y, width, -1, text, lineheight) drawFormattedChars(bitmap, chars) end diff --git a/Data/Scripts/007_Objects and windows/012_TextEntry.rb b/Data/Scripts/007_Objects and windows/012_TextEntry.rb index 1b5a84cbe..4fb42630a 100644 --- a/Data/Scripts/007_Objects and windows/012_TextEntry.rb +++ b/Data/Scripts/007_Objects and windows/012_TextEntry.rb @@ -507,7 +507,7 @@ class Window_MultilineTextEntry < SpriteWindow_Base bitmap.clear getTextChars height = self.height - self.borderY - cursorcolor = Color.new(0, 0, 0) + cursorcolor = Color.black textchars = getTextChars startY = getLineY(@firstline) textchars.each do |text| diff --git a/Data/Scripts/009_Scenes/001_Transitions.rb b/Data/Scripts/009_Scenes/001_Transitions.rb index 1ab6877ff..4f7244573 100644 --- a/Data/Scripts/009_Scenes/001_Transitions.rb +++ b/Data/Scripts/009_Scenes/001_Transitions.rb @@ -256,7 +256,7 @@ module Transitions @overworld_sprite.visible = false # Black background @black_sprite = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) - @black_sprite.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0)) + @black_sprite.bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black) # Overworld sprites sprite_width = @overworld_bitmap.width / NUM_SPRITES_X sprite_height = @overworld_bitmap.height / NUM_SPRITES_Y @@ -1292,7 +1292,7 @@ module Transitions @foe_sprite = new_sprite(Graphics.width + @foe_bitmap.width, @sprites[0].y + @sprites[0].height - 12, @foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height) @foe_sprite.z = 7 - @foe_sprite.color = Color.new(0, 0, 0) + @foe_sprite.color = Color.black # Sprite with foe's name written in it @text_sprite = BitmapSprite.new(Graphics.width, @bar_bitmap.height, @viewport) @text_sprite.y = BAR_Y @@ -1481,13 +1481,13 @@ module Transitions @player_bar_sprite.y + BAR_HEIGHT - TRAINER_Y_OFFSET, @player_bitmap, @player_bitmap.width / 2, @player_bitmap.height) @player_sprite.z = 7 - @player_sprite.color = Color.new(0, 0, 0) + @player_sprite.color = Color.black # Foe sprite @foe_sprite = new_sprite(@foe_bar_sprite.x + (@bar_bitmap.width / 2) - TRAINER_X_OFFSET, @foe_bar_sprite.y + @foe_bitmap.height - TRAINER_Y_OFFSET, @foe_bitmap, @foe_bitmap.width / 2, @foe_bitmap.height) @foe_sprite.z = 7 - @foe_sprite.color = Color.new(0, 0, 0) + @foe_sprite.color = Color.black # Sprite with foe's name written in it @text_sprite = BitmapSprite.new(@bar_bitmap.width / 2, BAR_HEIGHT, @viewport) @text_sprite.x = @foe_bar_start_x diff --git a/Data/Scripts/010_Data/001_Hardcoded data/004_BodyShape.rb b/Data/Scripts/010_Data/001_Hardcoded data/004_BodyShape.rb index 8d5a7b5b0..16d513dbf 100644 --- a/Data/Scripts/010_Data/001_Hardcoded data/004_BodyShape.rb +++ b/Data/Scripts/010_Data/001_Hardcoded data/004_BodyShape.rb @@ -1,6 +1,6 @@ # NOTE: The order these shapes are registered are the order they are listed in # the Pokédex search screen. -# "Graphics/Pictures/Pokedex/icon_shapes.png" contains icons for these +# "Graphics/UI/Pokedex/icon_shapes.png" contains icons for these # shapes. module GameData class BodyShape diff --git a/Data/Scripts/010_Data/001_Hardcoded data/010_Status.rb b/Data/Scripts/010_Data/001_Hardcoded data/010_Status.rb index 43ec0e1ff..3b4e53845 100644 --- a/Data/Scripts/010_Data/001_Hardcoded data/010_Status.rb +++ b/Data/Scripts/010_Data/001_Hardcoded data/010_Status.rb @@ -1,7 +1,7 @@ -# NOTE: "Graphics/Pictures/statuses.png" also contains icons for being fainted -# and for having Pokérus, in that order, at the bottom of the graphic. -# "Graphics/Pictures/Battle/icon_statuses.png" also contains an icon for -# bad poisoning (toxic), at the bottom of the graphic. +# NOTE: "Graphics/UI/statuses.png" also contains icons for being fainted and for +# having Pokérus, in that order, at the bottom of the graphic. +# "Graphics/UI/Battle/icon_statuses.png" also contains an icon for bad +# poisoning (toxic), at the bottom of the graphic. # Both graphics automatically handle varying numbers of defined statuses, # as long as their extra icons remain at the bottom of them. module GameData diff --git a/Data/Scripts/010_Data/002_PBS data/006_Item.rb b/Data/Scripts/010_Data/002_PBS data/006_Item.rb index bac5a775c..0c377b323 100644 --- a/Data/Scripts/010_Data/002_PBS data/006_Item.rb +++ b/Data/Scripts/010_Data/002_PBS data/006_Item.rb @@ -67,16 +67,16 @@ module GameData return nil if !item_data name_base = (item_data.is_mail?) ? "mail" : "item" # Check for files - ret = sprintf("Graphics/Pictures/Party/icon_%s_%s", name_base, item_data.id) + ret = sprintf("Graphics/UI/Party/icon_%s_%s", name_base, item_data.id) return ret if pbResolveBitmap(ret) - return sprintf("Graphics/Pictures/Party/icon_%s", name_base) + return sprintf("Graphics/UI/Party/icon_%s", name_base) end def self.mail_filename(item) item_data = self.try_get(item) return nil if !item_data # Check for files - ret = sprintf("Graphics/Pictures/Mail/mail_%s", item_data.id) + ret = sprintf("Graphics/UI/Mail/mail_%s", item_data.id) return pbResolveBitmap(ret) ? ret : nil end diff --git a/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb b/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb index cddc2b6eb..57991e127 100644 --- a/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb +++ b/Data/Scripts/010_Data/002_PBS data/014_TrainerType.rb @@ -71,12 +71,12 @@ module GameData end def self.map_icon_filename(tr_type) - return self.check_file(tr_type, "Graphics/Pictures/mapPlayer") + return self.check_file(tr_type, "Graphics/UI/Town Map/player_") end def self.player_map_icon_filename(tr_type) outfit = ($player) ? $player.outfit : 0 - return self.check_file(tr_type, "Graphics/Pictures/mapPlayer", sprintf("_%d", outfit)) + return self.check_file(tr_type, "Graphics/UI/Town Map/player_", sprintf("_%d", outfit)) end def initialize(hash) diff --git a/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb b/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb index 0df3a07e6..6a03f5145 100644 --- a/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb +++ b/Data/Scripts/011_Battle/001_Battle/011_Battle_EndOfRoundPhase.rb @@ -579,7 +579,7 @@ class Battle swaps.each do |pair| next if pbSideSize(pair[0]) == 2 && swaps.length > 1 next if !pbSwapBattlers(pair[0], pair[1]) - case pbSideSize(side) + case pbSideSize(pair[1]) when 2 pbDisplay(_INTL("{1} moved across!", @battlers[pair[1]].pbThis)) when 3 diff --git a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb index 58bde1144..a27a34a9a 100644 --- a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb +++ b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb @@ -28,7 +28,7 @@ class Battle::Scene pbCreateBackdropSprites # Create message box graphic messageBox = pbAddSprite("messageBox", 0, Graphics.height - 96, - "Graphics/Pictures/Battle/overlay_message", @viewport) + "Graphics/UI/Battle/overlay_message", @viewport) messageBox.z = 195 # Create message window (displays the message) msgWindow = Window_AdvancedTextPokemon.newWithSize( @@ -50,7 +50,7 @@ class Battle::Scene # The party lineup graphics (bar and balls) for both sides 2.times do |side| partyBar = pbAddSprite("partyBar_#{side}", 0, 0, - "Graphics/Pictures/Battle/overlay_lineup", @viewport) + "Graphics/UI/Battle/overlay_lineup", @viewport) partyBar.z = 120 partyBar.mirror = true if side == 0 # Player's lineup bar only partyBar.visible = false diff --git a/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb b/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb index 66379bee6..bb60d9fc4 100644 --- a/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb +++ b/Data/Scripts/011_Battle/004_Scene/005_Battle_Scene_Menus.rb @@ -97,10 +97,10 @@ end # Command menu (Fight/Pokémon/Bag/Run) #=============================================================================== class Battle::Scene::CommandMenu < Battle::Scene::MenuBase - # If true, displays graphics from Graphics/Pictures/Battle/overlay_command.png - # and Graphics/Pictures/Battle/cursor_command.png. + # If true, displays graphics from Graphics/UI/Battle/overlay_command.png + # and Graphics/UI/Battle/cursor_command.png. # If false, just displays text and the command window over the graphic - # Graphics/Pictures/Battle/overlay_message.png. You will need to edit def + # Graphics/UI/Battle/overlay_message.png. You will need to edit def # pbShowWindow to make the graphic appear while the command menu is being # displayed. USE_GRAPHICS = true @@ -128,10 +128,10 @@ class Battle::Scene::CommandMenu < Battle::Scene::MenuBase if USE_GRAPHICS # Create background graphic background = IconSprite.new(self.x, self.y, viewport) - background.setBitmap("Graphics/Pictures/Battle/overlay_command") + background.setBitmap("Graphics/UI/Battle/overlay_command") addSprite("background", background) # Create bitmaps - @buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_command")) + @buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_command")) # Create action buttons @buttons = Array.new(4) do |i| # 4 command options, therefore 4 buttons button = Sprite.new(viewport) @@ -205,10 +205,10 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase GET_MOVE_TEXT_COLOR_FROM_MOVE_BUTTON = true - # If true, displays graphics from Graphics/Pictures/Battle/overlay_fight.png - # and Graphics/Pictures/Battle/cursor_fight.png. + # If true, displays graphics from Graphics/UI/Battle/overlay_fight.png + # and Graphics/UI/Battle/cursor_fight.png. # If false, just displays text and the command window over the graphic - # Graphics/Pictures/Battle/overlay_message.png. You will need to edit def + # Graphics/UI/Battle/overlay_message.png. You will need to edit def # pbShowWindow to make the graphic appear while the command menu is being # displayed. USE_GRAPHICS = true @@ -231,13 +231,13 @@ class Battle::Scene::FightMenu < Battle::Scene::MenuBase # 0=don't show, 1=show unpressed, 2=show pressed if USE_GRAPHICS # Create bitmaps - @buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_fight")) - @typeBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) - @megaEvoBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_mega")) - @shiftBitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_shift")) + @buttonBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_fight")) + @typeBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types")) + @megaEvoBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_mega")) + @shiftBitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Battle/cursor_shift")) # Create background graphic background = IconSprite.new(0, Graphics.height - 96, viewport) - background.setBitmap("Graphics/Pictures/Battle/overlay_fight") + background.setBitmap("Graphics/UI/Battle/overlay_fight") addSprite("background", background) # Create move buttons @buttons = Array.new(Pokemon::MAX_MOVES) do |i| @@ -472,7 +472,7 @@ class Battle::Scene::TargetMenu < Battle::Scene::MenuBase # NOTE: @mode is for which buttons are shown as selected. # 0=select 1 button (@index), 1=select all buttons with text # Create bitmaps - @buttonBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/cursor_target") + @buttonBitmap = AnimatedBitmap.new("Graphics/UI/Battle/cursor_target") # Create target buttons @buttons = Array.new(maxIndex + 1) do |i| numButtons = @sideSizes[i % 2] diff --git a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb index ef4cea163..5081eec34 100644 --- a/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb +++ b/Data/Scripts/011_Battle/004_Scene/006_Battle_Scene_Objects.rb @@ -42,15 +42,15 @@ class Battle::Scene::PokemonDataBox < Sprite onPlayerSide = @battler.index.even? # Get the data box graphic and set whether the HP numbers/Exp bar are shown if sideSize == 1 # One Pokémon on side, use the regular dara box BG - bgFilename = ["Graphics/Pictures/Battle/databox_normal", - "Graphics/Pictures/Battle/databox_normal_foe"][@battler.index % 2] + bgFilename = ["Graphics/UI/Battle/databox_normal", + "Graphics/UI/Battle/databox_normal_foe"][@battler.index % 2] if onPlayerSide @showHP = true @showExp = true end else # Multiple Pokémon on side, use the thin dara box BG - bgFilename = ["Graphics/Pictures/Battle/databox_thin", - "Graphics/Pictures/Battle/databox_thin_foe"][@battler.index % 2] + bgFilename = ["Graphics/UI/Battle/databox_thin", + "Graphics/UI/Battle/databox_thin_foe"][@battler.index % 2] end @databoxBitmap&.dispose @databoxBitmap = AnimatedBitmap.new(bgFilename) @@ -76,9 +76,9 @@ class Battle::Scene::PokemonDataBox < Sprite def initializeOtherGraphics(viewport) # Create other bitmaps - @numbersBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/icon_numbers") - @hpBarBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/overlay_hp") - @expBarBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/overlay_exp") + @numbersBitmap = AnimatedBitmap.new("Graphics/UI/Battle/icon_numbers") + @hpBarBitmap = AnimatedBitmap.new("Graphics/UI/Battle/overlay_hp") + @expBarBitmap = AnimatedBitmap.new("Graphics/UI/Battle/overlay_exp") # Create sprite to draw HP numbers on @hpNumbers = BitmapSprite.new(124, 16, viewport) # pbSetSmallFont(@hpNumbers.bitmap) @@ -221,7 +221,7 @@ class Battle::Scene::PokemonDataBox < Sprite def draw_level # "Lv" graphic pbDrawImagePositions(self.bitmap, - [["Graphics/Pictures/Battle/overlay_lv", @spriteBaseX + 140, 16]] + [["Graphics/UI/Battle/overlay_lv", @spriteBaseX + 140, 16]] ) # Level number pbDrawNumber(@battler.level, self.bitmap, @spriteBaseX + 162, 16) @@ -244,26 +244,26 @@ class Battle::Scene::PokemonDataBox < Sprite s = GameData::Status.get(@battler.status).icon_position end return if s < 0 - pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/Battle/icon_statuses", @spriteBaseX + 24, 36, + pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/icon_statuses", @spriteBaseX + 24, 36, 0, s * STATUS_ICON_HEIGHT, -1, STATUS_ICON_HEIGHT]]) end def draw_shiny_icon return if !@battler.shiny? shiny_x = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's - pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/shiny", @spriteBaseX + shiny_x, 36]]) + pbDrawImagePositions(self.bitmap, [["Graphics/UI/shiny", @spriteBaseX + shiny_x, 36]]) end def draw_special_form_icon # Mega Evolution/Primal Reversion icon if @battler.mega? - pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/Battle/icon_mega", @spriteBaseX + 8, 34]]) + pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/icon_mega", @spriteBaseX + 8, 34]]) elsif @battler.primal? filename = nil if @battler.isSpecies?(:GROUDON) - filename = "Graphics/Pictures/Battle/icon_primal_Groudon" + filename = "Graphics/UI/Battle/icon_primal_Groudon" elsif @battler.isSpecies?(:KYOGRE) - filename = "Graphics/Pictures/Battle/icon_primal_Kyogre" + filename = "Graphics/UI/Battle/icon_primal_Kyogre" end primalX = (@battler.opposes?) ? 208 : -28 # Foe's/player's pbDrawImagePositions(self.bitmap, [[filename, @spriteBaseX + primalX, 4]]) if filename @@ -272,7 +272,7 @@ class Battle::Scene::PokemonDataBox < Sprite def draw_owned_icon return if !@battler.owned? || !@battler.opposes?(0) # Draw for foe Pokémon only - pbDrawImagePositions(self.bitmap, [["Graphics/Pictures/Battle/icon_own", @spriteBaseX + 8, 36]]) + pbDrawImagePositions(self.bitmap, [["Graphics/UI/Battle/icon_own", @spriteBaseX + 8, 36]]) end def refresh @@ -418,7 +418,7 @@ class Battle::Scene::AbilitySplashBar < Sprite @side = side @battler = nil # Create sprite wrapper that displays background graphic - @bgBitmap = AnimatedBitmap.new("Graphics/Pictures/Battle/ability_bar") + @bgBitmap = AnimatedBitmap.new("Graphics/UI/Battle/ability_bar") @bgSprite = Sprite.new(viewport) @bgSprite.bitmap = @bgBitmap.bitmap @bgSprite.src_rect.y = (side == 0) ? 0 : @bgBitmap.height / 2 diff --git a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb index 174592840..48acfed5f 100644 --- a/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb +++ b/Data/Scripts/011_Battle/004_Scene/007_Battle_Scene_BaseAnimation.rb @@ -105,7 +105,7 @@ module Battle::Scene::Animation::BallAnimationMixin if traSprite.bitmap.width < traSprite.bitmap.height * 2 ball.setVisible(7, true) ballStartX = traSprite.x - ballStartX -= ball.totalDuration * (Graphics.width / (2 * 16)) if !safariThrow + ballStartX -= ball.totalDuration * (Graphics.width / 32) if !safariThrow ballStartY = traSprite.y - (traSprite.bitmap.height / 2) return ballStartX, ballStartY end @@ -122,11 +122,11 @@ module Battle::Scene::Animation::BallAnimationMixin # Arm stretched out behind player ball.setVisible(0, true) ball.setXY(0, coordSets[0][0], coordSets[0][1]) - ball.moveDelta(0, 5, -5 * (Graphics.width / (2 * 16)), 0) if !safariThrow + ball.moveDelta(0, 5, -5 * (Graphics.width / 32), 0) if !safariThrow ball.setDelta(0, -12, 0) if safariThrow # Arm mid throw ball.setDelta(5, coordSets[1][0], coordSets[1][1]) - ball.moveDelta(5, 2, -2 * (Graphics.width / (2 * 16)), 0) if !safariThrow + ball.moveDelta(5, 2, -2 * (Graphics.width / 32), 0) if !safariThrow ball.setDelta(5, 34, 0) if safariThrow # Start of throw ball.setDelta(7, coordSets[2][0], coordSets[2][1]) @@ -137,7 +137,7 @@ module Battle::Scene::Animation::BallAnimationMixin ballStartX += c[0] ballStartY += c[1] end - ballStartX -= ball.totalDuration * (Graphics.width / (2 * 16)) if !safariThrow + ballStartX -= ball.totalDuration * (Graphics.width / 32) if !safariThrow ballStartX += 8 if safariThrow # -12 + 34 - 14 return ballStartX, ballStartY end diff --git a/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb b/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb index 03d1e4e61..a8a07cf0e 100644 --- a/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb +++ b/Data/Scripts/011_Battle/004_Scene/008_Battle_Scene_Animations.rb @@ -162,14 +162,14 @@ class Battle::Scene::Animation::LineupAppear < Battle::Scene::Animation def createBall(idxBall, delay, dir) # Choose ball's graphic idxParty = getPartyIndexFromBallIndex(idxBall) - graphicFilename = "Graphics/Pictures/Battle/icon_ball_empty" + graphicFilename = "Graphics/UI/Battle/icon_ball_empty" if idxParty >= 0 && idxParty < @party.length && @party[idxParty] if !@party[idxParty].able? - graphicFilename = "Graphics/Pictures/Battle/icon_ball_faint" + graphicFilename = "Graphics/UI/Battle/icon_ball_faint" elsif @party[idxParty].status != :NONE - graphicFilename = "Graphics/Pictures/Battle/icon_ball_status" + graphicFilename = "Graphics/UI/Battle/icon_ball_status" else - graphicFilename = "Graphics/Pictures/Battle/icon_ball" + graphicFilename = "Graphics/UI/Battle/icon_ball" end end # Set up ball sprite diff --git a/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb b/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb index a6e019a9f..d63a72970 100644 --- a/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb +++ b/Data/Scripts/011_Battle/006_Other battle code/007_BattleAnimationPlayer.rb @@ -268,7 +268,7 @@ class PBAnimTiming @colorAlpha = nil @duration = 5 @flashScope = 0 - @flashColor = Color.new(255, 255, 255, 255) + @flashColor = Color.white @flashDuration = 5 end @@ -722,7 +722,7 @@ class PBAnimationPlayerX @animsprites[i].visible = false end # Create background colour sprite - @bgColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) + @bgColor = ColoredPlane.new(Color.black, @viewport) @bgColor.z = 5 @bgColor.opacity = 0 @bgColor.refresh @@ -733,7 +733,7 @@ class PBAnimationPlayerX @bgGraphic.opacity = 0 @bgGraphic.refresh # Create foreground colour sprite - @foColor = ColoredPlane.new(Color.new(0, 0, 0), @viewport) + @foColor = ColoredPlane.new(Color.black, @viewport) @foColor.z = 85 @foColor.opacity = 0 @foColor.refresh diff --git a/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb index 298688abe..f0e7e0af2 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/001_SafariBattle.rb @@ -66,7 +66,7 @@ class Battle::Scene::SafariDataBox < Sprite super(viewport) @selected = 0 @battle = battle - @databox = AnimatedBitmap.new("Graphics/Pictures/Battle/databox_safari") + @databox = AnimatedBitmap.new("Graphics/UI/Battle/databox_safari") self.x = Graphics.width - 232 self.y = Graphics.height - 184 @contents = BitmapWrapper.new(@databox.width, @databox.height) diff --git a/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb index 215eaf0cc..6334b98e3 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb @@ -256,9 +256,9 @@ class Battle::Scene phase.times do |i| y = [48, 80, 112][i] x = (ratings1[i] == ratings2[i]) ? 64 : ((ratings1[i] > ratings2[i]) ? 0 : 32) - images.push(["Graphics/Pictures/judgment", 64 - 16, y, x, 0, 32, 32]) + images.push(["Graphics/UI/Battle/judgment", 64 - 16, y, x, 0, 32, 32]) x = (ratings1[i] == ratings2[i]) ? 64 : ((ratings1[i] < ratings2[i]) ? 0 : 32) - images.push(["Graphics/Pictures/judgment", 224 - 16, y, x, 0, 32, 32]) + images.push(["Graphics/UI/Battle/judgment", 224 - 16, y, x, 0, 32, 32]) end pbDrawImagePositions(window.contents, images) window.contents.fill_rect(16, 150, 256, 4, Color.new(80, 80, 80)) diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb index 56117aa6d..2af2116a5 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/002_Overworld_Overlays.rb @@ -69,7 +69,7 @@ class DarknessSprite < Sprite end def refresh - @darkness.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0, 255)) + @darkness.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black) cx = Graphics.width / 2 cy = Graphics.height / 2 cradius = @radius diff --git a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb index e32e76f9b..783f5844c 100644 --- a/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb +++ b/Data/Scripts/012_Overworld/002_Battle triggering/002_Overworld_BattleIntroAnim.rb @@ -138,7 +138,7 @@ def pbBattleAnimation(bgm = nil, battletype = 0, foe = nil) $PokemonGlobal.nextBattleBack = nil $PokemonEncounters.reset_step_count # Fade back to the overworld in 0.4 seconds - viewport.color = Color.new(0, 0, 0, 255) + viewport.color = Color.black timer = 0.0 loop do Graphics.update @@ -179,7 +179,7 @@ def pbBattleAnimationCore(anim, viewport, location, num_flashes = 2) $game_temp.background_bitmap = Graphics.snap_to_bitmap # Play main animation Graphics.freeze - viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black + viewport.color = Color.black # Ensure screen is black Graphics.transition(25, "Graphics/Transitions/" + anim) # Slight pause after animation before starting up the battle scene pbWait(Graphics.frame_rate / 10) @@ -421,7 +421,7 @@ SpecialBattleIntroAnimations.register("alternate_vs_trainer_animation", 50, # viewvs.dispose viewopp.dispose viewplayer.dispose - viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black + viewport.color = Color.black # Ensure screen is black } ) diff --git a/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb b/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb index 5a0077c45..69d64f050 100644 --- a/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb +++ b/Data/Scripts/012_Overworld/002_Overworld_Metadata.rb @@ -14,8 +14,9 @@ class PokemonGlobalMetadata attr_accessor :stepcount attr_accessor :pcItemStorage attr_accessor :mailbox - attr_accessor :phoneNumbers - attr_accessor :phoneTime + attr_accessor :phoneNumbers # Deprecated + attr_accessor :phoneTime # Deprecated + attr_accessor :phone attr_accessor :partner attr_accessor :creditsPlayed # Pokédex @@ -64,8 +65,7 @@ class PokemonGlobalMetadata @stepcount = 0 @pcItemStorage = nil @mailbox = nil - @phoneNumbers = [] - @phoneTime = 0 + @phone = Phone.new @partner = nil @creditsPlayed = false # Pokédex diff --git a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb index 395225545..7e86aeede 100644 --- a/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb +++ b/Data/Scripts/012_Overworld/004_Overworld_FieldMoves.rb @@ -72,17 +72,17 @@ def pbHiddenMoveAnimation(pokemon) viewport = Viewport.new(0, 0, 0, 0) viewport.z = 99999 bg = Sprite.new(viewport) - bg.bitmap = RPG::Cache.picture("hiddenMovebg") + bg.bitmap = RPG::Cache.ui("Field move/bg") sprite = PokemonSprite.new(viewport) sprite.setOffset(PictureOrigin::CENTER) sprite.setPokemonBitmap(pokemon) sprite.z = 1 sprite.visible = false - strobebitmap = AnimatedBitmap.new("Graphics/Pictures/hiddenMoveStrobes") + strobebitmap = AnimatedBitmap.new("Graphics/UI/Field move/strobes") strobes = [] 15.times do |i| - strobe = BitmapSprite.new(26 * 2, 8 * 2, viewport) - strobe.bitmap.blt(0, 0, strobebitmap.bitmap, Rect.new(0, (i % 2) * 8 * 2, 26 * 2, 8 * 2)) + strobe = BitmapSprite.new(52, 16, viewport) + strobe.bitmap.blt(0, 0, strobebitmap.bitmap, Rect.new(0, (i % 2) * 16, 52, 16)) strobe.z = (i.even? ? 2 : 0) strobe.visible = false strobes.push(strobe) diff --git a/Data/Scripts/013_Items/004_Item_Phone.rb b/Data/Scripts/013_Items/004_Item_Phone.rb index aca75a2f8..627bac373 100644 --- a/Data/Scripts/013_Items/004_Item_Phone.rb +++ b/Data/Scripts/013_Items/004_Item_Phone.rb @@ -1,305 +1,679 @@ -#=============================================================================== -# Register contacts -#=============================================================================== -def pbPhoneRegisterNPC(ident, name, mapid, showmessage = true) - $PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers - exists = pbFindPhoneTrainer(ident, name) - if exists - return if exists[0] # Already visible - exists[0] = true # Make visible - else - phonenum = [true, ident, name, mapid] - $PokemonGlobal.phoneNumbers.push(phonenum) - end - pbMessage(_INTL("\\me[Register phone]Registered {1} in the Pokégear.", name)) if showmessage -end +# TODO: Add an information window with details of the person in a phone call. +# Make this work with common event calls (create and dispose the info +# window in start_message and end_message). +# TODO: Rewrite the Phone UI. Have more than one method. Choosable icons/marks +# for each contact? Show an icon representing phone signal. -def pbPhoneRegister(event, trainertype, trainername) - $PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers - return if pbFindPhoneTrainer(trainertype, trainername) - phonenum = [] - phonenum.push(true) - phonenum.push(trainertype) - phonenum.push(trainername) - phonenum.push(0) # time to next battle - phonenum.push(0) # can battle - phonenum.push(0) # battle count - if event - phonenum.push(event.map.map_id) - phonenum.push(event.id) - end - $PokemonGlobal.phoneNumbers.push(phonenum) -end +# TODO: Add a trainer comment for giving a trainer a common event ID. +# TODO: Add calling a contact at a particular time forcing rematch readiness. +# Add trainer comments for this. +# TODO: Allow individual trainers to never arrange a rematch by themself, thus +# requiring the player to call them at their particular time of day/week. +# TODO: Be able to put the Phone on silent mode (prevent all phone calls from +# trainers, but allow scripted calls as normal). -def pbPhoneDeleteContact(index) - $PokemonGlobal.phoneNumbers[index][0] = false # Remove from contact list - if $PokemonGlobal.phoneNumbers[index].length == 8 - $PokemonGlobal.phoneNumbers[index][3] = 0 # Reset countdown - $PokemonGlobal.phoneNumbers[index][4] = 0 # Reset countdown +# TODO: Better messages, more customisation of messages. +# TODO: Add a Debug way of upgrading old phone script calls to new ones, or at +# least to find events using old phone scripts for the dev to update. +#=============================================================================== +# +#=============================================================================== +class Phone + attr_accessor :contacts + attr_accessor :rematch_variant, :rematches_enabled + attr_accessor :time_to_next_call, :last_refresh_time + + def initialize + @contacts = [] + @rematch_variant = 0 # Original variant is 0, first rematch variant is 1, etc. + @rematches_enabled = Settings::PHONE_REMATCHES_POSSIBLE_FROM_BEGINNING + @time_to_next_call = 0.0 + @last_refresh_time = 0 + end + + # Returns a visible contact only. + def get(trainer, *args) + @contacts.each do |contact| + next if !contact.visible? + next if contact.trainer? != trainer + if trainer + next if contact.trainer_type != args[0] || + contact.name != args[1] || contact.start_version != (args[2] || 0) + else + next if contact.name != args[0] + end + return contact + end + return nil + end + + def get_version(trainer_type, name, start_version = 0) + return 0 if !GameData::TrainerType.exists?(trainer_type) + trainer_type = GameData::TrainerType.get(trainer_type).id + contact = get(true, trainer_type, name, start_version) + return (contact) ? contact.version : 0 + end + + # Trainer type, name[, start_version] + # Name + def can_add?(*args) + return false if !$player.has_pokegear + if args.length == 1 + # Non-trainer (name only) + return false if get(false, args[0]) + else + # Trainer (has at least trainer type and name) + return false if !GameData::TrainerType.exists?(args[0]) + trainer_type = GameData::TrainerType.get(args[0]).id + return false if get(true, trainer_type, args[1], args[2] || 0) + end + return true + end + + # Event, trainer type, name, versions_count = 1, start_version = 0 + # Map ID, event ID, trainer type, name, versions_count = 1, start_version = 0 + # Map ID, name, common event ID + def add(*args) + if args[0].is_a?(Game_Event) + # Trainer + return false if !GameData::TrainerType.exists?(args[1]) + trainer_type = GameData::TrainerType.get(args[1]).id + name = args[2] + contact = get(true, trainer_type, name, args[3] || 0) + if contact + contact.visible = true + else + contact = Contact.new(true, args[0].map_id, args[0].id, + trainer_type, name, args[3] || 1, args[4] || 0) + contact.increment_version + @contacts.push(contact) + end + elsif args[1].is_a?(Numeric) + # Trainer + return false if !GameData::TrainerType.exists?(args[2]) + trainer_type = GameData::TrainerType.get(args[2]).id + name = args[3] + contact = get(true, trainer_type, name, args[4] || 0) + if contact + contact.visible = true + else + contact = Contact.new(true, args[0], args[1], + trainer_type, name, args[4] || 1, args[5] || 0) + contact.increment_version + @contacts.push(contact) + end + else + # Non-trainer + name = args[1] + contact = get(false, name) + if contact + contact.visible = true + else + contact = Contact.new(false, *args) + @contacts.push(contact) + end + end + return true + end + + #============================================================================= + + # Checks once every second. + def refresh_ready_trainers + return if !@rematches_enabled + time = pbGetTimeNow.to_i + return if @last_refresh_time == time + @last_refresh_time = time + @contacts.each do |contact| + next if !contact.trainer? || !contact.visible? + next if contact.rematch_flag > 0 # Already ready for rematch + if contact.time_to_ready <= 0 + contact.time_to_ready = rand(20...40) * 60 # 20-40 minutes + end + contact.time_to_ready -= 1 + next if contact.time_to_ready > 0 + contact.rematch_flag = 1 # Ready for rematch + contact.set_trainer_event_ready_for_rematch + end + end + + def reset_after_win(trainer_type, name, start_version = 0) + return if !GameData::TrainerType.exists?(trainer_type) + trainer_type = GameData::TrainerType.get(trainer_type).id + contact = get(true, trainer_type, name, start_version) + return if !contact + contact.variant_beaten = contact.version - contact.start_version + contact.increment_version + contact.rematch_flag = 0 + contact.time_to_ready = 0.0 + end + + #============================================================================= + + def self.rematch_variant + return $PokemonGlobal.phone.rematch_variant + end + + def self.rematch_variant=(value) + $PokemonGlobal.phone.rematch_variant = value + end + + def self.rematches_enabled + return $PokemonGlobal.phone.rematches_enabled + end + + def self.rematches_enabled=(value) + $PokemonGlobal.phone.rematches_enabled = value + end + + def self.get_trainer(*args) + return $PokemonGlobal.phone.get(true, *args) + end + + def self.can_add?(*args) + return $PokemonGlobal.phone.can_add?(*args) + end + + def self.add(*args) + ret = $PokemonGlobal.phone.add(*args) + if ret + if args[0].is_a?(Game_Event) + contact = $PokemonGlobal.phone.get(true, args[1], args[2], (args[4] || 0)) + elsif args[1].is_a?(Numeric) + contact = $PokemonGlobal.phone.get(true, args[2], args[3], (args[5] || 0)) + else + contact = $PokemonGlobal.phone.get(false, args[1]) + end + pbMessage(_INTL("\\me[Register phone]Registered {1} in the Pokégear!", contact.display_name)) + end + return ret + end + + def self.add_silent(*args) + return $PokemonGlobal.phone.add(*args) + end + + def self.increment_version(trainer_type, name, start_version = 0) + contact = $PokemonGlobal.phone.get(trainer_type, name, start_version) + contact.increment_version if contact + end + + # TODO: Rename this. + def self.variant(trainer_type, name, start_version = 0) + contact = $PokemonGlobal.phone.get(trainer_type, name, start_version) + return contact.version - contact.start_version if contact + return start_version + end + + def self.battle(trainer_type, name, start_version = 0) + contact = $PokemonGlobal.phone.get(true, trainer_type, name, start_version) + return false if !contact + contact.increment_version if contact.version == contact.start_version + contact.variant_beaten + return TrainerBattle.start(trainer_type, name, contact.version) + end + + def self.reset_after_win(trainer_type, name, start_version = 0) + $PokemonGlobal.phone.reset_after_win(trainer_type, name, start_version) + end + + def self.variant_beaten(trainer_type, name, start_version = 0) + contact = $PokemonGlobal.phone.get(true, trainer_type, name, start_version) + return 0 if !contact + return contact.variant_beaten end end -def pbPhoneRegisterBattle(message, event, trainertype, trainername, maxbattles) - return false if !$player.has_pokegear # Can't register without a Pokégear - return false if !GameData::TrainerType.exists?(trainertype) - trainertype = GameData::TrainerType.get(trainertype).id - contact = pbFindPhoneTrainer(trainertype, trainername) - return false if contact && contact[0] # Existing contact and is visible - message = _INTL("Let me register you.") if !message - return false if !pbConfirmMessage(message) - displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainertype).name, - pbGetMessageFromHash(MessageTypes::TrainerNames, trainername)) - if contact # Previously registered, just make visible - contact[0] = true - else # Add new contact - pbPhoneRegister(event, trainertype, trainername) - pbPhoneIncrement(trainertype, trainername, maxbattles) +#=============================================================================== +# +#=============================================================================== +class Phone + class Contact + attr_accessor :map_id, :event_id + attr_accessor :name + attr_accessor :trainer_type, :start_version, :versions_count, :version + attr_accessor :time_to_ready, :rematch_flag, :variant_beaten + attr_accessor :common_event_id + attr_accessor :visible + + # Map ID, event ID, trainer type, name, versions count = 1, start version = 0 + # Map ID, name, common event ID + def initialize(trainer, *args) + @trainer = trainer + if @trainer + # Trainer + @map_id = args[0] + @event_id = args[1] + @trainer_type = args[2] + @name = args[3] + @versions_count = [args[4] || 1, 1].max # Includes the original version + @start_version = args[5] || 0 + @version = @start_version + @variant_beaten = 0 + @time_to_ready = 0 + @rematch_flag = 0 # 0=counting down, 1=ready for rematch, 2=ready and told player + @common_event_id = 0 + else + # Non-trainer + @map_id = args[0] + @name = args[1] + @common_event_id = args[2] || 0 + end + @visible = true + end + + def trainer? + return @trainer + end + + def visible? + return @visible + end + + def visible=(value) + return if @visible == value + @visible = value + if !value && trainer? + @time_to_ready = 0 + @rematch_flag = 0 + $game_self_switches[[@map_id, @event_id, "A"]] = true + $game_map.need_refresh = true + end + end + + def common_event_call? + return @common_event_id > 0 + end + + def can_rematch? + return trainer? && @rematch_flag >= 1 + end + + def display_name + if trainer? + return sprintf("%s %s", GameData::TrainerType.get(@trainer_type).name, + pbGetMessageFromHash(MessageTypes::TrainerNames, @name)) + end + return _INTL(@name) + end + + def increment_version + return if !trainer? + max_variant = [$PokemonGlobal.phone.rematch_variant, @versions_count - 1].min + return if @version - @start_version >= max_variant + @version += 1 + @time_to_ready = 0 + @rematch_flag = 0 + end + + def set_trainer_event_ready_for_rematch + return if !@trainer + $game_self_switches[[@map_id, @event_id, "A"]] = false + $game_self_switches[[@map_id, @event_id, "B"]] = true + $game_map.need_refresh = true + end end - pbMessage(_INTL("\\me[Register phone]Registered {1} in the Pokégear.", displayname)) - return true end #=============================================================================== -# Contact information +# #=============================================================================== -def pbRandomPhoneTrainer - $PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers - temparray = [] - this_map_metadata = $game_map.metadata - return nil if !this_map_metadata || !this_map_metadata.town_map_position - currentRegion = this_map_metadata.town_map_position[0] - $PokemonGlobal.phoneNumbers.each do |num| - next if !num[0] || num.length != 8 # if not visible or not a trainer - next if $game_map.map_id == num[6] # Can't call if on same map - caller_map_metadata = GameData::MapMetadata.try_get(num[6]) - next if !caller_map_metadata || !caller_map_metadata.town_map_position - # Can't call if in different region - next if caller_map_metadata.town_map_position[0] != currentRegion - temparray.push(num) +class Phone + module Call + module_function + + def can_make? + return false if $game_map.metadata.has_flag?("NoPhoneSignal") + return true + end + + # For the player initiating the call. + def can_call_contact?(contact) + return false if !contact + if !can_make? + pbMessage(_INTL("There is no phone signal here...")) + return false + end + return true if !contact.trainer? + if contact.map_id == $game_map.map_id + pbMessage(_INTL("The Trainer is close by.\nTalk to the Trainer in person!")) + return false + end + caller_map_metadata = GameData::MapMetadata.try_get(contact.map_id) + this_map_metadata = $game_map.metadata + if !caller_map_metadata || !caller_map_metadata.town_map_position || + !this_map_metadata || !this_map_metadata.town_map_position || + caller_map_metadata.town_map_position[0] != this_map_metadata.town_map_position[0] + pbMessage(_INTL("The Trainer is out of range.")) + return false + end + return true + end + + # Get a random trainer contact from the region the player is currently in, + # but is not in the same map as the player. + def get_random_trainer_for_incoming_call + player_location = $game_map.metadata&.town_map_position + return nil if !player_location + player_region = player_location[0] + valid_contacts = [] + $PokemonGlobal.phone.contacts.each do |contact| + next if !contact.trainer? || !contact.visible? + next if contact.map_id == $game_map.map_id + # TODO: next if the contact's map name is the same as the current map's? + caller_map_metadata = GameData::MapMetadata.try_get(contact.map_id) + next if !caller_map_metadata || !caller_map_metadata.town_map_position + next if caller_map_metadata.town_map_position[0] != player_region + valid_contacts.push(contact) + end + return valid_contacts.sample + end + + #=========================================================================== + + def make_incoming + return if !can_make? + contact = get_random_trainer_for_incoming_call + if contact + call = generate_trainer_dialogue(contact) + play(call, contact) + end + end + + # Phone::Contact + # Trainer type, name[, start_version] + # Name (for non-trainers) + def make_outgoing(*args) + if args[0].is_a?(Phone::Contact) + contact = args[0] + elsif args.length > 1 + contact = Phone.get(true, args[0], args[1], args[2] || 0) # Trainer + else + contact = Phone.get(false, args[0]) # Non-trainer + end + raise _INTL("Couldn't find phone contact given: {1}.", args.inspect) if !contact + return if !can_call_contact?(contact) + if contact.common_event_call? + if !pbCommonEvent(contact.common_event_id) + pbMessage(_INTL("{1}'s messages not defined.\nCouldn't call common event {2}.", + contact.display_name, contact.common_event_id)) + end + else + call = generate_trainer_dialogue(contact) + play(call, contact) + end + end + + def start_message(contact) + pbMessage(_INTL("......\\wt[5] ......\\1")) + end + + def play(dialogue, contact) + start_message(contact) + contact_pokemon_species = get_random_contact_pokemon_species(contact) + random_encounter_species = get_random_encounter_species(contact) + contact_map_name = get_map_name(contact) + gender_colour_text = "" + if Settings::COLOR_PHONE_CALL_MESSAGES_BY_CONTACT_GENDER && contact.trainer? + data = GameData::TrainerType.try_get(contact.trainer_type) + if data + case data.gender + when 0 then gender_colour_text = "\\b" + when 1 then gender_colour_text = "\\r" + end + end + end + messages = dialogue.split("\\m") + messages.each_with_index do |message, i| + message.gsub!(/\\TN/, _INTL(contact.name)) + message.gsub!(/\\TP/, contact_pokemon_species) + message.gsub!(/\\TE/, random_encounter_species) + message.gsub!(/\\TM/, contact_map_name) + message += "\\1" if i < messages.length - 1 + pbMessage(gender_colour_text + message) + end + end_message(contact) + end + + def end_message(contact) + pbMessage(_INTL("Click!\\wt[10]\n......\\wt[5] ......\\1")) + end + + #=========================================================================== + + def generate_trainer_dialogue(contact) + validate contact => Phone::Contact + get_random_message = lambda do |messages| + msg = messages.sample + return "" if !msg + return pbGetMessageFromHash(MessageTypes::PhoneMessages, msg) + end + phone_data = pbLoadPhoneData + # Choose random greeting depending on time of day + ret = get_random_message.call(phone_data.greetings) + time = pbGetTimeNow + if PBDayNight.isMorning?(time) + modcall = get_random_message.call(phone_data.greetingsMorning) + ret = modcall if !nil_or_empty?(modcall) + elsif PBDayNight.isEvening?(time) + modcall = get_random_message.call(phone_data.greetingsEvening) + ret = modcall if !nil_or_empty?(modcall) + end + ret += "\\m" + if Phone.rematches_enabled && (contact.rematch_flag == 1 || + (contact.rematch_flag == 2 && rand(100) < 50)) + # If ready for rematch, tell the player (50% chance to remind the player) + ret += get_random_message.call(phone_data.battleRequests) + contact.rematch_flag = 2 # Ready for rematch and told player + elsif rand(100) < 75 + # Choose random body + ret += get_random_message.call(phone_data.bodies1) + ret += "\\m" + ret += get_random_message.call(phone_data.bodies2) + else + # Choose random generic + ret += get_random_message.call(phone_data.generics) + end + return ret + end + + def get_random_contact_pokemon_species(contact) + return "" if !contact.trainer? + version = [contact.version - 1, contact.start_version].max + trainer_data = GameData::Trainer.try_get(contact.trainer_type, contact.name, version) + return "" if !trainer_data + pkmn = trainer_data.pokemon.sample[:species] + return GameData::Species.get(pkmn).name + end + + def get_random_encounter_species(contact) + return "" if !contact.trainer? + encounter_data = GameData::Encounter.get(contact.map_id, $PokemonGlobal.encounter_version) + return "" if !encounter_data + get_species_from_table = lambda do |encounter_table| + return nil if !encounter_table || encounter_table.length == 0 + len = [encounter_table.length, 4].min # From first 4 slots only + return encounter_table[rand(len)][1] + end + enc_tables = encounter_data.types + species = get_species_from_table.call(enc_tables[:Land]) + if !species + species = get_species_from_table.call(enc_tables[:Cave]) + if !species + species = get_species_from_table.call(enc_tables[:Water]) + end + end + return "" if !species + return GameData::Species.get(species).name + end + + def get_map_name(contact) + return pbGetMapNameFromId(contact.map_id) + end end - return nil if temparray.length == 0 - return temparray[rand(temparray.length)] -end - -def pbFindPhoneTrainer(tr_type, tr_name) # Ignores whether visible or not - return nil if !$PokemonGlobal.phoneNumbers - $PokemonGlobal.phoneNumbers.each do |num| - return num if num[1] == tr_type && num[2] == tr_name # If a match - end - return nil -end - -def pbHasPhoneTrainer?(tr_type, tr_name) - return pbFindPhoneTrainer(tr_type, tr_name) != nil -end - -def pbPhoneBattleCount(tr_type, tr_name) - trainer = pbFindPhoneTrainer(tr_type, tr_name) - return (trainer) ? trainer[5] : 0 -end - -def pbPhoneReadyToBattle?(tr_type, tr_name) - trainer = pbFindPhoneTrainer(tr_type, tr_name) - return (trainer && trainer[4] >= 2) end #=============================================================================== -# Contact rematch data modifications -#=============================================================================== -def pbPhoneIncrement(tr_type, tr_name, maxbattles) - trainer = pbFindPhoneTrainer(tr_type, tr_name) - return if !trainer - trainer[5] += 1 if trainer[5] < maxbattles # Increment battle count - trainer[3] = 0 # reset time to can-battle - trainer[4] = 0 # reset can-battle flag -end - -def pbPhoneReset(tr_type, tr_name) - trainer = pbFindPhoneTrainer(tr_type, tr_name) - return false if !trainer - trainer[3] = 0 # reset time to can-battle - trainer[4] = 0 # reset can-battle flag - return true -end - -def pbSetReadyToBattle(num) - return if !num[6] || !num[7] - $game_self_switches[[num[6], num[7], "A"]] = false - $game_self_switches[[num[6], num[7], "B"]] = true - $game_map.need_refresh = true -end - -#=============================================================================== -# Phone-related counters +# #=============================================================================== EventHandlers.add(:on_frame_update, :phone_call_counter, proc { next if !$player&.has_pokegear - # Reset time to next phone call if necessary - if !$PokemonGlobal.phoneTime || $PokemonGlobal.phoneTime <= 0 - $PokemonGlobal.phoneTime = rand(20...40) * 60 * Graphics.frame_rate - end # Don't count down various phone times if other things are happening - $PokemonGlobal.phoneNumbers = [] if !$PokemonGlobal.phoneNumbers next if $game_temp.in_menu || $game_temp.in_battle || $game_temp.message_window_showing next if $game_player.move_route_forcing || pbMapInterpreterRunning? - # Count down time to next phone call - $PokemonGlobal.phoneTime -= 1 # Count down time to next can-battle for each trainer contact - if $PokemonGlobal.phoneTime % Graphics.frame_rate == 0 # Every second - $PokemonGlobal.phoneNumbers.each do |num| - next if !num[0] || num.length != 8 # if not visible or not a trainer - # Reset time to next can-battle if necessary - if num[4] == 0 - num[3] = rand(20...40) * 60 # 20-40 minutes - num[4] = 1 - end - # Count down time to next can-battle - num[3] -= 1 - # Ready to battle - if num[3] <= 0 && num[4] == 1 - num[4] = 2 # set ready-to-battle flag - pbSetReadyToBattle(num) - end - end + $PokemonGlobal.phone.refresh_ready_trainers + # Count down time to next phone call + if $PokemonGlobal.phone.time_to_next_call <= 0 + $PokemonGlobal.phone.time_to_next_call = rand(20...40) * 60.0 # 20-40 minutes end + $PokemonGlobal.phone.time_to_next_call -= Graphics.delta_s + next if $PokemonGlobal.phone.time_to_next_call > 0 # Time for a random phone call; generate one - if $PokemonGlobal.phoneTime <= 0 - # find all trainer phone numbers - phonenum = pbRandomPhoneTrainer - if phonenum - call = pbPhoneGenerateCall(phonenum) - pbPhoneCall(call, phonenum) - end - end + Phone::Call.make_incoming } ) #=============================================================================== -# Player calls a contact +# Deprecated. #=============================================================================== -def pbCallTrainer(trtype, trname) - trainer = pbFindPhoneTrainer(trtype, trname) - return if !trainer - # Special NPC contacts - if trainer.length != 8 - if !pbCommonEvent(trtype) - pbMessage(_INTL("{1}'s messages not defined.\nCouldn't call common event {2}.", trainer[2], trtype)) - end - return - end - # Trainer contacts - if $game_map.map_id == trainer[6] - pbMessage(_INTL("The Trainer is close by.\nTalk to the Trainer in person!")) - return - end - caller_map_metadata = GameData::MapMetadata.try_get(trainer[6]) - this_map_metadata = $game_map.metadata - if !caller_map_metadata || !caller_map_metadata.town_map_position || - !this_map_metadata || !this_map_metadata.town_map_position || - caller_map_metadata.town_map_position[0] != this_map_metadata.town_map_position[0] - pbMessage(_INTL("The Trainer is out of range.")) - return # Can't call if in different region - end - call = pbPhoneGenerateCall(trainer) - pbPhoneCall(call, trainer) +# Called by events. +# @>Conditional Branch: Phone.can_add?(trainer_type, name, start_version) +# @>Text: Let me register you. +# @>Show Choices: Yes, No +# : When [Yes] +# @>Conditional Branch: Phone.add(get_self, trainer_type, name, start_version, versions_count) +# @>Text: Thanks! (optional) +# @> +# : Branch End +# : When [No] +# @>Text: Oh, okay then. (optional) +# @> +# : Branch End +# : Branch End +# @> +# @deprecated This method is slated to be removed in v22. +def pbPhoneRegisterBattle(message, event, trainer_type, name, versions_count) + Deprecation.warn_method("pbPhoneRegisterBattle", "v22", "several scripts and event commands; see def pbPhoneRegisterBattle") + return false if !Phone.can_add?(trainer_type, name, 0) + message = _INTL("Let me register you.") if !message + return false if !pbConfirmMessage(message) + return Phone.add(event, trainer_type, name, 0, versions_count) end -#=============================================================================== -# Generate phone message -#=============================================================================== -def pbPhoneGenerateCall(phonenum) - phoneData = pbLoadPhoneData - # Choose random greeting depending on time of day - call = pbRandomPhoneItem(phoneData.greetings) - time = pbGetTimeNow - if PBDayNight.isMorning?(time) - modcall = pbRandomPhoneItem(phoneData.greetingsMorning) - call = modcall if modcall && modcall != "" - elsif PBDayNight.isEvening?(time) - modcall = pbRandomPhoneItem(phoneData.greetingsEvening) - call = modcall if modcall && modcall != "" - end - call += "\\m" - if phonenum[4] == 2 || (rand(2) == 0 && phonenum[4] == 3) - # If "can battle" is set, make ready to battle - call += pbRandomPhoneItem(phoneData.battleRequests) - pbSetReadyToBattle(phonenum) - phonenum[4] = 3 - elsif rand(4) < 3 - # Choose random body - call += pbRandomPhoneItem(phoneData.bodies1) - call += "\\m" - call += pbRandomPhoneItem(phoneData.bodies2) +# @deprecated This method is slated to be removed in v22. +def pbPhoneRegister(event, trainer_type, name) + Deprecation.warn_method("pbPhoneRegister", "v22", "Phone.add_silent(event, trainer_type, name)") + Phone.add_silent(event, trainer_type, name) +end + +# Called by events. +# @deprecated This method is slated to be removed in v22. +def pbPhoneRegisterNPC(common_event_id, name, map_id, show_message = true) + Deprecation.warn_method("pbPhoneRegisterNPC", "v22", "Phone.add(map_id, name, common_event_id) or Phone.add_silent(map_id, name, common_event_id)") + if show_message + Phone.add(map_id, name, common_event_id) else - # Choose random generic - call += pbRandomPhoneItem(phoneData.generics) + Phone.add_silent(map_id, name, common_event_id) end - return call end -def pbRandomPhoneItem(array) - ret = array[rand(array.length)] - ret = "" if !ret - return pbGetMessageFromHash(MessageTypes::PhoneMessages, ret) +# @deprecated This method is slated to be removed in v22. +def pbPhoneDeleteContact(index) + Deprecation.warn_method("pbPhoneDeleteContact", "v22", "$PokemonGlobal.phone.contacts[index].visible = false") + $PokemonGlobal.phone.contacts[index].visible = false end -def pbRandomEncounterSpecies(enc_table) - return nil if !enc_table || enc_table.length == 0 - len = [enc_table.length, 4].min - return enc_table[rand(len)][1] +# @deprecated This method is slated to be removed in v22. +def pbFindPhoneTrainer(trainer_type, name) + Deprecation.warn_method("pbFindPhoneTrainer", "v22", "Phone.get(trainer_type, name)") + return Phone.get(trainer_type, name) end -def pbEncounterSpecies(phonenum) - return "" if !phonenum[6] || phonenum[6] == 0 - encounter_data = GameData::Encounter.get(phonenum[6], $PokemonGlobal.encounter_version) - return "" if !encounter_data - enc_tables = encounter_data.types - species = pbRandomEncounterSpecies(enc_tables[:Land]) - if !species - species = pbRandomEncounterSpecies(enc_tables[:Cave]) - if !species - species = pbRandomEncounterSpecies(enc_tables[:Water]) - end - end - return "" if !species - return GameData::Species.get(species).name +# @deprecated This method is slated to be removed in v22. +def pbHasPhoneTrainer?(trainer_type, name) + Deprecation.warn_method("pbHasPhoneTrainer", "v22", "Phone.get(trainer_type, name) != nil") + return Phone.get(trainer_type, name) != nil end -def pbTrainerSpecies(phonenum) - return "" if !phonenum[0] - partyid = [0, phonenum[5] - 1].max - trainer_data = GameData::Trainer.try_get(phonenum[1], phonenum[2], partyid) - return "" if !trainer_data - if trainer_data.pokemon.length == 1 - pkmn = trainer_data.pokemon[0][:species] - else - pkmn = trainer_data.pokemon[rand(trainer_data.pokemon.length)][:species] - end - return GameData::Species.get(pkmn).name +# @deprecated This method is slated to be removed in v22. +def pbPhoneReadyToBattle?(trainer_type, name) + Deprecation.warn_method("pbPhoneReadyToBattle", "v22", "Phone.get(trainer_type, name).can_rematch?") + contact = Phone.get(trainer_type, name) + return contact && contact.can_rematch? end -def pbTrainerMapName(phonenum) - return "" if !phonenum[6] || phonenum[6] == 0 - return pbGetMapNameFromId(phonenum[6]) +# @deprecated This method is slated to be removed in v22. +def pbPhoneReset(tr_type, tr_name) + Deprecation.warn_method("pbPhoneReadyToBattle", "v22", "Phone.get(trainer_type, name) and other things") + contact = Phone.get(trainer_type, name) + return false if !contact + contact.time_to_ready = 0 + contact.rematch_flag = 0 + $game_self_switches[[contact.map_id, contact.event_id, "A"]] = true + $game_map.need_refresh = true + return true end -#=============================================================================== -# The phone call itself -#=============================================================================== -def pbPhoneCall(call, phonenum) - pbMessage(_INTL("......\\wt[5] ......\\1")) - encspecies = pbEncounterSpecies(phonenum) - trainerspecies = pbTrainerSpecies(phonenum) - trainermap = pbTrainerMapName(phonenum) - messages = call.split("\\m") - messages.length.times do |i| - messages[i].gsub!(/\\TN/, phonenum[2]) - messages[i].gsub!(/\\TP/, trainerspecies) - messages[i].gsub!(/\\TE/, encspecies) - messages[i].gsub!(/\\TM/, trainermap) - messages[i] += "\\1" if i < messages.length - 1 - pbMessage(messages[i]) - end - pbMessage(_INTL("Click!\\wt[10]\n......\\wt[5] ......\\1")) +# Called by events. +# @deprecated This method is slated to be removed in v22. +def pbPhoneBattleCount(trainer_type, name) + Deprecation.warn_method("pbPhoneBattleCount", "v22", "Phone.variant(trainer_type, name)") + return Phone.variant(trainer_type, name) +end + +# Called by events. +# @deprecated This method is slated to be removed in v22. +def pbPhoneIncrement(trainer_type, name, versions_count) + Deprecation.warn_method("pbPhoneIncrement", "v22", "Phone.increment_version(trainer_type, name, start_version)") + Phone.increment_version(trainer_type, name, 0) +end + +# Used in phone calls that say they're ready for a rematch, used in Debug function. +# @deprecated This method is slated to be removed in v22. +def pbSetReadyToBattle(contact) + Deprecation.warn_method("pbSetReadyToBattle", "v22", "contact.set_trainer_event_ready_for_rematch") + contact.set_trainer_event_ready_for_rematch +end + +# @deprecated This method is slated to be removed in v22. +def pbRandomPhoneTrainer + Deprecation.warn_method("pbRandomPhoneTrainer", "v22", "Phone::Call.get_random_trainer_for_incoming_call") + return Phone::Call.get_random_trainer_for_incoming_call +end + +# @deprecated This method is slated to be removed in v22. +def pbCallTrainer(trainer_type, name) + Deprecation.warn_method("pbCallTrainer", "v22", "Phone::Call.make_outgoing(trainer_type, name)") + Phone::Call.make_outgoing(trainer_type, name) +end + +# @deprecated This method is slated to be removed in v22. +def pbPhoneGenerateCall(contact) + Deprecation.warn_method("pbPhoneGenerateCall", "v22", "Phone::Call.generate_trainer_dialogue(contact)") + return Phone::Call.generate_trainer_dialogue(contact) +end + +# @deprecated This method is slated to be removed in v22. +def pbPhoneCall(dialogue, contact) + Deprecation.warn_method("pbPhoneCall", "v22", "Phone::Call.play(dialogue, contact)") + Phone::Call.play(dialogue, contact) +end + +# @deprecated This method is slated to be removed in v22. +def pbEncounterSpecies(contact) + Deprecation.warn_method("pbEncounterSpecies", "v22", "Phone::Call.get_random_encounter_species(contact)") + return Phone::Call.get_random_encounter_species(contact) +end + +# @deprecated This method is slated to be removed in v22. +def pbTrainerSpecies(contact) + Deprecation.warn_method("pbTrainerSpecies", "v22", "Phone::Call.get_random_contact_pokemon_species(contact)") + return Phone::Call.get_random_contact_pokemon_species(contact) +end + +# @deprecated This method is slated to be removed in v22. +def pbTrainerMapName(contact) + Deprecation.warn_method("pbTrainerMapName", "v22", "Phone::Call.get_map_name(contact)") + return Phone::Call.get_map_name(contact) end diff --git a/Data/Scripts/013_Items/006_Item_Mail.rb b/Data/Scripts/013_Items/006_Item_Mail.rb index 8312a6499..2daafa70b 100644 --- a/Data/Scripts/013_Items/006_Item_Mail.rb +++ b/Data/Scripts/013_Items/006_Item_Mail.rb @@ -32,7 +32,7 @@ def pbDisplayMail(mail, _bearer = nil) sprites = {} viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport.z = 99999 - addBackgroundPlane(sprites, "background", "mailbg", viewport) + addBackgroundPlane(sprites, "background", "Mail/bg", viewport) sprites["card"] = IconSprite.new(0, 0, viewport) sprites["card"].setBitmap(GameData::Item.mail_filename(mail.item)) sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, viewport) @@ -69,13 +69,13 @@ def pbDisplayMail(mail, _bearer = nil) baseForLightBG = Color.new(80, 80, 88) shadowForLightBG = Color.new(168, 168, 176) if mail.message && mail.message != "" - isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(48, 48, Graphics.width - 96, 32 * 7)) + isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(48, 48, Graphics.width - 96, 224)) drawTextEx(overlay, 48, 52, Graphics.width - 94, 7, mail.message, (isDark) ? baseForDarkBG : baseForLightBG, (isDark) ? shadowForDarkBG : shadowForLightBG) end if mail.sender && mail.sender != "" - isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(336, 322, 144, 32 * 1)) + isDark = isDarkBackground(sprites["card"].bitmap, Rect.new(336, 322, 144, 32)) drawTextEx(overlay, 336, 328, 144, 1, mail.sender, (isDark) ? baseForDarkBG : baseForLightBG, (isDark) ? shadowForDarkBG : shadowForLightBG) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb index fc602f988..10e16a40c 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb @@ -260,8 +260,7 @@ MultipleForms.register(:ROTOM, { MultipleForms.register(:GIRATINA, { "getForm" => proc { |pkmn| next 1 if pkmn.hasItem?(:GRISEOUSORB) - if $game_map && - GameData::MapMetadata.get($game_map.map_id)&.has_flag?("DistortionWorld") + if $game_map && $game_map.metadata&.has_flag?("DistortionWorld") next 1 end next 0 diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb b/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb index a3b7e9365..f98ff3477 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/002_UI_Controls.rb @@ -10,27 +10,27 @@ class ButtonEventScene < EventScene super Graphics.freeze @current_screen = 1 - addImage(0, 0, "Graphics/Pictures/Controls help/help_bg") + addImage(0, 0, "Graphics/UI/Controls help/bg") @labels = [] @label_screens = [] @keys = [] @key_screens = [] - addImageForScreen(1, 44, 122, "Graphics/Pictures/Controls help/help_f1") - addImageForScreen(1, 44, 252, "Graphics/Pictures/Controls help/help_f8") + addImageForScreen(1, 44, 122, "Graphics/UI/Controls help/help_f1") + addImageForScreen(1, 44, 252, "Graphics/UI/Controls help/help_f8") addLabelForScreen(1, 134, 84, 352, _INTL("Opens the Key Bindings window, where you can choose which keyboard keys to use for each control.")) addLabelForScreen(1, 134, 244, 352, _INTL("Take a screenshot. It is put in the same folder as the save file.")) - addImageForScreen(2, 16, 158, "Graphics/Pictures/Controls help/help_arrows") + addImageForScreen(2, 16, 158, "Graphics/UI/Controls help/help_arrows") addLabelForScreen(2, 134, 100, 352, _INTL("Use the Arrow keys to move the main character.\r\n\r\nYou can also use the Arrow keys to select entries and navigate menus.")) - addImageForScreen(3, 16, 90, "Graphics/Pictures/Controls help/help_usekey") - addImageForScreen(3, 16, 236, "Graphics/Pictures/Controls help/help_backkey") + addImageForScreen(3, 16, 90, "Graphics/UI/Controls help/help_usekey") + addImageForScreen(3, 16, 236, "Graphics/UI/Controls help/help_backkey") addLabelForScreen(3, 134, 68, 352, _INTL("Used to confirm a choice, interact with people and things, and move through text. (Default: C)")) addLabelForScreen(3, 134, 196, 352, _INTL("Used to exit, cancel a choice, and cancel a mode. While moving around, hold to move at a different speed. (Default: X)")) - addImageForScreen(4, 16, 90, "Graphics/Pictures/Controls help/help_actionkey") - addImageForScreen(4, 16, 236, "Graphics/Pictures/Controls help/help_specialkey") + addImageForScreen(4, 16, 90, "Graphics/UI/Controls help/help_actionkey") + addImageForScreen(4, 16, 236, "Graphics/UI/Controls help/help_specialkey") addLabelForScreen(4, 134, 68, 352, _INTL("Used to open the Pause Menu. Also has various functions depending on context. (Default: Z)")) addLabelForScreen(4, 134, 196, 352, _INTL("Press to open the Ready Menu, where registered items and available field moves can be used. (Default: D)")) @@ -68,7 +68,7 @@ class ButtonEventScene < EventScene # End scene $game_temp.background_bitmap = Graphics.snap_to_bitmap Graphics.freeze - @viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black + @viewport.color = Color.black # Ensure screen is black Graphics.transition(8, "fadetoblack") $game_temp.background_bitmap.dispose scene.dispose diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb index 85be34c5b..9426c7524 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb @@ -17,7 +17,7 @@ class PokemonEggHatch_Scene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 # Create background image - addBackgroundOrColoredPlane(@sprites, "background", "hatchbg", + addBackgroundOrColoredPlane(@sprites, "background", "hatch_bg", Color.new(248, 248, 248), @viewport) # Create egg sprite/Pokémon sprite @sprites["pokemon"] = PokemonSprite.new(@viewport) @@ -45,8 +45,7 @@ class PokemonEggHatch_Scene @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"].z = 200 @sprites["overlay"].bitmap = Bitmap.new(Graphics.width, Graphics.height) - @sprites["overlay"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, - Color.new(255, 255, 255)) + @sprites["overlay"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.white) @sprites["overlay"].opacity = 0 # Start up scene pbFadeInAndShow(@sprites) diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index 96fe239dc..1efc28f79 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -496,7 +496,7 @@ class PokemonEvolutionScene @viewport.z = 99999 @msgviewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @msgviewport.z = 99999 - addBackgroundOrColoredPlane(@sprites, "background", "evolutionbg", + addBackgroundOrColoredPlane(@sprites, "background", "evolution_bg", Color.new(248, 248, 248), @bgviewport) rsprite1 = PokemonSprite.new(@viewport) rsprite1.setOffset(PictureOrigin::CENTER) diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb index e7b62b0d3..2782def27 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/005_UI_Trading.rb @@ -32,7 +32,7 @@ class PokemonTrade_Scene @pokemon2 = pokemon2 @trader1 = trader1 @trader2 = trader2 - addBackgroundOrColoredPlane(@sprites, "background", "tradebg", + addBackgroundOrColoredPlane(@sprites, "background", "trade_bg", Color.new(248, 248, 248), @viewport) @sprites["rsprite1"] = PokemonSprite.new(@viewport) @sprites["rsprite1"].setPokemonBitmap(@pokemon, false) @@ -70,7 +70,7 @@ class PokemonTrade_Scene picturePoke.setOrigin(0, PictureOrigin::BOTTOM) picturePoke.setVisible(0, true) # Change Pokémon color - picturePoke.moveColor(2, 5, Color.new(31 * 8, 22 * 8, 30 * 8, 255)) + picturePoke.moveColor(2, 5, Color.new(248, 176, 140)) # Recall delay = picturePoke.totalDuration picturePoke.setSE(delay, "Battle recall") @@ -110,7 +110,7 @@ class PokemonTrade_Scene # Starting position of sprite picturePoke.setOrigin(0, PictureOrigin::BOTTOM) picturePoke.setZoom(0, 0) - picturePoke.setColor(0, Color.new(31 * 8, 22 * 8, 30 * 8, 255)) + picturePoke.setColor(0, Color.new(248, 176, 240)) picturePoke.setVisible(0, false) # Dropping ball y = Graphics.height - 96 - 16 - 16 # end point of Poké Ball @@ -141,7 +141,7 @@ class PokemonTrade_Scene picturePoke.moveXY(delay, 8, Graphics.width / 2, @sprites["rsprite2"].y) # Return Pokémon's color to normal and play cry delay = picturePoke.totalDuration - picturePoke.moveColor(delay, 5, Color.new(31 * 8, 22 * 8, 30 * 8, 0)) + picturePoke.moveColor(delay, 5, Color.new(248, 176, 240, 0)) cry = GameData::Species.cry_filename_from_pokemon(@pokemon2) picturePoke.setSE(delay, cry) if cry # Play animation diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb index 5fe3e2e8a..862c6e219 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/006_UI_HallOfFame.rb @@ -48,9 +48,9 @@ class HallOfFame_Scene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 # Comment the below line to doesn't use a background - addBackgroundPlane(@sprites, "bg", "hallfamebg", @viewport) + addBackgroundPlane(@sprites, "bg", "Hall of Fame/bg", @viewport) @sprites["hallbars"] = IconSprite.new(@viewport) - @sprites["hallbars"].setBitmap("Graphics/Pictures/hallfamebars") + @sprites["hallbars"].setBitmap("Graphics/UI/Hall of Fame/bars") @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["overlay"].z = 10 pbSetSystemFont(@sprites["overlay"].bitmap) @@ -161,7 +161,7 @@ class HallOfFame_Scene def xpositionformula(battlernumber) ret = 0 if SINGLEROW - ret = battlernumber % 2 * 2 + ret = (battlernumber % 2) * 2 else ret = (battlernumber / 3).even? ? (19 - battlernumber) % 3 : (19 + battlernumber) % 3 end @@ -173,7 +173,7 @@ class HallOfFame_Scene if SINGLEROW ret = 1 else - ret = (battlernumber / 3) % 2 * 2 + ret = ((battlernumber / 3) % 2) * 2 end return ret end diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb index 80985fc37..4fae0cb96 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/007_UI_Credits.rb @@ -201,7 +201,7 @@ _END_ pbBGMFade(2.0) $game_temp.background_bitmap = Graphics.snap_to_bitmap Graphics.freeze - viewport.color = Color.new(0, 0, 0, 255) # Ensure screen is black + viewport.color = Color.black # Ensure screen is black Graphics.transition(8, "fadetoblack") $game_temp.background_bitmap.dispose @background_sprite.dispose diff --git a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb index 69839f348..4b02e6be9 100644 --- a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb +++ b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb @@ -8,9 +8,9 @@ class Window_DexesList < Window_CommandPokemon def initialize(commands, commands2, width) @commands2 = commands2 super(commands, width) - @selarrow = AnimatedBitmap.new("Graphics/Pictures/selarrow_white") + @selarrow = AnimatedBitmap.new("Graphics/UI/sel_arrow_white") self.baseColor = Color.new(248, 248, 248) - self.shadowColor = Color.new(0, 0, 0) + self.shadowColor = Color.black self.windowskin = nil end @@ -25,8 +25,8 @@ class Window_DexesList < Window_CommandPokemon allown = (@commands2[index][1] >= @commands2[index][2]) pbDrawImagePositions( self.contents, - [["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 236, rect.y + 6, (allseen) ? 24 : 0, 0, 24, 24], - ["Graphics/Pictures/Pokedex/icon_menuseenown", rect.x + 332, rect.y + 6, (allown) ? 24 : 0, 24, 24, 24]] + [["Graphics/UI/Pokedex/icon_menuseenown", rect.x + 236, rect.y + 6, (allseen) ? 24 : 0, 0, 24, 24], + ["Graphics/UI/Pokedex/icon_menuseenown", rect.x + 332, rect.y + 6, (allown) ? 24 : 0, 24, 24, 24]] ) end end @@ -46,7 +46,7 @@ class PokemonPokedexMenu_Scene @viewport.z = 99999 @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) - @sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_menu")) + @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_menu")) @sprites["headings"] = Window_AdvancedTextPokemon.newWithSize( _INTL("SEENOBTAINED"), 286, 136, 208, 64, @viewport ) diff --git a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb index 3c144e435..043d4fdf2 100644 --- a/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb +++ b/Data/Scripts/016_UI/003_UI_Pokedex_Main.rb @@ -5,9 +5,9 @@ class Window_Pokedex < Window_DrawableCommand def initialize(x, y, width, height, viewport) @commands = [] super(x, y, width, height, viewport) - @selarrow = AnimatedBitmap.new("Graphics/Pictures/Pokedex/cursor_list") - @pokeballOwn = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_own") - @pokeballSeen = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_seen") + @selarrow = AnimatedBitmap.new("Graphics/UI/Pokedex/cursor_list") + @pokeballOwn = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_own") + @pokeballSeen = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_seen") self.baseColor = Color.new(88, 88, 80) self.shadowColor = Color.new(168, 184, 184) self.windowskin = nil @@ -86,7 +86,7 @@ class PokedexSearchSelectionSprite < Sprite def initialize(viewport = nil) super(viewport) - @selbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/cursor_search") + @selbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/cursor_search") self.bitmap = @selbitmap.bitmap self.mode = -1 @index = 0 @@ -262,12 +262,12 @@ class PokemonPokedex_Scene end def pbStartScene - @sliderbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_slider") - @typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_types")) - @shapebitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_shapes") - @hwbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_hw") - @selbitmap = AnimatedBitmap.new("Graphics/Pictures/Pokedex/icon_searchsel") - @searchsliderbitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_searchslider")) + @sliderbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_slider") + @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_types")) + @shapebitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_shapes") + @hwbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_hw") + @selbitmap = AnimatedBitmap.new("Graphics/UI/Pokedex/icon_searchsel") + @searchsliderbitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_searchslider")) @sprites = {} @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @@ -405,9 +405,9 @@ class PokemonPokedex_Scene @sprites["pokedex"].index = index @sprites["pokedex"].refresh if @searchResults - @sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_listsearch") + @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_listsearch") else - @sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_list") + @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_list") end pbRefresh end @@ -428,7 +428,7 @@ class PokemonPokedex_Scene end end textpos = [ - [dexname, Graphics.width / 2, 10, 2, Color.new(248, 248, 248), Color.new(0, 0, 0)] + [dexname, Graphics.width / 2, 10, 2, Color.new(248, 248, 248), Color.black] ] textpos.push([GameData::Species.get(iconspecies).name, 112, 58, 2, base, shadow]) if iconspecies if @searchResults @@ -902,19 +902,19 @@ class PokemonPokedex_Scene ret = nil # Set background case mode - when 0 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_order") - when 1 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_name") + when 0 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_order") + when 1 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_name") when 2 count = 0 GameData::Type.each { |t| count += 1 if !t.pseudo_type && t.id != :SHADOW } if count == 18 - @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type_18") + @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_type_18") else - @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_type") + @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_type") end - when 3, 4 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_size") - when 5 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_color") - when 6 then @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search_shape") + when 3, 4 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_size") + when 5 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_color") + when 6 then @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search_shape") end selindex = selitems.clone index = selindex[0] @@ -1087,7 +1087,7 @@ class PokemonPokedex_Scene end Input.update # Set background image - @sprites["searchbg"].setBitmap("Graphics/Pictures/Pokedex/bg_search") + @sprites["searchbg"].setBitmap("Graphics/UI/Pokedex/bg_search") @sprites["searchcursor"].mode = -1 @sprites["searchcursor"].index = mainindex return ret @@ -1246,9 +1246,9 @@ class PokemonPokedex_Scene end pbFadeOutAndHide(@sprites) if @searchResults - @sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_listsearch") + @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_listsearch") else - @sprites["background"].setBitmap("Graphics/Pictures/Pokedex/bg_list") + @sprites["background"].setBitmap("Graphics/UI/Pokedex/bg_list") end pbRefresh pbFadeInAndShow(@sprites, oldsprites) diff --git a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb index 066cd1d21..eabdf250c 100644 --- a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb +++ b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb @@ -10,7 +10,7 @@ class PokemonPokedexInfo_Scene @region = region @page = 1 @show_battled_count = false - @typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_types")) + @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_types")) @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["infosprite"] = PokemonSprite.new(@viewport) @@ -23,21 +23,21 @@ class PokemonPokedexInfo_Scene @region = (mappos) ? mappos[0] : 0 # Region 0 default end @sprites["areamap"] = IconSprite.new(0, 0, @viewport) - @sprites["areamap"].setBitmap("Graphics/Pictures/#{@mapdata[@region][1]}") + @sprites["areamap"].setBitmap("Graphics/UI/Town Map/#{@mapdata[@region][1]}") @sprites["areamap"].x += (Graphics.width - @sprites["areamap"].bitmap.width) / 2 @sprites["areamap"].y += (Graphics.height + 32 - @sprites["areamap"].bitmap.height) / 2 Settings::REGION_MAP_EXTRAS.each do |hidden| next if hidden[0] != @region || hidden[1] <= 0 || !$game_switches[hidden[1]] pbDrawImagePositions( @sprites["areamap"].bitmap, - [["Graphics/Pictures/#{hidden[4]}", + [["Graphics/UI/Town Map/#{hidden[4]}", hidden[2] * PokemonRegionMap_Scene::SQUARE_WIDTH, hidden[3] * PokemonRegionMap_Scene::SQUARE_HEIGHT]] ) end @sprites["areahighlight"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["areaoverlay"] = IconSprite.new(0, 0, @viewport) - @sprites["areaoverlay"].setBitmap("Graphics/Pictures/Pokedex/overlay_area") + @sprites["areaoverlay"].setBitmap("Graphics/UI/Pokedex/overlay_area") @sprites["formfront"] = PokemonSprite.new(@viewport) @sprites["formfront"].setOffset(PictureOrigin::CENTER) @sprites["formfront"].x = 130 @@ -49,12 +49,12 @@ class PokemonPokedexInfo_Scene @sprites["formicon"].setOffset(PictureOrigin::CENTER) @sprites["formicon"].x = 82 @sprites["formicon"].y = 328 - @sprites["uparrow"] = AnimatedSprite.new("Graphics/Pictures/uparrow", 8, 28, 40, 2, @viewport) + @sprites["uparrow"] = AnimatedSprite.new("Graphics/UI/up_arrow", 8, 28, 40, 2, @viewport) @sprites["uparrow"].x = 242 @sprites["uparrow"].y = 268 @sprites["uparrow"].play @sprites["uparrow"].visible = false - @sprites["downarrow"] = AnimatedSprite.new("Graphics/Pictures/downarrow", 8, 28, 40, 2, @viewport) + @sprites["downarrow"] = AnimatedSprite.new("Graphics/UI/down_arrow", 8, 28, 40, 2, @viewport) @sprites["downarrow"].x = 242 @sprites["downarrow"].y = 348 @sprites["downarrow"].play @@ -94,7 +94,7 @@ class PokemonPokedexInfo_Scene @index = 0 @page = 1 @brief = true - @typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/Pokedex/icon_types")) + @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/Pokedex/icon_types")) @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["infosprite"] = PokemonSprite.new(@viewport) @@ -198,13 +198,13 @@ class PokemonPokedexInfo_Scene end def drawPageInfo - @sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_info")) + @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_info")) overlay = @sprites["overlay"].bitmap base = Color.new(88, 88, 80) shadow = Color.new(168, 184, 184) imagepos = [] if @brief - imagepos.push([_INTL("Graphics/Pictures/Pokedex/overlay_info"), 0, 0]) + imagepos.push([_INTL("Graphics/UI/Pokedex/overlay_info"), 0, 0]) end species_data = GameData::Species.get_species_form(@species, @form) # Write various bits of text @@ -216,7 +216,7 @@ class PokemonPokedexInfo_Scene end textpos = [ [_INTL("{1}{2} {3}", indexText, " ", species_data.name), - 246, 48, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)] + 246, 48, 0, Color.new(248, 248, 248), Color.black] ] if @show_battled_count textpos.push([_INTL("Number Battled"), 314, 164, 0, base, shadow]) @@ -243,7 +243,7 @@ class PokemonPokedexInfo_Scene end end # Draw the Pokédex entry text - drawTextEx(overlay, 40, 246, Graphics.width - (40 * 2), 4, # overlay, x, y, width, num lines + drawTextEx(overlay, 40, 246, Graphics.width - 80, 4, # overlay, x, y, width, num lines species_data.pokedex_entry, base, shadow) # Draw the footprint footprintfile = GameData::Species.footprint_filename(@species, @form) @@ -253,7 +253,7 @@ class PokemonPokedexInfo_Scene footprint.dispose end # Show the owned icon - imagepos.push(["Graphics/Pictures/Pokedex/icon_own", 212, 44]) + imagepos.push(["Graphics/UI/Pokedex/icon_own", 212, 44]) # Draw the type icon(s) species_data.types.each_with_index do |type, i| type_number = GameData::Type.get(type).icon_position @@ -333,7 +333,7 @@ class PokemonPokedexInfo_Scene end def drawPageArea - @sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_area")) + @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_area")) overlay = @sprites["overlay"].bitmap base = Color.new(88, 88, 80) shadow = Color.new(168, 184, 184) @@ -371,7 +371,7 @@ class PokemonPokedexInfo_Scene if points.length == 0 pbDrawImagePositions( overlay, - [[sprintf("Graphics/Pictures/Pokedex/overlay_areanone"), 108, 188]] + [[sprintf("Graphics/UI/Pokedex/overlay_areanone"), 108, 188]] ) textpos.push([_INTL("Area unknown"), Graphics.width / 2, (Graphics.height / 2) + 6, 2, base, shadow]) end @@ -382,7 +382,7 @@ class PokemonPokedexInfo_Scene end def drawPageForms - @sprites["background"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_forms")) + @sprites["background"].setBitmap(_INTL("Graphics/UI/Pokedex/bg_forms")) overlay = @sprites["overlay"].bitmap base = Color.new(88, 88, 80) shadow = Color.new(168, 184, 184) diff --git a/Data/Scripts/016_UI/005_UI_Party.rb b/Data/Scripts/016_UI/005_UI_Party.rb index 9d235e910..9e432d984 100644 --- a/Data/Scripts/016_UI/005_UI_Party.rb +++ b/Data/Scripts/016_UI/005_UI_Party.rb @@ -9,11 +9,11 @@ class PokemonPartyConfirmCancelSprite < Sprite @refreshBitmap = true @bgsprite = ChangelingSprite.new(0, 0, viewport) if narrowbox - @bgsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_cancel_narrow") - @bgsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_cancel_narrow_sel") + @bgsprite.addBitmap("desel", "Graphics/UI/Party/icon_cancel_narrow") + @bgsprite.addBitmap("sel", "Graphics/UI/Party/icon_cancel_narrow_sel") else - @bgsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_cancel") - @bgsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_cancel_sel") + @bgsprite.addBitmap("desel", "Graphics/UI/Party/icon_cancel") + @bgsprite.addBitmap("sel", "Graphics/UI/Party/icon_cancel_sel") end @bgsprite.changeBitmap("desel") @overlaysprite = BitmapSprite.new(@bgsprite.bitmap.width, @bgsprite.bitmap.height, viewport) @@ -140,7 +140,7 @@ class PokemonPartyBlankPanel < Sprite super(viewport) self.x = (index % 2) * Graphics.width / 2 self.y = (16 * (index % 2)) + (96 * (index / 2)) - @panelbgsprite = AnimatedBitmap.new("Graphics/Pictures/Party/panel_blank") + @panelbgsprite = AnimatedBitmap.new("Graphics/UI/Party/panel_blank") self.bitmap = @panelbgsprite.bitmap @text = nil end @@ -186,31 +186,31 @@ class PokemonPartyPanel < Sprite @panelbgsprite = ChangelingSprite.new(0, 0, viewport) @panelbgsprite.z = self.z if @active # Rounded panel - @panelbgsprite.addBitmap("able", "Graphics/Pictures/Party/panel_round") - @panelbgsprite.addBitmap("ablesel", "Graphics/Pictures/Party/panel_round_sel") - @panelbgsprite.addBitmap("fainted", "Graphics/Pictures/Party/panel_round_faint") - @panelbgsprite.addBitmap("faintedsel", "Graphics/Pictures/Party/panel_round_faint_sel") - @panelbgsprite.addBitmap("swap", "Graphics/Pictures/Party/panel_round_swap") - @panelbgsprite.addBitmap("swapsel", "Graphics/Pictures/Party/panel_round_swap_sel") - @panelbgsprite.addBitmap("swapsel2", "Graphics/Pictures/Party/panel_round_swap_sel2") + @panelbgsprite.addBitmap("able", "Graphics/UI/Party/panel_round") + @panelbgsprite.addBitmap("ablesel", "Graphics/UI/Party/panel_round_sel") + @panelbgsprite.addBitmap("fainted", "Graphics/UI/Party/panel_round_faint") + @panelbgsprite.addBitmap("faintedsel", "Graphics/UI/Party/panel_round_faint_sel") + @panelbgsprite.addBitmap("swap", "Graphics/UI/Party/panel_round_swap") + @panelbgsprite.addBitmap("swapsel", "Graphics/UI/Party/panel_round_swap_sel") + @panelbgsprite.addBitmap("swapsel2", "Graphics/UI/Party/panel_round_swap_sel2") else # Rectangular panel - @panelbgsprite.addBitmap("able", "Graphics/Pictures/Party/panel_rect") - @panelbgsprite.addBitmap("ablesel", "Graphics/Pictures/Party/panel_rect_sel") - @panelbgsprite.addBitmap("fainted", "Graphics/Pictures/Party/panel_rect_faint") - @panelbgsprite.addBitmap("faintedsel", "Graphics/Pictures/Party/panel_rect_faint_sel") - @panelbgsprite.addBitmap("swap", "Graphics/Pictures/Party/panel_rect_swap") - @panelbgsprite.addBitmap("swapsel", "Graphics/Pictures/Party/panel_rect_swap_sel") - @panelbgsprite.addBitmap("swapsel2", "Graphics/Pictures/Party/panel_rect_swap_sel2") + @panelbgsprite.addBitmap("able", "Graphics/UI/Party/panel_rect") + @panelbgsprite.addBitmap("ablesel", "Graphics/UI/Party/panel_rect_sel") + @panelbgsprite.addBitmap("fainted", "Graphics/UI/Party/panel_rect_faint") + @panelbgsprite.addBitmap("faintedsel", "Graphics/UI/Party/panel_rect_faint_sel") + @panelbgsprite.addBitmap("swap", "Graphics/UI/Party/panel_rect_swap") + @panelbgsprite.addBitmap("swapsel", "Graphics/UI/Party/panel_rect_swap_sel") + @panelbgsprite.addBitmap("swapsel2", "Graphics/UI/Party/panel_rect_swap_sel2") end @hpbgsprite = ChangelingSprite.new(0, 0, viewport) @hpbgsprite.z = self.z + 1 - @hpbgsprite.addBitmap("able", "Graphics/Pictures/Party/overlay_hp_back") - @hpbgsprite.addBitmap("fainted", "Graphics/Pictures/Party/overlay_hp_back_faint") - @hpbgsprite.addBitmap("swap", "Graphics/Pictures/Party/overlay_hp_back_swap") + @hpbgsprite.addBitmap("able", "Graphics/UI/Party/overlay_hp_back") + @hpbgsprite.addBitmap("fainted", "Graphics/UI/Party/overlay_hp_back_faint") + @hpbgsprite.addBitmap("swap", "Graphics/UI/Party/overlay_hp_back_swap") @ballsprite = ChangelingSprite.new(0, 0, viewport) @ballsprite.z = self.z + 1 - @ballsprite.addBitmap("desel", "Graphics/Pictures/Party/icon_ball") - @ballsprite.addBitmap("sel", "Graphics/Pictures/Party/icon_ball_sel") + @ballsprite.addBitmap("desel", "Graphics/UI/Party/icon_ball") + @ballsprite.addBitmap("sel", "Graphics/UI/Party/icon_ball_sel") @pkmnsprite = PokemonIconSprite.new(pokemon, viewport) @pkmnsprite.setOffset(PictureOrigin::CENTER) @pkmnsprite.active = @active @@ -220,8 +220,8 @@ class PokemonPartyPanel < Sprite @overlaysprite = BitmapSprite.new(Graphics.width, Graphics.height, viewport) @overlaysprite.z = self.z + 4 pbSetSystemFont(@overlaysprite.bitmap) - @hpbar = AnimatedBitmap.new("Graphics/Pictures/Party/overlay_hp") - @statuses = AnimatedBitmap.new(_INTL("Graphics/Pictures/statuses")) + @hpbar = AnimatedBitmap.new("Graphics/UI/Party/overlay_hp") + @statuses = AnimatedBitmap.new(_INTL("Graphics/UI/statuses")) @selected = false @preselected = false @switching = false @@ -380,7 +380,7 @@ class PokemonPartyPanel < Sprite return if @pokemon.egg? # "Lv" graphic pbDrawImagePositions(@overlaysprite.bitmap, - [["Graphics/Pictures/Party/overlay_lv", 20, 70, 0, 0, 22, 14]]) + [["Graphics/UI/Party/overlay_lv", 20, 70, 0, 0, 22, 14]]) # Level number pbSetSmallFont(@overlaysprite.bitmap) pbDrawTextPositions(@overlaysprite.bitmap, @@ -434,7 +434,7 @@ class PokemonPartyPanel < Sprite def draw_shiny_icon return if @pokemon.egg? || !@pokemon.shiny? pbDrawImagePositions(@overlaysprite.bitmap, - [["Graphics/Pictures/shiny", 80, 48, 0, 0, 16, 16]]) + [["Graphics/UI/shiny", 80, 48, 0, 0, 16, 16]]) end def draw_annotation @@ -498,7 +498,7 @@ class PokemonParty_Scene @sprites["storagetext"].z = 10 @sprites["storagetext"].viewport = @viewport @sprites["storagetext"].baseColor = Color.new(248, 248, 248) - @sprites["storagetext"].shadowColor = Color.new(0, 0, 0) + @sprites["storagetext"].shadowColor = Color.black @sprites["storagetext"].windowskin = nil @sprites["helpwindow"] = Window_UnformattedTextPokemon.new(starthelptext) @sprites["helpwindow"].viewport = @viewport diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index 6041caf96..403c30498 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -7,7 +7,7 @@ class MoveSelectionSprite < Sprite def initialize(viewport = nil, fifthmove = false) super(viewport) - @movesel = AnimatedBitmap.new("Graphics/Pictures/Summary/cursor_move") + @movesel = AnimatedBitmap.new("Graphics/UI/Summary/cursor_move") @frame = 0 @index = 0 @fifthmove = fifthmove @@ -61,7 +61,7 @@ end class RibbonSelectionSprite < MoveSelectionSprite def initialize(viewport = nil) super(viewport) - @movesel = AnimatedBitmap.new("Graphics/Pictures/Summary/cursor_ribbon") + @movesel = AnimatedBitmap.new("Graphics/UI/Summary/cursor_ribbon") @frame = 0 @index = 0 @preselected = false @@ -117,8 +117,8 @@ class PokemonSummary_Scene @pokemon = @party[@partyindex] @inbattle = inbattle @page = 1 - @typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) - @markingbitmap = AnimatedBitmap.new("Graphics/Pictures/Summary/markings") + @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types")) + @markingbitmap = AnimatedBitmap.new("Graphics/UI/Summary/markings") @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["pokemon"] = PokemonSprite.new(@viewport) @@ -145,24 +145,24 @@ class PokemonSummary_Scene @sprites["ribbonpresel"].preselected = true @sprites["ribbonsel"] = RibbonSelectionSprite.new(@viewport) @sprites["ribbonsel"].visible = false - @sprites["uparrow"] = AnimatedSprite.new("Graphics/Pictures/uparrow", 8, 28, 40, 2, @viewport) + @sprites["uparrow"] = AnimatedSprite.new("Graphics/UI/up_arrow", 8, 28, 40, 2, @viewport) @sprites["uparrow"].x = 350 @sprites["uparrow"].y = 56 @sprites["uparrow"].play @sprites["uparrow"].visible = false - @sprites["downarrow"] = AnimatedSprite.new("Graphics/Pictures/downarrow", 8, 28, 40, 2, @viewport) + @sprites["downarrow"] = AnimatedSprite.new("Graphics/UI/down_arrow", 8, 28, 40, 2, @viewport) @sprites["downarrow"].x = 350 @sprites["downarrow"].y = 260 @sprites["downarrow"].play @sprites["downarrow"].visible = false @sprites["markingbg"] = IconSprite.new(260, 88, @viewport) - @sprites["markingbg"].setBitmap("Graphics/Pictures/Summary/overlay_marking") + @sprites["markingbg"].setBitmap("Graphics/UI/Summary/overlay_marking") @sprites["markingbg"].visible = false @sprites["markingoverlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["markingoverlay"].visible = false pbSetSystemFont(@sprites["markingoverlay"].bitmap) @sprites["markingsel"] = IconSprite.new(0, 0, @viewport) - @sprites["markingsel"].setBitmap("Graphics/Pictures/Summary/cursor_marking") + @sprites["markingsel"].setBitmap("Graphics/UI/Summary/cursor_marking") @sprites["markingsel"].src_rect.height = @sprites["markingsel"].bitmap.height / 2 @sprites["markingsel"].visible = false @sprites["messagebox"] = Window_AdvancedTextPokemon.new("") @@ -183,7 +183,7 @@ class PokemonSummary_Scene @partyindex = partyindex @pokemon = @party[@partyindex] @page = 4 - @typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) + @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types")) @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @@ -306,10 +306,10 @@ class PokemonSummary_Scene base = Color.new(248, 248, 248) shadow = Color.new(104, 104, 104) # Set background image - @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_#{page}") + @sprites["background"].setBitmap("Graphics/UI/Summary/bg_#{page}") imagepos = [] # Show the Poké Ball containing the Pokémon - ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball) + ballimage = sprintf("Graphics/UI/Summary/icon_ball_%s", @pokemon.poke_ball) imagepos.push([ballimage, 14, 60]) # Show status/fainted/Pokérus infected icon status = -1 @@ -321,15 +321,15 @@ class PokemonSummary_Scene status = GameData::Status.count end if status >= 0 - imagepos.push(["Graphics/Pictures/statuses", 124, 100, 0, 16 * status, 44, 16]) + imagepos.push(["Graphics/UI/statuses", 124, 100, 0, 16 * status, 44, 16]) end # Show Pokérus cured icon if @pokemon.pokerusStage == 2 - imagepos.push([sprintf("Graphics/Pictures/Summary/icon_pokerus"), 176, 100]) + imagepos.push([sprintf("Graphics/UI/Summary/icon_pokerus"), 176, 100]) end # Show shininess star if @pokemon.shiny? - imagepos.push([sprintf("Graphics/Pictures/shiny"), 2, 134]) + imagepos.push([sprintf("Graphics/UI/shiny"), 2, 134]) end # Draw all images pbDrawImagePositions(overlay, imagepos) @@ -381,8 +381,8 @@ class PokemonSummary_Scene if @pokemon.shadowPokemon? shadowfract = @pokemon.heart_gauge.to_f / @pokemon.max_gauge_size imagepos = [ - ["Graphics/Pictures/Summary/overlay_shadow", 224, 240], - ["Graphics/Pictures/Summary/overlay_shadowbar", 242, 280, 0, 0, (shadowfract * 248).floor, -1] + ["Graphics/UI/Summary/overlay_shadow", 224, 240], + ["Graphics/UI/Summary/overlay_shadowbar", 242, 280, 0, 0, (shadowfract * 248).floor, -1] ] pbDrawImagePositions(overlay, imagepos) end @@ -468,7 +468,7 @@ class PokemonSummary_Scene w = @pokemon.exp_fraction * 128 w = ((w / 2).round) * 2 pbDrawImagePositions(overlay, - [["Graphics/Pictures/Summary/overlay_exp", 362, 372, 0, 0, w, 6]]) + [["Graphics/UI/Summary/overlay_exp", 362, 372, 0, 0, w, 6]]) end end @@ -479,10 +479,10 @@ class PokemonSummary_Scene base = Color.new(248, 248, 248) shadow = Color.new(104, 104, 104) # Set background image - @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_egg") + @sprites["background"].setBitmap("Graphics/UI/Summary/bg_egg") imagepos = [] # Show the Poké Ball containing the Pokémon - ballimage = sprintf("Graphics/Pictures/Summary/icon_ball_%s", @pokemon.poke_ball) + ballimage = sprintf("Graphics/UI/Summary/icon_ball_%s", @pokemon.poke_ball) imagepos.push([ballimage, 14, 60]) # Draw all images pbDrawImagePositions(overlay, imagepos) @@ -670,7 +670,7 @@ class PokemonSummary_Scene hpzone = 1 if @pokemon.hp <= (@pokemon.totalhp / 2).floor hpzone = 2 if @pokemon.hp <= (@pokemon.totalhp / 4).floor imagepos = [ - ["Graphics/Pictures/Summary/overlay_hp", 360, 110, 0, hpzone * 6, w, 6] + ["Graphics/UI/Summary/overlay_hp", 360, 110, 0, hpzone * 6, w, 6] ] pbDrawImagePositions(overlay, imagepos) end @@ -699,7 +699,7 @@ class PokemonSummary_Scene move = @pokemon.moves[i] if move type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position - imagepos.push(["Graphics/Pictures/types", 248, yPos - 4, 0, type_number * 28, 64, 28]) + imagepos.push(["Graphics/UI/types", 248, yPos - 4, 0, type_number * 28, 64, 28]) textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow]) if move.total_pp > 0 textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow]) @@ -741,9 +741,9 @@ class PokemonSummary_Scene Color.new(136, 48, 48)] # Zero PP # Set background image if move_to_learn - @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_learnmove") + @sprites["background"].setBitmap("Graphics/UI/Summary/bg_learnmove") else - @sprites["background"].setBitmap("Graphics/Pictures/Summary/bg_movedetail") + @sprites["background"].setBitmap("Graphics/UI/Summary/bg_movedetail") end # Write various bits of text textpos = [ @@ -765,7 +765,7 @@ class PokemonSummary_Scene end if move type_number = GameData::Type.get(move.display_type(@pokemon)).icon_position - imagepos.push(["Graphics/Pictures/types", 248, yPos - 4, 0, type_number * 28, 64, 28]) + imagepos.push(["Graphics/UI/types", 248, yPos - 4, 0, type_number * 28, 64, 28]) textpos.push([move.name, 316, yPos, 0, moveBase, moveShadow]) if move.total_pp > 0 textpos.push([_INTL("PP"), 342, yPos + 32, 0, moveBase, moveShadow]) @@ -823,7 +823,7 @@ class PokemonSummary_Scene # Draw all text pbDrawTextPositions(overlay, textpos) # Draw selected move's damage category icon - imagepos = [["Graphics/Pictures/category", 166, 124, 0, selected_move.display_category(@pokemon) * 28, 64, 28]] + imagepos = [["Graphics/UI/category", 166, 124, 0, selected_move.display_category(@pokemon) * 28, 64, 28]] pbDrawImagePositions(overlay, imagepos) # Draw selected move's description drawTextEx(overlay, 4, 224, 230, 5, selected_move.description, base, shadow) @@ -847,7 +847,7 @@ class PokemonSummary_Scene break if !@pokemon.ribbons[i] ribbon_data = GameData::Ribbon.get(@pokemon.ribbons[i]) ribn = ribbon_data.icon_position - imagepos.push(["Graphics/Pictures/ribbons", + imagepos.push(["Graphics/UI/Summary/ribbons", 230 + (68 * (coord % 4)), 78 + (68 * (coord / 4).floor), 64 * (ribn % 8), 64 * (ribn / 8).floor, 64, 64]) coord += 1 @@ -870,7 +870,7 @@ class PokemonSummary_Scene desc = ribbonid ? GameData::Ribbon.get(ribbonid).description : "" # Draw the description box imagepos = [ - ["Graphics/Pictures/Summary/overlay_ribbon", 8, 280] + ["Graphics/UI/Summary/overlay_ribbon", 8, 280] ] pbDrawImagePositions(overlay, imagepos) # Draw name of selected ribbon diff --git a/Data/Scripts/016_UI/007_UI_Bag.rb b/Data/Scripts/016_UI/007_UI_Bag.rb index 403e7a50d..4a0ac1cbe 100644 --- a/Data/Scripts/016_UI/007_UI_Bag.rb +++ b/Data/Scripts/016_UI/007_UI_Bag.rb @@ -12,8 +12,8 @@ class Window_PokemonBag < Window_DrawableCommand @sorting = false @adapter = PokemonMartAdapter.new super(x, y, width, height) - @selarrow = AnimatedBitmap.new("Graphics/Pictures/Bag/cursor") - @swaparrow = AnimatedBitmap.new("Graphics/Pictures/Bag/cursor_swap") + @selarrow = AnimatedBitmap.new("Graphics/UI/Bag/cursor") + @swaparrow = AnimatedBitmap.new("Graphics/UI/Bag/cursor_swap") self.windowskin = nil end @@ -82,12 +82,12 @@ class Window_PokemonBag < Window_DrawableCommand if @bag.registered?(item) pbDrawImagePositions( self.contents, - [["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 0, -1, 24]] + [["Graphics/UI/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 0, -1, 24]] ) elsif pbCanRegisterItem?(item) pbDrawImagePositions( self.contents, - [["Graphics/Pictures/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 24, -1, 24]] + [["Graphics/UI/Bag/icon_register", rect.x + rect.width - 72, rect.y + 8, 0, 24, -1, 24]] ) end else @@ -172,8 +172,8 @@ class PokemonBag_Scene end end @bag.last_viewed_pocket = lastpocket - @sliderbitmap = AnimatedBitmap.new("Graphics/Pictures/Bag/icon_slider") - @pocketbitmap = AnimatedBitmap.new("Graphics/Pictures/Bag/icon_pocket") + @sliderbitmap = AnimatedBitmap.new("Graphics/UI/Bag/icon_slider") + @pocketbitmap = AnimatedBitmap.new("Graphics/UI/Bag/icon_pocket") @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @@ -182,12 +182,12 @@ class PokemonBag_Scene @sprites["pocketicon"] = BitmapSprite.new(186, 32, @viewport) @sprites["pocketicon"].x = 0 @sprites["pocketicon"].y = 224 - @sprites["leftarrow"] = AnimatedSprite.new("Graphics/Pictures/leftarrow", 8, 40, 28, 2, @viewport) + @sprites["leftarrow"] = AnimatedSprite.new("Graphics/UI/left_arrow", 8, 40, 28, 2, @viewport) @sprites["leftarrow"].x = -4 @sprites["leftarrow"].y = 76 @sprites["leftarrow"].visible = (!@choosing || numfilledpockets > 1) @sprites["leftarrow"].play - @sprites["rightarrow"] = AnimatedSprite.new("Graphics/Pictures/rightarrow", 8, 40, 28, 2, @viewport) + @sprites["rightarrow"] = AnimatedSprite.new("Graphics/UI/right_arrow", 8, 40, 28, 2, @viewport) @sprites["rightarrow"].x = 150 @sprites["rightarrow"].y = 76 @sprites["rightarrow"].visible = (!@choosing || numfilledpockets > 1) @@ -258,13 +258,13 @@ class PokemonBag_Scene def pbRefresh # Set the background image - @sprites["background"].setBitmap(sprintf("Graphics/Pictures/Bag/bg_#{@bag.last_viewed_pocket}")) + @sprites["background"].setBitmap(sprintf("Graphics/UI/Bag/bg_#{@bag.last_viewed_pocket}")) # Set the bag sprite - fbagexists = pbResolveBitmap(sprintf("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f")) + fbagexists = pbResolveBitmap(sprintf("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}_f")) if $player.female? && fbagexists - @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}_f") + @sprites["bagsprite"].setBitmap("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}_f") else - @sprites["bagsprite"].setBitmap("Graphics/Pictures/Bag/bag_#{@bag.last_viewed_pocket}") + @sprites["bagsprite"].setBitmap("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}") end # Draw the pocket icons @sprites["pocketicon"].bitmap.clear diff --git a/Data/Scripts/016_UI/008_UI_Pokegear.rb b/Data/Scripts/016_UI/008_UI_Pokegear.rb index 78882499f..4d822d16b 100644 --- a/Data/Scripts/016_UI/008_UI_Pokegear.rb +++ b/Data/Scripts/016_UI/008_UI_Pokegear.rb @@ -14,10 +14,10 @@ class PokegearButton < Sprite @image = command[0] @name = command[1] @selected = false - if $player.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/icon_button_f")) - @button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button_f") + if $player.female? && pbResolveBitmap(sprintf("Graphics/UI/Pokegear/icon_button_f")) + @button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button_f") else - @button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button") + @button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button") end @contents = BitmapWrapper.new(@button.width, @button.height) self.bitmap = @contents @@ -49,7 +49,7 @@ class PokegearButton < Sprite ] pbDrawTextPositions(self.bitmap, textpos) imagepos = [ - [sprintf("Graphics/Pictures/Pokegear/icon_" + @image), 18, 10] + [sprintf("Graphics/UI/Pokegear/icon_" + @image), 18, 10] ] pbDrawImagePositions(self.bitmap, imagepos) end @@ -73,10 +73,10 @@ class PokemonPokegear_Scene @viewport.z = 99999 @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) - if $player.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/bg_f")) - @sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg_f") + if $player.female? && pbResolveBitmap(sprintf("Graphics/UI/Pokegear/bg_f")) + @sprites["background"].setBitmap("Graphics/UI/Pokegear/bg_f") else - @sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg") + @sprites["background"].setBitmap("Graphics/UI/Pokegear/bg") end @commands.length.times do |i| @sprites["button#{i}"] = PokegearButton.new(@commands[i], Graphics.width / 2, 0, @viewport) @@ -180,7 +180,7 @@ MenuHandlers.add(:pokegear_menu, :phone, { "name" => _INTL("Phone"), "icon_name" => "phone", "order" => 20, - "condition" => proc { next $PokemonGlobal.phoneNumbers && $PokemonGlobal.phoneNumbers.length > 0 }, +# "condition" => proc { next $PokemonGlobal.phone && $PokemonGlobal.phone.contacts.length > 0 }, "effect" => proc { |menu| pbFadeOutIn { PokemonPhoneScene.new.start } next false diff --git a/Data/Scripts/016_UI/009_UI_RegionMap.rb b/Data/Scripts/016_UI/009_UI_RegionMap.rb index b48815ff6..5c5b4264b 100644 --- a/Data/Scripts/016_UI/009_UI_RegionMap.rb +++ b/Data/Scripts/016_UI/009_UI_RegionMap.rb @@ -104,9 +104,9 @@ class PokemonRegionMap_Scene pbMessage(_INTL("The map data cannot be found.")) return false end - addBackgroundOrColoredPlane(@sprites, "background", "mapbg", Color.new(0, 0, 0), @viewport) + addBackgroundOrColoredPlane(@sprites, "background", "Town Map/bg", Color.black, @viewport) @sprites["map"] = IconSprite.new(0, 0, @viewport) - @sprites["map"].setBitmap("Graphics/Pictures/#{@map[1]}") + @sprites["map"].setBitmap("Graphics/UI/Town Map/#{@map[1]}") @sprites["map"].x += (Graphics.width - @sprites["map"].bitmap.width) / 2 @sprites["map"].y += (Graphics.height - @sprites["map"].bitmap.height) / 2 Settings::REGION_MAP_EXTRAS.each do |graphic| @@ -118,7 +118,7 @@ class PokemonRegionMap_Scene end pbDrawImagePositions( @sprites["map2"].bitmap, - [["Graphics/Pictures/#{graphic[4]}", graphic[2] * SQUARE_WIDTH, graphic[3] * SQUARE_HEIGHT]] + [["Graphics/UI/Town Map/#{graphic[4]}", graphic[2] * SQUARE_WIDTH, graphic[3] * SQUARE_HEIGHT]] ) end @sprites["mapbottom"] = MapBottomSprite.new(@viewport) @@ -136,7 +136,7 @@ class PokemonRegionMap_Scene (TOP..BOTTOM).each do |j| healspot = pbGetHealingSpot(i, j) next if !healspot || !$PokemonGlobal.visitedMaps[healspot[0]] - @sprites["point#{k}"] = AnimatedSprite.create("Graphics/Pictures/mapFly", 2, 16) + @sprites["point#{k}"] = AnimatedSprite.create("Graphics/UI/Town Map/icon_fly", 2, 16) @sprites["point#{k}"].viewport = @viewport @sprites["point#{k}"].x = point_x_to_screen_x(i) @sprites["point#{k}"].y = point_y_to_screen_y(j) @@ -145,7 +145,7 @@ class PokemonRegionMap_Scene k += 1 end end - @sprites["cursor"] = AnimatedSprite.create("Graphics/Pictures/mapCursor", 2, 5) + @sprites["cursor"] = AnimatedSprite.create("Graphics/UI/Town Map/cursor", 2, 5) @sprites["cursor"].viewport = @viewport @sprites["cursor"].x = point_x_to_screen_x(@map_x) @sprites["cursor"].y = point_y_to_screen_y(@map_y) @@ -250,7 +250,7 @@ class PokemonRegionMap_Scene text = (@mode == 0) ? _INTL("ACTION: Fly") : _INTL("ACTION: Cancel Fly") pbDrawTextPositions( @sprites["help"].bitmap, - [[text, Graphics.width - 16, 4, 1, Color.new(248, 248, 248), Color.new(0, 0, 0)]] + [[text, Graphics.width - 16, 4, 1, Color.new(248, 248, 248), Color.black]] ) @sprites.each do |key, sprite| next if !key.include?("point") diff --git a/Data/Scripts/016_UI/010_UI_Phone.rb b/Data/Scripts/016_UI/010_UI_Phone.rb index d027f3df6..d6e07d2b9 100644 --- a/Data/Scripts/016_UI/010_UI_Phone.rb +++ b/Data/Scripts/016_UI/010_UI_Phone.rb @@ -3,9 +3,9 @@ #=============================================================================== class Window_PhoneList < Window_CommandPokemon def drawCursor(index, rect) - selarrow = AnimatedBitmap.new("Graphics/Pictures/phoneSel") + selarrow = AnimatedBitmap.new("Graphics/UI/Phone/cursor") if self.index == index - pbCopyBitmap(self.contents, selarrow.bitmap, rect.x, rect.y) + pbCopyBitmap(self.contents, selarrow.bitmap, rect.x, rect.y + 2) end return Rect.new(rect.x + 28, rect.y + 8, rect.width - 16, rect.height) end @@ -22,44 +22,60 @@ end #=============================================================================== class PokemonPhoneScene def start - commands = [] - @trainers = [] - if $PokemonGlobal.phoneNumbers - $PokemonGlobal.phoneNumbers.each do |num| - if num[0] # if visible - if num.length == 8 # if trainer - @trainers.push([num[1], num[2], num[6], (num[4] >= 2)]) - else # if NPC - @trainers.push([num[1], num[2], num[3]]) - end - end - end + # Get list of contacts + @contacts = [] + $PokemonGlobal.phone.contacts.each do |contact| + @contacts.push(contact) if contact.visible? end - if @trainers.length == 0 + if @contacts.length == 0 pbMessage(_INTL("There are no phone numbers stored.")) return end + # Create list of commands (display names of contacts) and count rematches + commands = [] + rematch_count = 0 + @contacts.each do |contact| + commands.push(contact.display_name) + rematch_count += 1 if contact.can_rematch? + end + # Create viewport and sprites @sprites = {} @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 + addBackgroundPlane(@sprites, "bg", "Phone/bg", @viewport) @sprites["list"] = Window_PhoneList.newEmpty(152, 32, Graphics.width - 142, Graphics.height - 80, @viewport) + @sprites["list"].windowskin = nil + @sprites["list"].commands = commands + @sprites["list"].page_item_max.times do |i| + @sprites["rematch[#{i}]"] = IconSprite.new(468, 62 + (i * 32), @viewport) + j = i + @sprites["list"].top_item + if j < @contacts.length && @contacts[j].can_rematch? + @sprites["rematch[#{i}]"].setBitmap("Graphics/UI/Phone/icon_rematch") + end + end @sprites["header"] = Window_UnformattedTextPokemon.newWithSize( _INTL("Phone"), 2, -18, 128, 64, @viewport ) @sprites["header"].baseColor = Color.new(248, 248, 248) - @sprites["header"].shadowColor = Color.new(0, 0, 0) - mapname = (@trainers[0][2]) ? pbGetMapNameFromId(@trainers[0][2]) : "" + @sprites["header"].shadowColor = Color.black + @sprites["header"].windowskin = nil @sprites["bottom"] = Window_AdvancedTextPokemon.newWithSize( "", 162, Graphics.height - 64, Graphics.width - 158, 64, @viewport ) - @sprites["bottom"].text = "" + mapname + @sprites["bottom"].windowskin = nil + map_name = (@contacts[0].map_id > 0) ? pbGetMapNameFromId(@contacts[0].map_id) : "" + @sprites["bottom"].text = "" + map_name @sprites["info"] = Window_AdvancedTextPokemon.newWithSize("", -8, 224, 180, 160, @viewport) - addBackgroundPlane(@sprites, "bg", "phonebg", @viewport) + @sprites["info"].windowskin = nil + infotext = _INTL("Registered
") + infotext += _INTL(" {1}
", @sprites["list"].commands.length) + infotext += _INTL("Waiting for a rematch{1}", rematch_count) + @sprites["info"].text = infotext @sprites["icon"] = IconSprite.new(70, 102, @viewport) - if @trainers[0].length == 4 - filename = GameData::TrainerType.charset_filename(@trainers[0][0]) + if @contacts[0].trainer? + filename = GameData::TrainerType.charset_filename(@contacts[0].trainer_type) else - filename = sprintf("Graphics/Characters/phone%03d", @trainers[0][0]) + filename = sprintf("Graphics/Characters/phone%03d", @contacts[0].common_event_id) end @sprites["icon"].setBitmap(filename) charwidth = @sprites["icon"].bitmap.width @@ -67,33 +83,7 @@ class PokemonPhoneScene @sprites["icon"].x = 86 - (charwidth / 8) @sprites["icon"].y = 134 - (charheight / 8) @sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4) - @trainers.each do |trainer| - if trainer.length == 4 - displayname = _INTL("{1} {2}", GameData::TrainerType.get(trainer[0]).name, - pbGetMessageFromHash(MessageTypes::TrainerNames, trainer[1])) - commands.push(displayname) # trainer's display name - else - commands.push(trainer[1]) # NPC's display name - end - end - @sprites["list"].commands = commands - @sprites["list"].page_item_max.times do |i| - @sprites["rematch[#{i}]"] = IconSprite.new(468, 62 + (i * 32), @viewport) - j = i + @sprites["list"].top_item - next if j >= commands.length - trainer = @trainers[j] - if trainer.length == 4 && trainer[3] - @sprites["rematch[#{i}]"].setBitmap("Graphics/Pictures/phoneRematch") - end - end - rematchcount = 0 - @trainers.each do |trainer| - rematchcount += 1 if trainer.length == 4 && trainer[3] - end - infotext = _INTL("Registered
") - infotext += _INTL(" {1}
", @sprites["list"].commands.length) - infotext += _INTL("Waiting for a rematch{1}", rematchcount) - @sprites["info"].text = infotext + # Start scene pbFadeInAndShow(@sprites) pbActivateWindow(@sprites, "list") { oldindex = -1 @@ -101,12 +91,13 @@ class PokemonPhoneScene Graphics.update Input.update pbUpdateSpriteHash(@sprites) + # Cursor moved, update display if @sprites["list"].index != oldindex - trainer = @trainers[@sprites["list"].index] - if trainer.length == 4 - filename = GameData::TrainerType.charset_filename(trainer[0]) + contact = @contacts[@sprites["list"].index] + if contact.trainer? + filename = GameData::TrainerType.charset_filename(contact.trainer_type) else - filename = sprintf("Graphics/Characters/phone%03d", trainer[0]) + filename = sprintf("Graphics/Characters/phone%03d", contact.common_event_id) end @sprites["icon"].setBitmap(filename) charwidth = @sprites["icon"].bitmap.width @@ -114,24 +105,23 @@ class PokemonPhoneScene @sprites["icon"].x = 86 - (charwidth / 8) @sprites["icon"].y = 134 - (charheight / 8) @sprites["icon"].src_rect = Rect.new(0, 0, charwidth / 4, charheight / 4) - mapname = (trainer[2]) ? pbGetMapNameFromId(trainer[2]) : "" - @sprites["bottom"].text = "" + mapname + map_name = (contact.map_id > 0) ? pbGetMapNameFromId(contact.map_id) : "" + @sprites["bottom"].text = "" + map_name @sprites["list"].page_item_max.times do |i| @sprites["rematch[#{i}]"].clearBitmaps j = i + @sprites["list"].top_item - next if j >= commands.length - trainer = @trainers[j] - if trainer.length == 4 && trainer[3] - @sprites["rematch[#{i}]"].setBitmap("Graphics/Pictures/phoneRematch") + if j < @contacts.length && @contacts[j].can_rematch? + @sprites["rematch[#{i}]"].setBitmap("Graphics/UI/Phone/icon_rematch") end end end + # Get inputs if Input.trigger?(Input::BACK) pbPlayCloseMenuSE break elsif Input.trigger?(Input::USE) index = @sprites["list"].index - pbCallTrainer(@trainers[index][0], @trainers[index][1]) if index >= 0 + Phone::Call.make_outgoing(@contacts[index]) if index >= 0 end end } diff --git a/Data/Scripts/016_UI/011_UI_Jukebox.rb b/Data/Scripts/016_UI/011_UI_Jukebox.rb index cbce3f0b5..a89d10d29 100644 --- a/Data/Scripts/016_UI/011_UI_Jukebox.rb +++ b/Data/Scripts/016_UI/011_UI_Jukebox.rb @@ -12,12 +12,12 @@ class PokemonJukebox_Scene @viewport.z = 99999 @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) - @sprites["background"].setBitmap("Graphics/Pictures/jukeboxbg") + @sprites["background"].setBitmap("Graphics/UI/jukebox_bg") @sprites["header"] = Window_UnformattedTextPokemon.newWithSize( _INTL("Jukebox"), 2, -18, 128, 64, @viewport ) @sprites["header"].baseColor = Color.new(248, 248, 248) - @sprites["header"].shadowColor = Color.new(0, 0, 0) + @sprites["header"].shadowColor = Color.black @sprites["header"].windowskin = nil @sprites["commands"] = Window_CommandPokemon.newWithSize( @commands, 94, 92, 324, 224, @viewport diff --git a/Data/Scripts/016_UI/012_UI_TrainerCard.rb b/Data/Scripts/016_UI/012_UI_TrainerCard.rb index eefbbfaa2..e06641060 100644 --- a/Data/Scripts/016_UI/012_UI_TrainerCard.rb +++ b/Data/Scripts/016_UI/012_UI_TrainerCard.rb @@ -10,18 +10,18 @@ class PokemonTrainerCard_Scene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @sprites = {} - background = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/bg_f")) + background = pbResolveBitmap(sprintf("Graphics/UI/Trainer Card/bg_f")) if $player.female? && background addBackgroundPlane(@sprites, "bg", "Trainer Card/bg_f", @viewport) else addBackgroundPlane(@sprites, "bg", "Trainer Card/bg", @viewport) end - cardexists = pbResolveBitmap(sprintf("Graphics/Pictures/Trainer Card/card_f")) + cardexists = pbResolveBitmap(sprintf("Graphics/UI/Trainer Card/card_f")) @sprites["card"] = IconSprite.new(0, 0, @viewport) if $player.female? && cardexists - @sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card_f") + @sprites["card"].setBitmap("Graphics/UI/Trainer Card/card_f") else - @sprites["card"].setBitmap("Graphics/Pictures/Trainer Card/card") + @sprites["card"].setBitmap("Graphics/UI/Trainer Card/card") end @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) pbSetSystemFont(@sprites["overlay"].bitmap) @@ -68,7 +68,7 @@ class PokemonTrainerCard_Scene imagePositions = [] 8.times do |i| if $player.badges[i + (region * 8)] - imagePositions.push(["Graphics/Pictures/Trainer Card/icon_badges", x, 310, i * 32, region * 32, 32, 32]) + imagePositions.push(["Graphics/UI/Trainer Card/icon_badges", x, 310, i * 32, region * 32, 32, 32]) end x += 48 end diff --git a/Data/Scripts/016_UI/013_UI_Load.rb b/Data/Scripts/016_UI/013_UI_Load.rb index 2dbd28f32..d58b84d38 100644 --- a/Data/Scripts/016_UI/013_UI_Load.rb +++ b/Data/Scripts/016_UI/013_UI_Load.rb @@ -20,7 +20,7 @@ class PokemonLoadPanel < Sprite @totalsec = (stats) ? stats.play_time.to_i : ((framecount || 0) / Graphics.frame_rate) @mapid = mapid @selected = (index == 0) - @bgbitmap = AnimatedBitmap.new("Graphics/Pictures/loadPanels") + @bgbitmap = AnimatedBitmap.new("Graphics/UI/Load/panels") @refreshBitmap = true @refreshing = false refresh @@ -103,7 +103,7 @@ class PokemonLoad_Scene @sprites = {} @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99998 - addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport) + addBackgroundOrColoredPlane(@sprites, "background", "Load/bg", Color.new(248, 248, 248), @viewport) y = 32 commands.length.times do |i| @sprites["panel#{i}"] = PokemonLoadPanel.new( @@ -128,7 +128,7 @@ class PokemonLoad_Scene @sprites = {} @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99998 - addBackgroundOrColoredPlane(@sprites, "background", "loadbg", Color.new(248, 248, 248), @viewport) + addBackgroundOrColoredPlane(@sprites, "background", "Load/bg", Color.new(248, 248, 248), @viewport) end def pbUpdate diff --git a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb index 702fa8255..253f5f0f6 100644 --- a/Data/Scripts/016_UI/016_UI_ReadyMenu.rb +++ b/Data/Scripts/016_UI/016_UI_ReadyMenu.rb @@ -13,9 +13,9 @@ class ReadyMenuButton < Sprite @selected = selected @side = side if @command[2] - @button = AnimatedBitmap.new("Graphics/Pictures/Ready Menu/icon_movebutton") + @button = AnimatedBitmap.new("Graphics/UI/Ready Menu/icon_movebutton") else - @button = AnimatedBitmap.new("Graphics/Pictures/Ready Menu/icon_itembutton") + @button = AnimatedBitmap.new("Graphics/UI/Ready Menu/icon_itembutton") end @contents = BitmapWrapper.new(@button.width, @button.height / 2) self.bitmap = @contents @@ -124,7 +124,7 @@ class PokemonReadyMenu_Scene @viewport.z = 99999 @sprites = {} @sprites["cmdwindow"] = Window_CommandPokemon.new((@index[2] == 0) ? @movecommands : @itemcommands) - @sprites["cmdwindow"].height = 6 * 32 + @sprites["cmdwindow"].height = 192 @sprites["cmdwindow"].visible = false @sprites["cmdwindow"].viewport = @viewport @commands[0].length.times do |i| diff --git a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb index 2307abc73..1e2de25a0 100644 --- a/Data/Scripts/016_UI/017_UI_PokemonStorage.rb +++ b/Data/Scripts/016_UI/017_UI_PokemonStorage.rb @@ -130,14 +130,14 @@ class PokemonBoxArrow < Sprite @placingState = 0 @heldpkmn = nil @handsprite = ChangelingSprite.new(0, 0, viewport) - @handsprite.addBitmap("point1", "Graphics/Pictures/Storage/cursor_point_1") - @handsprite.addBitmap("point2", "Graphics/Pictures/Storage/cursor_point_2") - @handsprite.addBitmap("grab", "Graphics/Pictures/Storage/cursor_grab") - @handsprite.addBitmap("fist", "Graphics/Pictures/Storage/cursor_fist") - @handsprite.addBitmap("point1q", "Graphics/Pictures/Storage/cursor_point_1_q") - @handsprite.addBitmap("point2q", "Graphics/Pictures/Storage/cursor_point_2_q") - @handsprite.addBitmap("grabq", "Graphics/Pictures/Storage/cursor_grab_q") - @handsprite.addBitmap("fistq", "Graphics/Pictures/Storage/cursor_fist_q") + @handsprite.addBitmap("point1", "Graphics/UI/Storage/cursor_point_1") + @handsprite.addBitmap("point2", "Graphics/UI/Storage/cursor_point_2") + @handsprite.addBitmap("grab", "Graphics/UI/Storage/cursor_grab") + @handsprite.addBitmap("fist", "Graphics/UI/Storage/cursor_fist") + @handsprite.addBitmap("point1q", "Graphics/UI/Storage/cursor_point_1_q") + @handsprite.addBitmap("point2q", "Graphics/UI/Storage/cursor_point_2_q") + @handsprite.addBitmap("grabq", "Graphics/UI/Storage/cursor_grab_q") + @handsprite.addBitmap("fistq", "Graphics/UI/Storage/cursor_fist_q") @handsprite.changeBitmap("fist") @spriteX = self.x @spriteY = self.y @@ -372,7 +372,7 @@ class PokemonBoxSprite < Sprite @storage[@boxnumber].background = @bg end @boxbitmap&.dispose - @boxbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/box_#{@bg}") + @boxbitmap = AnimatedBitmap.new("Graphics/UI/Storage/box_#{@bg}") end end @@ -447,7 +447,7 @@ class PokemonBoxPartySprite < Sprite def initialize(party, viewport = nil) super(viewport) @party = party - @boxbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/overlay_party") + @boxbitmap = AnimatedBitmap.new("Graphics/UI/Storage/overlay_party") @pokemonsprites = [] Settings::MAX_PARTY_SIZE.times do |i| @pokemonsprites[i] = nil @@ -593,7 +593,7 @@ class PokemonStorageScene addBackgroundPlane(@sprites, "background", "Storage/bg", @bgviewport) @sprites["box"] = PokemonBoxSprite.new(@storage, @storage.currentBox, @boxviewport) @sprites["boxsides"] = IconSprite.new(0, 0, @boxsidesviewport) - @sprites["boxsides"].setBitmap("Graphics/Pictures/Storage/overlay_main") + @sprites["boxsides"].setBitmap("Graphics/UI/Storage/overlay_main") @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport) pbSetSystemFont(@sprites["overlay"].bitmap) @sprites["pokemon"] = AutoMosaicPokemonSprite.new(@boxsidesviewport) @@ -605,9 +605,9 @@ class PokemonStorageScene @sprites["boxparty"].x = 182 @sprites["boxparty"].y = Graphics.height end - @markingbitmap = AnimatedBitmap.new("Graphics/Pictures/Storage/markings") + @markingbitmap = AnimatedBitmap.new("Graphics/UI/Storage/markings") @sprites["markingbg"] = IconSprite.new(292, 68, @boxsidesviewport) - @sprites["markingbg"].setBitmap("Graphics/Pictures/Storage/overlay_marking") + @sprites["markingbg"].setBitmap("Graphics/UI/Storage/overlay_marking") @sprites["markingbg"].visible = false @sprites["markingoverlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @boxsidesviewport) @sprites["markingoverlay"].visible = false @@ -695,15 +695,15 @@ class PokemonStorageScene def pbSetArrow(arrow, selection) case selection - when -1, -4, -5 # Box name, move left, move right - arrow.x = 157 * 2 - arrow.y = -12 * 2 - when -2 # Party Pokémon - arrow.x = 119 * 2 - arrow.y = 139 * 2 - when -3 # Close Box - arrow.x = 207 * 2 - arrow.y = 139 * 2 + when -1, -4, -5 # Box name, move left, move right + arrow.x = 314 + arrow.y = -24 + when -2 # Party Pokémon + arrow.x = 238 + arrow.y = 278 + when -3 # Close Box + arrow.x = 414 + arrow.y = 278 else arrow.x = (97 + (24 * (selection % PokemonBox::BOX_WIDTH))) * 2 arrow.y = (8 + (24 * (selection / PokemonBox::BOX_WIDTH))) * 2 @@ -1429,7 +1429,7 @@ class PokemonStorageScene elsif pokemon.female? textstrings.push([_INTL("♀"), 148, 14, false, Color.new(248, 56, 32), Color.new(224, 152, 144)]) end - imagepos.push(["Graphics/Pictures/Storage/overlay_lv", 6, 246]) + imagepos.push(["Graphics/UI/Storage/overlay_lv", 6, 246]) textstrings.push([pokemon.level.to_s, 28, 240, false, base, shadow]) if pokemon.ability textstrings.push([pokemon.ability.name, 86, 312, 2, base, shadow]) @@ -1442,9 +1442,9 @@ class PokemonStorageScene textstrings.push([_INTL("No item"), 86, 348, 2, nonbase, nonshadow]) end if pokemon.shiny? - imagepos.push(["Graphics/Pictures/shiny", 156, 198]) + imagepos.push(["Graphics/UI/shiny", 156, 198]) end - typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) + typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types")) pokemon.types.each_with_index do |type, i| type_number = GameData::Type.get(type).icon_position type_rect = Rect.new(0, type_number * 28, 64, 28) diff --git a/Data/Scripts/016_UI/018_UI_ItemStorage.rb b/Data/Scripts/016_UI/018_UI_ItemStorage.rb index ffa1ba651..391c43036 100644 --- a/Data/Scripts/016_UI/018_UI_ItemStorage.rb +++ b/Data/Scripts/016_UI/018_UI_ItemStorage.rb @@ -75,7 +75,7 @@ class ItemStorage_Scene @bag = bag @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) - @sprites["background"].setBitmap("Graphics/Pictures/pcItembg") + @sprites["background"].setBitmap("Graphics/UI/itemstorage_bg") @sprites["icon"] = ItemIconSprite.new(50, 334, nil, @viewport) # Item list @sprites["itemwindow"] = Window_PokemonItemStorage.new(@bag, 98, 14, 334, 32 + (ITEMSVISIBLE * 32)) diff --git a/Data/Scripts/016_UI/020_UI_PokeMart.rb b/Data/Scripts/016_UI/020_UI_PokeMart.rb index ae09c384d..901bdb160 100644 --- a/Data/Scripts/016_UI/020_UI_PokeMart.rb +++ b/Data/Scripts/016_UI/020_UI_PokeMart.rb @@ -157,7 +157,7 @@ class Window_PokemonMart < Window_DrawableCommand @stock = stock @adapter = adapter super(x, y, width, height, viewport) - @selarrow = AnimatedBitmap.new("Graphics/Pictures/martSel") + @selarrow = AnimatedBitmap.new("Graphics/UI/Mart/cursor") @baseColor = Color.new(88, 88, 80) @shadowColor = Color.new(168, 184, 184) self.windowskin = nil @@ -224,7 +224,7 @@ class PokemonMart_Scene @adapter = adapter @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) - @sprites["background"].setBitmap("Graphics/Pictures/martScreen") + @sprites["background"].setBitmap("Graphics/UI/Mart/bg") @sprites["icon"] = ItemIconSprite.new(36, Graphics.height - 50, nil, @viewport) winAdapter = buying ? BuyAdapter.new(adapter) : SellAdapter.new(adapter) @sprites["itemwindow"] = Window_PokemonMart.new( @@ -238,7 +238,7 @@ class PokemonMart_Scene ) pbPrepareWindow(@sprites["itemtextwindow"]) @sprites["itemtextwindow"].baseColor = Color.new(248, 248, 248) - @sprites["itemtextwindow"].shadowColor = Color.new(0, 0, 0) + @sprites["itemtextwindow"].shadowColor = Color.black @sprites["itemtextwindow"].windowskin = nil @sprites["helpwindow"] = Window_AdvancedTextPokemon.new("") pbPrepareWindow(@sprites["helpwindow"]) @@ -460,7 +460,6 @@ class PokemonMart_Scene ret = 0 helpwindow = @sprites["helpwindow"] itemprice = @adapter.getPrice(item, !@buying) - itemprice /= 2 if !@buying pbDisplay(helptext, true) using(numwindow = Window_AdvancedTextPokemon.new("")) do # Showing number of items pbPrepareWindow(numwindow) @@ -681,7 +680,6 @@ class PokemonMartScreen @scene.pbHideMoney next end - price /= 2 price *= qty if pbConfirm(_INTL("I can pay ${1}.\nWould that be OK?", price.to_s_formatted)) old_money = @adapter.getMoney diff --git a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb index 837c6b036..7a9817bd2 100644 --- a/Data/Scripts/016_UI/021_UI_MoveRelearner.rb +++ b/Data/Scripts/016_UI/021_UI_MoveRelearner.rb @@ -25,13 +25,13 @@ class MoveRelearner_Scene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @sprites = {} - addBackgroundPlane(@sprites, "bg", "reminderbg", @viewport) + addBackgroundPlane(@sprites, "bg", "Move Reminder/bg", @viewport) @sprites["pokeicon"] = PokemonIconSprite.new(@pokemon, @viewport) @sprites["pokeicon"].setOffset(PictureOrigin::CENTER) @sprites["pokeicon"].x = 320 @sprites["pokeicon"].y = 84 @sprites["background"] = IconSprite.new(0, 0, @viewport) - @sprites["background"].setBitmap("Graphics/Pictures/reminderSel") + @sprites["background"].setBitmap("Graphics/UI/Move Reminder/cursor") @sprites["background"].y = 78 @sprites["background"].src_rect = Rect.new(0, 72, 258, 72) @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @@ -42,7 +42,7 @@ class MoveRelearner_Scene @sprites["msgwindow"] = Window_AdvancedTextPokemon.new("") @sprites["msgwindow"].visible = false @sprites["msgwindow"].viewport = @viewport - @typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) + @typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types")) pbDrawMoveList pbDeactivateWindows(@sprites) # Fade in all sprites @@ -68,8 +68,8 @@ class MoveRelearner_Scene if moveobject moveData = GameData::Move.get(moveobject) type_number = GameData::Type.get(moveData.display_type(@pokemon)).icon_position - imagepos.push(["Graphics/Pictures/types", 12, yPos - 4, 0, type_number * 28, 64, 28]) - textpos.push([moveData.name, 80, yPos, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) + imagepos.push(["Graphics/UI/types", 12, yPos - 4, 0, type_number * 28, 64, 28]) + textpos.push([moveData.name, 80, yPos, 0, Color.new(248, 248, 248), Color.black]) textpos.push([_INTL("PP"), 112, yPos + 32, 0, Color.new(64, 64, 64), Color.new(176, 176, 176)]) if moveData.total_pp > 0 textpos.push([_INTL("{1}/{1}", moveData.total_pp), 230, yPos + 32, 1, @@ -80,27 +80,27 @@ class MoveRelearner_Scene end yPos += 64 end - imagepos.push(["Graphics/Pictures/reminderSel", + imagepos.push(["Graphics/UI/Move Reminder/cursor", 0, 78 + ((@sprites["commands"].index - @sprites["commands"].top_item) * 64), 0, 0, 258, 72]) selMoveData = GameData::Move.get(@moves[@sprites["commands"].index]) basedamage = selMoveData.display_damage(@pokemon) category = selMoveData.display_category(@pokemon) accuracy = selMoveData.display_accuracy(@pokemon) - textpos.push([_INTL("CATEGORY"), 272, 120, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) - textpos.push([_INTL("POWER"), 272, 152, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) + textpos.push([_INTL("CATEGORY"), 272, 120, 0, Color.new(248, 248, 248), Color.black]) + textpos.push([_INTL("POWER"), 272, 152, 0, Color.new(248, 248, 248), Color.black]) textpos.push([basedamage <= 1 ? basedamage == 1 ? "???" : "---" : sprintf("%d", basedamage), 468, 152, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)]) - textpos.push([_INTL("ACCURACY"), 272, 184, 0, Color.new(248, 248, 248), Color.new(0, 0, 0)]) + textpos.push([_INTL("ACCURACY"), 272, 184, 0, Color.new(248, 248, 248), Color.black]) textpos.push([accuracy == 0 ? "---" : "#{accuracy}%", 468, 184, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)]) pbDrawTextPositions(overlay, textpos) - imagepos.push(["Graphics/Pictures/category", 436, 116, 0, category * 28, 64, 28]) + imagepos.push(["Graphics/UI/category", 436, 116, 0, category * 28, 64, 28]) if @sprites["commands"].index < @moves.length - 1 - imagepos.push(["Graphics/Pictures/reminderButtons", 48, 350, 0, 0, 76, 32]) + imagepos.push(["Graphics/UI/Move Reminder/buttons", 48, 350, 0, 0, 76, 32]) end if @sprites["commands"].index > 0 - imagepos.push(["Graphics/Pictures/reminderButtons", 134, 350, 76, 0, 76, 32]) + imagepos.push(["Graphics/UI/Move Reminder/buttons", 134, 350, 76, 0, 76, 32]) end pbDrawImagePositions(overlay, imagepos) drawTextEx(overlay, 272, 216, 230, 5, selMoveData.description, diff --git a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb index 41ee293a6..d3d0f6d23 100644 --- a/Data/Scripts/016_UI/022_UI_PurifyChamber.rb +++ b/Data/Scripts/016_UI/022_UI_PurifyChamber.rb @@ -27,7 +27,7 @@ end #=============================================================================== def pbDrawGauge(bitmap, rect, color, value, maxValue) return if !bitmap - bitmap.fill_rect(rect.x, rect.y, rect.width, rect.height, Color.new(0, 0, 0)) + bitmap.fill_rect(rect.x, rect.y, rect.width, rect.height, Color.black) width = (maxValue <= 0) ? 0 : (rect.width - 4) * value / maxValue if rect.width >= 4 && rect.height >= 4 bitmap.fill_rect(rect.x + 2, rect.y + 2, rect.width - 4, rect.height - 4, Color.new(248, 248, 248)) @@ -713,7 +713,7 @@ class DirectFlowDiagram def ensurePoint(j) if !@points[j] || @points[j].disposed? @points[j] = BitmapSprite.new(8, 8, @viewport) - @points[j].bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0)) + @points[j].bitmap.fill_rect(0, 0, 8, 8, Color.black) end @points[j].tone = (@strength == 2) ? Tone.new(232, 232, 248) : Tone.new(16, 16, 232) @points[j].visible = (@strength != 0) @@ -787,7 +787,7 @@ class FlowDiagram def ensurePoint(j) if !@points[j] || @points[j].disposed? @points[j] = BitmapSprite.new(8, 8, @viewport) - @points[j].bitmap.fill_rect(0, 0, 8, 8, Color.new(0, 0, 0)) + @points[j].bitmap.fill_rect(0, 0, 8, 8, Color.black) end @points[j].tone = (@strength == 2) ? Tone.new(232, 232, 248) : Tone.new(16, 16, 232) @points[j].visible = (@strength != 0) @@ -854,7 +854,7 @@ class PurifyChamberSetView < Sprite @heldpkmn = nil @cursor = -1 @view = BitmapSprite.new(64, 64, viewport) - @view.bitmap.fill_rect(8, 8, 48, 48, Color.new(255, 255, 255)) + @view.bitmap.fill_rect(8, 8, 48, 48, Color.white) @view.bitmap.fill_rect(10, 10, 44, 44, Color.new(255, 255, 255, 128)) @info = BitmapSprite.new(Graphics.width - 112, 48, viewport) @flows = [] @@ -1114,7 +1114,7 @@ class PurifyChamberScene @viewport.z = 99999 @viewportmsg = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewportmsg.z = 99999 - addBackgroundOrColoredPlane(@sprites, "bg", "purifychamberbg", + addBackgroundOrColoredPlane(@sprites, "bg", "purifychamber_bg", Color.new(64, 48, 96), @viewport) @sprites["setwindow"] = Window_PurifyChamberSets.new( @chamber, 0, 0, 112, Graphics.height, @viewport diff --git a/Data/Scripts/016_UI/023_UI_MysteryGift.rb b/Data/Scripts/016_UI/023_UI_MysteryGift.rb index f1daf6fc2..9453a952e 100644 --- a/Data/Scripts/016_UI/023_UI_MysteryGift.rb +++ b/Data/Scripts/016_UI/023_UI_MysteryGift.rb @@ -242,7 +242,7 @@ def pbDownloadMysteryGift(trainer) sprites = {} viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) viewport.z = 99999 - addBackgroundPlane(sprites, "background", "mysteryGiftbg", viewport) + addBackgroundPlane(sprites, "background", "mysterygift_bg", viewport) pbFadeInAndShow(sprites) sprites["msgwindow"] = pbCreateMessageWindow pbMessageDisplay(sprites["msgwindow"], _INTL("Searching for a gift.\nPlease wait...\\wtnp[0]")) diff --git a/Data/Scripts/016_UI/024_UI_TextEntry.rb b/Data/Scripts/016_UI/024_UI_TextEntry.rb index dd3e4fd4e..16a404a79 100644 --- a/Data/Scripts/016_UI/024_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/024_UI_TextEntry.rb @@ -124,22 +124,22 @@ class PokemonEntryScene meta = GameData::PlayerMetadata.get($player.character_ID) if meta @sprites["shadow"] = IconSprite.new(0, 0, @viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x = 33 * 2 - @sprites["shadow"].y = 32 * 2 + @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow") + @sprites["shadow"].x = 66 + @sprites["shadow"].y = 64 filename = pbGetPlayerCharset(meta.walk_charset, nil, true) @sprites["subject"] = TrainerWalkingCharSprite.new(filename, @viewport) charwidth = @sprites["subject"].bitmap.width charheight = @sprites["subject"].bitmap.height - @sprites["subject"].x = (44 * 2) - (charwidth / 8) - @sprites["subject"].y = (38 * 2) - (charheight / 4) + @sprites["subject"].x = 88 - (charwidth / 8) + @sprites["subject"].y = 76 - (charheight / 4) end when 2 # Pokémon if pokemon @sprites["shadow"] = IconSprite.new(0, 0, @viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x = 33 * 2 - @sprites["shadow"].y = 32 * 2 + @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow") + @sprites["shadow"].x = 66 + @sprites["shadow"].y = 64 @sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport) @sprites["subject"].setOffset(PictureOrigin::CENTER) @sprites["subject"].x = 88 @@ -159,22 +159,22 @@ class PokemonEntryScene end when 3 # NPC @sprites["shadow"] = IconSprite.new(0, 0, @viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") - @sprites["shadow"].x = 33 * 2 - @sprites["shadow"].y = 32 * 2 + @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow") + @sprites["shadow"].x = 66 + @sprites["shadow"].y = 64 @sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport) charwidth = @sprites["subject"].bitmap.width charheight = @sprites["subject"].bitmap.height - @sprites["subject"].x = (44 * 2) - (charwidth / 8) - @sprites["subject"].y = (38 * 2) - (charheight / 4) + @sprites["subject"].x = 88 - (charwidth / 8) + @sprites["subject"].y = 76 - (charheight / 4) when 4 # Storage box @sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport) - @sprites["subject"].altcharset = "Graphics/Pictures/Naming/icon_storage" + @sprites["subject"].altcharset = "Graphics/UI/Naming/icon_storage" @sprites["subject"].animspeed = 4 charwidth = @sprites["subject"].bitmap.width charheight = @sprites["subject"].bitmap.height - @sprites["subject"].x = (44 * 2) - (charwidth / 8) - @sprites["subject"].y = (26 * 2) - (charheight / 2) + @sprites["subject"].x = 88 - (charwidth / 8) + @sprites["subject"].y = 52 - (charheight / 2) end pbFadeInAndShow(@sprites) end @@ -281,9 +281,9 @@ class PokemonEntryScene2 def initialize(viewport) @sprite = Sprite.new(viewport) @cursortype = 0 - @cursor1 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_1") - @cursor2 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_2") - @cursor3 = AnimatedBitmap.new("Graphics/Pictures/Naming/cursor_3") + @cursor1 = AnimatedBitmap.new("Graphics/UI/Naming/cursor_1") + @cursor2 = AnimatedBitmap.new("Graphics/UI/Naming/cursor_2") + @cursor3 = AnimatedBitmap.new("Graphics/UI/Naming/cursor_3") @cursorPos = 0 updateInternal end @@ -382,7 +382,7 @@ class PokemonEntryScene2 # Create bitmaps @bitmaps = [] @@Characters.length.times do |i| - @bitmaps[i] = AnimatedBitmap.new(sprintf("Graphics/Pictures/Naming/overlay_tab_#{i + 1}")) + @bitmaps[i] = AnimatedBitmap.new(sprintf("Graphics/UI/Naming/overlay_tab_#{i + 1}")) b = @bitmaps[i].bitmap.clone pbSetSystemFont(b) textPos = [] @@ -403,13 +403,13 @@ class PokemonEntryScene2 # Create sprites @sprites = {} @sprites["bg"] = IconSprite.new(0, 0, @viewport) - @sprites["bg"].setBitmap("Graphics/Pictures/Naming/bg") + @sprites["bg"].setBitmap("Graphics/UI/Naming/bg") case subject when 1 # Player meta = GameData::PlayerMetadata.get($player.character_ID) if meta @sprites["shadow"] = IconSprite.new(0, 0, @viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow") @sprites["shadow"].x = 66 @sprites["shadow"].y = 64 filename = pbGetPlayerCharset(meta.walk_charset, nil, true) @@ -422,7 +422,7 @@ class PokemonEntryScene2 when 2 # Pokémon if pokemon @sprites["shadow"] = IconSprite.new(0, 0, @viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow") @sprites["shadow"].x = 66 @sprites["shadow"].y = 64 @sprites["subject"] = PokemonIconSprite.new(pokemon, @viewport) @@ -444,7 +444,7 @@ class PokemonEntryScene2 end when 3 # NPC @sprites["shadow"] = IconSprite.new(0, 0, @viewport) - @sprites["shadow"].setBitmap("Graphics/Pictures/Naming/icon_shadow") + @sprites["shadow"].setBitmap("Graphics/UI/Naming/icon_shadow") @sprites["shadow"].x = 66 @sprites["shadow"].y = 64 @sprites["subject"] = TrainerWalkingCharSprite.new(pokemon.to_s, @viewport) @@ -454,7 +454,7 @@ class PokemonEntryScene2 @sprites["subject"].y = 76 - (charheight / 4) when 4 # Storage box @sprites["subject"] = TrainerWalkingCharSprite.new(nil, @viewport) - @sprites["subject"].altcharset = "Graphics/Pictures/Naming/icon_storage" + @sprites["subject"].altcharset = "Graphics/UI/Naming/icon_storage" @sprites["subject"].animspeed = 4 charwidth = @sprites["subject"].bitmap.width charheight = @sprites["subject"].bitmap.height @@ -484,7 +484,7 @@ class PokemonEntryScene2 @sprites["controls"] = IconSprite.new(0, 0, @viewport) @sprites["controls"].x = 16 @sprites["controls"].y = 96 - @sprites["controls"].setBitmap(_INTL("Graphics/Pictures/Naming/overlay_controls")) + @sprites["controls"].setBitmap(_INTL("Graphics/UI/Naming/overlay_controls")) @init = true @sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) pbDoUpdateOverlay2 @@ -502,7 +502,7 @@ class PokemonEntryScene2 def pbDoUpdateOverlay2 overlay = @sprites["overlay"].bitmap overlay.clear - modeIcon = [[_INTL("Graphics/Pictures/Naming/icon_mode"), 44 + (@mode * 62), 120, @mode * 60, 0, 60, 44]] + modeIcon = [[_INTL("Graphics/UI/Naming/icon_mode"), 44 + (@mode * 62), 120, @mode * 60, 0, 60, 44]] pbDrawImagePositions(overlay, modeIcon) end diff --git a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb index a40ace4a8..217558e35 100644 --- a/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb +++ b/Data/Scripts/017_Minigames/002_Minigame_TripleTriad.rb @@ -84,12 +84,12 @@ class TriadCard def self.createBack(type = nil, noback = false) bitmap = BitmapWrapper.new(80, 96) if !noback - cardbitmap = AnimatedBitmap.new("Graphics/Pictures/triad_card_opponent") + cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_opponent") bitmap.blt(0, 0, cardbitmap.bitmap, Rect.new(0, 0, cardbitmap.width, cardbitmap.height)) cardbitmap.dispose end if type - typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) + typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types")) type_number = GameData::Type.get(type).icon_position typerect = Rect.new(0, type_number * 28, 64, 28) bitmap.blt(8, 50, typebitmap.bitmap, typerect, 192) @@ -102,13 +102,13 @@ class TriadCard return TriadCard.createBack if owner == 0 bitmap = BitmapWrapper.new(80, 96) if owner == 2 # Opponent - cardbitmap = AnimatedBitmap.new("Graphics/Pictures/triad_card_opponent") + cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_opponent") else # Player - cardbitmap = AnimatedBitmap.new("Graphics/Pictures/triad_card_player") + cardbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/card_player") end - typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types")) + typebitmap = AnimatedBitmap.new(_INTL("Graphics/UI/types")) iconbitmap = AnimatedBitmap.new(GameData::Species.icon_filename(@species, @form)) - numbersbitmap = AnimatedBitmap.new("Graphics/Pictures/triad_numbers") + numbersbitmap = AnimatedBitmap.new("Graphics/UI/Triple Triad/numbers") # Draw card background bitmap.blt(0, 0, cardbitmap.bitmap, Rect.new(0, 0, cardbitmap.width, cardbitmap.height)) # Draw type icon @@ -168,7 +168,7 @@ class TriadScene # Allocate viewport @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 - addBackgroundPlane(@sprites, "background", "triad_bg", @viewport) + addBackgroundPlane(@sprites, "background", "Triple Triad/bg", @viewport) @sprites["helpwindow"] = Window_AdvancedTextPokemon.newWithSize( "", 0, Graphics.height - 64, Graphics.width, 64, @viewport ) diff --git a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb index b4543a103..27cb99894 100644 --- a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb +++ b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb @@ -32,8 +32,8 @@ class SlotMachineReel < BitmapSprite @stopping = false @slipping = 0 @index = rand(@reel.length) - @images = AnimatedBitmap.new(_INTL("Graphics/Pictures/Slot Machine/images")) - @shading = AnimatedBitmap.new("Graphics/Pictures/Slot Machine/ReelOverlay") + @images = AnimatedBitmap.new(_INTL("Graphics/UI/Slot Machine/images")) + @shading = AnimatedBitmap.new("Graphics/UI/Slot Machine/ReelOverlay") update end @@ -88,7 +88,7 @@ class SlotMachineScore < BitmapSprite @viewport = Viewport.new(x, y, 70, 22) @viewport.z = 99999 super(70, 22, @viewport) - @numbers = AnimatedBitmap.new("Graphics/Pictures/Slot Machine/numbers") + @numbers = AnimatedBitmap.new("Graphics/UI/Slot Machine/numbers") self.score = score end @@ -181,10 +181,10 @@ class SlotMachineScene Input.update update @sprites["window2"].bitmap&.clear - @sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/win")) + @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/win")) @sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 4), 0, 152, 208) if bonus > 0 - @sprites["window2"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/bonus")) + @sprites["window2"].setBitmap(sprintf("Graphics/UI/Slot Machine/bonus")) @sprites["window2"].src_rect.set(152 * (bonus - 1), 0, 152, 208) end @sprites["light1"].visible = true @@ -229,7 +229,7 @@ class SlotMachineScene Input.update update @sprites["window2"].bitmap&.clear - @sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/lose")) + @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/lose")) @sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 2), 0, 152, 208) frame += 1 end @@ -247,25 +247,25 @@ class SlotMachineScene @sprites["reel3"] = SlotMachineReel.new(224, 112, difficulty) (1..3).each do |i| @sprites["button#{i}"] = IconSprite.new(68 + (80 * (i - 1)), 260, @viewport) - @sprites["button#{i}"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/button")) + @sprites["button#{i}"].setBitmap(sprintf("Graphics/UI/Slot Machine/button")) @sprites["button#{i}"].visible = false end (1..5).each do |i| y = [170, 122, 218, 82, 82][i - 1] @sprites["row#{i}"] = IconSprite.new(2, y, @viewport) - @sprites["row#{i}"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/line%1d%s", + @sprites["row#{i}"].setBitmap(sprintf("Graphics/UI/Slot Machine/line%1d%s", 1 + (i / 2), (i >= 4) ? ((i == 4) ? "a" : "b") : "")) @sprites["row#{i}"].visible = false end @sprites["light1"] = IconSprite.new(16, 32, @viewport) - @sprites["light1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/lights")) + @sprites["light1"].setBitmap(sprintf("Graphics/UI/Slot Machine/lights")) @sprites["light1"].visible = false @sprites["light2"] = IconSprite.new(240, 32, @viewport) - @sprites["light2"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/lights")) + @sprites["light2"].setBitmap(sprintf("Graphics/UI/Slot Machine/lights")) @sprites["light2"].mirror = true @sprites["light2"].visible = false @sprites["window1"] = IconSprite.new(358, 96, @viewport) - @sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert")) + @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/insert")) @sprites["window1"].src_rect.set(0, 0, 152, 208) @sprites["window2"] = IconSprite.new(358, 96, @viewport) @sprites["credit"] = SlotMachineScore.new(360, 66, $player.coins) @@ -292,7 +292,7 @@ class SlotMachineScene pbMessage(_INTL("You've run out of Coins.\nGame over!")) break elsif @gameRunning # Reels are spinning - @sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/stop")) + @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/stop")) @sprites["window1"].src_rect.set(152 * ((frame / spinFrameTime) % 4), 0, 152, 208) if Input.trigger?(Input::USE) pbSEPlay("Slots stop") @@ -322,10 +322,10 @@ class SlotMachineScene end @gameEnd = false else # Awaiting coins for the next spin - @sprites["window1"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/insert")) + @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/insert")) @sprites["window1"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208) if @wager > 0 - @sprites["window2"].setBitmap(sprintf("Graphics/Pictures/Slot Machine/press")) + @sprites["window2"].setBitmap(sprintf("Graphics/UI/Slot Machine/press")) @sprites["window2"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208) end if Input.trigger?(Input::DOWN) && @wager < 3 && @sprites["credit"].score > 0 diff --git a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb index 2ec32ba5c..bc97d61a5 100644 --- a/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb +++ b/Data/Scripts/017_Minigames/004_Minigame_VoltorbFlip.rb @@ -37,7 +37,7 @@ class VoltorbFlip @index = [0, 0] # [x,y,points,selected] @squares = [0, 0, 0, false] - @directory = "Graphics/Pictures/Voltorb Flip/" + @directory = "Graphics/UI/Voltorb Flip/" squareValues = [] total = 1 voltorbs = 0 @@ -152,24 +152,24 @@ class VoltorbFlip @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @sprites["bg"] = Sprite.new(@viewport) - @sprites["bg"].bitmap = RPG::Cache.load_bitmap(@directory, "boardbg") + @sprites["bg"].bitmap = RPG::Cache.load_bitmap(@directory, "bg") @sprites["text"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) pbSetSystemFont(@sprites["text"].bitmap) @sprites["level"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) pbSetSystemFont(@sprites["level"].bitmap) @sprites["curtain"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["curtain"].z = 99999 - @sprites["curtain"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0)) + @sprites["curtain"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black) @sprites["curtain"].opacity = 0 @sprites["curtainL"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["curtainL"].z = 99999 @sprites["curtainL"].x = Graphics.width / 2 @sprites["curtainL"].angle = -90 - @sprites["curtainL"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.new(0, 0, 0)) + @sprites["curtainL"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height, Color.black) @sprites["curtainR"] = BitmapSprite.new(Graphics.width, Graphics.height * 2, @viewport) @sprites["curtainR"].z = 99999 @sprites["curtainR"].x = Graphics.width / 2 - @sprites["curtainR"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height * 2, Color.new(0, 0, 0)) + @sprites["curtainR"].bitmap.fill_rect(0, 0, Graphics.width, Graphics.height * 2, Color.black) @sprites["cursor"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) @sprites["cursor"].z = 99998 @sprites["icon"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) diff --git a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb index f9de33c82..9f86c925b 100644 --- a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb +++ b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb @@ -12,7 +12,7 @@ class MiningGameCounter < BitmapSprite @viewport.z = 99999 super(416, 60, @viewport) @hits = 0 - @image = AnimatedBitmap.new("Graphics/Pictures/Mining/cracks") + @image = AnimatedBitmap.new("Graphics/UI/Mining/cracks") update end @@ -53,7 +53,7 @@ class MiningGameTile < BitmapSprite else @layer = 6 # 15% end - @image = AnimatedBitmap.new("Graphics/Pictures/Mining/tiles") + @image = AnimatedBitmap.new("Graphics/UI/Mining/tiles") update end @@ -89,9 +89,9 @@ class MiningGameCursor < BitmapSprite @mode = mode @hit = 0 # 0=regular, 1=hit item, 2=hit iron @counter = 0 - @cursorbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/cursor") - @toolbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/tools") - @hitsbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/hits") + @cursorbitmap = AnimatedBitmap.new("Graphics/UI/Mining/cursor") + @toolbitmap = AnimatedBitmap.new("Graphics/UI/Mining/tools") + @hitsbitmap = AnimatedBitmap.new("Graphics/UI/Mining/hits") update end @@ -230,10 +230,10 @@ class MiningGameScene @sprites = {} @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 - addBackgroundPlane(@sprites, "bg", "Mining/miningbg", @viewport) + addBackgroundPlane(@sprites, "bg", "Mining/bg", @viewport) @sprites["itemlayer"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport) - @itembitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/items") - @ironbitmap = AnimatedBitmap.new("Graphics/Pictures/Mining/irons") + @itembitmap = AnimatedBitmap.new("Graphics/UI/Mining/items") + @ironbitmap = AnimatedBitmap.new("Graphics/UI/Mining/irons") @items = [] @itemswon = [] @iron = [] @@ -247,7 +247,7 @@ class MiningGameScene @sprites["crack"] = MiningGameCounter.new(0, 4) @sprites["cursor"] = MiningGameCursor.new(58, 0) # central position, pick @sprites["tool"] = IconSprite.new(434, 254, @viewport) - @sprites["tool"].setBitmap(sprintf("Graphics/Pictures/Mining/toolicons")) + @sprites["tool"].setBitmap(sprintf("Graphics/UI/Mining/toolicons")) @sprites["tool"].src_rect.set(0, 0, 68, 100) update pbFadeInAndShow(@sprites) @@ -531,7 +531,7 @@ class MiningGameScene collapseFraction = (Graphics.height.to_f / collapseTime).ceil (1..collapseTime).each do |i| @sprites["collapse"].bitmap.fill_rect(0, collapseFraction * (i - 1), - Graphics.width, collapseFraction * i, Color.new(0, 0, 0)) + Graphics.width, collapseFraction * i, Color.black) Graphics.update end pbMessage(_INTL("The wall collapsed!")) diff --git a/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb b/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb index e53a3b605..01efc392e 100644 --- a/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb +++ b/Data/Scripts/017_Minigames/007_Minigame_TilePuzzles.rb @@ -35,7 +35,7 @@ class TilePuzzleCursor < BitmapSprite @arrows = [] @selected = false @holding = false - @cursorbitmap = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/cursor") + @cursorbitmap = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/cursor") update end @@ -148,23 +148,23 @@ class TilePuzzleScene @sprites = {} @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 - if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/bg#{@board}") + if pbResolveBitmap("Graphics/UI/Tile Puzzle/bg#{@board}") addBackgroundPlane(@sprites, "bg", "Tile Puzzle/bg#{@board}", @viewport) else addBackgroundPlane(@sprites, "bg", "Tile Puzzle/bg", @viewport) end - @tilebitmap = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}") + @tilebitmap = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}") @tilebitmap1 = nil @tilebitmap2 = nil @tilebitmap3 = nil - if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/tiles#{@board}_1") - @tilebitmap1 = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}_1") + if pbResolveBitmap("Graphics/UI/Tile Puzzle/tiles#{@board}_1") + @tilebitmap1 = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}_1") end - if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/tiles#{@board}_2") - @tilebitmap2 = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}_2") + if pbResolveBitmap("Graphics/UI/Tile Puzzle/tiles#{@board}_2") + @tilebitmap2 = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}_2") end - if pbResolveBitmap("Graphics/Pictures/Tile Puzzle/tiles#{@board}_3") - @tilebitmap3 = AnimatedBitmap.new("Graphics/Pictures/Tile Puzzle/tiles#{@board}_3") + if pbResolveBitmap("Graphics/UI/Tile Puzzle/tiles#{@board}_3") + @tilebitmap3 = AnimatedBitmap.new("Graphics/UI/Tile Puzzle/tiles#{@board}_3") end @tilewidth = @tilebitmap.width / @boardwidth @tileheight = @tilebitmap.height / @boardheight diff --git a/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb b/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb index 71b53af7d..3ec9276a4 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb @@ -111,10 +111,10 @@ class PokemonTilesetScene # Draw tile (at 200% size) @tilehelper.bltSmallTile(overlay, tile_x, tile_y, TILE_SIZE * 2, TILE_SIZE * 2, tile_id) # Draw box around tile image - overlay.fill_rect(tile_x - 1, tile_y - 1, (TILE_SIZE * 2) + 2, 1, Color.new(255, 255, 255)) - overlay.fill_rect(tile_x - 1, tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.new(255, 255, 255)) - overlay.fill_rect(tile_x - 1, tile_y + (TILE_SIZE * 2), (TILE_SIZE * 2) + 2, 1, Color.new(255, 255, 255)) - overlay.fill_rect(tile_x + (TILE_SIZE * 2), tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.new(255, 255, 255)) + overlay.fill_rect(tile_x - 1, tile_y - 1, (TILE_SIZE * 2) + 2, 1, Color.white) + overlay.fill_rect(tile_x - 1, tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.white) + overlay.fill_rect(tile_x - 1, tile_y + (TILE_SIZE * 2), (TILE_SIZE * 2) + 2, 1, Color.white) + overlay.fill_rect(tile_x + (TILE_SIZE * 2), tile_y - 1, 1, (TILE_SIZE * 2) + 2, Color.white) # Write terrain tag info about selected tile terrain_tag = @tileset.terrain_tags[tile_id] || 0 if GameData::TerrainTag.exists?(terrain_tag) diff --git a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb index 846a4d7a3..8b970efd2 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb @@ -107,7 +107,7 @@ class RegionMapSprite def createRegionMap(map) @mapdata = pbLoadTownMapData @map = @mapdata[map] - bitmap = AnimatedBitmap.new("Graphics/Pictures/#{@map[1]}").deanimate + bitmap = AnimatedBitmap.new("Graphics/UI/Town Map/#{@map[1]}").deanimate retbitmap = BitmapWrapper.new(bitmap.width / 2, bitmap.height / 2) retbitmap.stretch_blt( Rect.new(0, 0, bitmap.width / 2, bitmap.height / 2), diff --git a/Data/Scripts/020_Debug/001_Editor screens/004_EditorScreens_SpritePositioning.rb b/Data/Scripts/020_Debug/001_Editor screens/004_EditorScreens_SpritePositioning.rb index e395b8676..110d64a5e 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/004_EditorScreens_SpritePositioning.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/004_EditorScreens_SpritePositioning.rb @@ -67,7 +67,7 @@ class SpritePositioner @sprites["base_1"].y -= @sprites["base_1"].bitmap.height / 2 if @sprites["base_1"].bitmap @sprites["base_1"].z = 1 @sprites["messageBox"] = IconSprite.new(0, Graphics.height - 96, @viewport) - @sprites["messageBox"].setBitmap("Graphics/Pictures/Battle/debug_message") + @sprites["messageBox"].setBitmap("Graphics/UI/Debug/battle_message") @sprites["messageBox"].z = 2 @sprites["shadow_1"] = IconSprite.new(0, 0, @viewport) @sprites["shadow_1"].z = 3 @@ -339,7 +339,7 @@ class SpritePositioner pbFadeInAndShow(@sprites) { update } @starting = false end - cw = Window_CommandPokemonEx.newEmpty(0, 0, 260, 32 + (24 * 6), @viewport) + cw = Window_CommandPokemonEx.newEmpty(0, 0, 260, 176, @viewport) cw.rowHeight = 24 pbSetSmallFont(cw.contents) cw.x = Graphics.width - cw.width diff --git a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb index 44df0c4af..f0905e8ea 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/001_AnimEditor_SceneElements.rb @@ -173,7 +173,7 @@ class AnimationWindow < Sprite def initialize(x, y, width, height, viewport = nil) super(viewport) @animbitmap = nil - @arrows = AnimatedBitmap.new("Graphics/Pictures/arrows") + @arrows = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_arrows") self.x = x self.y = y @start = 0 @@ -368,12 +368,12 @@ class SpriteFrame < InvalidatableSprite @previous = previous @locked = false @selected = false - @selcolor = Color.new(0, 0, 0) + @selcolor = Color.black @unselcolor = Color.new(220, 220, 220) @prevcolor = Color.new(64, 128, 192) @contents = Bitmap.new(64, 64) self.z = (@previous) ? 49 : 50 - @iconbitmap = AnimatedBitmap.new("Graphics/Pictures/animFrameIcon") + @iconbitmap = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_frame_icons") self.bitmap = @contents self.invalidate end @@ -453,9 +453,9 @@ class AnimationCanvas < Sprite @playingframe = 0 @player = nil @battle = MiniBattle.new - @user = AnimatedBitmap.new("Graphics/Pictures/testback").deanimate - @target = AnimatedBitmap.new("Graphics/Pictures/testfront").deanimate - @testscreen = AnimatedBitmap.new("Graphics/Pictures/testscreen") + @user = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_battler_back").deanimate + @target = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_battler_front").deanimate + @testscreen = AnimatedBitmap.new("Graphics/UI/Debug/anim_editor_battle_bg") self.bitmap = @testscreen.bitmap PBAnimation::MAX_SPRITES.times do |i| @lastframesprites[i] = SpriteFrame.new(i, @celsprites[i], viewport, true) diff --git a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb index 94f91992c..321b6516c 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/003_AnimEditor_Interpolation.rb @@ -7,11 +7,11 @@ class ControlPointSprite < Sprite def initialize(red, viewport = nil) super(viewport) self.bitmap = Bitmap.new(6, 6) - self.bitmap.fill_rect(0, 0, 6, 1, Color.new(0, 0, 0)) - self.bitmap.fill_rect(0, 0, 1, 6, Color.new(0, 0, 0)) - self.bitmap.fill_rect(0, 5, 6, 1, Color.new(0, 0, 0)) - self.bitmap.fill_rect(5, 0, 1, 6, Color.new(0, 0, 0)) - color = (red) ? Color.new(255, 0, 0) : Color.new(0, 0, 0) + self.bitmap.fill_rect(0, 0, 6, 1, Color.black) + self.bitmap.fill_rect(0, 0, 1, 6, Color.black) + self.bitmap.fill_rect(0, 5, 6, 1, Color.black) + self.bitmap.fill_rect(5, 0, 1, 6, Color.black) + color = (red) ? Color.new(255, 0, 0) : Color.black self.bitmap.fill_rect(2, 2, 2, 2, color) self.x = -6 self.y = -6 @@ -54,7 +54,7 @@ class PointSprite < Sprite def initialize(x, y, viewport = nil) super(viewport) self.bitmap = Bitmap.new(2, 2) - self.bitmap.fill_rect(0, 0, 2, 2, Color.new(0, 0, 0)) + self.bitmap.fill_rect(0, 0, 2, 2, Color.black) self.x = x self.y = y end diff --git a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb index befbbca1b..939d5fa42 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/002_Debug_MenuCommands.rb @@ -391,13 +391,13 @@ MenuHandlers.add(:debug_menu, :ready_rematches, { "parent" => :battle_menu, "description" => _INTL("Make all trainers in the phone ready for rematches."), "effect" => proc { - if !$PokemonGlobal.phoneNumbers || $PokemonGlobal.phoneNumbers.length == 0 + if !$PokemonGlobal.phone || $PokemonGlobal.phone.contacts.length == 0 pbMessage(_INTL("There are no trainers in the Phone.")) else - $PokemonGlobal.phoneNumbers.each do |i| - next if i.length != 8 # Isn't a trainer with an event - i[4] = 2 - pbSetReadyToBattle(i) + $PokemonGlobal.phone.contacts.each do |contact| + next if !contact.trainer? + contact.rematch_flag = 1 + contact.set_trainer_event_ready_for_rematch end pbMessage(_INTL("All trainers in the Phone are now ready to rebattle.")) end diff --git a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb index e5ba27036..6a16e190a 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/003_Debug_MenuExtraCode.rb @@ -68,14 +68,14 @@ class SpriteWindow_DebugVariables < Window_DrawableCommand x += (w / 2) - (width / 2) end y += 8 # TEXT OFFSET - base = Color.new(12 * 8, 12 * 8, 12 * 8) + base = Color.new(96, 96, 96) case colors when 1 # Red base = Color.new(168, 48, 56) when 2 # Green base = Color.new(0, 144, 0) end - pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(26 * 8, 26 * 8, 25 * 8)) + pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(208, 208, 200)) end def drawItem(index, _count, rect) @@ -394,18 +394,18 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand width = self.contents.text_size(t).width case align when 1 - x += (w - width) # Right aligned + x += (w - width) # Right aligned when 2 x += (w / 2) - (width / 2) # Centre aligned end - base = Color.new(12 * 8, 12 * 8, 12 * 8) + base = Color.new(96, 96, 96) case colors when 1 base = Color.new(168, 48, 56) # Red when 2 base = Color.new(0, 144, 0) # Green end - pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(26 * 8, 26 * 8, 25 * 8)) + pbDrawShadowText(self.contents, x, y, [width, w].max, h, t, base, Color.new(208, 208, 200)) end def drawItem(index, _count, rect) diff --git a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index 5896f3cd1..348a7114c 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -198,6 +198,21 @@ module Compiler list.push(RPG::EventCommand.new(412, indent - 1, [])) end + # cancel is 1/2/3/4 for the options, 0 for disallow, 5 for branch + def push_choices(list, choices, cancel = 0, indent = 0) + list.push(RPG::EventCommand.new(102, indent, [choices, cancel, [0, 1, 2, 3]])) + end + + def push_choice(list, index, text, indent = 0) + list.push(RPG::EventCommand.new(0, indent, [])) if index > 0 + list.push(RPG::EventCommand.new(402, indent - 1, [index, text])) + end + + def push_choices_end(list, indent = 0) + list.push(RPG::EventCommand.new(0, indent, [])) + list.push(RPG::EventCommand.new(404, indent - 1, [])) + end + def push_self_switch(list, swtch, switchOn, indent = 0) list.push(RPG::EventCommand.new(123, indent, [swtch, switchOn ? 0 : 1])) end @@ -491,14 +506,13 @@ module Compiler end end # Compile the trainer comments - rewriteComments = false # You can change this + rewriteComments = true #false # You can change this battles = [] trtype = nil trname = nil battleid = 0 doublebattle = false backdrop = nil - endspeeches = [] outcome = 0 continue = false endbattles = [] @@ -522,34 +536,32 @@ module Compiler value = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") doublebattle = true if value.upcase == "TRUE" || value.upcase == "YES" push_comment(firstpage.list, command) if rewriteComments - elsif command[/^Backdrop\:\s*([\s\S]+)$/i] - backdrop = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") - push_comment(firstpage.list, command) if rewriteComments - elsif command[/^EndSpeech\:\s*([\s\S]+)$/i] - endspeeches.push(command) - push_comment(firstpage.list, command) if rewriteComments - elsif command[/^Outcome\:\s*(\d+)$/i] - outcome = $~[1].to_i - push_comment(firstpage.list, command) if rewriteComments elsif command[/^Continue\:\s*([\s\S]+)$/i] value = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") continue = true if value.upcase == "TRUE" || value.upcase == "YES" push_comment(firstpage.list, command) if rewriteComments - elsif command[/^EndBattle\:\s*([\s\S]+)$/i] - endbattles.push($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")) - push_comment(firstpage.list, command) if rewriteComments elsif command[/^EndIfSwitch\:\s*([\s\S]+)$/i] endifswitch.push(($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")).to_i) push_comment(firstpage.list, command) if rewriteComments elsif command[/^VanishIfSwitch\:\s*([\s\S]+)$/i] vanishifswitch.push(($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")).to_i) push_comment(firstpage.list, command) if rewriteComments + elsif command[/^Backdrop\:\s*([\s\S]+)$/i] + backdrop = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") + push_comment(firstpage.list, command) if rewriteComments + elsif command[/^Outcome\:\s*(\d+)$/i] + outcome = $~[1].to_i + push_comment(firstpage.list, command) if rewriteComments + elsif command[/^EndBattle\:\s*([\s\S]+)$/i] + endbattles.push($~[1].gsub(/^\s+/, "").gsub(/\s+$/, "")) + push_comment(firstpage.list, command) if rewriteComments elsif command[/^RegSpeech\:\s*([\s\S]+)$/i] regspeech = $~[1].gsub(/^\s+/, "").gsub(/\s+$/, "") push_comment(firstpage.list, command) if rewriteComments end end return nil if battles.length <= 0 + endbattles.push("...") if endbattles.length == 0 # Run trainer check now, except in editor trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid) # Set the event's charset to one depending on the trainer type if the event @@ -562,32 +574,43 @@ module Compiler end end # Create strings that will be used repeatedly - safetrcombo = sprintf(":%s,\"%s\"", trtype, safequote(trname)) # :YOUNGSTER,"Joey" + safetrcombo = sprintf(":%s, \"%s\"", trtype, safequote(trname)) # :YOUNGSTER, "Joey" + brieftrcombo = safetrcombo + safetrcombo = sprintf("%s, %d", safetrcombo, battleid) if battleid > 0 # :YOUNGSTER, "Joey", 1 introplay = sprintf("pbTrainerIntro(:%s)", trtype) # Write first page - push_comment(firstpage.list, endspeeches[0]) if endspeeches[0] # Just so it isn't lost push_script(firstpage.list, introplay) # pbTrainerIntro push_script(firstpage.list, "pbNoticePlayer(get_self)") push_text(firstpage.list, battles[0]) if battles.length > 1 # Has rematches - push_script(firstpage.list, sprintf("pbTrainerCheck(%s,%d,%d)", safetrcombo, battles.length, battleid)) + if battleid > 0 + push_script(firstpage.list, sprintf("pbTrainerCheck(%s, %d, %d)", brieftrcombo, battles.length, battleid)) + else + push_script(firstpage.list, sprintf("pbTrainerCheck(%s, %d)", brieftrcombo, battles.length)) + end end push_script(firstpage.list, "setBattleRule(\"double\")") if doublebattle - push_script(firstpage.list, sprintf("setBattleRule(\"backdrop\",\"%s\")", safequote(backdrop))) if backdrop - push_script(firstpage.list, sprintf("setBattleRule(\"outcomeVar\",%d)", outcome)) if outcome > 1 + push_script(firstpage.list, sprintf("setBattleRule(\n \"backdrop\", \"%s\"\n)", safequote(backdrop))) if backdrop + push_script(firstpage.list, sprintf("setBattleRule(\"outcomeVar\", %d)", outcome)) if outcome > 1 push_script(firstpage.list, "setBattleRule(\"canLose\")") if continue - if battleid > 0 - battleString = sprintf("TrainerBattle.start(%s,%d)", safetrcombo, battleid) - else - battleString = sprintf("TrainerBattle.start(%s)", safetrcombo) - end + battleString = sprintf("TrainerBattle.start(%s)", safetrcombo) push_branch(firstpage.list, battleString) if battles.length > 1 # Has rematches - push_script(firstpage.list, - sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", - regspeech, safetrcombo, battles.length), 1) + push_branch(firstpage.list, sprintf("Phone.can_add?(%s)", safetrcombo), 1) + push_text(firstpage.list, regspeech, 2) + push_choices(firstpage.list, ["Yes", "No"], 2, 2) + push_choice(firstpage.list, 0, "Yes", 3) + if battleid > 0 + push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", brieftrcombo, battles.length, battleid), 3) + else + push_script(firstpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", brieftrcombo, battles.length), 3) + end + push_choice(firstpage.list, 1, "No", 3) + push_choices_end(firstpage.list, 3) + push_branch_end(firstpage.list, 2) end push_self_switch(firstpage.list, "A", true, 1) + push_self_switch(firstpage.list, "B", true, 1) if battles.length > 1 push_branch_end(firstpage.list, 1) push_script(firstpage.list, "pbTrainerEnd", 0) push_end(firstpage.list) @@ -604,53 +627,66 @@ module Compiler rematchpage.condition = lastpage.condition.clone rematchpage.condition.self_switch_valid = true rematchpage.condition.self_switch_ch = "B" - # Write rematch and last pages - (1...battles.length).each do |i| - # Run trainer check now, except in editor - trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid + i) - if i == battles.length - 1 - push_branch(rematchpage.list, sprintf("pbPhoneBattleCount(%s)>=%d", safetrcombo, i)) - push_branch(lastpage.list, sprintf("pbPhoneBattleCount(%s)>%d", safetrcombo, i)) - else - push_branch(rematchpage.list, sprintf("pbPhoneBattleCount(%s)==%d", safetrcombo, i)) - push_branch(lastpage.list, sprintf("pbPhoneBattleCount(%s)==%d", safetrcombo, i)) + # Write rematch page + push_script(rematchpage.list, introplay, 0) # pbTrainerIntro + if battles.length == 2 + push_text(rematchpage.list, battles[1], 0) + else + (1...battles.length).each do |i| + # Run trainer check now, except in editor + trainerChecker.pbTrainerBattleCheck(trtype, trname, battleid + i) + if i == 1 + push_branch(rematchpage.list, sprintf("Phone.variant(%s) <= %d", safetrcombo, i)) + elsif i == battles.length - 1 + push_branch(rematchpage.list, sprintf("Phone.variant(%s) >= %d", safetrcombo, i)) + else + push_branch(rematchpage.list, sprintf("Phone.variant(%s) == %d", safetrcombo, i)) + end + push_text(rematchpage.list, battles[i], 1) + push_branch_end(rematchpage.list, 1) end - # Rematch page - push_script(rematchpage.list, introplay, 1) # pbTrainerIntro - push_text(rematchpage.list, battles[i], 1) - push_script(rematchpage.list, "setBattleRule(\"double\")", 1) if doublebattle - push_script(rematchpage.list, sprintf("setBattleRule(\"backdrop\",%s)", safequote(backdrop)), 1) if backdrop - push_script(rematchpage.list, sprintf("setBattleRule(\"outcomeVar\",%d)", outcome), 1) if outcome > 1 - push_script(rematchpage.list, "setBattleRule(\"canLose\")", 1) if continue - battleString = sprintf("TrainerBattle.start(%s,%d)", safetrcombo, battleid + i) - push_branch(rematchpage.list, battleString, 1) - push_script(rematchpage.list, sprintf("pbPhoneIncrement(%s,%d)", safetrcombo, battles.length), 2) - push_self_switch(rematchpage.list, "A", true, 2) - push_self_switch(rematchpage.list, "B", false, 2) - push_script(rematchpage.list, "pbTrainerEnd", 2) - push_branch_end(rematchpage.list, 2) - push_exit(rematchpage.list, 1) # Exit Event Processing - push_branch_end(rematchpage.list, 1) - # Last page - if endbattles.length > 0 - ebattle = (endbattles[i]) ? endbattles[i] : endbattles[endbattles.length - 1] - push_text(lastpage.list, ebattle, 1) - end - push_script(lastpage.list, - sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", - regspeech, safetrcombo, battles.length), 1) - push_exit(lastpage.list, 1) # Exit Event Processing - push_branch_end(lastpage.list, 1) end - # Finish writing rematch page + push_script(rematchpage.list, "setBattleRule(\"double\")", 1) if doublebattle + push_script(rematchpage.list, sprintf("setBattleRule(\n \"backdrop\", %s\n)", safequote(backdrop)), 1) if backdrop + push_script(rematchpage.list, sprintf("setBattleRule(\"outcomeVar\", %d)", outcome), 1) if outcome > 1 + push_script(rematchpage.list, "setBattleRule(\"canLose\")", 1) if continue + battleString = sprintf("Phone.battle(%s)", safetrcombo) + push_branch(rematchpage.list, battleString, 0) + push_script(rematchpage.list, sprintf("Phone.reset_after_win(\n %s\n)", safetrcombo), 1) + push_self_switch(rematchpage.list, "A", true, 1) + push_script(rematchpage.list, "pbTrainerEnd", 1) + push_branch_end(rematchpage.list, 1) push_end(rematchpage.list) - # Finish writing last page - ebattle = (endbattles[0]) ? endbattles[0] : "..." - push_text(lastpage.list, ebattle) + # Write last page + if endbattles.length > 0 + if battles.length == 1 + push_text(lastpage.list, endbattles[0], 0) + else + (0...battles.length).each do |i| + if i == battles.length - 1 + push_branch(lastpage.list, sprintf("Phone.variant_beaten(%s) >= %d", safetrcombo, i)) + else + push_branch(lastpage.list, sprintf("Phone.variant_beaten(%s) == %d", safetrcombo, i)) + end + ebattle = (endbattles[i]) ? endbattles[i] : endbattles[endbattles.length - 1] + push_text(lastpage.list, ebattle, 1) + push_branch_end(lastpage.list, 1) + end + end + end if battles.length > 1 - push_script(lastpage.list, - sprintf("pbPhoneRegisterBattle(_I(\"%s\"),get_self,%s,%d)", - regspeech, safetrcombo, battles.length)) + push_branch(lastpage.list, sprintf("Phone.can_add?(%s)", safetrcombo), 0) + push_text(lastpage.list, regspeech, 1) + push_choices(lastpage.list, ["Yes", "No"], 2, 1) + push_choice(lastpage.list, 0, "Yes", 2) + if battleid > 0 + push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d, %d\n)", brieftrcombo, battles.length, battleid), 2) + else + push_script(lastpage.list, sprintf("Phone.add(get_self,\n %s, %d\n)", brieftrcombo, battles.length), 2) + end + push_choice(lastpage.list, 1, "No", 2) + push_choices_end(lastpage.list, 2) + push_branch_end(lastpage.list, 1) end push_end(lastpage.list) # Add pages to the new event diff --git a/PBS/phone.txt b/PBS/phone.txt index 7270a5546..226a306f8 100644 --- a/PBS/phone.txt +++ b/PBS/phone.txt @@ -1,34 +1,34 @@ # See the documentation on the wiki to learn how to edit this file. #------------------------------- [] -How are your Pokémon doing?\mMy \TP's really energetic. It's a handful!\mOh yeah, I managed to beat a tough \TE.\mI need to make my party stronger. -My \TP's looking really awesome.\mI wish I could show you.\mHey, listen! I almost caught a \TE the other day.\mOh, it was sooooooo close, too! +How are your Pokémon doing?\mMy \TP's really energetic. It's a handful!\mOh yeah, I managed to beat a tough \TE.\mI need to make my party stronger. +My \TP's looking really awesome.\mI wish I could show you.\mHey, listen! I almost caught a \TE the other day.\mOh, it was sooooooo close, too! #------------------------------- [] -Want to battle? It's not going to be a repeat of the last time we met.\mI'll be waiting for you around \TM. -Do you want to battle? I'm going to win this time!\mI'll be waiting for you around \TM.\mLook for me, OK? My \TP will be expecting you. +Want to battle? It's not going to be a repeat of the last time we met.\mI'll be waiting for you around \TM. +Do you want to battle? I'm going to win this time!\mI'll be waiting for you around \TM.\mLook for me, OK? My \TP will be expecting you. #------------------------------- [] -Good morning, \PN.\mThis is \TN. Did I wake you? +Good morning, \PN.\mThis is \TN. Did I wake you? #------------------------------- [] -\PN, good evening! Hi.\mThis is \TN. +\PN, good evening! Hi.\mThis is \TN. #------------------------------- [] -Hello. This is \TN. -Good day, \PN! Hi. This is \TN. -How are you doing? \PN, howdy! This is \TN. Isn't it nice out? -\PN, good day! It's me, \TN. Got a minute? -Hello, \PN. This is \TN. How are things? +Hello. This is \TN. +Good day, \PN! Hi. This is \TN. +How are you doing? \PN, howdy! This is \TN. Isn't it nice out? +\PN, good day! It's me, \TN. Got a minute? +Hello, \PN. This is \TN. How are things? #------------------------------- [] -How are your Pokémon doing?\mMy \TP's really energetic. It's a handful! +How are your Pokémon doing?\mMy \TP's really energetic. It's a handful! How are your Pokémon doing?\mI always keep my \TP in top shape by going to Pokémon Centers. -My \TP's looking really awesome. I wish I could show you. +My \TP's looking really awesome. I wish I could show you. I dressed my \TP and it looks even cuter than before. #------------------------------- [] Oh yeah, I managed to beat a tough \TE.\mI need to make my party stronger. -You have to hear this! I battled \TE the other day.\mIt was easy! I had a type advantage. -Hey, listen! I almost caught \TE the other day.\mOh, it was sooooooo close, too! -Guess what happened the other day. I missed catching \TE again.\mMaybe I'm not very good at this. +You have to hear this! I battled \TE the other day.\mIt was easy! I had a type advantage. +Hey, listen! I almost caught \TE the other day.\mOh, it was sooooooo close, too! +Guess what happened the other day. I missed catching \TE again.\mMaybe I'm not very good at this.