Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: nathmatt on March 07, 2008, 06:12:57 pm

Title: [RESOLVED] Different requests
Post by: nathmatt on March 07, 2008, 06:12:57 pm
i want a menu script that set up in a circle & spins something like this but i want icons on top of the names




                                               inventory
             
                                status                      equipment

                                                   skill

                               
Title: Re: [request] CMS
Post by: Nortos on March 07, 2008, 08:01:56 pm
a ring menu? Wouldn't you want more stuff like save, load, exit? Also want the background to be the map?
Title: Re: [request] CMS
Post by: nathmatt on March 07, 2008, 08:07:14 pm
exit yes but not save or load because going to make save points
Title: Re: [request] ring menu
Post by: nathmatt on March 09, 2008, 05:06:25 pm
any 1 ?
Title: Re: [request] ring menu
Post by: Sally on March 09, 2008, 06:51:48 pm
like the mana game on GBA?
Title: Re: [request] ring menu
Post by: nathmatt on March 09, 2008, 08:02:04 pm
yea
Title: Re: [request] ring menu
Post by: nathmatt on March 16, 2008, 07:46:16 am
i guess no 1 wants to lol
Title: Re: [request] ring menu
Post by: Nortos on March 16, 2008, 11:52:30 pm
I would but dnt really have any time sorry :( I think there's one on .org or CA try the search functions there?
Title: Re: [request] ring menu
Post by: nathmatt on March 17, 2008, 05:37:07 pm
.org or Ca ?
Title: Re: [request] ring menu
Post by: Juan on March 17, 2008, 05:40:34 pm
I saw one in Ca.
Title: Re: [request] ring menu
Post by: nathmatt on March 17, 2008, 06:32:11 pm
what ca?
Title: Re: [request] ring menu
Post by: Juan on March 17, 2008, 07:58:15 pm
Creation Asylum http://www.creationasylum.net/index.php?showtopic=13870 Edit I you want I can edit the script
Title: Re: [request] ring menu
Post by: nathmatt on March 18, 2008, 12:38:44 pm
ive been messing with it some all i need to do know is get rid of the window



Spoiler: ShowHide
class Window_RingMenu < Window_Base

STARTUP_FRAMES = 20
MOVING_FRAMES = 5
RING_R = 64

ICON_ITEM = RPG::Cache.icon('034-Item03')
ICON_SKILL = RPG::Cache.icon('045-Skill02')
ICON_EQUIP = RPG::Cache.icon('013-Body01')
ICON_STATUS = RPG::Cache.icon("049-Skill06")
ICON_EXIT = RPG::Cache.icon('048-Skill05')
ICON_DISABLE= RPG::Cache.icon("")

MODE_START = 1
MODE_WAIT = 2
MODE_MOVER = 3
MODE_MOVEL = 4

attr_accessor :index

def initialize( center_x, center_y )
super(0, 0, 640, 416)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"

s1 = "Inventory"
s2 = "Skills"
s3 = "Equipment"
s4 = "Status"
s5 = "Quit"

@commands = [ s1, s2, s3, s4, s5, ]
@item_max = 5
@index = 0
@items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_EXIT ]
@disabled = [ false, false, false, false, false, ]
@cx = 290
@cy = 150

setup_move_start
refresh
end

def update
super
refresh
end

def refresh

self.contents.clear

case @mode
when MODE_START
refresh_start
when MODE_WAIT
refresh_wait
when MODE_MOVER
refresh_move(1)
when MODE_MOVEL
refresh_move(0)
end

rect = Rect.new(@cx - 272, @cy - 5, self.contents.width-32, 32) #+24
self.contents.draw_text(rect, @commands[@index],1)
end

def refresh_start
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / STARTUP_FRAMES
r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end

def refresh_wait
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @index
x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
draw_item(x, y, i)
end
end

def refresh_move( mode )
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / MOVING_FRAMES
d2 *= -1 if mode != 0
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( RING_R * Math.sin( d ) ).to_i
y = @cy - ( RING_R * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end

def draw_item(x, y, i)
rect = Rect.new(0, 0, @items[i].width, @items[i].height)
if @index == i
self.contents.blt( x, y, @items[i], rect )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect )
end
else
self.contents.blt( x, y, @items[i], rect, 128 )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
end
end
end

def disable_item(index)
@disabled[index] = true
end

def setup_move_start
@mode = MODE_START
@steps = STARTUP_FRAMES
end

