module IMP1_Storage_Boxes # Lines to show for the help window. HELP_WINDOW_LINES = 2end#==============================================================================# Scene_ItemStorage#==============================================================================class Scene_ItemStorage < Scene_MenuBase #-------------------------------------------------------------------------- # Creates windows. - !!UPDATED!! #-------------------------------------------------------------------------- alias sixth_theo_invpatch122 create_windows def create_windows if $imported[:Theo_LimInventory] @old_inv = $game_party.total_inv_size @bag_window = Window_ItemStorageLeft.new @box_window = Window_ItemStorageRight.new(@box_id) @help_window = Window_Help.new(IMP1_Storage_Boxes::HELP_WINDOW_LINES) @bag_title = Window_BoxTitle.new(0, IMP1_Storage_Boxes:

ARTY_NAME,nil,@old_inv) @box_title = Window_BoxTitle.new((Graphics.width/2), IMP1_Storage_Boxes::BOXES[@box_id][:name], @box_id,@old_inv) @box_window.help_window = @help_window @bag_window.help_window = @help_window @bag_window.help_window.back_opacity = 200 @taking = false if $game_boxes.full?(@box_id) if @taking @box_window.activate.select_last @bag_window.deactivate.select_last else @bag_window.activate.select_last @box_window.deactivate.select_last end else sixth_theo_invpatch122 end end #-------------------------------------------------------------------------- # Move item from one side to the other. - !!UPDATED!! #-------------------------------------------------------------------------- alias sixth_galv_indi122 move_item def move_item if $imported[:Theo_LimInventory] if @box_window.active item = @box_window.item if @box_window.index < 0 or item.nil? || $game_party.inv_maxed? || $game_party.total_inv_size + item.inv_size > $game_party.inv_max Sound.play_buzzer else Sound.play_ok @old_inv = $game_party.total_inv_size $game_boxes.remove_item(item, 1, @box_id) $game_party.gain_item(item, 1) end else item = @bag_window.item if @bag_window.index < 0 or item.nil? Sound.play_buzzer elsif !$game_boxes.space?(@box_id) or !@bag_window.enable?(item) Sound.play_buzzer else Sound.play_ok @old_inv = $game_party.total_inv_size $game_party.lose_item(item, 1) $game_boxes.add_item(item, 1, @box_id) end end else sixth_galv_indi122 end refresh_new if $imported["Galv_New_Item_Indicator"] end #-------------------------------------------------------------------------- # Refreshes new indicator. - !!NEW!! #-------------------------------------------------------------------------- def refresh_new @item_window.refresh if @item_window @box_window.refresh if @box_window @bag_window.refresh if @bag_window endend#==============================================================================# Window_Item_StorageLeft - !!UPDATED!!#==============================================================================class Window_ItemStorageLeft < Window_ItemList #-------------------------------------------------------------------------- # Edited to make there only one column, to change the positioning and make # it inactive by default. #-------------------------------------------------------------------------- def initialize y = line_height*IMP1_Storage_Boxes::HELP_WINDOW_LINES+24+fitting_height(1) super(0, y, Graphics.width/2, Graphics.height-y) refresh endend#==============================================================================# Window_ItemStorageRight - !!UPDATED!!#==============================================================================class Window_ItemStorageRight < Window_ItemList #-------------------------------------------------------------------------- # Edited to make there only one column, to change the positioning and make # it inactive by default. #-------------------------------------------------------------------------- def initialize(box_id) @box_id = box_id y = line_height*IMP1_Storage_Boxes::HELP_WINDOW_LINES+24+fitting_height(1) super(Graphics.width/2, y, Graphics.width/2, Graphics.height-y) refresh endend#==============================================================================# Window_BoxTitle - !!UPDATED!!#==============================================================================class Window_BoxTitle < Window_Base #-------------------------------------------------------------------------- # Initialization. - !!UPDATED!! #-------------------------------------------------------------------------- def initialize(x, t, box = nil, old_inv=nil) super(x, line_height*IMP1_Storage_Boxes::HELP_WINDOW_LINES + 24, Graphics.width/2, fitting_height(1)) @box = box @t = t @old_inv = old_inv refresh #draw_contents end #-------------------------------------------------------------------------- # Frame update. - !!UPDATED!! #-------------------------------------------------------------------------- def update super if !@box.nil? a = $game_boxes.how_full(@box, true) != @text b = $game_boxes.how_full(@box, false) != @text if a and b self.contents.clear refresh end elsif @old_inv != $game_party.total_inv_size && $imported[:Theo_LimInventory] refresh @old_inv = $game_party.total_inv_size end end #-------------------------------------------------------------------------- # Draws the contents. - !!UPDATED!! #-------------------------------------------------------------------------- def refresh #draw_contents(dull = false) contents.clear if not @box.nil? and IMP1_Storage_Boxes::BOXES[@box][:size] != 0 @text = $game_boxes.how_full(@box, true) draw_text(0, 0, (Graphics.width/2)-32, line_height, @text, 2) elsif not @box.nil? @text = $game_boxes.how_full(@box, false) draw_text(0, 0, (Graphics.width/2)-32, line_height, @text, 2) elsif @box.nil? && $imported[:Theo_LimInventory] x = contents.width/3 draw_inv_info(0,0,contents.width) else self.contents.draw_text(0, 0, (Graphics.width/2)-32, line_height, @t) end end end# Window_BoxTitle