Some time ago I was looking for a script that would allow me to replace the in-game time or play time with a e.g. PST or GMT
This is what I edited in the Window_PlayTime script...
I replaced the original lines (where def refresh is defined) with these...
UPDATE!!!
Just in case someone is having problems with the full weekday name being displayed in English, I included a modification that would allow you to see it being displayed in your mother tongue.
Replace text1 value with the one you need.
Take a look at these examples:
# German
Monday = "Montag"
# Italian
Monday = "Lunedi"
# Spanish
Monday = "Lunes"
Portuguese
Monday = "Segunda" or Segunda-feira
I think it is ready. It worked normally.
You may close this thread now. Thanks.
This is what I edited in the Window_PlayTime script...
I replaced the original lines (where def refresh is defined) with these...
UPDATE!!!
Just in case someone is having problems with the full weekday name being displayed in English, I included a modification that would allow you to see it being displayed in your mother tongue.
Replace text1 value with the one you need.
Take a look at these examples:
# German
Monday = "Montag"
# Italian
Monday = "Lunedi"
# Spanish
Monday = "Lunes"
Portuguese
Monday = "Segunda" or Segunda-feira
#============================
# Your Current Time Window
# version 0.3
# Edited by shadowball
# 11.25.2007 - 11.28.2007
#============================
# This is what I edited in the Window_PlayTime script...
# I replaced the original lines (where def refresh is defined) with these...
# It prints the current date/time this way:
# Sunday
# 11.25.2007 23:59
class Window_YourCurrentTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 88)
self.contents = Bitmap.new(width - 32, height - 32)
#self.contents.sfont = SFont.new("Arial_Red")
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Draw Time Text
t = Time.now
# The full weekday name is normally displayed in English.
# If you speak English, you may delete this hash.
days = {'Monday' => 'Lunes',
'Tuesday' => 'Martes',
'Wednesday' => 'Miércoles',
'Thursday' => 'Jueves',
'Friday' => 'Viernes',
'Saturday' => 'Sábado',
'Sunday' => 'Domingo'}
text1 = days[t.strftime('%A')]
# End of full weekday name in your language
text2 = t.strftime('%d.%m.%Y %H:%M')
# System Color
self.contents.font.color = system_color
# Print Day Of The Week
self.contents.draw_text(0, 0, 60, 32, text1, 0)
# Normal Color
self.contents.font.color = normal_color
# Print Time
self.contents.draw_text(0, 32, 145, 32, text2, 0)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
# Your Current Time Window
# version 0.3
# Edited by shadowball
# 11.25.2007 - 11.28.2007
#============================
# This is what I edited in the Window_PlayTime script...
# I replaced the original lines (where def refresh is defined) with these...
# It prints the current date/time this way:
# Sunday
# 11.25.2007 23:59
class Window_YourCurrentTime < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 160, 88)
self.contents = Bitmap.new(width - 32, height - 32)
#self.contents.sfont = SFont.new("Arial_Red")
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
# Draw Time Text
t = Time.now
# The full weekday name is normally displayed in English.
# If you speak English, you may delete this hash.
days = {'Monday' => 'Lunes',
'Tuesday' => 'Martes',
'Wednesday' => 'Miércoles',
'Thursday' => 'Jueves',
'Friday' => 'Viernes',
'Saturday' => 'Sábado',
'Sunday' => 'Domingo'}
text1 = days[t.strftime('%A')]
# End of full weekday name in your language
text2 = t.strftime('%d.%m.%Y %H:%M')
# System Color
self.contents.font.color = system_color
# Print Day Of The Week
self.contents.draw_text(0, 0, 60, 32, text1, 0)
# Normal Color
self.contents.font.color = normal_color
# Print Time
self.contents.draw_text(0, 32, 145, 32, text2, 0)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
end
end
end
Expand to see the code.
I think it is ready. It worked normally.
You may close this thread now. Thanks.