def setup_move_move(mode)
if mode == MODE_MOVER
@index -= 1
@index = @items.size - 1 if @index < 0
elsif mode == MODE_MOVEL
@index += 1
@index = 0 if @index >= @items.size
else
return
end
@mode = mode
@steps = MOVING_FRAMES
end

def animation?
return @mode != MODE_WAIT
end
end

class Scene_Menu

def initialize(menu_index = 0)
@menu_index = menu_index
end

def main
@spriteset = Spriteset_Map.new
px = $game_player.screen_x - 15
py = $game_player.screen_y - 24

@command_window = Window_RingMenu.new(px,py)
@command_window.index = @menu_index
@command_window.back_opacity = 200

if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@command_window.z = 100
if $game_system.save_disabled
@command_window.disable_item(4)
end

@status_window = MenuStatusPlus.new
@status_window.x = 640
@status_window.y = 10
@status_window.z = 9999
@status_window.opacity = 0

@status_window.visible = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end

Graphics.freeze
@command_window.dispose
@status_window.dispose
@spriteset.dispose
end

def update

@command_window.update
@status_window.update
if @status_window.x > 210
@status_window.x -= 21
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end

def update_command

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$game_system.save_disabled = true
$scene = Scene_Map.new
return
end

if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end

case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0
when 4
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end

return if @command_window.animation?
if Input.press?(Input::UP) or Input.press?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
return
end

if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
return
end
end

def update_status

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end

if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
Title: Re: [request] ring menu
Post by: Juan on March 18, 2008, 04:54:16 pm
what window?
Title: Re: [request] ring menu
Post by: Nortos on March 18, 2008, 04:59:05 pm
underneath self.contents.font.name write

    self.opacity = 0
Title: Re: [request] ring menu
Post by: nathmatt on March 18, 2008, 05:06:17 pm
that did it thx



2 question is there a way i could make it where bliz abs hud dosent disaper when i use it and how i choose my char in status skills & equipment is there a way to chose them in that menu by presing the left & right keys or bliz's next page & previous page keys ?

edit: ok i got the hud on but need it to disaper when i open the windows
added credit so no 1 thinks i made it

Spoiler: ShowHide
###RING MENU  BY Siegfried EDIT A LITTLE BY NATH MATT#######################
###I REMOVED THE SAVE,AND LOAD#####################################
###ALSO REMOVED A WINDOW WITH HELP FROM Nortos ON CHAOSPROJECT############
###I ALSO CENTERED THE MENU #######################################
###AND CHANGED THE MENU TO ENGLISH#################################
###ALL WHICH COULD OF EASLY BEEN DONE BY THE CREATER SO NO CREDIT TO ME#######
###THE ARIGINAL SCRIPT IS AT http://www.creationasylum.net/index.php?showtopic=13870###
class Window_RingMenu < Window_Base

STARTUP_FRAMES = 20
MOVING_FRAMES = 5
RING_R = 64

ICON_ITEM = RPG::Cache.icon('034-Item03')
ICON_SKILL = RPG::Cache.icon('045-Skill02')
ICON_EQUIP = RPG::Cache.icon('013-Body01')
ICON_STATUS = RPG::Cache.icon("049-Skill06")
ICON_CONTROLS = RPG::Cache.icon('040-Item09')
ICON_EXIT = RPG::Cache.icon('048-Skill05')
ICON_DISABLE= RPG::Cache.icon("")

MODE_START = 1
MODE_WAIT = 2
MODE_MOVER = 3
MODE_MOVEL = 4

attr_accessor :index

def initialize( center_x, center_y )
super(0, 0, 640, 416)
self.contents = Bitmap.new(width-32, height-32)
self.contents.font.name = "Arial"
self.opacity = 0
# create HUD if HUD_ENABLED is turned on and HUD active
@hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud

s1 = "Inventory"
s2 = "Skills"
s3 = "Equipment"
s4 = "Status"
s5 = "Controls"
s6 = "Quit"

@commands = [ s1, s2, s3, s4, s5,s6 ]
@item_max = 6
@index = 0
@items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS,ICON_CONTROLS, ICON_EXIT ]
@disabled = [ false, false, false, false, false,false]
@cx = 290
@cy = 150

setup_move_start
refresh
end

def update
super
refresh
end

def refresh

self.contents.clear

case @mode
when MODE_START
refresh_start
when MODE_WAIT
refresh_wait
when MODE_MOVER
refresh_move(1)
when MODE_MOVEL
refresh_move(0)
end

rect = Rect.new(@cx - 272, @cy - 5, self.contents.width-32, 32) #+24
self.contents.draw_text(rect, @commands[@index],1)
end

def refresh_start
d1 = 2.0 * Math::PI / @item_max
d2 = 1.0 * Math::PI / STARTUP_FRAMES
r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( r * Math.sin( d ) ).to_i
y = @cy - ( r * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end

def refresh_wait
d = 2.0 * Math::PI / @item_max
for i in 0...@item_max
j = i - @index
x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
draw_item(x, y, i)
end
end

def refresh_move( mode )
d1 = 2.0 * Math::PI / @item_max
d2 = d1 / MOVING_FRAMES
d2 *= -1 if mode != 0
for i in 0...@item_max
j = i - @index
d = d1 * j + d2 * @steps
x = @cx + ( RING_R * Math.sin( d ) ).to_i
y = @cy - ( RING_R * Math.cos( d ) ).to_i
draw_item(x, y, i)
end
@steps -= 1
if @steps < 1
@mode = MODE_WAIT
end
end

def draw_item(x, y, i)
rect = Rect.new(0, 0, @items[i].width, @items[i].height)
if @index == i
self.contents.blt( x, y, @items[i], rect )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect )
end
else
self.contents.blt( x, y, @items[i], rect, 128 )
if @disabled[@index]
self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
end
end
end

def disable_item(index)
@disabled[index] = true
end

def setup_move_start
@mode = MODE_START
@steps = STARTUP_FRAMES
end

def setup_move_move(mode)
if mode == MODE_MOVER
@index -= 1
@index = @items.size - 1 if @index < 0
elsif mode == MODE_MOVEL
@index += 1
@index = 0 if @index >= @items.size
else
return
end
@mode = mode
@steps = MOVING_FRAMES
end

def animation?
return @mode != MODE_WAIT
end
end

class Scene_Menu

def initialize(menu_index = 0)
@menu_index = menu_index
end

def main
@spriteset = Spriteset_Map.new
px = $game_player.screen_x - 15
py = $game_player.screen_y - 24

@command_window = Window_RingMenu.new(px,py)
@command_window.index = @menu_index
@command_window.back_opacity = 200

if $game_party.actors.size == 0
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
@command_window.z = 100
if $game_system.save_disabled
@command_window.disable_item(4)
end

@status_window = MenuStatusPlus.new
@status_window.x = 640
@status_window.y = 10
@status_window.z = 9999
@status_window.opacity = 0

@status_window.visible = false
Graphics.transition
loop do
Graphics.update
Input.update
update
if $scene != self
break
end
end

Graphics.freeze
@command_window.dispose
@status_window.dispose
@spriteset.dispose
end

def update

@command_window.update
@status_window.update
if @status_window.x > 210
@status_window.x -= 21
end
if @command_window.active
update_command
return
end
if @status_window.active
update_status
return
end
end

def update_command

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$game_system.save_disabled = true
$scene = Scene_Map.new
return
end

if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end

case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0

when 2
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0

when 3
$game_system.se_play($data_system.decision_se)
@command_window.active = false
@status_window.active = true
@status_window.visible = true
@status_window.index = 0

when 4
$game_system.se_play($data_system.decision_se)
# create hotkey assignment scene with the current screen tint
$scene = Scene_Controls.new(@view.tone)

when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end

return if @command_window.animation?
if Input.press?(Input::UP) or Input.press?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
return
end

if Input.press?(Input::DOWN) or Input.press?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
return
end
end

def update_status

if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end

if Input.trigger?(Input::C)
case @command_window.index
when 1
if $game_party.actors[@status_window.index].restriction >= 2
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill.new(@status_window.index)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip.new(@status_window.index)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end
#==============================================================================
# Scene_Controls
#------------------------------------------------------------------------------
#  This class handles the skill/item hotkey processing.
#==============================================================================

class Scene_Controls
 
  #----------------------------------------------------------------------------
  # Initialization
  #  tone - screen background tone
  #----------------------------------------------------------------------------
  def initialize(tone)
    # store current screen tint
    @tone = tone
  end
#----------------------------------------------------------------------------
  # main
  #  The main processing method.
  #----------------------------------------------------------------------------
  def main
    # create spriteset
    @spriteset = Spriteset_Map.new
    # create viewport
    @view = Viewport.new(0, 0, 640, 480)
    # set tone to current screen tone
    @view.tone = @tone.clone
    # creat HUD if HUD_ENABLED is turned on and HUD active
    @hud = Hud.new if BlizzABS::Config::HUD_ENABLED && $game_system.hud
    # if hotkey display is turned off
    unless $game_system.assignment
      # create hotkey display
      @hotkeys = Hotkey_Assignment.new
      # set z position
      @hotkeys.z = 5000
    end
    # create sprite
    @choice = Sprite.new
    # create bitmap
    @choice.bitmap = Bitmap.new(16, 9)
    # draw arrow image from BlizzABS Cache
    @choice.bitmap.blt(0, 0, BlizzABS::Cache.image(1), Rect.new(0, 0, 16, 9), 128)
    # set x, y and z positions
    @choice.x, @choice.y, @choice.z = 160, 40, 500
    # set x position offset
    @choice.ox = -8
    # set active flag
    @active = true
    # set index
    @index = 0
    # set up mode flag
    @up_mode = true
    # create modified skill window
    @skill_window = Window_Skill_Hotkey.new($game_player.battler)
    # create modified item window
    @item_window = Window_Item_Hotkey.new
    # set last active
    @last_active = true
    # transtition
    Graphics.transition
    # loop
    loop do
      # update game screen
      Graphics.update
      # update input
      Input.update
      # frame update
      update
      # stop if chosen an option
      break if $scene != self
    end
    # freeze screen
    Graphics.freeze
    # delet spriteset
    @spriteset.dispose
    # delete HUD if HUD exists
    @hud.dispose if @hud != nil
    # delete hotkey display if not hotkey display active
    @hotkeys.dispose unless $game_system.assignment
    # delete choice sprite
    @choice.dispose
    # delete skill window
    @skill_window.dispose
    # delete item window
    @item_window.dispose
    # delete viewport
    @view.dispose
  end
  #----------------------------------------------------------------------------
  # update
  #  The update processing method.
  #----------------------------------------------------------------------------
  def update
    # update choice sprite
    @choice.update
    # update skill window
    @skill_window.update
    # update item window
    @item_window.update
    # move by 2 or 1 whether active in direction depending on @up_mode
    @choice.oy += (@up_mode ? (@active ? 2 : 1) : (@active ? -2 : -1))
    # set new @up_mode if necesseray depending on @up_mode
    @up_mode = (@up_mode ? (@choice.oy < 8) : (@choice.oy <= -8))
    # if select button pressed
    if Input.trigger?(Input::Select)
      # switch to next actor
      @skill_window.switch_actor
    # if active
    elsif @active
      # set choice offset always to a number dividable with 2
      @choice.oy = @choice.oy / 2 * 2
      # update hotkey selection
      update_choice
    # if skill window is active
    elsif @skill_window.active
      # update skill selection
      update_skill
    # if item window is active
    elsif @item_window.active
      # update item selection
      update_item
    end
  end
  #----------------------------------------------------------------------------
  # update_choice
  #  Updates input during the hotkey selection.
  #----------------------------------------------------------------------------
  def update_choice
    # set x position
    @choice.x = 160 + @index * 32
    # if pressed B
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # create map scene
      $scene = Scene_Map.new
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # not active
      @active = false
      # the one that was active the last time is now active
      @skill_window.active = @last_active
      @item_window.active = (!@last_active)
    # if RIGHT is being pressed
    elsif Input.repeat?(Input::RIGHT)
      # if RIGHT is pressed or index is less than 9
      if Input.trigger?(Input::RIGHT) || @index < 9
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 1) % 10
      end
    # if LEFT is being pressed
    elsif Input.repeat?(Input::LEFT)
      # if LEFT is pressed or index is equal or greater than 1
      if Input.trigger?(Input::LEFT) || @index >= 1
        # play sound
        $game_system.se_play($data_system.cursor_se)
        # set new index
        @index = (@index + 9) % 10
      end
    end
  end
  #----------------------------------------------------------------------------
  # update_skill
  #  Updates input during the skill selection.
  #----------------------------------------------------------------------------
  def update_skill
    # set last active
    @last_active = true
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel sound
      $game_system.se_play($data_system.cancel_se)
      # set active
      @active = true
      # skill window is not active
      @skill_window.active = false
      # delete cursor
      @skill_window.cursor_rect.empty
    # if C is pressd
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # if last position
      if @skill_window.index == @skill_window.item_max - 1
        # remove hotkey assigmnent from skill
        $game_system.controls.skills[(@index+1)%10] = 0
        # remove hotkey assigmnent from item
        $game_system.controls.items[(@index+1)%10] = 0
      else
        # set skill to hotkey
        $game_system.controls.skills[(@index+1)%10] = @skill_window.skill.id
        # remove hotkey assigmnent from item
        $game_system.controls.items[(@index+1)%10] = 0
      end
      # if hotkey display exists
      if @hotkeys != nil
        # draw hotkey display
        @hotkeys.draw
      # if HUD_ENABLED is turned on and HUD is active
      elsif BlizzABS::Config::HUD_ENABLED && $game_system.hud
        # draw hotkey display within the HUD
        @hud.assignment.draw
      end
      # set active
      @active = true
      # skill window is not active
      @skill_window.active = false
      # delete cursor
      @skill_window.cursor_rect.empty
    # if RIGHT or LEFT is pressed
    elsif Input.trigger?(Input::RIGHT) || Input.trigger?(Input::LEFT)
      # play sound
      $game_system.se_play($data_system.cursor_se)
      # item window is active
      @item_window.active = true
      # skill window is not active
      @skill_window.active = false
      # delete cursor
      @skill_window.cursor_rect.empty
    end
  end
  #----------------------------------------------------------------------------
  # update_item
  #  Updates input during the item selection.
  #----------------------------------------------------------------------------
  def update_item
    # set last active
    @last_active = false
    # if B is pressed
    if Input.trigger?(Input::B)
      # play cancel cound
      $game_system.se_play($data_system.cancel_se)
      # set active
      @active = true
      # item window is not active
      @item_window.active = false
      # delete cursor
      @item_window.cursor_rect.empty
    # if C is pressed
    elsif Input.trigger?(Input::C)
      # play sound
      $game_system.se_play($data_system.decision_se)
      # if last position
      if @item_window.index == @item_window.item_max - 1
        # remove hotkey assigmnent from item
        $game_system.controls.items[(@index+1)%10] = 0
        # remove hotkey assigmnent from skill
        $game_system.controls.skills[(@index+1)%10] = 0
      else
        # set item to hotkey
        $game_system.controls.items[(@index+1)%10] = @item_window.item.id
        # remove hotkey assigmnent from skill
        $game_system.controls.skills[(@index+1)%10] = 0
      end
      # if hotkey display exists
      if @hotkeys != nil
        # draw hotkey display
        @hotkeys.draw
      # if HUD_ENABLED is turned on and HUD is active
      elsif BlizzABS::Config::HUD_ENABLED && $game_system.hud
        # draw hotkey display within the HUD
        @hud.assignment.draw
      end
      # set active
      @active = true
      # item window is not active
      @item_window.active = false
      # delete cursor
      @item_window.cursor_rect.empty
    # if RIGHT or LEFT is pressed
    elsif Input.trigger?(Input::RIGHT) || Input.trigger?(Input::LEFT)
      # play sound
      $game_system.se_play($data_system.cursor_se)
      # skill window is active
      @skill_window.active = true
      # item window is not active
      @item_window.active = false
      # delete cursor
      @item_window.cursor_rect.empty
    end
  end
 
end


i also had to change class menu to this

Spoiler: ShowHide
#Combo CMS by Xk8=============================================================#
#This is CMS is a combination between my second CMS and Zieg's Ring Menu Edit=#
#Credit to the ring coding will then go to Zieg===============================#
#I didn't do much in this CMS (item screens etc are uncustomized)=============#
#made this cms in under 60 minutes============================================#
#=============================================================================#
#other credits: Darkzero2840, Squall, Unknown Japanese Dude===================#
#Traduction par masterjojo :
#Ce script est une combinaison entre mon second CMS et le RingMenu de Zieg==#
#Remerciement à Zieg pour sa programation du RingMenu==================#
#CMS fait en moins de 60mn=========================================#
#==============================================================#
# Remerciement à Darkzero2840, Squall, Unknown Japanese Dude===========#
# Résolution du bug d'affichage par Siegfried
#===============================================================#
#www.neorpg.net
#www.neorpg.net/forum
#=============================================================================#
class Dummy_Window < Window_Base
def initialize
super(0, 0, 640, 64)
end
end

class Xtime < Window_Base

def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
end

def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.font.size = 14
self.contents.draw_text(4, -4, 120, 32, "Real Time")

@time_string = Time.now

text = @time_string.strftime("%A %H:%M:%S")
self.contents.font.size = 16
self.contents.font.color = normal_color
self.contents.draw_text(4, 10, 120, 32, text, 2)
end
def update
super
refresh
end
end

class Xlocation < Window_Base

def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.contents.clear
self.contents.font.color = system_color
self.contents.font.color = normal_color
$maps = load_data("Data/MapInfos.rxdata")
@map_id = $game_map.map_id
@currmap = $maps[@map_id].name
self.contents.font.size = 16
self.contents.draw_text(4, 0, 64, 32, @currmap)
end
end

class Window_PlayTimePlus < Window_Base

def initialize
super(0, 0, 160, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = 18
refresh
end

def refresh
self.contents.clear
self.contents.font.size = 14
self.contents.font.color = system_color
self.contents.draw_text(4, -4, 120, 32, "Temps de jeu")
@total_sec = Graphics.frame_count / Graphics.frame_rate
hour = @total_sec / 60 / 60
min = @total_sec / 60 % 60
sec = @total_sec % 60
text = sprintf("%02d:%02d:%02d", hour, min, sec)
self.contents.font.size = 18
self.contents.font.color = normal_color
self.contents.draw_text(4, 10, 120, 32, text, 2)
end

def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end


class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end

class Window_BasePlus < Window_Base

alias :draw_actor_hp_original :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 144)
if actor.maxhp != 0
rate = actor.hp.to_f / actor.maxhp
else
rate = 0
end

plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 - 24 * rate, 80 * rate, 14 * rate, 192)
color6 = Color.new(240 - 72 * rate, 240 * rate, 62 * rate, 192)

if actor.maxhp != 0
hp = (width + plus_width) * actor.hp * rate_width / 100 / actor.maxhp
else
hp = 0
end

gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, hp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_hp_original(actor, x, y, width)
end

alias :draw_actor_sp_original :draw_actor_sp
def draw_actor_sp(actor, x, y, width = 144)

if actor.maxsp != 0
rate = actor.sp.to_f / actor.maxsp
else
rate = 1
end

plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0
color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(0, 64, 0, 192)
color5 = Color.new(14 * rate, 80 - 24 * rate, 80 * rate, 192)
color6 = Color.new(62 * rate, 240 - 72 * rate, 240 * rate, 192)

if actor.maxsp != 0
sp = (width + plus_width) * actor.sp * rate_width / 100 / actor.maxsp
else
sp = (width + plus_width) * rate_width / 100
end

gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, sp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_sp_original(actor, x, y, width)
end

alias :draw_actor_exp_original :draw_actor_exp
def draw_actor_exp(actor, x, y, width = 204)

if actor.next_exp != 0
rate = actor.now_exp.to_f / actor.next_exp
else
rate = 1
end

plus_x = 0
rate_x = 0
plus_y = 25
plus_width = 0
rate_width = 100
height = 10
align1 = 1
align2 = 2
align3 = 0
grade1 = 1
grade2 = 0

color1 = Color.new(0, 0, 0, 192)
color2 = Color.new(255, 255, 192, 192)
color3 = Color.new(0, 0, 0, 192)
color4 = Color.new(64, 0, 0, 192)
color5 = Color.new(80 * rate, 80 - 80 * rate ** 2, 80 - 80 * rate, 192)
color6 = Color.new(240 * rate, 240 - 240 * rate ** 2, 240 - 240 * rate, 192)

if actor.next_exp != 0
exp = (width + plus_width) * actor.now_exp * rate_width /
100 / actor.next_exp
else
exp = (width + plus_width) * rate_width / 100
end

gauge_rect(x + plus_x + width * rate_x / 100, y + plus_y,
width, plus_width + width * rate_width / 100,
height, exp, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
draw_actor_exp_original(actor, x, y)
end

def gauge_rect(x, y, rect_width, width, height, gauge, align1, align2, align3,
color1, color2, color3, color4, color5, color6, grade1, grade2)
case align1
when 1
x += (rect_width - width) / 2
when 2
x += rect_width - width
end
case align2
when 1
y -= height / 2
when 2
y -= height
end

self.contents.fill_rect(x, y, width, height, color1)
self.contents.fill_rect(x + 1, y + 1, width - 2, height - 2, color2)
if align3 == 0
if grade1 == 2
grade1 = 3
end
if grade2 == 2
grade2 = 3
end
end
if (align3 == 1 and grade1 == 0) or grade1 > 0
color = color3
color3 = color4
color4 = color
end
if (align3 == 1 and grade2 == 0) or grade2 > 0
color = color5
color5 = color6
color6 = color
end

self.contents.gradation_rect(x + 2, y + 2, width - 4, height - 4,
color3, color4, grade1)
if align3 == 1
x += width - gauge
end

self.contents.gradation_rect(x + 2, y + 2, gauge - 4, height - 4,
color5, color6, grade2)
end
end

class Bitmap

def gradation_rect(x, y, width, height, color1, color2, align = 0)
if align == 0
for i in x...x + width
red = color1.red + (color2.red - color1.red) * (i - x) / (width - 1)
green = color1.green +
(color2.green - color1.green) * (i - x) / (width - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - x) / (width - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - x) / (width - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(i, y, 1, height, color)
end
elsif align == 1
for i in y...y + height
red = color1.red +
(color2.red - color1.red) * (i - y) / (height - 1)
green = color1.green +
(color2.green - color1.green) * (i - y) / (height - 1)
blue = color1.blue +
(color2.blue - color1.blue) * (i - y) / (height - 1)
alpha = color1.alpha +
(color2.alpha - color1.alpha) * (i - y) / (height - 1)
color = Color.new(red, green, blue, alpha)
fill_rect(x, i, width, 1, color)
end

elsif align == 2
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((i - x) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end

elsif align == 3
for i in x...x + width
for j in y...y + height
red = color1.red + (color2.red - color1.red) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
green = color1.green + (color2.green - color1.green) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
blue = color1.blue + (color2.blue - color1.blue) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
alpha = color1.alpha + (color2.alpha - color1.alpha) *
((x + width - i) / (width - 1.0) + (j - y) / (height - 1.0)) / 2
color = Color.new(red, green, blue, alpha)
set_pixel(i, j, color)
end
end
end
end
end

module RPG
class Sprite < ::Sprite
def damage(value, critical)
dispose_damage
if value.is_a?(Numeric)
damage_string = value.abs.to_s
else
damage_string = value.to_s
end

bitmap = Bitmap.new(160, 48)
bitmap.font.name = "Arial Black"
bitmap.font.size = 32
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12-1, 160, 36, damage_string, 1)
bitmap.draw_text(-1, 12+1, 160, 36, damage_string, 1)
bitmap.draw_text(+1, 12+1, 160, 36, damage_string, 1)

if value.is_a?(Numeric) and value < 0
bitmap.font.color.set(176, 255, 144)
else
bitmap.font.color.set(255, 255, 255)
end
bitmap.draw_text(0, 12, 160, 36, damage_string, 1)
if critical
bitmap.font.size = 20
bitmap.font.color.set(0, 0, 0)
bitmap.draw_text(-1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, -1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(-1, +1, 160, 20, "CRITICAL", 1)
bitmap.draw_text(+1, +1, 160, 20, "CRITICAL", 1)
bitmap.font.color.set(255, 255, 255)
bitmap.draw_text(0, 0, 160, 20, "CRITICAL", 1)
end
@_damage_sprite = ::Sprite.new
@_damage_sprite.bitmap = bitmap
@_damage_sprite.ox = 80 + self.viewport.ox
@_damage_sprite.oy = 20 + self.viewport.oy
@_damage_sprite.x = self.x + self.viewport.rect.x
@_damage_sprite.y = self.y - self.oy / 2 + self.viewport.rect.y
@_damage_sprite.z = 3000
@_damage_duration = 40
end
def animation(animation, hit)
dispose_animation
@_animation = animation
return if @_animation == nil
@_animation_hit = hit
@_animation_duration = @_animation.frame_max
animation_name = @_animation.animation_name
animation_hue = @_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_animation_sprites = []
if @_animation.position != 3 or not @@_animations.include?(animation)
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_animation_sprites.push(sprite)
end
unless @@_animations.include?(animation)
@@_animations.push(animation)
end
end
update_animation
end
def loop_animation(animation)
return if animation == @_loop_animation
dispose_loop_animation
@_loop_animation = animation
return if @_loop_animation == nil
@_loop_animation_index = 0
animation_name = @_loop_animation.animation_name
animation_hue = @_loop_animation.animation_hue
bitmap = RPG::Cache.animation(animation_name, animation_hue)
if @@_reference_count.include?(bitmap)
@@_reference_count[bitmap] += 1
else
@@_reference_count[bitmap] = 1
end
@_loop_animation_sprites = []
for i in 0..15
sprite = ::Sprite.new
sprite.bitmap = bitmap
sprite.visible = false
@_loop_animation_sprites.push(sprite)
end
update_loop_animation
end
def animation_set_sprites(sprites, cell_data, position)
for i in 0..15
sprite = sprites[i]
pattern = cell_data[i, 0]
if sprite == nil or pattern == nil or pattern == -1
sprite.visible = false if sprite != nil
next
end

sprite.visible = true
sprite.src_rect.set(pattern % 5 * 192, pattern / 5 * 192, 192, 192)
if position == 3
if self.viewport != nil
sprite.x = self.viewport.rect.width / 2
sprite.y = self.viewport.rect.height - 160
else
sprite.x = 320
sprite.y = 240
end
else

sprite.x = self.x + self.viewport.rect.x -
self.ox + self.src_rect.width / 2
sprite.y = self.y + self.viewport.rect.y -
self.oy + self.src_rect.height / 2
sprite.y -= self.src_rect.height / 4 if position == 0
sprite.y += self.src_rect.height / 4 if position == 2
end

sprite.x += cell_data[i, 1]
sprite.y += cell_data[i, 2]
sprite.z = 2000
sprite.ox = 96
sprite.oy = 96
sprite.zoom_x = cell_data[i, 3] / 100.0
sprite.zoom_y = cell_data[i, 3] / 100.0
sprite.angle = cell_data[i, 4]
sprite.mirror = (cell_data[i, 5] == 1)
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
sprite.blend_type = cell_data[i, 7]
end
end
end
end

class StatusSelectPlus < Window_BasePlus
attr_reader :index
attr_reader :help_window

def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end

def index=(index)
@index = index

if self.active and @help_window != nil
update_help
end
update_cursor_rect
end

def row_max
return (@item_max + @column_max - 1) / @column_max
end

def top_row

return self.oy / 32
end

def top_row=(row)

if row < 0
row = 0
end

if row > row_max - 1
row = row_max - 1
end

self.oy = row * 32
end

def page_row_max

return (self.height - 32) / 32
end
#www.neorpg.net
def page_item_max

return page_row_max * @column_max
end

def help_window=(help_window)
@help_window = help_window

if self.active and @help_window != nil
update_help
end
end

def update_cursor_rect

if @index < 0
self.cursor_rect.empty
return
end

row = @index / @column_max

if row < self.top_row
self.top_row = row
end

if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end

cursor_width = 32
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * 32 - self.oy
self.cursor_rect.set(x, y, cursor_width, 32)
end

def update
super

if self.active and @item_max > 0 and @index >= 0
if Input.repeat?(Input::DOWN)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index < @item_max - @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max) % @item_max
end
end

if Input.repeat?(Input::UP)

if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= @column_max
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max + @item_max) % @item_max
end
end

if Input.repeat?(Input::RIGHT)
if @column_max >= 2 and @index < @item_max - 1
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end

if Input.repeat?(Input::LEFT)

if @column_max >= 2 and @index > 0
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end

if Input.repeat?(Input::R)
if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
$game_system.se_play($data_system.cursor_se)
@index = [@index + self.page_item_max, @item_max - 1].min
self.top_row += self.page_row_max
end
end

if Input.repeat?(Input::L)
if self.top_row > 0
$game_system.se_play($data_system.cursor_se)
@index = [@index - self.page_item_max, 0].max
self.top_row -= self.page_row_max
end
end
end

if self.active and @help_window != nil
update_help
end

update_cursor_rect
end
end

class MenuStatusPlus < StatusSelectPlus

def initialize
super(0, 0, 450, 416)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
refresh
self.active = false
self.index = -1
end

def refresh
self.contents.clear
@item_max = $game_party.actors.size
for i in 0...$game_party.actors.size
x = 64
y = i * 90
actor = $game_party.actors[i]
draw_actor_face(actor, x + 200, y + 79)
draw_actor_graphic(actor, x - 50, y + 80)
self.contents.font.size = 18
draw_actor_name(actor, x - 60, y + 4)
self.contents.font.color = normal_color
draw_actor_class(actor, x + 60, y + 4)
draw_actor_level(actor, x+5 , y + 4)
draw_actor_state(actor, x + 150, y + 4)
draw_actor_exp(actor, x - 35, y + 54)
draw_actor_hp(actor, x - 35, y + 32)
draw_actor_sp(actor, x + 115, y + 32)
end
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
else
self.cursor_rect.set(1, @index * 90 + 33, 26, 48)
end
end

def draw_actor_face(actor, x, y)
face = RPG::Cache.battler(actor.character_name, actor.character_hue)
fw = face.width
fh = 90
src_rect = Rect.new(3, -1, fw, fh)
opacity = 180
self.contents.blt(x - fw / 23, y - fh, face, src_rect, opacity)
end
end
Title: Re: [request] ring menu
Post by: nathmatt on March 20, 2008, 08:53:58 pm
i want them to look somthing like this the background to use the normal menu backround unless i change it in the database
Spoiler: ShowHide
(http://i184.photobucket.com/albums/x287/nathmatt/layout.jpg)