07-19-2015, 10:57 PM
Riddle me this. When is a BUMP not a BUMP?
When I'm BUMPING a supplemental system/script.
Has it really been 3 years since my last update? Well, you have to thank yamina-chan for this one. She noticed that the Windows Edits which were initially crafted by Lambchop/Amaranth/Amanda Fitch ... didn't properly align the mouse with the characters drawn in the Name Edit window.
Provided below is the new mouse operation method from within the 'Window_NameInput' class. This method is also available within the complete 'Window Edits' in the main post, but not within the demo itself. When downloading the demo, you must still update the window edits within.
Code:
#--------------------------------------------------------------------------
# * Perform mouse operations
#--------------------------------------------------------------------------
def mouse_operation
index = @index
mx = Mouse.pos_x - (self.x - self.ox + 16)
my = Mouse.pos_y - (self.y - self.oy + 16)
width = 28
height = 32
# Exit if between Capital and non-caps
if ( Mouse.pos_x > 296 && Mouse.pos_x < 350)
return
end
# Switch mx area if going from caps to/from non-caps
if Mouse.pos_x <= 318
mx -= 136
elsif Mouse.pos_x >= 337
mx -= 166
end
for index in 0...180
x = 4 + index / 5 / 9 * 152 + index % 5 * 32
y = index / 5 % 9 * 32
if mx > x and
mx < x + width and
my > y and
my < y + height
$game_system.se_play($data_system.cursor_se) unless @index == index
@index = index
break
end
end
# Set Y condition for outside boundary check
# Value of 9 could be 8 ( 8 * 32) as Last row in CHARACTER_TABLE empty.
y = 9 * 32
# Outside test
outside = false
outside = true if mx < 4
outside = true if mx > 312
outside = true if my < 4
outside = true if my > y
# Go to 'OK' if outside character window
if outside
$game_system.se_play($data_system.cursor_se) unless @index == 180
@index = 180
end
end
Um, if anyone wants to make the right mouse click delete letters in the name window (rather than the ESC) button, please consider this snippet from Scene_Name:
Code:
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@edit_window.update
@input_window.update
# If B button was pressed
if Input.repeat?(Input::B)
# If cursor position is at 0
if @edit_window.index == 0
return
end
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Delete text
@edit_window.back
return
end
[/code
]The line that reads
[code]if Input.repeat?(Input::B)
Code:
if Input.repeat?(Input::B) or Mouse.click?(Mouse::Right_Click)
Enjoy.