Class: Window_DebugLeft

Inherits:
Window_Selectable show all
Defined in:
Window_DebugLeft.rb

Overview

** Window_DebugLeft


This window designates switch and variable blocks on the debug screen.

Constant Summary

@@last_top_row =

  • Class Variable


0
@@last_index =

For saving first line

0

Instance Attribute Summary (collapse)

Attributes inherited from Window_Selectable

#cursor_all, #cursor_fix, #help_window, #index

Instance Method Summary (collapse)

Methods inherited from Window_Selectable

#active=, #bottom_row, #bottom_row=, #call_cancel_handler, #call_handler, #call_ok_handler, #call_update_help, #cancel_enabled?, #clear_item, #col_max, #contents_height, #current_item_enabled?, #cursor_down, #cursor_left, #cursor_movable?, #cursor_pagedown, #cursor_pageup, #cursor_right, #cursor_up, #draw_all_items, #ensure_cursor_visible, #handle?, #height=, #horizontal?, #item_height, #item_rect, #item_rect_for_text, #item_width, #ok_enabled?, #page_item_max, #page_row_max, #process_cursor_move, #process_handling, #process_ok, #process_pagedown, #process_pageup, #redraw_current_item, #redraw_item, #row, #row_max, #select, #set_handler, #spacing, #top_row, #top_row=, #unselect, #update_cursor, #update_help, #update_padding, #update_padding_bottom

Methods inherited from Window_Base

#activate, #actor_name, #calc_line_height, #change_color, #close, #contents_height, #contents_width, #convert_escape_characters, #create_contents, #crisis_color, #deactivate, #dispose, #draw_actor_class, #draw_actor_face, #draw_actor_graphic, #draw_actor_hp, #draw_actor_icons, #draw_actor_level, #draw_actor_mp, #draw_actor_name, #draw_actor_nickname, #draw_actor_param, #draw_actor_simple_status, #draw_actor_tp, #draw_character, #draw_currency_value, #draw_current_and_max_values, #draw_face, #draw_gauge, #draw_icon, #draw_item_name, #draw_text, #draw_text_ex, #fitting_height, #gauge_back_color, #hide, #hp_color, #hp_gauge_color1, #hp_gauge_color2, #knockout_color, #line_height, #make_font_bigger, #make_font_smaller, #mp_color, #mp_cost_color, #mp_gauge_color1, #mp_gauge_color2, #normal_color, #obtain_escape_code, #obtain_escape_param, #open, #param_change_color, #party_member_name, #pending_color, #power_down_color, #power_up_color, #process_character, #process_draw_icon, #process_escape_character, #process_new_line, #process_new_page, #process_normal_character, #reset_font_settings, #show, #standard_padding, #system_color, #text_color, #text_size, #tp_color, #tp_cost_color, #tp_gauge_color1, #tp_gauge_color2, #translucent_alpha, #update_close, #update_open, #update_padding, #update_tone

Constructor Details

- (Window_DebugLeft) initialize(x, y)


  • Object Initialization




20
21
22
23
24
25
26
# File 'Window_DebugLeft.rb', line 20

def initialize(x, y)
  super(x, y, window_width, window_height)
  refresh
  self.top_row = @@last_top_row
  select(@@last_index)
  activate
end

Instance Attribute Details

- (Object) right_window


  • Public Instance Variables




16
17
18
# File 'Window_DebugLeft.rb', line 16

def right_window
  @right_window
end

Instance Method Details

- (Object) draw_item(index)


  • Draw Item




79
80
81
82
83
84
85
86
87
88
# File 'Window_DebugLeft.rb', line 79

def draw_item(index)
  if index < @switch_max
    n = index * 10
    text = sprintf("S [%04d-%04d]", n+1, n+10)
  else
    n = (index - @switch_max) * 10
    text = sprintf("V [%04d-%04d]", n+1, n+10)
  end
  draw_text(item_rect_for_text(index), text)
end

- (Object) item_max


  • Get Number of Items




42
43
44
# File 'Window_DebugLeft.rb', line 42

def item_max
  @item_max || 0
end

- (Object) mode


  • Get Mode




57
58
59
# File 'Window_DebugLeft.rb', line 57

def mode
  index < @switch_max ? :switch : :variable
end

- (Object) process_cancel


  • Processing When Cancel Button Is Pressed




92
93
94
95
96
# File 'Window_DebugLeft.rb', line 92

def process_cancel
  super
  @@last_top_row = top_row
  @@last_index = index
end

- (Object) refresh


  • Refresh




69
70
71
72
73
74
75
# File 'Window_DebugLeft.rb', line 69

def refresh
  @switch_max = ($data_system.switches.size - 1 + 9) / 10
  @variable_max = ($data_system.variables.size - 1 + 9) / 10
  @item_max = @switch_max + @variable_max
  create_contents
  draw_all_items
end

- (Object) top_id


  • Get ID Shown on Top




63
64
65
# File 'Window_DebugLeft.rb', line 63

def top_id
  (index - (index < @switch_max ? 0 : @switch_max)) * 10 + 1
end

- (Object) update


  • Frame Update




48
49
50
51
52
53
# File 'Window_DebugLeft.rb', line 48

def update
  super
  return unless @right_window
  @right_window.mode = mode
  @right_window.top_id = top_id
end

- (Object) window_height


  • Get Window Height




36
37
38
# File 'Window_DebugLeft.rb', line 36

def window_height
  Graphics.height
end

- (Object) window_width


  • Get Window Width




30
31
32
# File 'Window_DebugLeft.rb', line 30

def window_width
  return 164
end