# * Time Details Patch * #
# 2023-12-25
class Window_Details
include PHLiM2::MAIN_MENU
TIME_X_MS = 56
TIME_X = 72
def update
contents.clear
if SHOW_BG_IMAGE or SHOW_BACKGROUND
for i in 0..line_number
draw_text_bg_rect(line_height * i)
end
end
# Show Gold
if SHOW_GOLD
draw_currency_value(value, currency_unit, 0, line_height * gold_adjust,
contents.width - 8)
end
if SHOW_STEPS
@steps = $game_party.steps
if SHOW_WINDOW_ICONS
draw_text_icon(0, line_height * steps_adjust,contents.width - 8,
line_height, @steps, STEPS_ICON_ID)
else
contents.font.color = system_color
draw_text(8,line_height * steps_adjust, contents.width - 8,
line_height, "STEPS")
contents.font.color = normal_color
draw_text(0,line_height * steps_adjust, contents.width,
line_height, @steps, 2)
end
end
draw_time
end
def draw_time
return unless SHOW_TIME
time = Graphics.frame_count / Graphics.frame_rate
msec = Graphics.frame_count % Graphics.frame_rate * 1.6667
sec = time % 60
min = time / 60 % 60
hour = time / 60 / 60
if BLINK_MARKERS
if msec >= 50
marker = " "
else
marker = ":"
end
else
marker = ":"
end
time_text = sprintf("%02d"+marker+"%02d"+marker+"%02d", hour, min, sec)
time_text_ms = SHOW_MS ? sprintf("\\}.%02d\\{", msec) : ""
ty = line_height * time_adjust
time_str = time_text + time_text_ms
if SHOW_WINDOW_ICONS
draw_text_icon(0, ty, contents.width, line_height, time_str, TIME_ICON_ID)
else
change_color(normal_color)
tx = SHOW_MS ? TIME_X_MS : TIME_X
draw_text_ex(tx, ty, time_str)
end
end
end