02-26-2017, 04:29 AM
Because Selwyn did not include redesigned versions of the 'top_row', the 'top_row=' and 'page_row_max' methods within Window_CharSelect. Couple that with a incorrectly designed 'update_cursor_rect' because he DID neglect to include reference to the redesiged methods.
So.... add the following methods to Window_CharSelect:
And replace the 'update_cursor_rect' in the class with THIS one:
5 minutes bay bee.
So.... add the following methods to Window_CharSelect:
Code:
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
# Divide y-coordinate of window contents transfer origin by 1 row
# height of 192
return self.oy / 192
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
# If row is less than 0, change it to 0
if row < 0
row = 0
end
# If row exceeds row_max - 1, change it to row_max - 1
if row > row_max - 1
row = row_max - 1
end
# Multiply 1 row height by 32 for y-coordinate of window contents
# transfer origin
self.oy = row * 192
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
# Subtract a frame height of 32 from the window height, and divide it by
# 1 row height of 32
return (self.height - 32) / 192
end
And replace the 'update_cursor_rect' in the class with THIS one:
Code:
#--------------------------------------------------------------------------
# (>^_^)> update_cursor_rect
#--------------------------------------------------------------------------
def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.width / @column_max - 32
# Calculate cursor coordinates
x = @index % @column_max * (148 + 1)
y = @index / @column_max * 192 - self.oy
# Update cursor rectangle
self.cursor_rect.set(x, y, 149, 192)
end
5 minutes bay bee.