#==============================================================================
# ■ Window_DebugLeft
#------------------------------------------------------------------------------
# 偵錯畫面、指定開關及變數區塊的視窗。
#==============================================================================
class Window_DebugLeft < Window_Selectable
#--------------------------------------------------------------------------
# ● 初始化物件
#--------------------------------------------------------------------------
def initialize
super(0, 0, 192, 480)
self.index = 0
refresh
end
#--------------------------------------------------------------------------
# ● 更新
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@switch_min=10
@variable_min = 20
@switch_max = 15
@variable_max = 25
@item_max = @switch_max + @variable_max-@switch_min-@variable_min
self.contents = Bitmap.new(width - 32, @item_max * 32)
for i in @switch_min...@switch_max
text = sprintf("S [%04d-%04d]", i*10+1, i*10+10)
self.contents.draw_text(4, (i-@switch_min) * 32, 152, 32, text)
end
for i in @variable_min...@variable_max
text = sprintf("V [%04d-%04d]", i*10+1, i*10+10)
self.contents.draw_text(4, (@switch_max-@switch_min + i - @variable_min) * 32, 152, 32, text)
end
end
#--------------------------------------------------------------------------
# ● 獲取模式
#--------------------------------------------------------------------------
def mode
if self.index+@switch_min < @switch_max
return 0
else
return 1
end
end
#--------------------------------------------------------------------------
# ● 獲取開頭顯示的 ID
#--------------------------------------------------------------------------
def top_id
if self.index < @switch_max
return (self.index+@switch_min) * 10 + 1
else
return (self.index+@variable_min - @switch_max) * 10 + 1
end
end
end