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

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

1 Menu Personalizado em Sab Abr 06, 2013 1:52 pm

avatarT-Lord
Admin
Menu Personalizado
Por lb_guilherme
Características:

Um
menu diferente do padrão. Nele você pode definir quase tudo a seu
gosto. Você ordena as janelas do seu menu como você quiser, e se não as
quiser, pode escolher quais ficam e quais não ficam. O menu é muito
bonito e completo, vale a pena conferir!

Como usar:

Cole
acima do Main, no seu editor de scripts. Dá incompatibilidade com
scripts que também mexam com o menu. Customização no script

Screen:

Script:

Código:
###########################################################
          ################### MENU PERSONALIZADO ####################
          #### V 1.3.1 ##############################################
          ################################### Por: lb_guilherme #####
          ###########################################################


module Conf_Menu
  Exibir_Char = true
  Exibir_Classe = true
  Exibir_Exp = true
  Exibir_Status = true
  Exibir_Map = true
 
  Exibir_Status_Pos = 2
  # 0 = Posição da exp
  # 1 = Posição da classe
  # 2 = Canto da imagem de face
 
  Ordem = ["Tempo", "Passos", "Gold"]
  # Escreva a ordem em que a janelas aparecerão.
  # Para desativar uma dessas janelas, deixe o
  # espaço em branco, exemplo:
  # Ordem = ["Gold", "Passos", ""]
 
  Ordem2 = 1
  # 1 = Organização das janelas começa de cima
  # 2 = Organização das janelas começa de baixo
 
  Lado_Menu = 2
  # 1 = Lado Esquedo
  # 2 = Lado Direito
 
  Texto_Map = "Local:"
  Texto_Passos = "Passos:"
  Texto_Tempo = "Tempo de Jogo:"
 
end
class Window_Base < Window
  def draw_actor_exp(actor, x, y, t)
    s1 = actor.exp_s
    s2 = actor.next_rest_exp_s + s1
    text = s1.to_s + "/" + s2.to_s
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, "E")
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 20, y, t, WLH, text, 2)
  end
end
class Window_MenuStatus < Window_Selectable
  def initialize(x, y)
    super(x, y, 384, 360)
    refresh
    self.active = false
    self.index = -1
  end
  def refresh
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members
      draw_actor_face(actor, 2, actor.index * 84 + 2, 74)
      x = 80
      y = actor.index * 84
      draw_actor_name(actor, x, y)
      draw_actor_level(actor, x, y + WLH * 1)     
      if Conf_Menu::Exibir_Status == true
        if Conf_Menu::Exibir_Status_Pos == 0
          draw_actor_state(actor, x, y + WLH * 2)
        elsif Conf_Menu::Exibir_Status_Pos == 1
          draw_actor_state(actor, x + 100, y)
        elsif Conf_Menu::Exibir_Status_Pos == 2
          draw_actor_state(actor, 0, y + 53)
        end
      end
      if Conf_Menu::Exibir_Exp == true
        draw_actor_exp(actor, x, y + WLH * 2, 70)
      end
      if Conf_Menu::Exibir_Classe == true
        draw_actor_class(actor, x + 100, y)
      end
      if Conf_Menu::Exibir_Char == true
        draw_actor_graphic(actor, x + 245, y + 68)
        draw_actor_hp(actor, x + 100, y + WLH * 1)
        draw_actor_mp(actor, x + 100, y + WLH * 2)
      else
        draw_actor_hp(actor, x + 100, y + WLH * 1, 170)
        draw_actor_mp(actor, x + 100, y + WLH * 2, 170)
      end
     
    end
  end
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    elsif @index < @item_max
      self.cursor_rect.set(0, @index * 84, contents.width, 78)
    elsif @index >= 100
      self.cursor_rect.set(0, (@index - 100) * 84, contents.width, 78)
    else
      self.cursor_rect.set(0, 0, contents.width, @item_max * 78)
    end
  end
end
class Window_Steps < Window_Base
  def initialize
    super(0, 0, 160, 90)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, Conf_Menu::Texto_Passos)
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 32, 120, 32, $game_party.steps.to_s, 2)
  end
end
class Window_PlayTime < Window_Base
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 32, Conf_Menu::Texto_Tempo)
    @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, 32, 120, 32, text, 2)
  end
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end
class Game_Map
  def name
    $map_infos[@map_id]
  end
end
class Scene_Title
  $map_infos = load_data("Data/MapInfos.rvdata")
  for key in $map_infos.keys
    $map_infos[key] = $map_infos[key].name
  end
end
class Window_Map < Window_Base
  def initialize
    super(0, 360, 384, WLH + 32)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  def refresh
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 120, 25, Conf_Menu::Texto_Map)
    self.contents.font.color = normal_color
    self.contents.draw_text(70, 0, 286, 25, $game_map.name.to_s)
  end
end
class Scene_Menu < Scene_Base
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  def start
    super
    create_menu_background
    create_command_window
    if Conf_Menu::Lado_Menu == 1
      x_pos1 = 0
      x_pos2 = 160
    else
      x_pos1 = 385
      x_pos2 = 0
    end
    @status_window = Window_MenuStatus.new(0, 0)
    @status_window.x = x_pos2
    if Conf_Menu::Exibir_Map == true
      @window_local = Window_Map.new
      @window_local.x = x_pos2
    end
    @gold_window = Window_Gold.new(0, 0)
    @gold_window.x = x_pos1
    @gold_window.visible = false
    @window_steps = Window_Steps.new
    @window_steps.x = x_pos1
    @window_steps.visible = false
    @window_playtime = Window_PlayTime.new
    @window_playtime.x = x_pos1
    @window_playtime.visible = false
    if Conf_Menu::Ordem2 == 1
      y_pos = 175
    else
      y_pos = 416
    end
    for i in 0...3
      if Conf_Menu::Ordem[i] == "Gold"
        @gold_window.visible = true
        if Conf_Menu::Ordem2 == 1
          @gold_window.y = y_pos
          y_pos = y_pos + 56
        else
          y_pos = y_pos - 56
          @gold_window.y = y_pos
        end
      end
      if Conf_Menu::Ordem[i] == "Passos"
        @window_steps.visible = true
        if Conf_Menu::Ordem2 == 1
          @window_steps.y = y_pos
          y_pos = y_pos + 90
        else
          y_pos = y_pos - 90
          @window_steps.y = y_pos
        end
      end
      if Conf_Menu::Ordem[i] == "Tempo"
        @window_playtime.visible = true
        if Conf_Menu::Ordem2 == 1
          @window_playtime.y = y_pos
          y_pos = y_pos + 95
        else
          y_pos = y_pos - 95
          @window_playtime.y = y_pos
        end
      end
    end
  end
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
    @window_steps.dispose
    if Conf_Menu::Exibir_Map == true
      @window_local.dispose
    end
    @window_playtime.dispose
  end
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    @window_steps.update
    if Conf_Menu::Exibir_Map == true
      @window_local.update
    end
    @window_playtime.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  def create_command_window
    if Conf_Menu::Lado_Menu == 1
      x_pos1 = 0
    else
      x_pos1 = 385
    end
    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
    @command_window.x = x_pos1
    if $game_party.members.size == 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
    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
  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

Ver perfil do usuário http://www.zonetoony.net

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo  Mensagem [Página 1 de 1]

Permissão deste fórum:
Você não pode responder aos tópicos neste fórum