Jump to content
Sign in to follow this  
roninator2

Syvkal Ring Menu addon - Game End Menu Ring

Recommended Posts

Syvkal Ring Menu addon - Game End Menu Ring 1.00
by Roninator2

Introduction
An addon to make the Game End Menu show icons in a ring for the Syvkal ring menu

Features
- Plug & play

How to Use
Put below Syvkal Ring Menu script

Images

Spoiler

1609628028664.png.7f5d63c47c19a69182d79c3306e72125.png


Script

Spoiler

# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Syvkal Game End Ring         ║  Version: 1.00     ║
# ║ Author: Roninator2                  ║                    ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function:                           ║   Date Created     ║
# ║    Add ring menu to game end menu   ╠════════════════════╣
# ║                                     ║    02 Jan 2021     ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Using code from Syvkal's Ring Menu                       ║
# ║ I created the game end screen menu                       ║
# ║                                                          ║
# ║ If other options are added, it will require changes.     ║
# ║ Icons must be in the format of ''choice' + space + icon' ║
# ║ example                                                  ║
# ║ 'yes icon'.png or 'no icon'.png  - without quotes        ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates:                                                 ║
# ║ 1.00 - 02 Jan 2021 - Initial publish                     ║
# ╚══════════════════════════════════════════════════════════╝
# ╔═════════════════════════════════════╗
# ║ Terms of use:                       ║
# ║ Follow the Original Authors terms   ║
# ╚═════════════════════════════════════╝
#==============================================================================
# ** Window_GameEnd
#------------------------------------------------------------------------------
#  This window is for selecting Go to Title/Shut Down on the game over screen.
#==============================================================================
class Window_GameEnd < Window_Command
  #--------------------------------------------------------------------------
  # * Includes The Ring_Menu Module
  #--------------------------------------------------------------------------
  include Ring_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
    @cx = $game_player.screen_x - 16
    @cy = $game_player.screen_y - 28
    @icons = []
    @endcom = []
    @list.clear
    make_command_list
    make_game_end_icons
    select(0)
    self.opacity = 0
    @mode = :start
    open
    activate
    refresh
  end
  #--------------------------------------------------------------------------
  # * Update Cursor
  #--------------------------------------------------------------------------
  def update_cursor
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    super
    @cx = $game_player.screen_x - 16
    @cy = $game_player.screen_y - 28
    rect = Rect.new(@cx - 254, @cy - 20, self.contents.width, line_height)
    draw_text(rect, choice_name(index), 1)
  end
  #--------------------------------------------------------------------------
  # * Determines if is moving
  #--------------------------------------------------------------------------
  def animation?
    return @mode != :wait
  end
  #--------------------------------------------------------------------------
  # * make_title_icons
  #--------------------------------------------------------------------------
  def make_game_end_icons
    @endcom.each_with_index do |command, i|
      @icons.push(Cache::picture(command + ' Icon'))
      rect = Rect.new(self.x, self.y, @icons[i].width / 2, @icons[i].height / 2)
      draw_item(x, y, i)
    end
  end
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    return Graphics.width
  end
  #--------------------------------------------------------------------------
  # * Get Window Height
  #--------------------------------------------------------------------------
  def window_height
    return Graphics.height
  end
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    @endcom = []
    add_command(Vocab::to_title, :to_title)
    add_command(Vocab::shutdown, :shutdown)
    add_command(Vocab::cancel,   :cancel)
    @endcom.push(Vocab::to_title)
    @endcom.push(Vocab::shutdown)
    @endcom.push(Vocab::cancel)
  end
  #--------------------------------------------------------------------------
  # * Get Command Name
  #--------------------------------------------------------------------------
  def choice_name(index)
    return if @endcom == nil
    @endcom[index]
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #     x     : draw spot x-coordinate
  #     y     : draw spot y-coordinate
  #     i     : item number
  #--------------------------------------------------------------------------
  def draw_item(x, y, i)
    return if @icons.nil?
    rect = Rect.new(0, 0, @icons[i].width, @icons[i].height)
    if i == index
      self.contents.blt(x - rect.width/2, y - rect.height/2, @icons[i], rect )
      unless command_enabled?(index)
        self.contents.blt(x - rect.width/2, y - rect.height/2, ICON_DISABLE, rect )
      end
    else
      self.contents.blt(x - rect.width/2, y - rect.height/2, @icons[i], rect, 128 )
    end
  end
end

 


Credit and Thanks
- Syvkal
- Roninator2

Terms of use
Follow original authors terms

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted