Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Cursor Command Windows

Cursor Command Windows

This plug and play script replaces the box command windows with a cursor pointer like in Final Fantasy games.

It uses windowskins in the following form:

ff.png


I.e. replace the box cursor with a normal cursor, like a hand.

Script

Code:
 

#=======================================

# cursor command windows                                   

# author: como                                                   

# date: 9th June 2010                                          

# version: 1.1 (status window fix)                                                        

#=======================================

 

class Window_Selectable < Window_Base

  alias update_cursor_rect_orig update_cursor_rect

  def update_cursor_rect

    update_cursor_rect_orig

    self.cursor_rect.set(x - 16, y, 32, 32)

  end

end

 

class Window_MenuStatus < Window_Selectable

  def update_cursor_rect

    if @index < 0

      self.cursor_rect.empty

    else

      self.cursor_rect.set(0, @index * 116, 32, 32)

    end

  end

end

 

class Window_Target < Window_Selectable

  def update_cursor_rect

    # Cursor position -1 = all choices, -2 or lower = independent choice

    # (meaning the user's own choice)

    if @index <= -2

      self.cursor_rect.set(0, (@index + 10) * 116, 32, 32)

    elsif @index == -1

      self.cursor_rect.set(0, 0, 32, 32)

    else

      self.cursor_rect.set(0, @index * 116, 32, 32)

    end

  end

end

 

Note: I did not alias the second two because I was editing all lines in the script. I probably should (well, could) have done.
 

Untra

Sponsor

Thats one quick-n-dirty script right there! It definitely gets the job done.
Aliasing the other two shouldn't be that hard, but its such a small script so shouldn't matter too much.

I like it!
 
Few bugs .__.
First the window is named Window_Selectable, so it errors out as soon as you run the game.
Second the cursor dissappears instantly on the title screen.
You also need to change Window_MenuStatus < Window_Base to Window_MenuStatus < Window_Selectable or else it errors
In the menu the cursor stays there and blinks but it doesnt update its position.
It updates the position in the menu status.
 
Wow, sorry about that. I asked someone to test it because I've done it a bit differently in my game (I just hard coded it because I'm naughty). I guess they lied when they said it worked :x
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top