じ☆ve冰风 发表于 2026-8-3 12:42:36

Shaz Simple Mouse Script enable/disable FIX

Save Mouse Selection in Shaz' Super Simple Mouse System for Ace v.1.0

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 = 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 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 = value
    self.visible = value
    Mouse.update
end
end





Save Mouse Selection Part Two

Spoiler                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
end





Credits

I 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.


本贴来自国际rpgmaker官方论坛作者:Kes处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/shaz-simple-mouse-script-enable-disable-fix.23480/
页: [1]
查看完整版本: Shaz Simple Mouse Script enable/disable FIX