Skip to content

Commit

Permalink
[Multiple Cols]: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyMalkieri committed Aug 11, 2013
1 parent 41ec273 commit 920e8c6
Showing 1 changed file with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#==========================================
# Multiple Cols Command Window
# Multiple Cols In Selectable
#==========================================
# by bStefan aka. regendo
# requested by monstrumgod
Expand All @@ -25,8 +25,7 @@
# def give_item
# #code
# end
# 5. ???
# 6. Profit.
# 5. Enjoy
#============================================================


Expand All @@ -46,39 +45,33 @@ module Horizontal_Command
#==============

#spacing in pixels
def self.spacing
32
end
SPACING = 32

#padding in pixels
def self.standard_padding
12
end
PADDING = 12

#number of columns if no number is given upon calling intialize
def self.standard_cols
2
end
COLS = 2
end
end
#==============
# Script
#==============
class Window_HorizontalCommand < Window_Command
def initialize(x = 0, y = 0, cols = standard_cols, width = "fitting")
def initialize(x = 0, y = 0, cols = standard_cols, width = :fitting)
col_max(cols)
@list = []
make_command_list
width == "fitting" ? window_width(fitting_width) : window_width(width)
width == :fitting ? window_width(fitting_width) : window_width(width)
clear_command_list
super(x, y)
end
# the value is only so that window_width can be called without specifying
# : width. Changing the standard value from 255 to something else, unless
# : it's a method, will not actually change the result.
def window_width(width = 255)
@width ? @width : @width = width
@width > Graphics.width ? @width = Graphics.width : @width
@width = width unless @width
@width = [Graphics.width, width].min
end

def col_max(cols = standard_cols)
Expand Down Expand Up @@ -111,15 +104,15 @@ def item_width
end

def spacing
Regendo::Horizontal_Command::spacing
Regendo::Horizontal_Command::SPACING
end

def standard_padding
Regendo::Horizontal_Command::standard_padding
Regendo::Horizontal_Command::PADDING
end

def standard_cols
Regendo::Horizontal_Command::standard_cols
Regendo::Horizontal_Command::COLS
end

end

0 comments on commit 920e8c6

Please sign in to comment.