Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Window_SystemOptions < Window_Command
- #--------------------------------------------------------------------------
- # * Move Cursor Down
- #--------------------------------------------------------------------------
- def cursor_down(wrap = false)
- if index < item_max - col_max || (wrap && col_max == 1)
- select((index + col_max) % item_max)
- cursor_down(wrap) if current_symbol == :blank
- end
- end
- #--------------------------------------------------------------------------
- # * Move Cursor Up
- #--------------------------------------------------------------------------
- def cursor_up(wrap = false)
- if index >= col_max || (wrap && col_max == 1)
- select((index - col_max + item_max) % item_max)
- cursor_up(wrap) if current_symbol == :blank
- end
- end
- #--------------------------------------------------------------------------
- # * Get Rectangle for Drawing Items
- #--------------------------------------------------------------------------
- def item_rect(index)
- lines = YEA::SYSTEM::COMMANDS.size
- h = (height - lines * line_height - line_height) / 2
- rect = Rect.new
- rect.width = item_width
- rect.height = item_height
- rect.x = index % col_max * (item_width + spacing)
- rect.y = index / col_max * item_height + h
- rect
- end
- #--------------------------------------------------------------------------
- # * Draw Horizontal Line
- #--------------------------------------------------------------------------
- def draw_horz_line(y)
- line_y = y + line_height / 2 - 1
- contents.fill_rect(0, line_y, contents_width, 2, line_color)
- end
- #--------------------------------------------------------------------------
- # * Get Color of Horizontal Line
- #--------------------------------------------------------------------------
- def line_color
- color = normal_color
- color.alpha = 48
- color
- end
- #--------------------------------------------------------------------------
- # draw_item
- #--------------------------------------------------------------------------
- def draw_item(index)
- reset_font_settings
- rect = item_rect(index)
- contents.clear_rect(rect)
- case @list[index][:symbol]
- when :blank
- draw_horz_line(rect.y)
- when :window_red, :window_grn, :window_blu
- draw_window_tone(rect, index, @list[index][:symbol])
- when :volume_bgm, :volume_bgs, :volume_sfx
- draw_volume(rect, index, @list[index][:symbol])
- when :autodash, :instantmsg, :animations
- draw_toggle(rect, index, @list[index][:symbol])
- when :to_title, :shutdown
- draw_text(item_rect_for_text(index), command_name(index), 1)
- when :custom_switch
- draw_custom_switch(rect, index, @list[index][:ext])
- when :custom_variable
- draw_custom_variable(rect, index, @list[index][:ext])
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment