# ╔═════════════════════════════════════╦════════════════════╗ # ║ Title: KFBQ Actor Command Override ║ Version: 1.00 ║ # ║ Author: Roninator2 ║ ║ # ╠═════════════════════════════════════╬════════════════════╣ # ║ Function: ║ Date Created ║ # ║ ╠════════════════════╣ # ║ FFMQ Style Actor Commands ║ 12 Mar 2023 ║ # ╚═════════════════════════════════════╩════════════════════╝ # ╔══════════════════════════════════════════════════════════╗ # ║ Instructions: ║ # ║ ║ # ║ none ║ # ╚══════════════════════════════════════════════════════════╝ # ╔══════════════════════════════════════════════════════════╗ # ║ Terms of use: ║ # ║ Free for all uses in RPG Maker - Except nudity ║ # ╚══════════════════════════════════════════════════════════╝ #============================================================================== # ■ Window_BattleCommandBlank #============================================================================== class Window_BattleCommandBlank < Window_Base #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(x, y, w, h) hgt = line_height * h + 10 super(x, y, w, hgt) end #-------------------------------------------------------------------------- # * Get Line Height #-------------------------------------------------------------------------- def line_height return 21 end end #============================================================================== # ** Window_ActorCommand #============================================================================== class Window_KFBQActorCommand < Window_HorzCommand #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0) self.opacity = 0 self.back_opacity = 0 self.z = 400 self.openness = 0 deactivate @actor = nil end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return Graphics.width end #-------------------------------------------------------------------------- # * Get Number of Lines to Show #-------------------------------------------------------------------------- def visible_line_number return 4 end #-------------------------------------------------------------------------- # * Get Row Count #-------------------------------------------------------------------------- def row_max return 2 end #-------------------------------------------------------------------------- # * Get Digit Count #-------------------------------------------------------------------------- def col_max return 2 end #-------------------------------------------------------------------------- # * Get Spacing for Items Arranged Side by Side #-------------------------------------------------------------------------- def spacing return 8 end #-------------------------------------------------------------------------- # * Calculate Width of Window Contents #-------------------------------------------------------------------------- def contents_width (item_width + spacing) * (item_max / 2) - spacing end #-------------------------------------------------------------------------- # * Calculate Height of Window Contents #-------------------------------------------------------------------------- def contents_height item_height * 4 end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list return unless @actor add_attack_command add_spell_command add_item_command add_guard_command end #-------------------------------------------------------------------------- # * Add Attack Command to List #-------------------------------------------------------------------------- def add_attack_command add_command("Attack", :attack, @actor.attack_usable?) end #-------------------------------------------------------------------------- # * Add Attack Command to List #-------------------------------------------------------------------------- def add_spell_command add_command("Spell", :spell) end #-------------------------------------------------------------------------- # * Add Item Command to List #-------------------------------------------------------------------------- def add_item_command add_command("Item", :item) end #-------------------------------------------------------------------------- # * Add Guard Command to List #-------------------------------------------------------------------------- def add_guard_command add_command("Defense", :guard, @actor.guard_usable?) end #-------------------------------------------------------------------------- # * Setup #-------------------------------------------------------------------------- def setup(actor) @actor = actor clear_command_list make_command_list refresh select(0) activate open end #-------------------------------------------------------------------------- # * Draw Item #-------------------------------------------------------------------------- def draw_item(index) change_color(normal_color, command_enabled?(index)) draw_text(item_rect_for_text(index), command_name(index), alignment) end #-------------------------------------------------------------------------- # * Get Rectangle for Displaying Items #-------------------------------------------------------------------------- def item_rect(index) rect = Rect.new rect.width = item_width rect.height = item_height case index when 0 rect.x = 20 rect.y = 0 when 1 rect.x = 220 rect.y = 0 when 2 rect.x = 20 rect.y = 60 when 3 rect.x = 220 rect.y = 60 end rect end #-------------------------------------------------------------------------- # * Update Cursor #-------------------------------------------------------------------------- def update_cursor cursor_rect.set(item_rect(@index)) cursor_rect.width -= 150 case index when 0 cursor_rect.x = 90 cursor_rect.y = 0 when 1 cursor_rect.x = 290 cursor_rect.y = 0 when 2 cursor_rect.x = 90 cursor_rect.y = 60 when 3 cursor_rect.x = 290 cursor_rect.y = 60 end cursor_rect end #-------------------------------------------------------------------------- # * Get Alignment #-------------------------------------------------------------------------- def alignment return 1 end #-------------------------------------------------------------------------- # * Move Cursor Down #-------------------------------------------------------------------------- def cursor_down(wrap = false) case index when 0 select(2) when 1 select(3) when 2 select(0) when 3 select(1) end end #-------------------------------------------------------------------------- # * Move Cursor Up #-------------------------------------------------------------------------- def cursor_up(wrap = false) case index when 0 select(2) when 1 select(3) when 2 select(0) when 3 select(1) end end #-------------------------------------------------------------------------- # * Move Cursor Right #-------------------------------------------------------------------------- def cursor_right(wrap = false) case index when 0 select(1) when 1 select(0) when 2 select(3) when 3 select(2) end end #-------------------------------------------------------------------------- # * Move Cursor Left #-------------------------------------------------------------------------- def cursor_left(wrap = false) case index when 0 select(1) when 1 select(0) when 2 select(3) when 3 select(2) end end #-------------------------------------------------------------------------- # * Move Cursor One Page Down #-------------------------------------------------------------------------- def cursor_pagedown end #-------------------------------------------------------------------------- # * Move Cursor One Page Up #-------------------------------------------------------------------------- def cursor_pageup end end