🤔 Para Refletir : "Mais vale um jogo completo na mão do que dois projetos voando." - FL

[Ace] Omega Day & Night

Membro Membro
Postagens
206
Bravecoins
148
Omega Day & Night
Faz com que de acordo com a hora do PC a cor da tela de testes mude, também a uma HUD que mostra a Data e as Horas.

Ruby:
#===============================================================================
# +++ Omega Day & Night +++
#===============================================================================
# Criado por Faalco
#===============================================================================
# Faz com que de acordo com a horas do computador a tela de teste do RPG Maker
# mude de cor, também a uma HUD que mostra Dia, Mês, Ano, Hora, Minutos e
# Segundos.
#
#===============================================================================
# ● Histórico
#===============================================================================
# v 1.0 - Criação do Script (14-10-2013)
#===============================================================================
module OGSDN # Módulo de Configuração
  Fonte = "Trebuchet MS"
  # Fonte que será usada para mostrar as informações na HUD.
end # Fim das Configurações
#===============================================================================
# ■ Window_Time
#===============================================================================
class Window_Time < Window_Base
  def initialize
    super(10,360,250,50)
    self.contents.font.name = OGSDN::Fonte
    @time = Time.new
    @hour = @time.hour
    mudar_cor
    refresh
  end
  def refresh
    self.contents.clear
    @time = Time.new
    @hour = @time.hour
    @min = @time.min
    @sec = @time.sec
    @day = @time.day
    @mon = @time.mon
    @year = @time.year
    text = "%02d:%02d:%02d - %02d/%02d/04d" % [@hour, @min, @sec, @day, @mon, @year]
    self.draw_text(4,  0, self.width - 40, 32, text)
  end
  def mudar_cor
    if @hour >= 0
    $game_map.screen.start_tone_change(Tone.new(-255, -170, -68, 255), 30)
  end
    if @hour >= 6
    $game_map.screen.start_tone_change(Tone.new(-34, -17, -17, 0), 30)
  end
    if @hour >= 7
    $game_map.screen.start_tone_change(Tone.new(0, 0, 0, 0), 30)
  end
    if @hour >= 12
    $game_map.screen.start_tone_change(Tone.new(0, 0, -68, 0), 30)
  end
    if @hour >= 17
    $game_map.screen.start_tone_change(Tone.new(-34, -85, 51, 0), 30)
  end
    if @hour >= 18
    $game_map.screen.start_tone_change(Tone.new(-119, -68, 0, 170), 30)
  end
    if @hour >= 23
    $game_map.screen.start_tone_change(Tone.new(-187, -255, 0, 255), 30)
  end
  end
  def update
    @hour = @time.hour
    refresh
    mudar_cor
  end
end
#===============================================================================
# ■ Scene_Map
#===============================================================================
class Scene_Map
    alias omega123_main main
    alias omega123_update update
  def main
    @odn = Window_Time.new
    omega123_main
    @odn.dispose
  end
  def update
    @odn.update
    omega123_update
  end
end
 
Voltar
Topo