Auteur: Yukihiro matsumoto
#============================================
# ¡ö Window_DebugRight
#----------------------------------------------
# ¡¡¥Ç¥Ð¥Ã¥°»Ãæ¤Ç¡¢¥¹¥¤¥Ã¥Á¤ä‰äÊý¤ò‚€„e¤Ë±íʾ¤¹¤ë¥¦¥£¥ó¥É¥¦¤Ç¤¹¡£
#============================================
class Window_DebugRight < Window_Selectable
#------------------------------------------
# ¡ñ ¹«é_¥¤¥ó¥¹¥¿¥ó¥¹‰äÊý
#------------------------------------------
attr_reader :mode # ¥â©`¥É (0:¥¹¥¤¥Ã¥Á¡¢1:‰äÊý)
attr_reader :top_id # ÏÈî^¤Ë±íʾ¤¹¤ë ID
#------------------------------------------
# ¡ñ ¥ª¥Ö¥¸¥§¥¯¥È³õÆÚ»¯
#------------------------------------------
def initialize
super(192, 0, 448, 352)
self.contents = Bitmap.new(width - 32, height - 32)
self.contents.font.name = $fontface
self.contents.font.size = $fontsize
self.index = -1
self.active = false
@item_max = 10
@mode = 0
@top_id = 1
refresh
end
#------------------------------------------
# ¡ñ ¥ê¥Õ¥ì¥Ã¥·¥å
#------------------------------------------
def refresh
self.contents.clear
for i in 0..9
if @mode == 0
name = $data_system.switches[@top_id+i]
status = $game_switches[@top_id+i] ? "[Activ¨¦]" : "[D¨¦sactiv¨¦]"
else
name = $data_system.variables[@top_id+i]
status = $game_variables[@top_id+i].to_s
end
if name == nil
name = ''
end
id_text = sprintf("%04d:", @top_id+i)
width = self.contents.text_size(id_text).width
self.contents.draw_text(4, i * 32, width, 32, id_text)
self.contents.draw_text(12 + width, i * 32, 296 - width, 32, name)
self.contents.draw_text(312, i * 32, 100, 32, status, 2)
end
end
#------------------------------------------
# ¡ñ ¥â©`¥É¤ÎÔO¶¨
# id : Ф·¤¤¥â©`¥É
#------------------------------------------
def mode=(mode)
if @mode != mode
@mode = mode
refresh
end
end
#------------------------------------------
# ¡ñ ÏÈî^¤Ë±íʾ¤¹¤ë ID ¤ÎÔO¶¨
# id : Ф·¤¤ ID
#------------------------------------------
def top_id=(id)
if @top_id != id
@top_id = id
refresh
end
end
end |
|