Introduction
This code allows you to use a newer 'Window_RingCommand' script instead of the default system's 'Window_Command', and by doing so, have a ring system of commands.
Features
Basic features are entered similar to the default Window_Command script
Can display text commands, icons, or both.... yep, you can do icons only!
Can control the fonts of the text
Can control the highlight and disabled text color for your text options
Can control the disabled icon's opacity for your icon options
Can control the order (clockwise/counterclockwise) the options are displayed
Instructions
Pretty much built into the script. :)
Sample Code
Sample code
This little sample should help you make a ring menu for the map. First, I will make it so your character cannot move when the menu is up. It's a section in GAME_PLAYER's update class
Code:
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Remember whether or not moving in local variables
last_moving = moving?
# If moving, event running, move route forcing, and message window
# display are all not occurring
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# Move player in the direction the directional button is being pressed
# EDIT FOR RING MENU - Freeze the actor ^_^
#========================================================================
unless $game_temp.ring_menu
case Input.dir4
when 2
move_down
when 4
move_left
when 6
move_right
when 8
move_up
end
end
#========================================================================
# END OF EDIT
Then here's the main bit of code that does most of the work and creates a 'ring menu' flag that I used above.
Code:
#==============================================================================
# ** Leidy's Ring Command Window
# ==Sample Menu Edit==
#------------------------------------------------------------------------------
# by DerVVulfman
#==============================================================================
#==============================================================================
# ** Game_Temp
#------------------------------------------------------------------------------
# This class handles temporary data that is not included with save data.
# Refer to "$game_temp" for the instance of this class.
#==============================================================================
class Game_Temp
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_accessor :ring_menu # ring menu flag
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
alias rm_initialize initialize
def initialize
rm_initialize
@ring_menu = false
end
end
#==============================================================================
# ** Scene_Map
#------------------------------------------------------------------------------
# This class performs map screen processing.
#==============================================================================
class Scene_Map
#--------------------------------------------------------------------------
# * Main Dispose
#--------------------------------------------------------------------------
alias rm_main main
def main
# Original call
rm_main
# Dispose of Ring
@map_ring_window.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias my_update update
def update
# Only if ring menu is on
if $game_temp.ring_menu == true
@map_ring_window.refresh
unless @map_ring_window.moving?
@map_ring_window.move_right if Input.trigger?(Input::RIGHT)
@map_ring_window.move_right if Input.trigger?(Input::UP)
@map_ring_window.move_left if Input.trigger?(Input::LEFT)
@map_ring_window.move_left if Input.trigger?(Input::DOWN)
print @map_ring_window.index if Input.trigger?(Input::C)
end
end
# Original call
my_update
end
#--------------------------------------------------------------------------
# * Menu Call
#--------------------------------------------------------------------------
def call_menu
# Clear menu call flag
$game_temp.menu_calling = false
# If menu beep flag is set
if $game_temp.menu_beep
# Play decision SE
$game_system.se_play($data_system.decision_se)
# Clear menu beep flag
$game_temp.menu_beep = false
end
# If turned on, turn it off
if $game_temp.ring_menu
$game_temp.ring_menu = false
@map_ring_window.dispose if @map_ring_window != nil
# Else turn it on
else
$game_temp.ring_menu = true
mx = $game_player.screen_x - 80
my = $game_player.screen_y - 100
# Set up the ring
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = "Status"
s5 = "Save"
s6 = "End"
@map_ring_window = Window_RingCommand.new(40, [s1,s2,s3,s4,s5,s6])
@map_ring_window.x = mx
@map_ring_window.y = my
@map_ring_window.active = true
@map_ring_window.visible = true
@map_ring_window.makevisible = true
@map_ring_window.refresh
end
end
end
And for the record, it is $game_player.screen_x and $game_player.screen_y that shows the pixel placement of the player on the screen... very usable for the ring menu.
Compatibility
RPGMaker XP system. No method overwrite, but it creates its own window class.
Credits and Thanks
First off, let me thank XRXS for the creation of the original RMXP Ring menu and Dubealex of Creation Asylum for the re-release and continued availability in his forum. Thanks goes towards SephirothSpawn for the streamlining of the menu down to a mere 'Window' class system rather than a Scene/Window combination, and to Fomar0153 for his simplified code.
Terms and Conditions
Free for use, even commercially. However, due credit is required for me and the following scripters: Dubealex, XRXS, SephirothSpawn & Fomar0153.