From 01f451b398fb394440b5b56f72190a87d69a04ef Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Fri, 27 Nov 2020 21:14:38 +0000 Subject: [PATCH] Fixed battle graphics being incorrectly positioned, fixed mispositioned number choice window text --- Data/Scripts/004_Sprites/006_Spriteset_Map.rb | 6 ++-- .../004_Sprites/007_Spriteset_Global.rb | 2 +- .../005_SpriteWindow_text.rb | 12 +++---- .../003_PokeBattle_SceneConstants.rb | 34 +++++++++++-------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Data/Scripts/004_Sprites/006_Spriteset_Map.rb b/Data/Scripts/004_Sprites/006_Spriteset_Map.rb index 6c949fbbe..7064d83aa 100644 --- a/Data/Scripts/004_Sprites/006_Spriteset_Map.rb +++ b/Data/Scripts/004_Sprites/006_Spriteset_Map.rb @@ -33,11 +33,11 @@ end class Spriteset_Map attr_reader :map attr_accessor :tilemap - @@viewport0 = Viewport.new(0,0,Graphics.width,Graphics.height) # Panorama + @@viewport0 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Panorama @@viewport0.z = -100 - @@viewport1 = Viewport.new(0,0,Graphics.width,Graphics.height) # Map, events, player, fog + @@viewport1 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Map, events, player, fog @@viewport1.z = 0 - @@viewport3 = Viewport.new(0,0,Graphics.width,Graphics.height) # Flashing + @@viewport3 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) # Flashing @@viewport3.z = 500 def Spriteset_Map.viewport # For access by Spriteset_Global diff --git a/Data/Scripts/004_Sprites/007_Spriteset_Global.rb b/Data/Scripts/004_Sprites/007_Spriteset_Global.rb index cfd228787..df5417dc9 100644 --- a/Data/Scripts/004_Sprites/007_Spriteset_Global.rb +++ b/Data/Scripts/004_Sprites/007_Spriteset_Global.rb @@ -1,6 +1,6 @@ class Spriteset_Global attr_reader :playersprite - @@viewport2 = Viewport.new(0, 0, Graphics.width, Graphics.height) + @@viewport2 = Viewport.new(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT) @@viewport2.z = 200 def initialize diff --git a/Data/Scripts/009_Objects and windows/005_SpriteWindow_text.rb b/Data/Scripts/009_Objects and windows/005_SpriteWindow_text.rb index 4347f444a..65d043de1 100644 --- a/Data/Scripts/009_Objects and windows/005_SpriteWindow_text.rb +++ b/Data/Scripts/009_Objects and windows/005_SpriteWindow_text.rb @@ -663,11 +663,11 @@ class Window_InputNumberPokemon < SpriteWindow_Base self.contents.clear s=sprintf("%0*d",@digits_max,@number.abs) if @sign - textHelper(0,0,@negative ? "-" : "+",0) + textHelper(0,6,@negative ? "-" : "+",0) end for i in 0...@digits_max index=i+(@sign ? 1 : 0) - textHelper(index*24,0,s[i,1],index) + textHelper(index*24,6,s[i,1],index) end end @@ -715,13 +715,9 @@ class Window_InputNumberPokemon < SpriteWindow_Base def textHelper(x,y,text,i) textwidth=self.contents.text_size(text).width - self.contents.font.color=@shadowColor - pbDrawShadow(self.contents,x+(12-textwidth/2),y, textwidth+4, 32, text) - self.contents.font.color=@baseColor - self.contents.draw_text(x+(12-textwidth/2),y, textwidth+4, 32, text) + pbDrawShadowText(self.contents, x+(12-textwidth/2), y, textwidth+4, 32, text, @baseColor, @shadowColor) if @index==i && @active && @frame/15==0 - colors=getDefaultTextColors(self.windowskin) - self.contents.fill_rect(x+(12-textwidth/2),y+30,textwidth,2,colors[0]) + self.contents.fill_rect(x+(12-textwidth/2), y+24, textwidth, 2, @baseColor) end end end diff --git a/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb b/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb index 2f54ea687..87fcf603e 100644 --- a/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb +++ b/Data/Scripts/012_Battle/005_Battle scene/003_PokeBattle_SceneConstants.rb @@ -1,27 +1,29 @@ module PokeBattle_SceneConstants USE_ABILITY_SPLASH = true # Text colors - MESSAGE_BASE_COLOR = Color.new(80,80,88) - MESSAGE_SHADOW_COLOR = Color.new(160,160,168) + MESSAGE_BASE_COLOR = Color.new(80, 80, 88) + MESSAGE_SHADOW_COLOR = Color.new(160, 160, 168) # The number of party balls to show in each side's lineup. NUM_BALLS = 6 # Centre bottom of the player's side base graphic PLAYER_BASE_X = 128 - PLAYER_BASE_Y = Graphics.height - 80 + PLAYER_BASE_Y = SCREEN_HEIGHT - 80 # Centre middle of the foe's side base graphic - FOE_BASE_X = Graphics.width - 128 - FOE_BASE_Y = (Graphics.height * 3/4) - 112 + FOE_BASE_X = SCREEN_WIDTH - 128 + FOE_BASE_Y = (SCREEN_HEIGHT * 3 / 4) - 112 # Returns where the centre bottom of a battler's sprite should be, given its # index and the number of battlers on its side, assuming the battler has # metrics of 0 (those are added later). - def self.pbBattlerPosition(index,sideSize=1) + def self.pbBattlerPosition(index, sideSize = 1) # Start at the centre of the base for the appropriate side - if (index&1)==0; ret = [PLAYER_BASE_X,PLAYER_BASE_Y] - else; ret = [FOE_BASE_X,FOE_BASE_Y] + if (index & 1) == 0 + ret = [PLAYER_BASE_X, PLAYER_BASE_Y] + else + ret = [FOE_BASE_X, FOE_BASE_Y] end # Shift depending on index (no shifting needed for sideSize of 1) case sideSize @@ -37,19 +39,21 @@ module PokeBattle_SceneConstants # Returns where the centre bottom of a trainer's sprite should be, given its # side (0/1), index and the number of trainers on its side. - def self.pbTrainerPosition(side,index=0,sideSize=1) + def self.pbTrainerPosition(side, index = 0, sideSize = 1) # Start at the centre of the base for the appropriate side - if side==0; ret = [PLAYER_BASE_X,PLAYER_BASE_Y-16] - else; ret = [FOE_BASE_X,FOE_BASE_Y+6] + if side == 0 + ret = [PLAYER_BASE_X, PLAYER_BASE_Y - 16] + else + ret = [FOE_BASE_X, FOE_BASE_Y + 6] end # Shift depending on index (no shifting needed for sideSize of 1) case sideSize when 2 - ret[0] += [-48, 48, 32, -32][2*index+side] - ret[1] += [ 0, 0, 0, -16][2*index+side] + ret[0] += [-48, 48, 32, -32][2 * index + side] + ret[1] += [ 0, 0, 0, -16][2 * index + side] when 3 - ret[0] += [-80, 80, 0, 0, 80, -80][2*index+side] - ret[1] += [ 0, 0, 0, -8, 0, -16][2*index+side] + ret[0] += [-80, 80, 0, 0, 80, -80][2 * index + side] + ret[1] += [ 0, 0, 0, -8, 0, -16][2 * index + side] end return ret end