Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- - Save/Load Menu Patch v1.0
- - Made by: Sixth
- - Description:
- This little script fixes the issues with Moghunter's Scene File A script and
- Unknown's Mouse script. No, really, I don't know who wrote that mouse script.
- The player must click the left mouse button to select the previous/next
- savefile windows (when the mouse is NOT on the selected savefile window) or to
- save/load a file (when the mouse is on the selected savefile window).
- The right mouse click will exit the save/load menu.
- - Installation:
- Put this script below Moghunter's Scene File A script!
- =end
- class Scene_File
- alias mouse_upd9997 update
- def update
- mouse_upd9997
- mouse_cursor
- end
- def mouse_cursor
- pos = Mouse.pos?
- $cursor.x = pos[0] + CURSOR_OFFSET_X
- $cursor.y = pos[1] + CURSOR_OFFSET_Y
- end
- def mouse_input
- if Mouse.lclick?
- last_index = @index
- @savefile_windows.each_with_index do |win,i|
- case i
- when @aw # Currently selected
- return on_savefile_ok if sel_cur_win(win,i)
- when @nw # Previous window
- break if sel_prev_win(win,i)
- when @pw # Next window
- break if sel_next_win(win,i)
- else # Not shown
- next
- end
- end
- if @index != last_index
- Sound.play_cursor
- @savefile_windows[last_index].selected = false
- @savefile_windows[@index].selected = true
- end
- end
- on_savefile_cancel if Mouse.rclick?
- end
- def sel_cur_win(win,i)
- wrct = Rect.new(win.x,win.y,win.width,win.height)
- return Mouse.within?(wrct)
- end
- def sel_prev_win(win,i)
- wrct = Rect.new(win.x,win.y,win.width,win.height)
- if Mouse.within?(wrct)
- execute_index(1)
- @file_max > 2 ? reset_position(1) : reset_position(0)
- return true
- end
- return false
- end
- def sel_next_win(win,i)
- wrct = Rect.new(win.x,win.y,win.width,win.height)
- if Mouse.within?(wrct)
- execute_index(-1)
- reset_position(0)
- return true
- end
- return false
- end
- end
- # End of script! O_O
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement