From 8e2130ce57d74652345698c2ff70c85d2aaf9acb Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Tue, 27 Apr 2021 22:10:06 +0100 Subject: [PATCH] Fixed bug in conversion of Bag contents, fixed mispositioning of text cursor in keyboard text entry, fixed not being able to move right in keyboard text entry, fixed mispositioning of icons in text, fixed events not being able to see at a distance --- Data/Scripts/002_Save data/005_Game_SaveConversions.rb | 2 +- Data/Scripts/007_Objects and windows/010_DrawText.rb | 6 +++--- Data/Scripts/007_Objects and windows/012_TextEntry.rb | 6 +++--- Data/Scripts/012_Overworld/001_Overworld.rb | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Data/Scripts/002_Save data/005_Game_SaveConversions.rb b/Data/Scripts/002_Save data/005_Game_SaveConversions.rb index c066d83d0..237741f80 100644 --- a/Data/Scripts/002_Save data/005_Game_SaveConversions.rb +++ b/Data/Scripts/002_Save data/005_Game_SaveConversions.rb @@ -162,7 +162,7 @@ SaveData.register_conversion(:v19_convert_bag) do else item_data = GameData::Item.try_get(item) if item_data - self.registeredItems = item_data.id + self.registeredItems[i] = item_data.id else self.registeredItems[i] = nil end diff --git a/Data/Scripts/007_Objects and windows/010_DrawText.rb b/Data/Scripts/007_Objects and windows/010_DrawText.rb index 5ef64eeec..c12f31b31 100644 --- a/Data/Scripts/007_Objects and windows/010_DrawText.rb +++ b/Data/Scripts/007_Objects and windows/010_DrawText.rb @@ -507,7 +507,7 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32, nextline=0 graphic=nil graphicX=0 - graphicY=0 + graphicY=4 graphicWidth=nil graphicHeight=nil graphicRect=nil @@ -1089,11 +1089,11 @@ def drawSingleFormattedChar(bitmap,ch) bitmap.font.color=ch[8] if bitmap.font.color!=ch[8] end if ch[10] # underline - bitmap.fill_rect(ch[1],ch[2]+ch[4]-[(ch[4]-bitmap.font.size)/2,0].max-2, + bitmap.fill_rect(ch[1],ch[2]+ch[4]-4-[(ch[4]-bitmap.font.size)/2,0].max-2, ch[3]-2,2,ch[8]) end if ch[11] # strikeout - bitmap.fill_rect(ch[1],ch[2]+(ch[4]/2),ch[3]-2,2,ch[8]) + bitmap.fill_rect(ch[1],ch[2]+(ch[4]/2)-4,ch[3]-2,2,ch[8]) end end end diff --git a/Data/Scripts/007_Objects and windows/012_TextEntry.rb b/Data/Scripts/007_Objects and windows/012_TextEntry.rb index 479b94bed..2e5d201a9 100644 --- a/Data/Scripts/007_Objects and windows/012_TextEntry.rb +++ b/Data/Scripts/007_Objects and windows/012_TextEntry.rb @@ -210,13 +210,13 @@ class Window_TextEntry < SpriteWindow_Base pbDrawShadowText(bitmap,x,y, textwidth+4, 32, c,@baseColor,@shadowColor) # Draw cursor if necessary if ((@frame/10)&1) == 0 && i==@helper.cursor - bitmap.fill_rect(x,y-2,2,24,cursorcolor) + bitmap.fill_rect(x,y+4,2,24,cursorcolor) end # Add x to drawn text width x += textwidth end if ((@frame/10)&1) == 0 && textscan.length==@helper.cursor - bitmap.fill_rect(x,y-2,2,24,cursorcolor) + bitmap.fill_rect(x,y+4,2,24,cursorcolor) end end end @@ -240,7 +240,7 @@ class Window_TextEntry_Keyboard < Window_TextEntry self.refresh end return - elsif Input.triggerex?(:LEFT) || Input.repeatex?(:RIGHT) + elsif Input.triggerex?(:RIGHT) || Input.repeatex?(:RIGHT) if @helper.cursor < self.text.scan(/./m).length @helper.cursor+=1 @frame=0 diff --git a/Data/Scripts/012_Overworld/001_Overworld.rb b/Data/Scripts/012_Overworld/001_Overworld.rb index 4fad678a2..b6a726f64 100644 --- a/Data/Scripts/012_Overworld/001_Overworld.rb +++ b/Data/Scripts/012_Overworld/001_Overworld.rb @@ -332,7 +332,7 @@ end def pbEventFacesPlayer?(event, player, distance) return false if !event || !player || distance <= 0 x_min = x_max = y_min = y_max = -1 - case direction + case event.direction when 2 # Down x_min = event.x x_max = event.x + event.width - 1