Modifica o menu tornando-o parecido com o menu do jogo Final Fantasy VII

Desenvolvimento: AcedentProne

Instruções:

Crie uma nova pasta dentro da pasta ‘Characters’ e nomeie-a como ‘Faces’

Adicionando Faces: adicione uma imagem 80×80 com o mesmo nome do characterset correspondente do personagem.

Ex:

Characters\SephirotChar.png (character do personagem)

Characters\Faces\SephirotChar.png (face do personagem)

Observações:

Se você não quer usar faces, vá para a linha 94 e delete o da função ‘draw_actor_graphic’ e insira um # na frente da função ‘draw_actor_face’

 

#*********************************************************
# Menu Estilo Final Fantasy VII por AcedentProne
#*********************************************************
#
# Uso:
#
# Crie uma nova pasta dentro da pasta 'Characters' e nomeie-a como 'Faces'
#
# Adicionando Faces: adicione uma imagem 80x80 com o mesmo nome do characterset
# correspondente do personagem.
#
# Ex:
#
# Characters\\\\SephirotChar.png
# Characters\\\\Faces\\\\SephirotChar.png
#
#
# Observações:
#
# Se você não quer usar faces, vá para a linha 94
# e delete o # da função 'draw_actor_graphic'
# e insira um # na frente da função 'draw_actor_face'
#
#========================================
# Window_Base
#--------------------------------------------------------------------------------
# Definindo funções para a 'base'
#========================================
class Window_Base < Window

def draw_actor_face(actor, x, y)
face = RPG::Cache.character("Faces/" + actor.character_name, actor.character_hue)
fw = face.width
fh = face.height
src_rect = Rect.new(0, 0, fw, fh)
self.contents.blt(x - fw / 23, y - fh, face, src_rect)
end
end
def draw_actor_battler_graphic(actor, x, y)
  bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
  cw = bitmap.width
  ch = bitmap.height
  src_rect = Rect.new(0, 0, cw, ch)
  self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end

#========================================
# Game_Map
#--------------------------------------------------------------------------------
# Definindo funções para o mapa
#========================================
class Game_Map

def name
$map_infos[@map_id]
end
end

#========================================
# Window_Title
#--------------------------------------------------------------------------------
# Definindo funções para o título
#========================================
class Scene_Title
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
#==============================================================================
#  Window_MenuStatus
#------------------------------------------------------------------------------
#  Configura a escolha
#==============================================================================

class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# Inicialização
#--------------------------------------------------------------------------
def initialize
  super(0, 0, 560, 454)
  self.contents = Bitmap.new(width - 32, height - 32)
  self.contents.font.name = $defaultfonttype
  self.contents.font.size = $defaultfontsize
  refresh
  self.active = false
  self.index = -1
end
#--------------------------------------------------------------------------
# Mostrando as informações na tela
#--------------------------------------------------------------------------
def refresh
  self.contents.clear
  @item_max = $game_party.actors.size
  for i in 0...$game_party.actors.size
    x = 94
    y = i * 110
    actor = $game_party.actors[i]
    draw_actor_face(actor, 12, y + 90) # Para retirar as faces, insira um "#" antes do draw_ desta linha
    #draw_actor_graphic(actor, 48, y + 65) # e delete o "#" na frente do draw desta linha
    draw_actor_name(actor, x, y)
    draw_actor_class(actor, x + 72, y)
    draw_actor_level(actor, x, y + 18)
    draw_actor_state(actor, x + 144, y)
    draw_actor_exp(actor, x+ 144, y + 38)
    draw_actor_hp(actor, x, y + 38)
    draw_actor_sp(actor, x, y + 58)
  end
end
#--------------------------------------------------------------------------
# Atualização do Cursor
#--------------------------------------------------------------------------
def update_cursor_rect
  if @index < 0
    self.cursor_rect.empty
  else
    self.cursor_rect.set(0, @index * 110, self.width - 32, 96)
  end
end
end

#=======================================#
# Window_GameStats                                                              #
# por AcedentProne                                                          #
#------------------------------------------------------------------------------#

class Window_GameStats < Window_Base
def initialize
 super(0, 0, 160, 60)
 self.contents = Bitmap.new(width - 32, height - 32)
 self.contents.font.name = $defaultfonttype
 self.contents.font.size = $defaultfontsize
 refresh
end

def refresh
 self.contents.clear
 # Mostra o dinheiro em vírgulas separadas, por Dubealex
 case $game_party.gold
   when 0..9999
     gold = $game_party.gold
   when 10000..99999
     gold = $game_party.gold.to_s
     array = gold.split(//)
     gold = array[0].to_s+array[1].to_s+","+array[2].to_s+array[3].to_s+array[4].to_s
   when 100000..999999
     gold = $game_party.gold.to_s
     array = gold.split(//)
     gold = array[0].to_s+array[1].to_s+array[2].to_s+","+array[3].to_s+array[4].to_s+array[5].to_s
   when 1000000..9999999
     gold = $game_party.gold.to_s
     array = gold.split(//)
     gold = array[0].to_s+","+array[1].to_s+array[2].to_s+array[3].to_s+","+array[4].to_s+array[5].to_s+array[6].to_s
   end
# Mostra o dinheiro
 self.contents.font.color = system_color
 gold_word = $data_system.words.gold.to_s
 cx = contents.text_size(gold_word).width
 cx2=contents.text_size(gold.to_s).width
 self.contents.draw_text(4, 4, 120-cx-2, 32, gold_word)
 self.contents.font.color = normal_color
 self.contents.draw_text(124-cx2+1, 4, cx2, 32, gold.to_s, 2)
 self.contents.font.color = system_color
 # Mostra o 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, -10, 120, 32, text, 2)
self.contents.font.color = system_color
 self.contents.draw_text(4, -10, 120, 32, "Tempo")
end
#--------------------------------------------------------------------------
# Atualização do contador
#--------------------------------------------------------------------------
def update
 super
 if Graphics.frame_count / Graphics.frame_rate != @total_sec
   refresh
 end
end
end

#==============================================================================
# Window_Mapname
#------------------------------------------------------------------------------
# Mostra o nome do mapa
#==============================================================================

class Window_Mapname  0
 @command_window.y -= 60
end
 if @game_stats_window.x < gamepos
 @game_stats_window.x += 80
end
 if @map.y  0
   @status_window.x -= 80
 end
 # Verificando se as opções estão ativas
 if @command_window.active
   update_command
   return
 end
 if @status_window.active
   update_status
   return
 end
end
#--------------------------------------------------------------------------
# Atualizando a seleção de comandos
#--------------------------------------------------------------------------
def update_command
 # Verifica se o botão B foi pressionado
 if Input.trigger?(Input::B)
   # Executa o SE definido
   $game_system.se_play($data_system.cancel_se)
   # Loop para as janelas saírem
    loop do
     if @command_window.y  0 - @game_stats_window.width
      @game_stats_window.x -= 40
     end
     if @map.y > 0 - @map.height
      @map.y -= 40
     end
     if @status_window.x = 640
      break
    end
   end
  # Vai para o mapa
 $scene = Scene_Map.new
   return
 end
 # Verifica se o botão C foi pressionado
 if Input.trigger?(Input::C)
   # Verifica o tamanho do herói
   if $game_party.actors.size == 0 and @command_window.index < 4
     # Executa SE
     $game_system.se_play($data_system.buzzer_se)
     return
   end
   case @command_window.index
   when 0  
     $game_system.se_play($data_system.decision_se)
     loop do
     if @command_window.y  0 - @game_stats_window.width
      @game_stats_window.x -= 40
     end
     if @map.y > 0 - @map.height
      @map.y -= 40
     end
     if @status_window.x = 640
      break
    end
   end
     $scene = Scene_Item.new
   when 1
     $game_system.se_play($data_system.decision_se)
     @command_window.active = false
     @status_window.active = true
     @status_window.index = 0
   when 2
     $game_system.se_play($data_system.decision_se)
     @command_window.active = false
     @status_window.active = true
     @status_window.index = 0
   when 3  
     $game_system.se_play($data_system.decision_se)
     @command_window.active = false
     @status_window.active = true
     @status_window.index = 0
   when 4
     if $game_system.save_disabled
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     loop do
     if @command_window.y  0 - @game_stats_window.width
      @game_stats_window.x -= 40
     end
     if @map.y > 0 - @map.height
      @map.y -= 40
     end
     if @status_window.x = 640
      break
    end
   end
    $scene = Scene_Save.new
   when 5
     $game_system.se_play($data_system.decision_se)
     loop do
     if @command_window.y  0 - @game_stats_window.width
      @game_stats_window.x -= 40
     end
     if @map.y > 0 - @map.height
      @map.y -= 40
     end
     if @status_window.x = 640
      break
    end
   end
      $scene = Scene_End.new
   end
   return
 end
end
#--------------------------------------------------------------------------
# Atualiza a tela de status
#--------------------------------------------------------------------------
def update_status
 if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   @command_window.active = true
   @status_window.active = false
   @status_window.index = -1
   return
 end
 if Input.trigger?(Input::C)
   case @command_window.index
   when 1
     if $game_party.actors[@status_window.index].restriction >= 2
       $game_system.se_play($data_system.buzzer_se)
       return
     end
     $game_system.se_play($data_system.decision_se)
     loop do
     if @command_window.y  0 - @game_stats_window.width
      @game_stats_window.x -= 40
     end
     if @map.y > 0 - @map.height
      @map.y -= 40
     end
     if @status_window.x = 640
      break
    end
   end
     $scene = Scene_Skill.new(@status_window.index)
   when 2
     $game_system.se_play($data_system.decision_se)
     loop do
     if @command_window.y  0 - @game_stats_window.width
      @game_stats_window.x -= 40
     end
     if @map.y > 0 - @map.height
      @map.y -= 40
     end
     if @status_window.x = 640
      break
    end
   end
     $scene = Scene_Equip.new(@status_window.index)
   when 3
     $game_system.se_play($data_system.decision_se)
     loop do
     if @command_window.y  0 - @game_stats_window.width
      @game_stats_window.x -= 40
     end
     if @map.y > 0 - @map.height
      @map.y -= 40
     end
     if @status_window.x = 640
      break
    end
   end
     $scene = Scene_Status.new(@status_window.index)
   end
   return
 end
end
end
Anúncios