Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Pacman Advanced Creative (PAC) Engine - Main Menu 1.7d
- # 9/7/2012
- # Type: Menu
- # Installation: Heavy arrays and hashes, booleans and values.
- # Level: Difficult, Insane
- # Thanks: Cozziekuns, for the ring mode.
- #
- #===============================================================================
- #
- # Description:
- # So, here's the main menu. I'm sure you were looking for this. The setup is
- # now revolutionized; all the commands are done in one hash filled with arrays.
- # I'm pretty certain the configuration's going to stay like this.
- # With base code truly out of the way, I've begun working on aesthetic aspects
- # of the menu. So far, I've made two 'modes' for the menu, and Cozziekuns has
- # made 1.
- # Enjoy.
- #
- #===============================================================================
- #
- # Instructions:
- # INSTALLATION
- # Paste above main, below materials. It's not very difficult, even an XP
- # user could do it.
- # CONFIGURATION
- # There are detailed instructions for the configuration beginning at line 44.
- # Follow them closely, they shall lead you to your dream menu.
- #
- #===============================================================================
- #
- # CONFIGURATION BEGINS AT LINE 44
- #
- #==============================================================================
- ($pac ||= {})["Main Menu"] = [1.7, :d]
- module PAC
- module MM
- #==============================================================================
- #
- # BEGIN CONFIGURATION
- #
- #==============================================================================
- #--------------------------------------------------------------------------
- # Use icons in the main menu? (true / false)
- #--------------------------------------------------------------------------
- USE_ICONS = true
- #--------------------------------------------------------------------------
- # Setup for commands in the menu. Each entry must be an array ([]), ended
- # with a comma and begin with a number (the place where it is in the menu.
- # The indexes start at 0, so make sure you have a 0 command.
- # Syntax:
- # COMMANDS = {
- # INDEX (number) => [
- # 'Command Name',
- # 'Command action',
- # IconID,
- # 'Disable action', (optional)
- # ],
- # }
- # Command action should be left as is unless you know what you are doing.
- # For example, if you are implementing a custom scene into this menu, you
- # have to know the name of the scene and the arguments required. Disable
- # action is code that will be evaluated; if it returns true then the command
- # will not be allowed. Command Name, Command action and Disable action
- # must all be string, i.e. in quotation marks ''. If you do not want a
- # disable action, either do not enter one or enter it as nil.
- # Note that for the command action, if the scene requires actor selection,
- # place an @status_window.index in the paranthesis. It will trigger actor
- # selection upon pressing the command.
- # If you do not want to use an icon for a particular index, enter that
- # entry as nil.
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- COMMANDS = { # Do not touch this!
- #--------------------------------------------------------------------------
- 0 => [ # Do not touch this!
- #----------------------------------------------------------------------
- # Entry for command 1 (index 0)
- #----------------------------------------------------------------------
- 'Inventory', # Name
- '$scene = Scene_Item.new', # Command
- 144, # Icon
- nil # Disable
- #------------------------------------------------------------------------
- ], # Do not touch this!
- #------------------------------------------------------------------------
- 1 => [ # Do not touch this!
- #----------------------------------------------------------------------
- # Entry for command 2 (index 1)
- #----------------------------------------------------------------------
- 'Skills', # Name
- '$scene = Scene_Skill.new(@status_window.index)', # Command
- 137, # Icon
- # No disable needed.
- #------------------------------------------------------------------------
- ], # Do not touch this!
- #------------------------------------------------------------------------
- 2 => [ # Do not touch this!
- #----------------------------------------------------------------------
- # Entry for command 3 (index 2)
- #----------------------------------------------------------------------
- 'Equip', # Name
- '$scene = Scene_Equip.new(@status_window.index)', # Command
- 1, # Icon
- #------------------------------------------------------------------------
- ], # Do not touch this!
- #------------------------------------------------------------------------
- 3 => [
- 'Status',
- '$scene = Scene_Status.new(@status_window.index)',
- 130,
- ],
- 4 => [
- 'Party',
- '$scene = Scene_Party.new(false, true)',
- rand(224)
- ],
- 5 => [
- 'Save',
- '$scene = Scene_File.new(true, false, false)',
- 200,
- '$game_system.save_disabled',
- ],
- 6 => [
- 'End Game',
- '$scene = Scene_End.new',
- 224,
- ],
- #--------------------------------------------------------------------------
- } # Do not touch this!
- #--------------------------------------------------------------------------
- # Button used to completely recover the party in the menu. This is only
- # operational when the $TEST variable is true, so you'll only be able to
- # do it in debug mode.
- HEAL_BUTTON = Input::F5
- # Mode of graphics used for the menu. Usable:
- # :compact, :comprehensive, :ring
- # If you use the :ring option, make sure you credit Cozziekuns.
- # If you do not want to use this, set it to nil.
- WINDOW_MODE = :compact
- #--------------------------------------------------------------------------
- # THESE OPTIONS ARE FOR THE COMPACT OPTION
- #--------------------------------------------------------------------------
- # Pixels per frame the windows move (number)
- COMPACT_SCROLL_SPEED = 4
- # Direction the command window will move to when actor selection begins
- # (:left / :right)
- COMPACT_SELECTION = :right
- # Button to toggle gold window visibility (Input::Button)
- COMPACT_GOLD_BUTTON = Input::L
- # Start scene with gold window visible? (true / false)
- COMPACT_GOLD_WINDOW = true
- #--------------------------------------------------------------------------
- # THESE OPTIONS ARE FOR THE COMPREHENSIVE OPTION
- #--------------------------------------------------------------------------
- # Text displayed on the EXP gauge (string)
- EXP_STRING = "E"
- #--------------------------------------------------------------------------
- module RING
- #--------------------------------------------------------------------------
- # THESE OPTIONS ARE FOR THE RING OPTION
- #--------------------------------------------------------------------------
- # Size of the ring menu (radius)
- MENU_RADIUS = 128
- # How many frames the menu takes while spinning. Higher = slower.
- MENU_SPEED = 16
- # Origin of text in the menu. (:top / :center)
- MENU_TEXT_ORIGIN = :center
- # Button to toggle gold window visibility (Input::Button)
- MENU_GOLD_BUTTON = Input::L
- # Start scene with gold window visible? (true / false)
- MENU_GOLD_WINDOW = true
- end
- #===============================================================================
- #
- # END CONFIGURATION
- #
- #===============================================================================
- end
- end
- #==============================================================================
- # *** Math
- #------------------------------------------------------------------------------
- # A module that supports floating point calculations.
- #==============================================================================
- if PAC::MM::WINDOW_MODE == :ring
- module Math
- #--------------------------------------------------------------------------
- # * Sind
- #--------------------------------------------------------------------------
- def self.sind(value)
- return self.sin(value * PI / 180)
- end
- #--------------------------------------------------------------------------
- # * Cosd
- #--------------------------------------------------------------------------
- def self.cosd(value)
- return self.cos(value * PI / 180)
- end
- #--------------------------------------------------------------------------
- # * Tand
- #--------------------------------------------------------------------------
- def self.tand(value)
- return self.tan(value * PI / 180)
- end
- end
- end
- #==============================================================================
- # ** Game_System
- #------------------------------------------------------------------------------
- # This class handles system-related data. Also manages vehicles and BGM, etc.
- # The instance of this class is referenced by $game_system.
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :menu_index
- attr_accessor :menu_actor_selection
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias pac_menu_initialize initialize
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- pac_menu_initialize
- @menu_index = 0
- @menu_actor_selection = false
- end
- end
- #==============================================================================
- # ** Game_Actor
- #------------------------------------------------------------------------------
- # This class handles actors. It's used within the Game_Actors class
- # ($game_actors) and referenced by the Game_Party class ($game_party).
- #==============================================================================
- class Game_Actor < Game_Battler
- #--------------------------------------------------------------------------
- # * Get current exp
- #--------------------------------------------------------------------------
- def current_exp
- return @exp - @exp_list[@level]
- end
- #--------------------------------------------------------------------------
- # * Get required exp for next level
- #--------------------------------------------------------------------------
- def required_exp
- return @exp_list[@level + 1] > 0 ? @exp_list[@level + 1] -
- @exp_list[@level] : 0
- end
- end
- #==============================================================================
- # ** Game_Map
- #------------------------------------------------------------------------------
- # This class handles maps. It includes scrolling and passage determination
- # functions. The instance of this class is referenced by $game_map.
- #==============================================================================
- class Game_Map
- #--------------------------------------------------------------------------
- # * Get map's name
- #--------------------------------------------------------------------------
- def map_name
- m = load_data("Data/MapInfos.rvdata")
- return m[@map_id].name
- end
- end
- #==============================================================================
- # ** Window_Base
- #------------------------------------------------------------------------------
- # This is a superclass of all windows in the game.
- #==============================================================================
- class Window_Base < Window
- #--------------------------------------------------------------------------
- # * Draw Actor's Level
- #--------------------------------------------------------------------------
- def draw_menu_actor_level(actor, x, y)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
- self.contents.font.color = normal_color
- self.contents.draw_text(x + 16, y, 24, WLH, actor.level, 2)
- end
- #--------------------------------------------------------------------------
- # * Draw Actor's Class
- #--------------------------------------------------------------------------
- def draw_menu_actor_class(actor, x, y)
- self.contents.font.color = normal_color
- self.contents.draw_text(x, y, 85, WLH, actor.class.name)
- end
- #--------------------------------------------------------------------------
- # * Colour 1 for exp gauge
- #--------------------------------------------------------------------------
- def exp_gauge_color1
- return text_color(30)
- end
- #--------------------------------------------------------------------------
- # * Colour 2 for exp gauge
- #--------------------------------------------------------------------------
- def exp_gauge_color2
- return text_color(31)
- end
- #--------------------------------------------------------------------------
- # * Create exp gauge
- #--------------------------------------------------------------------------
- def draw_exp_meter(actor, x, y, width = 100)
- exp = actor.required_exp != 0 ? actor.current_exp : 1
- gw = width * exp / [actor.required_exp, 1].max
- gc1, gc2 = exp_gauge_color1, exp_gauge_color2
- self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
- self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
- self.contents.font.color = system_color
- self.contents.draw_text(x, y, 30, WLH, "Exp")
- self.contents.font.color = normal_color
- gx = x + width
- self.contents.draw_text(gx - 60, y, 60, WLH, actor.next_rest_exp_s, 2)
- end
- end
- #==============================================================================
- # ** Window_MapName
- #------------------------------------------------------------------------------
- # This window displays the map name on the menu screen.
- #==============================================================================
- class Window_MapName < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, 160, WLH * 3)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- self.contents.font.color = normal_color
- text = $game_map.map_name.to_s
- self.contents.draw_text(0, 0, 120, self.height / 2, text, 1)
- end
- end
- #==============================================================================
- # ** Window_Time
- #------------------------------------------------------------------------------
- # This window displays playtime on the menu screen.
- #==============================================================================
- class Window_Time < Window_Base
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(x, y)
- super(x, y, 160, WLH * 3)
- refresh
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @time = Graphics.frame_count / Graphics.frame_rate
- hour = @time / 60 / 60
- min = @time / 60 % 60
- sec = @time % 60
- text = sprintf("%02d:%02d:%02d", hour, min, sec)
- self.contents.font.color = normal_color
- self.contents.draw_text(0, 0, 120, self.height / 2, text, 1)
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super
- if Graphics.frame_count / Graphics.frame_rate != @time
- refresh
- end
- end
- end
- #==============================================================================
- # ** Window_MenuStatus
- #------------------------------------------------------------------------------
- # This window displays party member status on the menu screen.
- #==============================================================================
- class Window_MenuStatus < Window_Selectable
- #--------------------------------------------------------------------------
- # RING MODE
- #--------------------------------------------------------------------------
- if PAC::MM::WINDOW_MODE == :ring
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias coz_pac_mm_wms_initialize initialize
- alias coz_pac_mm_wms_update update
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(*args)
- coz_pac_mm_wms_initialize(*args)
- self.visible = self.active
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update(*args)
- coz_pac_mm_wms_update(*args)
- self.visible = self.active
- end
- #--------------------------------------------------------------------------
- # END RING MODE
- #--------------------------------------------------------------------------
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- @item_max = $game_party.members.size
- for actor in $game_party.members
- draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
- x = 104; y = actor.index * 96 + WLH / 2
- draw_actor_name(actor, x, y)
- draw_menu_actor_class(actor, x + 120, y)
- draw_menu_actor_level(actor, x + 200, y)
- draw_actor_state(actor, x, y + WLH * 2)
- draw_actor_hp(actor, x + 120, y + WLH * 1)
- draw_actor_mp(actor, x + 120, y + WLH * 2)
- draw_exp_meter(actor, x, y + WLH * 1)
- end
- end
- end
- #==============================================================================
- # ** Window_MenuCommand
- #------------------------------------------------------------------------------
- # This window displays selectable commands on the menu screen.
- #==============================================================================
- class Window_MenuCommand < Window_Selectable
- #--------------------------------------------------------------------------
- # * Object Initialization
- # width : window width
- # commands : command string array
- # column_max : digit count (if 2 or more, horizontal selection)
- # row_max : row count (0: match command count)
- # spacing : blank space when items are arrange horizontally
- #--------------------------------------------------------------------------
- def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32)
- if row_max == 0
- row_max = (commands.size + column_max - 1) / column_max
- end
- super(0, 0, width, row_max * WLH + 32, spacing)
- @commands = commands
- @item_max = commands.size
- @column_max = column_max
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- # index : item number
- # enabled : enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- def draw_item(index, enabled = true)
- rect = item_rect(index)
- rect.x += 4
- rect.width -= 8
- self.contents.clear_rect(rect)
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- if PAC::MM::COMMANDS[index][2] != nil and PAC::MM::USE_ICONS
- draw_icon(PAC::MM::COMMANDS[index][2], rect.x, rect.y)
- rect.x += 24
- end
- self.contents.draw_text(rect, PAC::MM::COMMANDS[index][0])
- end
- end
- #==============================================================================
- # ** Window_RingMenu
- #------------------------------------------------------------------------------
- # This window displays the ring menu.
- #==============================================================================
- if PAC::MM::WINDOW_MODE == :ring
- class Window_RingMenu < Window_Base
- #--------------------------------------------------------------------------
- # Public Instance Variables
- #--------------------------------------------------------------------------
- attr_reader :index
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(commands)
- super(0, 0, Graphics.width, Graphics.height)
- @commands = commands
- @item_max = commands.size
- self.opacity = 0
- self.index = 0
- @angle = 0
- @radius = PAC::MM::RING::MENU_RADIUS
- refresh
- end
- #--------------------------------------------------------------------------
- # * Set index
- #--------------------------------------------------------------------------
- def index=(n)
- @index = n
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # * Angle Size
- #--------------------------------------------------------------------------
- def angle_size
- return 360 / @item_max
- end
- #--------------------------------------------------------------------------
- # * Draw Item
- # index : item number
- # enabled : enabled flag. When false, draw semi-transparently.
- #--------------------------------------------------------------------------
- def draw_item(index, enabled = true)
- radius = @radius
- n = (index - @index) * angle_size + @angle
- cx = radius * Math.sind(n) + Graphics.width / 2
- cy = -radius * Math.cosd(n) + Graphics.height / 2
- if PAC::MM::COMMANDS[index][2] != nil and PAC::MM::USE_ICONS
- draw_icon(PAC::MM::COMMANDS[index][2], cx - 12, cy - 12, (n == 0 and
- enabled))
- end
- if n == 0
- self.contents.font.color.alpha = enabled ? 255 : 128
- case PAC::MM::RING::MENU_TEXT_ORIGIN
- when :top
- self.contents.draw_text(cx - 80, cy - 48, 160, WLH,
- PAC::MM::COMMANDS[index][0], 1)
- when :center
- self.contents.draw_text(Graphics.width / 2 - 80, Graphics.height / 2 -
- WLH, 160, WLH, PAC::MM::COMMANDS[index][0], 1)
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Spin Update
- #--------------------------------------------------------------------------
- def update_spin(reverse = false)
- speed = PAC::MM::RING::MENU_SPEED
- @angle += (reverse ? -angle_size : angle_size) / speed.to_f
- Graphics.update
- refresh
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- super
- update_index
- end
- #--------------------------------------------------------------------------
- # * Index Update
- #--------------------------------------------------------------------------
- def update_index
- if Input.trigger?(Input::LEFT)
- Sound.play_cursor
- while @angle.round < angle_size
- update_spin
- end
- @index -= 1
- @index %= @item_max
- @angle = 0
- refresh
- elsif Input.trigger?(Input::RIGHT)
- Sound.play_cursor
- while @angle.round > -angle_size
- update_spin(true)
- end
- @index += 1
- @index %= @item_max
- @angle = 0
- refresh
- end
- end
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # Include Configuration Data
- #--------------------------------------------------------------------------
- include PAC::MM
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias pac_menu_initialize initialize
- alias pac_menu_start start
- #--------------------------------------------------------------------------
- # * Object Initialization
- # menu_index : command cursor's initial position
- #--------------------------------------------------------------------------
- def initialize(menu_index = $game_system.menu_index)
- pac_menu_initialize(menu_index)
- @selection = $game_system.menu_actor_selection
- end
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- pac_menu_start
- pac_compact_windows if WINDOW_MODE == :compact
- if @selection && WINDOW_MODE == :compact
- pac_compact_quick_actor_selection
- elsif @selection
- start_actor_selection
- end
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- commands = COMMANDS
- @command_window = Window_MenuCommand.new(160, commands)
- @command_window.index = @menu_index
- pac_menu_disable_commands
- end
- #--------------------------------------------------------------------------
- # * Disable Menu Commands
- #--------------------------------------------------------------------------
- def pac_menu_disable_commands
- if $game_party.members.size == 0
- for i in 0...COMMANDS.size
- if selection?(i)
- @command_window.draw_item(i, false)
- end
- end
- end
- for i in 0...COMMANDS.size
- unless COMMANDS[i][3].nil?
- if eval(COMMANDS[i][3])
- @command_window.draw_item(i, false)
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Require Selection?
- # command : command to be determined whether or not to have selection
- #--------------------------------------------------------------------------
- def selection?(command)
- return COMMANDS[command][1].include?('@status_window.index')
- end
- #--------------------------------------------------------------------------
- # * Update Command Selection
- #--------------------------------------------------------------------------
- def update_command_selection
- $game_system.menu_index = @command_window.index
- selection = @command_window.index
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif $TEST and Input.trigger?(HEAL_BUTTON)
- Sound.play_recovery
- for member in $game_party.members
- member.recover_all
- end
- @status_window.refresh
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and selection?(selection)
- Sound.play_buzzer
- return
- elsif !COMMANDS[selection][3].nil?
- if eval(COMMANDS[selection][3])
- Sound.play_buzzer
- return
- end
- end
- Sound.play_decision
- if selection?(selection)
- start_actor_selection
- else
- $game_system.menu_actor_selection = false
- eval(COMMANDS[selection][1])
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Update Actor Selection
- #--------------------------------------------------------------------------
- def update_actor_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_actor_selection
- elsif Input.trigger?(Input::C)
- selection = @command_window.index
- $game_party.last_actor_index = @status_window.index
- Sound.play_decision
- $game_system.menu_actor_selection = true
- eval(COMMANDS[selection][1])
- end
- end
- #===============================================================================
- # COMPACT MODE
- #===============================================================================
- if WINDOW_MODE == :compact
- $pac["Compact Menu"] = true
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias pac_compact_start start
- alias pac_compact_start_actor_selection start_actor_selection
- alias pac_compact_end_actor_selection end_actor_selection
- alias pac_compact_update update
- #--------------------------------------------------------------------------
- # * Make Windows Compact
- #--------------------------------------------------------------------------
- def pac_compact_windows
- @command_window.x = Graphics.width / 2 - @command_window.width / 2
- @gold_window.visible = COMPACT_GOLD_WINDOW
- @gold_window.x = @command_window.x
- @gold_window.openness = COMPACT_GOLD_WINDOW ? 255 : 0
- @status_window.x = case COMPACT_SELECTION
- when :left then Graphics.width - @status_window.width
- when :right then 0
- end
- @status_window.visible = false
- @status_window.openness = 0
- if @gold_window.visible
- @command_window.y = Graphics.height / 2 - (@command_window.height +
- @gold_window.height) / 2
- else
- @command_window.y = Graphics.height / 2 - @command_window.height / 2
- end
- @gold_window.y = @command_window.y + @command_window.height
- @check_x = @command_window.x
- end
- #--------------------------------------------------------------------------
- # * Quick Actor Selection
- #--------------------------------------------------------------------------
- def pac_compact_quick_actor_selection
- @status_window.visible = true
- @command_window.x = COMPACT_SELECTION == :left ? 0 : Graphics.width -
- @command_window.width
- @gold_window.x = @command_window.x
- @status_window.open
- begin
- @status_window.update
- Graphics.update
- end until @status_window.openness == 255
- pac_compact_start_actor_selection
- end
- #--------------------------------------------------------------------------
- # * Start Actor Selection
- #--------------------------------------------------------------------------
- def start_actor_selection
- @status_window.visible = true
- check = case COMPACT_SELECTION
- when :left then 0
- when :right then Graphics.width - @command_window.width
- end
- begin
- @command_window.x -= case COMPACT_SELECTION
- when :left then COMPACT_SCROLL_SPEED
- when :right then -COMPACT_SCROLL_SPEED
- end
- @gold_window.x = @command_window.x
- Graphics.update
- end until @command_window.x == check
- @status_window.open
- begin
- @status_window.update
- Graphics.update
- end until @status_window.openness == 255
- pac_compact_start_actor_selection
- end
- #--------------------------------------------------------------------------
- # * End Actor Selection
- #--------------------------------------------------------------------------
- def end_actor_selection
- pac_compact_end_actor_selection
- @status_window.close
- begin
- @status_window.update
- Graphics.update
- end until @status_window.openness == 0
- @status_window.visible = false
- begin
- unless @command_window.x == @check_x
- @command_window.x += case COMPACT_SELECTION
- when :left then COMPACT_SCROLL_SPEED
- when :right then -COMPACT_SCROLL_SPEED
- end
- end
- @gold_window.x = @command_window.x
- Graphics.update
- end until @command_window.x == @check_x
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- pac_compact_update
- update_gold_visible
- end
- #--------------------------------------------------------------------------
- # * Update Visibility of Gold Window (and scroll to cater)
- #--------------------------------------------------------------------------
- def update_gold_visible
- @gold_window.x = @command_window.x if @gold_window.x != @command_window.x
- if Input.trigger?(COMPACT_GOLD_BUTTON)
- Sound.play_decision
- if @gold_window.visible
- @gold_window.close
- begin
- @gold_window.update
- Graphics.update
- end until @gold_window.openness == 0
- @gold_window.visible = false
- begin
- @command_window.y += COMPACT_SCROLL_SPEED
- @command_window.update
- Graphics.update
- end until @command_window.y == Graphics.height / 2 -
- @command_window.height / 2
- else
- begin
- @command_window.y -= COMPACT_SCROLL_SPEED
- @command_window.update
- Graphics.update
- end until @command_window.y == Graphics.height / 2 -
- (@command_window.height + @gold_window.height) / 2
- @gold_window.visible = true
- @gold_window.open
- begin
- @gold_window.update
- Graphics.update
- end until @gold_window.openness == 255
- end
- end
- end
- #===============================================================================
- # END COMPACT MODE
- #===============================================================================
- end
- #===============================================================================
- # COMPREHENSIVE MODE
- #===============================================================================
- if WINDOW_MODE == :comprehensive
- $pac["Comprehensive Menu"] = true
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias pac_comprehensive_start start
- alias pac_comprehensive_terminate terminate
- alias pac_comprehensive_update update
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- pac_comprehensive_start
- @location_window = Window_MapName.new(0, @command_window.height)
- @time_window = Window_Time.new(0, @location_window.y +
- @location_window.height)
- end
- #--------------------------------------------------------------------------
- # * Termination Processing
- #--------------------------------------------------------------------------
- def terminate
- pac_comprehensive_terminate
- @location_window.dispose
- @time_window.dispose
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- pac_comprehensive_update
- @location_window.update
- @time_window.update
- end
- #===============================================================================
- # END COMPREHENSIVE MODE
- #===============================================================================
- end
- #===============================================================================
- # RING MODE
- #===============================================================================
- if WINDOW_MODE == :ring
- $pac["Ring Menu"] = true
- #--------------------------------------------------------------------------
- # Include configuration data
- #--------------------------------------------------------------------------
- include RING
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias coz_pac_mm_sm_start start
- alias coz_pac_mm_sm_update update
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start(*args)
- coz_pac_mm_sm_start(*args)
- @gold_window.visible = MENU_GOLD_WINDOW
- @gold_window.openness = MENU_GOLD_WINDOW ? 255 : 0
- end
- #--------------------------------------------------------------------------
- # * Create Command Window
- #--------------------------------------------------------------------------
- def create_command_window
- commands = COMMANDS
- @command_window = Window_RingMenu.new(commands)
- @command_window.index = @menu_index
- @command_window.refresh
- pac_menu_disable_commands
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update(*args)
- coz_pac_mm_sm_update(*args)
- update_gold_visible
- end
- #--------------------------------------------------------------------------
- # * Update Visibility of Gold window
- #--------------------------------------------------------------------------
- def update_gold_visible
- if Input.trigger?(MENU_GOLD_BUTTON)
- Sound.play_decision
- if @gold_window.visible
- @gold_window.close
- while @gold_window.openness != 0
- @gold_window.update
- Graphics.update
- end
- @gold_window.visible = false
- else
- @gold_window.visible = true
- @gold_window.open
- while @gold_window.openness != 255
- @gold_window.update
- Graphics.update
- end
- end
- end
- end
- end
- #===============================================================================
- # END RING MODE
- #==============================================================================
- end
- #==============================================================================
- # ** Scene_Base
- #------------------------------------------------------------------------------
- # This is a superclass of all scenes in the game.
- #==============================================================================
- class Scene_Base
- #--------------------------------------------------------------------------
- # * Dispose of Background for Menu Screen
- #--------------------------------------------------------------------------
- def dispose_menu_background
- @menuback_sprite.dispose if @menuback_sprite != nil
- end
- end
- #==============================================================================
- # Menu Index Fix
- #==============================================================================
- ["Item", "Skill", "Equip", "Status", "End"].each { |klass|
- fix_return_scene = %Q(class Scene_#{klass}; def return_scene
- $scene = Scene_Menu.new; end; end); eval(fix_return_scene)
- }
- #==============================================================================
- # ** Scene_File
- #------------------------------------------------------------------------------
- # This class performs the save and load screen processing.
- #==============================================================================
- class Scene_File < Scene_Base
- #--------------------------------------------------------------------------
- # * Return to Original Screen
- #--------------------------------------------------------------------------
- def return_scene
- if @from_title
- $scene = Scene_Title.new
- elsif @from_event
- $scene = Scene_Map.new
- else
- $scene = Scene_Menu.new
- end
- end
- end
- #===============================================================================
- #
- # END OF SCRIPT
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement