(09-28-2019, 03:58 AM)DerVVulfman Wrote: Okay, I posted that pretty quickly... seven years ago? I do have some bugs.... Let me correct, shall I?
FIRST, IT IS NOT IMMUNE TO THE F12 STACK ERROR!!!!! So the three alias statements in the Window_Selectable Class should be encapsulated like this:
Code:if @selwyn_cursor_script_antistack.nil?
alias initialize_cursor initialize
alias update_cursor_moves update
alias dispose_cursor dispose
@selwyn_cursor_script_antistack = true
end
Now for my corrections....
Going into the initialize method of Window_Selectable class, replace...
...with this...Code:@cursor = Sprite_Cursor.new(x, y)
update_cursor
This will only let the cursor sprite be generated AND begin updating the cursor if the switch is turned on. If it isn't, no cursor.Code:@cursor = Sprite_Cursor.new(x, y) if $cursor_switch == true
update_cursor if $cursor_switch == true
Going into the dispose method of Window_Selectable class, replace...
...with this...Code:@cursor.dispose
This will eliminate the cursor ONLY if the cursor switch is on. If there's no cursor and you try to dispose of it... *KE-RASH!!!*Code:@cursor.dispose if $cursor_switch == true
NOW... for the removal/hiding of the RECTANGLE CURSOR... merely add...
...right before you draw the rectangle using this statement...Code:cursor_width = 0 if $cursor_switch == true
Yes, this means it will be the 2nd from the last statement in the method. And it hides the rectangle cursor by making it literally 0 pixels in width.Code:self.cursor_rect.set(x, y, cursor_width, 32)
For a little extra, we have to make sure the cursor doesn't have any issues being turned on/off, so go into the update method of the Window_Selectable class, and add...
as the first line in the method.Code:@cursor = Sprite_Cursor.new(x, y) if @cursor.nil?
And finally, going into the update method of Window_Selectable class, replace...
...with this...Code:update_cursor
This will only execute the cursor graphic update system if the switch is turned on.Code:update_cursor if $cursor_switch == true
Now all the time and code, I used the basic global switch of $cursor switch. That is a switch you can use in a map event. Like use the script call command and enter "$cursor_switch = true" to turn it on, and "$cursor_switch = nil" to turn it off. That means, you do not use the RPGMaker Switches to turn it on or off.
Using RMXP switches in this code can be problematic. That, I know.
Now the cursor shows anyway when the switch is disabled but it don't move.
Also, I discovered that when it is active, like in a choice window or something, it spams the select sound from the system when i click the enter button, even if you are in another map or the choice windows is gone from ages. (only if i click that button)
(This below is my signature, it's not part of the post/message)
I'm a male and italian indie game developer, spriter and musician.
I'm currently working on my own indie game, called Our Destiny.
Follow it on it's GameJolt page: https://gamejolt.com/games/ourdestinyofficial/449988
----Contacts----
Twitter: https://twitter.com/Andrea87Sky
SoundCloud: https://soundcloud.com/skycraft-team-official/tracks
YouTube: https://www.youtube.com/channel/UCjPA_e7...subscriber
I'm a male and italian indie game developer, spriter and musician.
I'm currently working on my own indie game, called Our Destiny.
Follow it on it's GameJolt page: https://gamejolt.com/games/ourdestinyofficial/449988
----Contacts----
Twitter: https://twitter.com/Andrea87Sky
SoundCloud: https://soundcloud.com/skycraft-team-official/tracks
YouTube: https://www.youtube.com/channel/UCjPA_e7...subscriber