Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ╔═════════════════════════════════════╦════════════════════╗
- # ║ Title: KFBQ Battle Item Override ║ Version: 1.00 ║
- # ║ Author: Roninator2 ║ ║
- # ╠═════════════════════════════════════╬════════════════════╣
- # ║ Function: ║ Date Created ║
- # ║ ╠════════════════════╣
- # ║ FFMQ Style Battle Items ║ 12 Mar 2023 ║
- # ╚═════════════════════════════════════╩════════════════════╝
- # ╔══════════════════════════════════════════════════════════╗
- # ║ Instructions: ║
- # ║ ║
- # ║ none ║
- # ╚══════════════════════════════════════════════════════════╝
- # ╔══════════════════════════════════════════════════════════╗
- # ║ Terms of use: ║
- # ║ Free for all uses in RPG Maker - Except nudity ║
- # ╚══════════════════════════════════════════════════════════╝
- #==============================================================================
- # ** Window_BattleItem
- #==============================================================================
- class KFBQ_BattleItem < Window_ItemList
- #--------------------------------------------------------------------------
- # * Object Initialization
- # info_viewport : Viewport for displaying information
- #--------------------------------------------------------------------------
- def initialize(help_window, info_viewport)
- super(250, 280, 280, 100)
- self.visible = false
- self.tone.set(Color.new(0,0,0))
- self.opacity = 255
- self.back_opacity = 255
- self.contents_opacity = 255
- self.z = 400
- @help_window = help_window
- @info_viewport = info_viewport
- update_padding
- @data = []
- select(0)
- end
- #--------------------------------------------------------------------------
- # * Include in Item List?
- #--------------------------------------------------------------------------
- def include?(item)
- $game_party.usable?(item)
- end
- #--------------------------------------------------------------------------
- # * Show Window
- #--------------------------------------------------------------------------
- def show
- select_last
- @help_window.show
- super
- end
- #--------------------------------------------------------------------------
- # * Hide Window
- #--------------------------------------------------------------------------
- def hide
- @help_window.hide
- super
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- make_item_list
- create_contents
- draw_all_items
- call_update_help
- end
- #--------------------------------------------------------------------------
- # * Calculate Height of Window Contents
- #--------------------------------------------------------------------------
- def standard_padding
- return 18
- end
- #--------------------------------------------------------------------------
- # * Get Digit Count
- #--------------------------------------------------------------------------
- def col_max
- return 4
- end
- #--------------------------------------------------------------------------
- # * Item Rect
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = Rect.new
- rect.width = 60
- rect.height = 60
- rect.x = index % col_max * (60)
- rect.y = index / col_max * (60) - 2
- rect
- end
- #--------------------------------------------------------------------------
- # * Create Skill List
- #--------------------------------------------------------------------------
- def make_item_list
- @data = $game_party.all_items.select {|item| include?(item) }
- @data.push(nil) if include?(nil)
- end
- #--------------------------------------------------------------------------
- # * Update Cursor
- #--------------------------------------------------------------------------
- def update_cursor
- ensure_cursor_visible
- cursor_rect.set(item_rect(@index))
- cursor_rect.y += 2
- end
- end
- #==============================================================================
- # ** Window_Item_Command
- #==============================================================================
- class KFBQ_Item_Command < Window_Base
- #--------------------------------------------------------------------------
- # * Iniatilize
- #--------------------------------------------------------------------------
- def initialize
- super(40, 280, 200, fitting_height(1))
- self.tone.set(Color.new(-255,-255,-255))
- self.opacity = 255
- self.arrows_visible = false
- self.pause = false
- self.back_opacity = 255
- self.contents_opacity = 255
- refresh
- end
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- def dispose
- contents.dispose unless disposed?
- super unless disposed?
- end
- #--------------------------------------------------------------------------
- # * Refresh
- #--------------------------------------------------------------------------
- def refresh
- contents.clear
- name = "Item"
- draw_text(0, 0, 180, line_height, name, 1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement