Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # PAC Main Menu Ace - Compact Display Addon (1.0)
- # 16/7/2012
- # By Pacman
- #
- #===============================================================================
- #
- # This is the Compact Display Addon for the PAC Main Menu Ace. This script
- # requires PAC Main Menu Ace to work. This is a graphical change to the menu,
- # "compacting" the menu screen to only display the status window when required.
- # The extra windows (the gold, map and playtime windows) can now by closed by
- # pressing a designated button.
- #
- #===============================================================================
- #------------------------------------
- module PAC; module MM; module Compact # <- Do not touch.
- #----------------------------------
- Use_Compact = true # Use the compact menu?
- Show_Extras = true # Show the extra display windows when the menu opens?
- Show_Button = :X # Button used to open and close the extra windows.
- Move_Speed = 10 # Number of pixels per second the windows move when
- # sliding.
- #------------------------------------
- end; end; end
- #------------------------------------
- #===============================================================================
- #
- # END OF CONFIGURATION
- #
- #===============================================================================
- if PAC::MM::Compact::Use_Compact
- if !($pac ||= {})[:main_menu] || $pac[:main_menu] < 1.2
- msgbox "You require the PAC MM 1.2 base script to use the Compact Addon."
- exit
- end
- #==============================================================================
- # ** Game_System
- #------------------------------------------------------------------------------
- # This class handles system data. It saves the disable state of saving and
- # menus. Instances of this class are referenced by $game_system.
- #==============================================================================
- class Game_System
- #--------------------------------------------------------------------------
- # Public Instance Variables
- #--------------------------------------------------------------------------
- attr_accessor :menu_window_vis
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias pac_mmc_initialize initialize
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize(*args)
- pac_mmc_initialize(*args)
- @menu_window_vis = PAC::MM::Compact::Show_Extras
- end
- end
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # Alias listing
- #--------------------------------------------------------------------------
- alias pac_mmc_start start
- alias pac_mmc_comper command_personal
- alias pac_mmc_comfor command_formation
- alias pac_mmc_opc on_personal_cancel
- alias pac_mmc_ofc on_formation_cancel
- alias pac_mmc_update update
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start(*args)
- #----------- Original Method
- pac_mmc_start(*args)
- #----------- Setup window visibility
- if $game_system.menu_window_vis == false
- @gold_window.openness = @time_window.openness = @map_window.openness = 0
- end
- #----------- Setup window coordinates (y)
- @command_window.y = (Graphics.height - @command_window.height) / 2
- @map_window.y = @command_window.height + @command_window.y
- @gold_window.y = @map_window.y
- @gold_window.y += @map_window.height if PAC::MM::Map_Window
- @time_window.y = @command_window.y - @time_window.height
- #----------- Setup window coordinates (x)
- @windows = [@command_window, @gold_window, @time_window, @map_window]
- unless @@start_personal
- @status_window.hide
- @status_window.openness = 0
- @windows.each do |window| window.x = (Graphics.width -
- @command_window.width) / 2 end
- else
- @windows.each do |window| window.x = PAC::MM::Windows_Pos == :right ?
- Graphics.width - @command_window.width : 0 end
- end
- end
- #--------------------------------------------------------------------------
- # * [Skill], [Equipment] and [Status] Commands
- #--------------------------------------------------------------------------
- def command_personal(*args)
- pac_mmc_open_status
- pac_mmc_comper(*args)
- end
- #--------------------------------------------------------------------------
- # * [Cancel] Personal Command
- #--------------------------------------------------------------------------
- def on_personal_cancel(*args)
- pac_mmc_close_status
- pac_mmc_opc(*args)
- end
- #--------------------------------------------------------------------------
- # * [Formation] Command
- #--------------------------------------------------------------------------
- def command_formation(*args)
- pac_mmc_open_status
- pac_mmc_comfor(*args)
- end
- #--------------------------------------------------------------------------
- # * Formation [Cancel]
- #--------------------------------------------------------------------------
- def on_formation_cancel(*args)
- pac_mmc_close_status
- pac_mmc_ofc(*args)
- end
- #--------------------------------------------------------------------------
- # * Open Status Window
- #--------------------------------------------------------------------------
- def pac_mmc_open_status
- c = 0
- c = Graphics.width - @command_window.width if PAC::MM::Windows_Pos == :right
- unless @command_window.x == c
- s = PAC::MM::Compact::Move_Speed
- s *= -1 if PAC::MM::Windows_Pos != :right
- c = 0
- c = Graphics.width - @command_window.width if PAC::MM::Windows_Pos == :right
- begin
- @windows.each do |window| window.x += s end
- Graphics.update
- end until PAC::MM::Windows_Pos == :right ? @command_window.x >= c :
- @command_window.x <= c
- @windows.each do |window| window.x = c end
- end
- @status_window.show if @status_window.visible == false
- @status_window.open if @status_window.openness == 0
- end
- #--------------------------------------------------------------------------
- # * Close Status Window
- #--------------------------------------------------------------------------
- def pac_mmc_close_status
- @status_window.close
- begin; @status_window.update; Graphics.update
- end until @status_window.openness == 0
- s = PAC::MM::Compact::Move_Speed
- s *= -1 if PAC::MM::Windows_Pos == :right
- c = (Graphics.width - @command_window.width) / 2
- begin
- @windows.each do |window| window.x += s end
- Graphics.update
- end until PAC::MM::Windows_Pos == :right ? @command_window.x <= c :
- @command_window.x >= c
- @windows.each do |window| window.x = c end
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update(*args)
- pac_mmc_update(*args)
- update_window_vis
- end
- #--------------------------------------------------------------------------
- # * Update Window Visibility
- #--------------------------------------------------------------------------
- def update_window_vis
- if PAC::MM::Compact::Show_Button != nil &&
- Input.trigger?(PAC::MM::Compact::Show_Button)
- Sound.play_cursor
- win = [@gold_window, @map_window, @time_window]
- if @gold_window.open?
- win.each do |window| window.close end
- $game_system.menu_window_vis = false
- else
- win.each do |window| window.open end
- $game_system.menu_window_vis = true
- end
- end
- end
- end
- $pac[:compact] = 1.0
- end
- #===============================================================================
- #
- # END OF SCRIPT
- #
- #===============================================================================
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement