Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #======================#
- # Z-Systems by: Zetu #
- #===========================#======================#===========================#
- # * * * Neo Menu System - LITE v1.09 * * * #
- #=#==========================================================================#=#
- # This script allows easy customization to you menu commands. The way it #
- # works is, the array 'MENU_ITEMS' stores all commands and the hash #
- # 'COMMAND' will run the script on that command's selection. If the #
- # COMMAND of the item contains '@status_window.index', then it will #
- # prompt you to select an actor, and if it exists in DISABLES and the #
- # statement is true, then the item will be disabled. #
- #--------------------------------------------------------------------------#
- # From the free customization of this script, you can add/remove/change #
- # order of the menu items. When you add a new item (from another #
- # script), you MUST add a new item in the COMMAND hash. #
- #--------------------------------------------------------------------------#
- # Tip on finding the code within a script: #
- # Use Ctrl+F '$scene ='. This should be able to locate the call method #
- # used in most every script. #
- #==========================================================================#
- $zsys = {} if $zsys == nil
- $zsys["Menu"] = true
- module Z_Systems
- module NeoMenu
- #Items in Menu
- MENU_ITEMS = [
- 'Item',
- 'Skill',
- 'Equip',
- 'Status',
- 'Save',
- 'End Game'
- ]
- #Script to Run once Menu Item is selected
- #If script includes '@status_window.index', it will prompt you to
- # select an actor.
- COMMAND = {
- 'Item' => '$scene = Scene_Item.new',
- 'Skill' => '$scene = Scene_Skill.new(@status_window.index)',
- 'Equip' => '$scene = Scene_Equip.new(@status_window.index)',
- 'Status' => '$scene = Scene_Status.new(@status_window.index)',
- 'Save' => '$scene = Scene_File.new(true, false, false)',
- 'End Game' => '$scene = Scene_End.new',
- #From Popular Scripts (Must have approprate script installed)
- # KCG Large Party: (Capatability still in BETA/May not work in all layouts)
- 'Party' => '$scene = Scene_PartyForm.new(0, Scene_PartyForm::HOST_MAP)'}
- #Expression that tests if script is to be disabled.
- DISABLES = {#Disable option if true.
- #This shows disabling if Save Game is disabled.
- 'Save' => '$game_system.save_disabled',
- #This shows disabling if game switch id 11 if off.
- 'Example1' => '$game_switches[11] == false',
- #This shows disabling if variable id 1 is equal to or larger than 8.
- 'Example2' => '$game_variables[1] >= 8'}
- ICONS = { #Optional: Will not display an icon if nil.
- 'Item' => 144,
- 'Skill' => 137,
- 'Equip' => 1,
- 'Status' => 130,
- 'Save' => 200,
- 'End Game' => 224,
- 'Party' => 96,
- 'Clan' => 176}
- module Index
- ITEM = Z_Systems::NeoMenu::MENU_ITEMS.index('Item')
- SKILL = Z_Systems::NeoMenu::MENU_ITEMS.index('Skill')
- EQUIP = Z_Systems::NeoMenu::MENU_ITEMS.index('Equip')
- STATUS = Z_Systems::NeoMenu::MENU_ITEMS.index('Status')
- SAVE = Z_Systems::NeoMenu::MENU_ITEMS.index('Save')
- ENDGAME = Z_Systems::NeoMenu::MENU_ITEMS.index('End Game')
- end
- #========#======================#====#================================#========#
- #--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
- #--------# End of Customization #----# Editing will cause death by #--------#
- #--------# #----# brain asplosions. #--------#
- #========#======================#====#================================#========#
- end
- end
- $zsys = {} if $zsys == nil
- $zsys["Menu"] = true
- class Scene_Menu < Scene_Base
- def create_command_window
- menuitems = Z_Systems::NeoMenu::MENU_ITEMS
- @command_window = Window_CommandNMS.new(160, menuitems)
- @command_window.index = @menu_index
- zs_nms_disable
- end
- def zs_nms_disable
- if $game_party.members.size == 0
- for i in 0...Z_Systems::NeoMenu::MENU_ITEMS.size
- command = Z_Systems::NeoMenu::MENU_ITEMS[i]
- if needs_selection?(command)
- @command_window.draw_item(i, false)
- end
- end
- end
- for i in 0...Z_Systems::NeoMenu::MENU_ITEMS.size
- command = Z_Systems::NeoMenu::MENU_ITEMS[i]
- if Z_Systems::NeoMenu::DISABLES.key?(command)
- @command_window.draw_item(i, false) if eval(Z_Systems::NeoMenu::DISABLES[command])
- end
- end
- end
- def needs_selection?(command)
- return Z_Systems::NeoMenu::COMMAND[command].include?('@status_window.index')
- end
- def update_command_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- selection = Z_Systems::NeoMenu::MENU_ITEMS[@command_window.index]
- if $game_party.members.size == 0 and needs_selection?(selection)
- Sound.play_buzzer
- return
- elsif Z_Systems::NeoMenu::DISABLES.key?(selection)
- if eval(Z_Systems::NeoMenu::DISABLES[selection])
- Sound.play_buzzer
- return
- end
- end
- Sound.play_decision
- selection = Z_Systems::NeoMenu::MENU_ITEMS[@command_window.index]
- if needs_selection?(selection)
- start_actor_selection
- else
- eval(Z_Systems::NeoMenu::COMMAND[selection])
- end
- end
- end
- def update_actor_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_actor_selection
- elsif Input.trigger?(Input::C)
- selection = Z_Systems::NeoMenu::MENU_ITEMS[@command_window.index]
- $game_party.last_actor_index = @status_window.index
- Sound.play_decision
- eval(Z_Systems::NeoMenu::COMMAND[selection])
- end
- end
- end
- class Scene_Base
- def dispose_menu_background
- @menuback_sprite.dispose if @menuback_sprite != nil
- end
- end
- #-------------------------------------------------------------------------------
- #Indexing Fix. All default return_scene's have been OVERWRITE
- class Scene_Item < Scene_Base
- def return_scene
- $scene = Scene_Menu.new(Z_Systems::NeoMenu::Index::ITEM)
- end
- end
- class Scene_Skill < Scene_Base
- def return_scene
- $scene = Scene_Menu.new(Z_Systems::NeoMenu::Index::SKILL)
- end
- end
- class Scene_Equip < Scene_Base
- def return_scene
- $scene = Scene_Menu.new(Z_Systems::NeoMenu::Index::EQUIP)
- end
- end
- class Scene_Status < Scene_Base
- def return_scene
- $scene = Scene_Menu.new(Z_Systems::NeoMenu::Index::STATUS)
- end
- end
- class Scene_Status < Scene_Base
- def return_scene
- $scene = Scene_Menu.new(Z_Systems::NeoMenu::Index::ENDGAME)
- end
- end
- class Scene_File < Scene_Base
- def return_scene
- if @from_title
- $scene = Scene_Title.new
- elsif @from_event
- $scene = Scene_Map.new
- else
- $scene = Scene_Menu.new(Z_Systems::NeoMenu::Index::SAVE)
- end
- end
- end
- #-------------------------------------------------------------------------------
- class Window_CommandNMS < Window_Selectable
- 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
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- 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 Z_Systems::NeoMenu::ICONS[@commands[index]] != nil
- draw_icon(Z_Systems::NeoMenu::ICONS[@commands[index]], rect.x, rect.y)
- rect.x += 24
- end
- self.contents.draw_text(rect, @commands[index])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement