- Joined
- Nov 16, 2013
- Messages
- 20
- Reaction score
- 8
- First Language
- English
- Primarily Uses
Cursor Blink Remover V2.0
Typhon01
For versions prior to 2.0, please refer to this thread: http://forums.rpgmakerweb.com/index.php?/topic/28835-stop-cursor-from-blinking/
Introduction
This script prevents the "cursor" on selector windows (such as the Title Scene window, the main menu windows, battle scene windows, etc) from "blinking". If you start playtesting a new game, as soon as the title scene starts, on that window there, you will see the cursor I'm talking about, and how it rapidly fades in and out. This script can control that fading effect. Although I myself don't intend on using this script, it's here for anyone who does want it.
Features
This script has three customization features to give you control over the windows that have the blinking cursor.
- You can disable blinking by turning on a game switch. The default switch is 15, but that is customizable in the script.
- You can disable blinking at the Title Scene with a control in the script (something that option #1 couldn't do), this is set to false by default.
- You can disable blinking entirely, which renders the first two controls powerless regardless of their setting. No windows will have the blinking cursor, period. This is set to false by default.
How to Use
Full instructions are given in the script, but this script installs under the materials section, and above main. This script is usable with zero configuration, just launch the game, and should you want the cursor to not blink for whatever reason, flip the magic switch (15 by default) to ON. If you want to reverse that effect, simply flip it OFF again. More customization options are available, within the "Editable Region" inside the script.
Demo
The demo for this script can be downloaded here.
There are three NPCs that will show you exactly what the script does, and their dialog changes if you use the activate the third
setting within the script.
Script
At long last, here is the script itself. You can plug-and-play with zero customization if that's your thing, but at the very least, I recommend changing the default switch to something that works better for you.
Code:
#==============================================================================# ** CURSOR BLINK REMOVER **# V2.0# Author: Typhon01#------------------------------------------------------------------------------# DESCRIPTION#------------------------------------------------------------------------------# This script prevents the cursor from "blinking" by deactivating all windows# that are open while the Window class does it's processing, then restoring the# proper "active state" of each respective window when the update process has# finished.# # There are different settings explained in the "Instructions" section that alter# how and when the script works, so it allows for a little bit of flexibility.#------------------------------------------------------------------------------# Instructions#------------------------------------------------------------------------------# Look at the editable region below to set the script up for your needs. You can# alter how the blinking cursor restrictions work with the three settings below.## By default, whenever you want the cursor to NOT blink, you would set the game# switch #15 to ON. When you get to a point when you would like the cursor to act# as it normally would, you simply turn the switch OFF.The switch that is used, # of course, is customizable, and you can control that with the settings in the # editable region.## You can also make it so the script prevents the cursor from blinking at the# title scene, something that the script won't do by default.## The third setting is for if you don't want the cursor to blink period. This# setting renders the other two useless regardless of how they are set.#------------------------------------------------------------------------------# Compatibility#------------------------------------------------------------------------------# No testing has been performed to determine the compatibility of this script,# but issues with most scripts IN THEORY should be minimal. If there are scripts# that rely on the original update method from the hidden Window class, this # script may cause errors.#------------------------------------------------------------------------------# Terms of Use#------------------------------------------------------------------------------# This script is free for use in all projects, commercial or otherwise, so long# as credit is given to me, Typhon01.## You may redistribute this script however and wherever you please, so long# as you make sure the original source of this script is mentioned and anyone# who uses this script as a result of your distribution gives proper credit# to me.## You may edit this script however you want, to fit your purposes and suite your# needs, HOWEVER, you do so at your own risk. It is not my responsibility to# fix any issues caused as a direct result of tamperment of this script.## If you do alter this script, and you decide to distribute the altered script,# you must make certain that everyone knows the script is NOT in it's original # state, and you must describe any and all changes you have made.#==============================================================================module Typhon01 module Cursor_Blink_Remover#==============================================================================# ** EDITABLE REGION#==============================================================================# This is the game switch you would activate if you want to disable cursor blinking. BLINK_REMOVER_SWITCH = 15 # Set this to true if you want some windows to have a blinking cursor, but not the# title scene. REMOVE_TITLE_BLINK = false # Set this to true if you NEVER want the cursor to blink. NEVER_BLINK = false #==============================================================================# ** END EDITABLE REGION#============================================================================== endend#==============================================================================# ** Window#------------------------------------------------------------------------------# "The game window class. Created internally from multiple sprites."# A hidden class within the engine, editing here MAY be dangerous, #==============================================================================# According to the help contents, Window inherits from the Object class.class Window < Object # This is a new instance variable, used to determine when a window should be active @t01_active_state = 1 # According to the contents, the cursor blink is handled in the Update method. alias t01_window_update update def update # We only skip the blinks if the settings are in line with current circumstances if $game_switches[Typhon01::Cursor_Blink_Remover::BLINK_REMOVER_SWITCH] || Typhon01::Cursor_Blink_Remover::NEVER_BLINK || Typhon01::Cursor_Blink_Remover::REMOVE_TITLE_BLINK && SceneManager.scene_is?(Scene_Title) # Deactivates any active windows without using the modified method self.active = false # Calls original method t01_window_update # Reactivates windows, but only if they are supposed to be active. activate unless @t01_active_state == 0 # Simply call the original method if the right circumstances AREN'T in place. else t01_window_update end endend#==============================================================================# ** Window_Base#------------------------------------------------------------------------------# This is a super class of all windows within the game.#==============================================================================class Window_Base < Window #-------------------------------------------------------------------------- # * Deactivate Window #-------------------------------------------------------------------------- alias t01_win_base_deact deactivate def deactivate # This let's us know that the window is supposed to STAY inactive. @t01_active_state = 0 t01_win_base_deact end #-------------------------------------------------------------------------- # * Activate Window #-------------------------------------------------------------------------- alias t01_win_base_act activate def activate # This let's us know that the window is supposed to become active again. @t01_active_state = 1 t01_win_base_act endend
Credit and Terms of Use
This script is free to use for all projects, commercial or otherwise, so long as proper credit is given to me, Typhon01.
You are permitted to re-post and redistribute this script however you please, so long as anyone who ends up with it also provides proper credit to the original author of this script, Typhon01.
You may alter and edit this script how you see fit, however, you do so at your own risk. It is not my responsibility to fix any issues caused as a direct result of the tampering of this script.
If you do alter the script, and you decide to redistribute your alterations, it is your responsibility to inform everyone that your script is not the original, and you must inform them of any changes you have made to the script.
Author's Notes
I have personally tested this script with multiple windows in-game, including name-processing windows, the title scene, battle scene, choice dialogs, my own custom scene, and even the play-testing switch and variable control window that appears when you press F9. I have not stumbled upon any issues while testing THIS version of the script V2.0, but that doesn't mean they don't exist. After all, this script modifies the update method of a hidden class, which means I made this script without having any source code to work with. There's no way to know for certain what could be affected by my script, but if you do stumble upon any bugs/issues, I will certainly do my best to correct them.
Special Thanks
I'd like to give a special thanks to theadellie, for posting the original request for this script. The making of this script served as a learning experience for me, and helped me to understand the inner workings of the engine better.


