Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # Compact Menu System
- # 22/8/2011 - Pacman
- # Paste above main and below any scripts that alter the menu. This script was
- # first intended for usage with PAC Main Menu, but it works perfectly fine
- # standalone.
- # Edit the configuration module as you see fit below. I think I've explained
- # everything pretty thoroughly.
- #
- #===============================================================================
- module PAC
- module MM
- # 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)
- GOLD_BUTTON = Input::L
- # Start scene with gold window visible? (true / false)
- START_GOLD_WINDOW = true
- end
- end
- #===============================================================================
- #
- # Why would you even think about editing this?
- #
- #===============================================================================
- $imported = {} unless $imported
- $imported["PAC Compact Menu"] = true
- #==============================================================================
- # ** Scene_Menu
- #------------------------------------------------------------------------------
- # This class performs the menu screen processing.
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # Include configuration data
- #--------------------------------------------------------------------------
- include PAC::MM
- #--------------------------------------------------------------------------
- # 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
- #--------------------------------------------------------------------------
- # * Start Processing
- #--------------------------------------------------------------------------
- def start
- pac_compact_start
- pac_compact_windows
- end
- #--------------------------------------------------------------------------
- # * Make Windows Compact
- #--------------------------------------------------------------------------
- def pac_compact_windows
- @command_window.x = Graphics.width / 2 - @command_window.width / 2
- @gold_window.visible = START_GOLD_WINDOW
- @gold_window.x = @command_window.x
- @gold_window.openness = START_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
- #--------------------------------------------------------------------------
- # * 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?(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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement