Templo RPG Maker
Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Você não está conectado. Conecte-se ou registre-se

Ver o tópico anterior Ver o tópico seguinte Ir para baixo  Mensagem [Página 1 de 1]

1Advanced Menu VX Empty Advanced Menu VX 22/5/2012, 21:46

The Lucas Wugades

The Lucas Wugades
Membro Honorário III
Membro Honorário III
Advanced Menu VX

Por AzorMachine

Código:
#==============================================================================
# ¦ RMVX Advanced Menu v.1
#------------------------------------------------------------------------------
# Novo Menu com :
#
# - Chars embaixo das faces.
# - Tempo de Jogo.
# - Passos
#------------------------------------------------------------------------------
#
# .: Por AzorMachine :..: [email=lucas.zip@hotmail.com]lucas.zip@hotmail.com[/email]
#
#
# Script exclusivo das seguintes comunidades :
#
# Universo Maker - [url=http://www.universomaker.comze.com/]www.universomaker.comze.com[/url]
# Reino RPG - [url=http://www.reinorpg.com/]www.reinorpg.com[/url]
# Mundo RPG Maker - [url=http://www.mundorpgmaker.com/]www.mundorpgmaker.com[/url]
#
#==============================================================================
module AzMa



MSTRCHAR = true
MSTRFACE = true

end


class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # ? ?????????
  #    menu_index : ?????????????
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
    @playtime_window = Window_PlayTime.new(0, 176)
    @steps_window = Window_Steps.new(0, 274)
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    @playtime_window.update
    @steps_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????????
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # ??????? 0 ????
      @command_window.draw_item(0, false)    # ????????
      @command_window.draw_item(1, false)    # ???????
      @command_window.draw_item(2, false)    # ??????
      @command_window.draw_item(3, false)    # ?????????
    end
    if $game_system.save_disabled            # ????????
      @command_window.draw_item(4, false)    # ???????
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # ????
        $scene = Scene_Item.new
      when 1,2,3  # ????????????
        start_actor_selection
      when 4      # ???
        $scene = Scene_File.new(true, false, false)
      when 5      # ?????
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    @playtime_window.active = true
    @steps_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
    @playtime_window.active = true
    @steps_window.active = true
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # ???
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # ??
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # ?????
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end


class Window_MenuStatus < Window_Selectable

  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      if AzMa::MSTRFACE == true
        draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
        end
        if AzMa::MSTRCHAR == true
        draw_actor_graphic(actor, 18, actor.index * 96 + 96)
        end
      x = 104
      y = actor.index * 96 + WLH / 2
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 120, y)
      draw_actor_level(actor, x, y + WLH * 1)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x + 120, y + WLH * 1)
      draw_actor_mp(actor, x + 120, y + WLH * 2)
    end
  end
end


class Window_Steps < Window_Base
 
  #--------------------------------------------------------------------------
  # - Inicialização dos Objetos
  #--------------------------------------------------------------------------
 
  def initialize(x, y)
    super(x, y, 160, 86)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  #--------------------------------------------------------------------------
  # - Atualização
  #--------------------------------------------------------------------------
 
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, "Passos")
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 20, 120, 32, $game_party.steps.to_s, 2)
  end
end


class Window_PlayTime < Window_Base
 
  #--------------------------------------------------------------------------
  # - Inicialização dos Objetos
  #--------------------------------------------------------------------------
 
  def initialize(x, y)
    super(x, y, 160, 98)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  #--------------------------------------------------------------------------
  # - Atualização
  #--------------------------------------------------------------------------
 
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 24, "Tempo de Jogo")
    @total_sec = Graphics.frame_count / Graphics.frame_rate
    hour = @total_sec / 60 / 60
    min = @total_sec / 60 % 60
    sec = @total_sec % 60
    text = sprintf("%02d:%02d:%02d", hour, min, sec)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 30, 120, 24, text, 2)
  end
 
  #--------------------------------------------------------------------------
  # - Renovação do Frame
  #--------------------------------------------------------------------------
 
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end

https://templorpgmakerbr.forumeiros.com/forum

Ver o tópico anterior Ver o tópico seguinte Ir para o topo  Mensagem [Página 1 de 1]

Permissões neste sub-fórum
Não podes responder a tópicos