108 lines
4.2 KiB
Ruby
108 lines
4.2 KiB
Ruby
# -*- coding: utf-8 -*-
|
|
#==============================================================================
|
|
# ** Window_HorzCommand
|
|
#------------------------------------------------------------------------------
|
|
# This is a command window for the horizontal selection format.
|
|
#==============================================================================
|
|
|
|
class Window_HorzCommand < Window_Command
|
|
#--------------------------------------------------------------------------
|
|
# * Get Number of Lines to Show
|
|
#--------------------------------------------------------------------------
|
|
def visible_line_number
|
|
return 1
|
|
end
|
|
#--------------------------------------------------------------------------
|
|
# * Get Digit Count
|
|
#--------------------------------------------------------------------------
|
|
def col_max
|
|
return 4
|
|
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 - 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)
|
|
rect.y = 0
|
|
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
|
|
end
|