Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ╔═════════════════════════════════════╦════════════════════╗
- # ║ Title: KFBQ Party Command Override ║ Version: 1.00 ║
- # ║ Author: Roninator2 ║ ║
- # ╠═════════════════════════════════════╬════════════════════╣
- # ║ Function: ║ Date Created ║
- # ║ ╠════════════════════╣
- # ║ FFMQ Style Party Command ║ 12 Mar 2023 ║
- # ╚═════════════════════════════════════╩════════════════════╝
- # ╔══════════════════════════════════════════════════════════╗
- # ║ Instructions: ║
- # ║ ║
- # ║ none ║
- # ╚══════════════════════════════════════════════════════════╝
- # ╔══════════════════════════════════════════════════════════╗
- # ║ Terms of use: ║
- # ║ Free for all uses in RPG Maker - Except nudity ║
- # ╚══════════════════════════════════════════════════════════╝
- #==============================================================================
- # ** Window_PartyCommand
- #==============================================================================
- class Window_KFBQPartyCommand < Window_HorzCommand
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- super(0, 20)
- self.openness = 0
- self.z = 400
- self.opacity = 0
- self.back_opacity = 0
- self.contents_opacity = 255
- deactivate
- end
- #--------------------------------------------------------------------------
- # * Get Window Width
- #--------------------------------------------------------------------------
- def window_width
- return Graphics.width
- end
- #--------------------------------------------------------------------------
- # * Get Number of Lines to Show
- #--------------------------------------------------------------------------
- def visible_line_number
- return 1
- end
- #--------------------------------------------------------------------------
- # * Get Digit Count
- #--------------------------------------------------------------------------
- def col_max
- return 3
- end
- #--------------------------------------------------------------------------
- # * Get Spacing for Items Arranged Side by Side
- #--------------------------------------------------------------------------
- def spacing
- return 12
- end
- #--------------------------------------------------------------------------
- # * Get Item Width
- #--------------------------------------------------------------------------
- def item_width
- (width - standard_padding * 2 + spacing) / col_max - spacing
- end
- #--------------------------------------------------------------------------
- # * Calculate Width of Window Contents
- #--------------------------------------------------------------------------
- def contents_width
- (item_width + spacing) * item_max - spacing
- end
- #--------------------------------------------------------------------------
- # * Calculate Height of Window Contents
- #--------------------------------------------------------------------------
- def contents_height
- item_height
- end
- #--------------------------------------------------------------------------
- # * Get Leading Digits
- #--------------------------------------------------------------------------
- def top_col
- ox / (item_width + spacing)
- end
- #--------------------------------------------------------------------------
- # * Set Leading Digits
- #--------------------------------------------------------------------------
- def top_col=(col)
- col = 0 if col < 0
- col = col_max - 1 if col > col_max - 1
- self.ox = col * (item_width + spacing)
- end
- #--------------------------------------------------------------------------
- # * Get Trailing Digits
- #--------------------------------------------------------------------------
- def bottom_col
- top_col + col_max - 1
- end
- #--------------------------------------------------------------------------
- # * Set Trailing Digits
- #--------------------------------------------------------------------------
- def bottom_col=(col)
- self.top_col = col - (col_max - 1)
- end
- #--------------------------------------------------------------------------
- # * Scroll Cursor to Position Within Screen
- #--------------------------------------------------------------------------
- def ensure_cursor_visible
- self.top_col = index if index < top_col
- self.bottom_col = index if index > bottom_col
- end
- #--------------------------------------------------------------------------
- # * Get Rectangle for Displaying Items
- #--------------------------------------------------------------------------
- def item_rect(index)
- rect = super
- rect.x = index * (item_width + spacing) + (30 / (index + 1))
- rect.y = 0
- rect.width -= 60
- rect
- end
- #--------------------------------------------------------------------------
- # * Get Alignment
- #--------------------------------------------------------------------------
- def alignment
- return 1
- end
- #--------------------------------------------------------------------------
- # * Move Cursor Down
- #--------------------------------------------------------------------------
- def cursor_down(wrap = false)
- end
- #--------------------------------------------------------------------------
- # * Move Cursor Up
- #--------------------------------------------------------------------------
- def cursor_up(wrap = false)
- end
- #--------------------------------------------------------------------------
- # * Move Cursor One Page Down
- #--------------------------------------------------------------------------
- def cursor_pagedown
- end
- #--------------------------------------------------------------------------
- # * Move Cursor One Page Up
- #--------------------------------------------------------------------------
- def cursor_pageup
- end
- #--------------------------------------------------------------------------
- # * Create Command List
- #--------------------------------------------------------------------------
- def make_command_list
- add_command("Battle", :fight)
- add_command("Run", :escape)
- add_command("Control", :control)
- end
- #--------------------------------------------------------------------------
- # * Setup
- #--------------------------------------------------------------------------
- def setup
- clear_command_list
- make_command_list
- refresh
- select(0)
- activate
- open
- end
- #--------------------------------------------------------------------------
- # * Update Cursor
- #--------------------------------------------------------------------------
- def update_cursor
- if @index < 0
- cursor_rect.empty
- else
- ensure_cursor_visible
- cursor_rect.set(item_rect(@index))
- case index
- when 1
- cursor_rect.x -= 3
- when 2
- cursor_rect.x -= 9
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement