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

This commit is contained in:
Maruno17
2021-04-27 22:10:06 +01:00
parent e1ae094ff4
commit 8e2130ce57
4 changed files with 8 additions and 8 deletions

View File

@@ -162,7 +162,7 @@ SaveData.register_conversion(:v19_convert_bag) do
else else
item_data = GameData::Item.try_get(item) item_data = GameData::Item.try_get(item)
if item_data if item_data
self.registeredItems = item_data.id self.registeredItems[i] = item_data.id
else else
self.registeredItems[i] = nil self.registeredItems[i] = nil
end end

View File

@@ -507,7 +507,7 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
nextline=0 nextline=0
graphic=nil graphic=nil
graphicX=0 graphicX=0
graphicY=0 graphicY=4
graphicWidth=nil graphicWidth=nil
graphicHeight=nil graphicHeight=nil
graphicRect=nil graphicRect=nil
@@ -1089,11 +1089,11 @@ def drawSingleFormattedChar(bitmap,ch)
bitmap.font.color=ch[8] if bitmap.font.color!=ch[8] bitmap.font.color=ch[8] if bitmap.font.color!=ch[8]
end end
if ch[10] # underline 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]) ch[3]-2,2,ch[8])
end end
if ch[11] # strikeout 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 end
end end

View File

@@ -210,13 +210,13 @@ class Window_TextEntry < SpriteWindow_Base
pbDrawShadowText(bitmap,x,y, textwidth+4, 32, c,@baseColor,@shadowColor) pbDrawShadowText(bitmap,x,y, textwidth+4, 32, c,@baseColor,@shadowColor)
# Draw cursor if necessary # Draw cursor if necessary
if ((@frame/10)&1) == 0 && i==@helper.cursor 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 end
# Add x to drawn text width # Add x to drawn text width
x += textwidth x += textwidth
end end
if ((@frame/10)&1) == 0 && textscan.length==@helper.cursor 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 end
end end
@@ -240,7 +240,7 @@ class Window_TextEntry_Keyboard < Window_TextEntry
self.refresh self.refresh
end end
return return
elsif Input.triggerex?(:LEFT) || Input.repeatex?(:RIGHT) elsif Input.triggerex?(:RIGHT) || Input.repeatex?(:RIGHT)
if @helper.cursor < self.text.scan(/./m).length if @helper.cursor < self.text.scan(/./m).length
@helper.cursor+=1 @helper.cursor+=1
@frame=0 @frame=0

View File

@@ -332,7 +332,7 @@ end
def pbEventFacesPlayer?(event, player, distance) def pbEventFacesPlayer?(event, player, distance)
return false if !event || !player || distance <= 0 return false if !event || !player || distance <= 0
x_min = x_max = y_min = y_max = -1 x_min = x_max = y_min = y_max = -1
case direction case event.direction
when 2 # Down when 2 # Down
x_min = event.x x_min = event.x
x_max = event.x + event.width - 1 x_max = event.x + event.width - 1