#============================================================================== # Mirak's Simple Menu System # # Meant for walking simulator-type games that only use the item screen. # Post it under materials. It adapts to a 640 x 480 resolution. # This script uses variables #0005 and #0006. Change only if you know how. # # Variable #0005 allows and disallows saving. # Set it to 1 to allow saving, and 0 to disallow. # # Include a picture called bd_pauselogo.png inside the picture folder. # Feel free to use included template for properly placing your logo. # # # https://rpgmaker.net/users/Mirak/ # # #============================================================================== # Making sure screen size is correct Graphics.resize_screen(640, 480) # Changing default font and initializing window Font.default_name = ["04b03"] Font.default_size = 16 class Window_Logo < Window_Base def initialize super(0, 0, Graphics.width, Graphics.height) self.windowskin = nil #Cache.system("Window") self.z = 0 self.back_opacity = 255 update_padding update_tone create_contents @opening = @closing = false end end #============================================================================== # ** Scene_Item #------------------------------------------------------------------------------ # This class performs the item screen processing. #============================================================================== class Scene_Item < Scene_ItemBase #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super create_help_window create_category_window create_item_window end #-------------------------------------------------------------------------- # * Create Category Window #-------------------------------------------------------------------------- def create_category_window #@category_window = Window_ItemCategory.new #@category_window.viewport = @viewport #@category_window.help_window = @help_window #@category_window.y = @help_window.height #@category_window.set_handler(:ok, method(:on_category_ok)) #@category_window.set_handler(:cancel, method(:return_scene)) end #-------------------------------------------------------------------------- # * Create Item Window #-------------------------------------------------------------------------- def create_item_window x = 0 y = @help_window.height w = Graphics.width h = Graphics.height - y @item_window = Window_ItemList.new(x,y,w,h) @item_window.set_handler(:ok, method(:on_item_ok)) @item_window.set_handler(:cancel, method(:on_item_cancel)) @item_window.help_window = @help_window # Marked line 1! o.o @item_window.category = :item # Marked line 2! - Can be :key_item if needed. @item_window.viewport = @viewport @item_window.activate @item_window.select_last @description.refresh(@item_window.item) if @description end #-------------------------------------------------------------------------- # * Category [OK] #-------------------------------------------------------------------------- def on_category_ok @item_window.activate @item_window.select_last end #-------------------------------------------------------------------------- # * Item [OK] #-------------------------------------------------------------------------- def on_item_ok $game_party.last_item.object = item determine_item end #-------------------------------------------------------------------------- # * Item [Cancel] #-------------------------------------------------------------------------- def on_item_cancel @item_window.unselect return_scene end #-------------------------------------------------------------------------- # * Play SE When Using Item #-------------------------------------------------------------------------- def play_se_for_item Sound.play_use_item end #-------------------------------------------------------------------------- # * Use Item #-------------------------------------------------------------------------- def use_item super @item_window.redraw_current_item end end $common_event_number = 1 #---------------------------------------------------------------------------- # EDIT AT YOUR OWN RISK #---------------------------------------------------------------------------- class Window_Command < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y) clear_command_list make_command_list super(x, y, window_width, window_height) self.x = 80 self.y = 60 refresh select(0) activate end end class Window_ItemList < Window_Selectable #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, width, height) super self.x = 80 self.y = 60 self.width = 480 self.height = 255 @category = :none @data = [] end end class Window_MenuCommand < Window_Command def window_width return 100 end alias make_command_list make_command_list def make_command_list add_main_commands add_original_commands add_game_end_command end alias add_main_commands add_main_commands def add_main_commands add_command(Vocab::item, :item, main_commands_enabled) end alias soul_ce_add_original_commands add_original_commands def add_original_commands add_command("Save", :common_events_menu, main_commands_enabled) soul_ce_add_original_commands end end class Window_Gold < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0, window_width, fitting_height(1) ) refresh end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 100 end end #-----YYYYYY------ class Window_Help < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(line_number = 2) super(80, 315, 480, fitting_height(line_number)) end end class Window_ChoiceList < Window_Command #-------------------------------------------------------------------------- # * Update Window Position #-------------------------------------------------------------------------- def update_placement self.width = [max_choice_width + 12, 96].max + padding * 2 self.width = [width, Graphics.width].min self.height = fitting_height($game_message.choices.size) self.x = (Graphics.width/2) - (width/2) self.y = (Graphics.height/2) - (height/2) end end class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super create_command_window create_gold_window create_logo end alias create_command_window create_command_window def create_command_window @command_window = Window_MenuCommand.new @command_window.set_handler(:item, method(:command_item)) @command_window.set_handler(:game_end, method(:command_game_end)) @command_window.set_handler(:cancel, method(:return_scene)) end alias soul_create_command_window create_command_window def create_command_window soul_create_command_window @command_window.set_handler(:common_events_menu, method(:command_ce)) end def command_ce SceneManager.goto(Scene_Map) $game_temp.reserve_common_event($common_event_number) end def create_gold_window @gold_window = Window_Gold.new @gold_window.x = 80 @gold_window.y = 160 end def create_logo @logo = Window_Logo.new bitmap = Cache.picture("bd_pauselogo.png") @logo.contents.blt(0, 0, bitmap, bitmap.rect) end #-------------------------------------------------------------------------- # * [Item] Command #-------------------------------------------------------------------------- alias command_item command_item def command_item SceneManager.call(Scene_Item) end def on_load_ok SceneManager.call(Scene_Load) end def command_save SceneManager.call(Scene_Save) end #-------------------------------------------------------------------------- # * [Exit Game] Command #-------------------------------------------------------------------------- alias command_game_end command_game_end def command_game_end SceneManager.call(Scene_End) end end class Window_ItemCategory < Window_HorzCommand alias col_max col_max def col_max return 1 end alias make_command_list make_command_list def make_command_list add_command(Vocab::item, :item) end end class Window_ItemList < Window_Selectable alias include? include? def include?(item) case @category when :item item.is_a?(RPG::Item) && !item.key_item? else false end end end