Gameplay time.game play time or file creation date?
I made this. I copied and pasted the "draw_playtime" method to my scene, but nothing happened.find window_savefile, line 25 and 47
module AddVar # Módulo de configuração.
ICONE = 467
BACKG_OPACITY = 160
end
class Scene_AddVar < Scene_Base
def start
super
@window_add_var = Window_AddVar.new(0,0,100,50) # Criando a janela.
@window_add_var.z = 300 # Alterando valor "z", que faz a janela ficar por cima.
@window_add_var.draw_text_ex(2, 2, $game_party.steps) # Criando o texto.
@window_add_var.draw_icon(AddVar::ICONE, 50, 0) # Criando o ícone.
create_background # Criando o background (plano de fundo).
@window_add_var.draw_playtime(0, 50 - 25, 50 - 4, 2)
end
def update
super
if Input.trigger?(:DOWN) # Se, enquanto estiver na janela, apertar para baixo, a janela sai.
return_scene # Retorna a scene (cena), ou seja, faz a janela sair.
end
end
def create_background # Método de criação do background.
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
@background_sprite.color.set(0, 0, 0, AddVar::BACKG_OPACITY)
end
end
class Window_AddVar < Window_Base # Criando a janela.
def initialize(x, y, width, height)
super
self.opacity = 180 # Opacidade da janela. Não é muito importante alterar essa opacidade.
end
def draw_playtime(x, y, width, align)
header = DataManager.load_header(@file_index)
return unless header
draw_text(x, y, width, line_height, header[:playtime_s], 2)
end
end
module AddVar # Módulo de configuração.
ICONE = 467
BACKG_OPACITY = 160
end
class Scene_AddVar < Scene_Base
def start
super
@window_add_var = Window_AddVar.new(0,0,350,350) # Criando a janela.
@window_add_var.z = 300 # Alterando valor "z", que faz a janela ficar por cima.
@window_add_var.draw_text_ex(2, 2, $game_party.steps) # Criando o texto.
@window_add_var.draw_icon(AddVar::ICONE, 50, 0) # Criando o ícone.
draw_playtime(0, 40 - 20, 20 - 4, 0) if Input.trigger?(:LEFT)
create_background # Criando o background (plano de fundo).
end
def update
super
if Input.trigger?(:DOWN) # Se, enquanto estiver na janela, apertar para baixo, a janela sai.
return_scene # Retorna a scene (cena), ou seja, faz a janela sair.
end
end
def create_background # Método de criação do background.
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
@background_sprite.color.set(0, 0, 0, AddVar::BACKG_OPACITY)
end
end
class Window_AddVar < Window_Base # Criando a janela.
def initialize(x, y, width, height)
super
self.opacity = 180 # Opacidade da janela. Não é muito importante alterar essa opacidade.
end
def draw_playtime(x, y, width, align)
davi = DataManager.load_header(@file_index)
return unless davi
draw_text(x, y, width, line_height, davi[:saveve], 0)
p davi[:saveve]
end
end
class Scene_Map < Scene_Base
alias adk_start start
def start
adk_start
SceneManager.call(Scene_AddVar)
end
end
p davi[:saveve]
davi = DataManager.load_header(@file_index)
class Window_AddVar < Window_Base # Criando a janela.
def initialize(x, y, width, height)
super
self.opacity = 180 # Opacidade da janela. Não é muito importante alterar essa opacidade.
end
def draw_playtime(x, y, width, align)
davi = DataManager.load_header(@file_index)
p davi[:saveve]
return unless davi
draw_text(x, y, width, line_height, davi[:saveve], 0)
end
end
def initialize(height, index)
super(0, index * height, Graphics.width, height)
@file_index = index # <-- for this and...
refresh # <--- ...this
#~ @selected = false
end
#--------------------------------------------------------------------------
# * Renovação
#--------------------------------------------------------------------------
def refresh
contents.clear
#~ change_color(normal_color)
#~ name = Vocab::File + " #{@file_index + 1}"
#~ draw_text(4, 0, 200, line_height, name)
#~ @name_width = text_size(name).width
#~ draw_party_characters(152, 58)
draw_playtime(0, contents.height - line_height, contents.width - 4, 2)
end
Eu já usei, Gabriel.Just use this: $game_system.playtime_s