Save Mouse Selection in Shaz' Super Simple Mouse System for Ace v.1.0
Shaz and Engr. Shana
Shaz and Engr. Shana
This relates to Shaz' Mouse Script which is found here: http://forums.rpgmakerweb.com/index.php?/topic/17829-amaranths-super-simple-mouse-system-for-ace/
Objective
To give the player the choice to enable or disable the custom mouse at any point in the game.
These two scripts, taken together, enable the game to remember the data when the player restarts the game after quitting entirely, and solve the bug of having both the custom mouse icon and the default mouse icon showing simultaneously if the player has changed their mind and re-enabled the mouse.
How to use
Place under Shaz' Mouse script, with Part One above Part Two.
Designate an appropriate switch
At the beginning of the game, use a script call to enable the mouse
$mouse.enabled = true
To give the player the choice have a mechanism (I use an extra line in the main Menu) which will run these script calls
To enable the mouse:
$mouse.enabled = true
Mouse.shaz?(0)
To disable the mouse
$mouse.enabled = false
Mouse.shaz?(1)
Demo and screenshots
Not applicable.
Scripts
Save Mouse Selection Part One
Spoiler
Code:
#Save Mouse selection Part One
#USE: Place under Shaz Super simple Mouse System
#Select a switch and NAME IT. Insert the number at line 11 without
#leading zeros e.g. not switch = 008 but switch = 8
#For further use information see Save Mouse selection Part Two which
#must be used in conjunction with this script
#CREDITS: Shaz, Engr. Shana
#===============================================================================
module SHAZ
module MouseSwitch
ENABLED_SWITCH = 4
end
end
class Sprite_Mouse < Sprite
def enabled=(value)
@enabled = value
$game_switches[SHAZ::MouseSwitch::ENABLED_SWITCH] = value
self.visible = value
end
end
module DataManager
class << self
alias shaz_mouse_switch_load_game load_game
alias shaz_mouse_switch_setup_new_game setup_new_game
end
def self.load_game(index)
loaded = shaz_mouse_switch_load_game(index)
if loaded
$mouse.enabled = $game_switches[SHAZ::MouseSwitch::ENABLED_SWITCH] if $mouse && $game_switches
return true
else
return false
end
end
def setup_new_game
shaz_mouse_switch_setup_new_game
$mouse.enabled = true if $mouse
end
end
class Sprite_Mouse < Sprite
def enabled=(value)
@enabled = value
$game_switches[SHAZ::MouseSwitch::ENABLED_SWITCH] = value
self.visible = value
Mouse.update
end
endSpoiler
Code:
#Save Mouse Selection Part Two
#USE: Place under Save Mouse Selection Part One
#Use an event with this script call at the beginning of the game so that
#the game begins with the mouse enabled.
#$mouse.enabled = true
#To give the player the choice of enabling/disabling the mouse during the game
#provide an event - e.g. as a choice in the Main Menu - which does the
#following:
#To enable the mouse
#script call with 2 elements
#$mouse.enabled = true
#Mouse.shaz?(0)
#To disable the mouse
#script call with 2 elements
#$mouse.enabled = false
#Mouse.shaz?(1)
#
#CREDIT: Engr. Shana
#===============================================================================
module Mouse
def self.shaz?(show)
ShowCursor.call(show)
end
endI asked for the final fixes, and am posting it publicly because I think that other people may find it useful. These are in no way my work. Engr. Shana is happy for it to be made public. Credit:
Shaz
Engr. Shana
EDIT
Forgot to put this in.
Terms of use
Free for commercial and non-commercial, but credit must be given.