Save-Point

Full Version: Save-Point
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Board Message
Sorry, you do not have permission to access this resource.
Save-Point - Removing cursor "blink"

Save-Point

Full Version: Removing cursor "blink"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So in RPG Maker XP, the cursor always seems to blink or fade in and outĀ over selections, whether it be in the menu or for battle commands. Is there a way to stop the cursor from blinking altogether? I'm trying to experiment with a "retro" type game, and the blinking cursor seems to take away from it. I did manage to find one script that took away blinking but not in battles.
The curser itself is controlled by the Windowskin, the selection box is an other story.
What script did you find? Perhaps that is easily modifyable.
On second thought I didn't actually find a script for it, I got confused with another script sry xD
Well, the only thing you needed was a modified version of the Window_Select script that can allow you to avoid refreshing the cursor unless the index has changed recently.
Yeaaaah, no.....

I guess you forgot that the cursor blinking feature is not part of the Window_Base, _Selectable or _Command systems. In fact, it is natively built into the hidden Window class itself. And there is no parameter to set like @item_window.blink = false. An option like that does not exist.

It would be nice if it did.

Selwyn (aka Squall) created his own rewrite of the Window class. >> Window - Hidden RGSS Class << However, every time you want to reference the base window class itself, you'd refer to SG::Window instead of just Window
IE: Primarily just the Window_Base script by changing Window_Base < Window to Window_Base < SG::Window after the script is installed 'above' Window Base.

You wouldn't need to change any other class's name, so there's no need for a SG::Window_Base. Just saying. AND the rewrite needs to be above any script that references the Window class itself

After that, you can EDIT his script to remove the fading effect (lines 299 to 305).
O_o Are you absolutely sure you don't wanna delete that statement before I do embarrass you here? Laughing

Let's check out the Window_Select script then, guys.

Code:
def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = self.width / @column_max - 32
    # Calculate cursor coordinates
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * 32 - self.oy
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, 32)
  end

Don't let it re-set the cursor_rect! You could comment out that line at once, but it might never show up ever again. Thus we need some other code in order to find the culprit.

Code:
def update
# Dozens of lines we can leave alone!
# Update cursor rectangle
    update_cursor_rect
  end

Well, now we did find it! We could just comment out the cursor_rect right there! Laughing

Yeah, I know, then it might never get refreshed properly after hitting an arrow key... but don't worry about it! Shocked I've got a solution!

Just look for any line that looks something like this:

@index = [@index - self.page_item_max, 0].max

And replace the @ symbol with a self. (self dot)!

self.index = [@index - self.page_item_max, 0].max

The only problem here would be if you didn't want to alter the rectangular cursor blinking box but something else... Confused
I stand by it. He wants the cursor. Wants it to update properly. And doesn't want it to blink. What I have proposed fulfills this, only drawing upon using one script and including the minor alterations to it and Window_Base to accommodate the request. Tested.