Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Animated_Menu
- module Specs
- #------------------------------------------------------------------------
- # * Command Window Position & Size
- #------------------------------------------------------------------------
- Command_Window_X = 2
- Command_Window_Y = 330
- Command_Window_Z = 8
- Command_Window_Height = 200
- Command_Window_Width = 544
- #------------------------------------------------------------------------
- # * Command Window Opacity & Back Opacity
- #------------------------------------------------------------------------
- Command_Window_Opacity = 0
- Command_Window_Back_Opacity = 0
- #------------------------------------------------------------------------
- # * Command Rect for Background
- #------------------------------------------------------------------------
- Command_Window_Rect_Width = 640
- Command_Window_Rect_Height = 480
- Command_Window_Spacing = 2
- #------------------------------------------------------------------------
- # * Command Images
- #------------------------------------------------------------------------
- Command_Window_Images = {
- "itemof" => { :ox => 0, :oy => 0 },
- "saveof" => { :ox => 0, :oy => 0 },
- "outof" => { :ox => 0, :oy => 0 },
- "arataoff" => { :ox => 0, :oy => 0 }
- }
- end
- end
- module U1G
- XPos = 0 # The X Position of the Menu
- YPos = 480 # The Y Position of the Menu
- Width = 545 # The Width of the Menu
- Height = 50 # The Height of the Menu
- ItemsComm = "Ite2134ms" # The name of the Items Command
- SaveComm = "Save" # The name of the Save Command
- EquipComm = "Equip" # The name of the Equip Command
- GEComm = "Game End"# The name of the Game End Command
- end
- #===============================================================================
- # END CUSTOMIZABLE SECTION
- #===============================================================================
- class Window_U1G_Menu < Window_HorzCommand
- include Animated_Menu::Specs
- #--------------------------------------------------------------------------
- # Loading Size Information
- #--------------------------------------------------------------------------
- def initialize(x, y, width, height)
- @window_width = width
- @window_height = height
- @command = {}
- super(x, y)
- end
- #--------------------------------------------------------------------------
- # Loading Window Width
- #--------------------------------------------------------------------------
- def window_width
- @window_width
- end
- #--------------------------------------------------------------------------
- # Loading Window Height
- #--------------------------------------------------------------------------
- def window_height
- @window_height
- end
- #--------------------------------------------------------------------------
- # Making Command List
- #--------------------------------------------------------------------------
- def make_command_list
- add_command(U1G::ItemsComm, :item)
- add_command(U1G::SaveComm, :save)
- add_command(U1G::EquipComm, :equip)
- add_command(U1G::GEComm, :game_end)
- draw_command_images
- end
- def update
- move_up
- super
- end
- def dispose
- super
- dispose_item_images if @command != nil
- end
- def dispose_item_images
- @command.each_key { |i|
- @command[i].bitmap.dispose
- @command[i].dispose
- }
- end
- #--------------------------------------------------------------------------
- # * Draw Command Image
- #--------------------------------------------------------------------------
- def draw_command_images
- width = Command_Window_Rect_Width + Command_Window_Spacing
- height = Command_Window_Rect_Height + Command_Window_Spacing
- Command_Window_Images.each_key { |i|
- @command[i] = Sprite.new
- @command[i].bitmap = Cache.title1(i)
- @command[i].ox = Command_Window_Images[i][:ox]
- @command[i].oy = Command_Window_Images[i][:oy]
- }
- end
- #--------------------------------------------------------------------------
- # * Initialize Animation Method: Move Left for girl
- #--------------------------------------------------------------------------
- #--------------------------------------------------------------------------
- # * Initialize Animation Method: Move Up
- #--------------------------------------------------------------------------
- def move_up
- if self.y >= 40
- case
- when self.y > 40
- self.y -= 3
- end
- end
- end
- end
- class Scene_Map < Scene_Base
- #--------------------------------------------------------------------------
- # "Initialazing" Menu
- #--------------------------------------------------------------------------
- alias :u1g_call_menu call_menu
- def call_menu
- u1g_call_menu
- Sound.play_ok
- SceneManager.call(Scene_U1G_Menu)
- Window_MenuCommand::init_command_position
- end
- end
- class Scene_U1G_Menu < Scene_MenuBase
- #--------------------------------------------------------------------------
- # Starting Menu
- #--------------------------------------------------------------------------
- def start
- super
- create_command_window
- end
- #--------------------------------------------------------------------------
- # Creating Commands
- #--------------------------------------------------------------------------
- def create_command_window
- @command_window = Window_U1G_Menu.new(U1G::XPos,U1G::YPos,U1G::Width,U1G::Height)
- @command_window.set_handler(:item, method(:command_item))
- @command_window.set_handler(:save, method(:command_save))
- @command_window.set_handler(:equip, method(:command_equip))
- @command_window.set_handler(:game_end, method(:command_game_end))
- @command_window.set_handler(:cancel, method(:return_scene))
- end
- #--------------------------------------------------------------------------
- # Calling Items Scene
- #--------------------------------------------------------------------------
- def command_item
- SceneManager.call(Scene_Item)
- end
- #--------------------------------------------------------------------------
- # Calling Save Scene
- #--------------------------------------------------------------------------
- def command_save
- SceneManager.call(Scene_Save)
- end
- #---------------------------------------------------------------------------
- # Calling Equip Scene
- #--------------------------------------------------------------------------
- def command_equip
- SceneManager.call(Scene_Equip)
- end
- #--------------------------------------------------------------------------
- # Calling Game End Scene
- #--------------------------------------------------------------------------
- def command_game_end
- SceneManager.call(Scene_End)
- end
- #--------------------------------------------------------------------------
- # Continue Playing
- #--------------------------------------------------------------------------
- def return_scene
- SceneManager.call(Scene_Map)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement