O TEMA DO FÓRUM ESTÁ EM MANUTENÇÃO. FEEDBACKS AQUI: ACESSAR

FF Menu ~ Conversão VX para VXAce

Iniciado por Takkun, 09/01/2013 às 01:12

Bem estou a trabalhar em algo secreto.  :malvado:
E estou precisando muito do script de Menu do FF eu achei um aqui para VX mais estou tendo problemas para converte-ló eu ficaria bastante  agradecido pois estarei a me fazer um grande favor.

=begin
#BigEd781' Final Fantasy IX Menu
                      Créditos para PainHurt pelos os gráficos
                              HadesSama por traduzir
                           
                         
                           
=end

module FF9_Config
  # Colocar este valor como true para habilitar o menu FF9 em todas as janelas.
  USE_FOR_ALL = true
 
  # Nome da fonte usada no menu
  # use 'Font.default_name' para a fonte padrão.  Tente 'Centaur' para uma melhor,
  # e pequena fonte.
  DEFAULT_FONT = Font.default_name

  # Faz as  janelas de escolha um pouco menos larga no jogo, parece mais agradável.
  USE_SMART_COMMAND_WINDOW = true
 
  # O ícone do dinheiro que irá aparecer no menu, 194 é o padrão.
  GOLD_ICON_ID = 194
end

if FF9_Config::USE_FOR_ALL   
 
  Font.default_name = FF9_Config::DEFAULT_FONT
 
  class Window_Base < Window
   
    alias :eds_pre_ff9_menu_base_initialize :initialize
    def initialize(x, y, width, height)
      eds_pre_ff9_menu_base_initialize(x, y, width, height)     
      self.back_opacity = 255
    end
   
  end
 
end

class Window_TimeGold < Window_Base 
   
  def initialize(x, y) 
    width = find_window_width("9999999")
    width = 140 if width < 140
    super(x, y, width, WLH + 58)
    self.back_opacity = 255
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    @time_icon = Cache.picture('Timer') 
    @intern_frame_count = 0
    refresh
  end
 
  def draw_time
    sec = Graphics.frame_count / 60
    min = Graphics.frame_count / 3600
    hrs = Graphics.frame_count / 216000   
    self.contents.font.color = Color.new(255, 255, 255)   
    time = "%02d:%02d:%02d" % [hrs, min, sec]
    self.contents.draw_text(0, 0, self.contents.width, WLH, time, 2)   
  end 
 
  def refresh
    self.contents.clear
    self.contents.blt(0, 0, @time_icon, @time_icon.rect)
    draw_icon(FF9_Config::GOLD_ICON_ID, 2, WLH) 
    draw_currency_value($game_party.gold, 0, WLH, self.contents.width)
    draw_time
  end
 
  def update
    super
    @intern_frame_count += 1
    return if (@intern_frame_count % 60) != 0         
    refresh
  end
 
  def find_window_width(text)             
    return Bitmap.new(544, 416).text_size(text).width + 80
  end
 
end

class Window_MenuLocation < Window_Base
 
  def initialize(x, y)
    @map_name = load_data("Data/MapInfos.rvdata")[$game_map.map_id].name
    width = find_window_width(@map_name)
    super(x, y, width, WLH + 32)   
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    self.back_opacity = 255
    refresh
  end
 
  def refresh
    self.contents.clear   
    self.contents.draw_text(0, 0, self.contents.width, WLH,  @map_name, 1)
  end
 
  def find_window_width(text)             
    return Bitmap.new(544, 416).text_size(text).width + 48
  end
 
end

class Window_Command < Window_Selectable
 
  alias :eds_pre_ff9_menu_win_command_init :initialize
  def initialize(width, commands, column_max = 1, row_max = 0, spacing = 32) 
    @font_name = Font.default_name
    width = find_window_width(commands) if FF9_Config::USE_SMART_COMMAND_WINDOW
    eds_pre_ff9_menu_win_command_init(width, commands, column_max, row_max, spacing)
  end
 
  def find_window_width(texts)     
    long = ''   
    text.each { |line| long = line if line.size > long.size }                   
    return Bitmap.new(544, 416).text_size(long).width + 48
  end
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear   
    self.contents.font.name = @font_name
    for i in 0...@item_max
      draw_item(i)
    end
  end
 
  def font_name=(name)
    @font_name = name   
  end
 
end

class Window_MenuStatus < Window_Selectable
   
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 452, 352)   
    @bg_image = Cache.picture('FF9_MenuBar') 
    @arrow_image = Cache.picture('Arrow')
    @arrow_sprite = Sprite.new
    @arrow_sprite.bitmap = Bitmap.new(45, 38)  #7 pixels larger in 'w' for animation     
    @arrow_sprite.y = 52 
    @arrow_sprite.z = 999   
    @sprite_last_draw_x = 0
    @sprite_inc_x = 1
    @intern_frame_count = 0   
    self.contents.font.name = FF9_Config::DEFAULT_FONT
    self.opacity = 0   
    self.z = 99   
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def refresh   
    self.contents.clear
    @item_max = $game_party.members.size
    for actor in $game_party.members     
      x = 104
      y = actor.index * 80     
      y_offset = 6
      draw_background_window(y)
      draw_actor_face(actor, 19, y + 4, 73)     
      draw_actor_name(actor, x, y + y_offset)
      draw_actor_class(actor, x + 125, y + y_offset)
      draw_actor_level(actor, x, y + WLH * 1)
      draw_actor_state(actor, x, y + WLH * 2)
      draw_actor_hp(actor, x, ((y) + (WLH * 2) - 5))
      draw_actor_mp(actor, x + 125, ((y) + (WLH * 2) - 5))   
    end
  end 
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def update_cursor             
    if @index < 0             
      @arrow_sprite.bitmap.clear
      return
    end
    @intern_frame_count += 1
    return if (@intern_frame_count % 5) != 0
    if @sprite_last_draw_x == 7
      @sprite_inc_x = -1
    elsif @sprite_last_draw_x == 0
      @sprite_inc_x = 1
    end
    @arrow_sprite.bitmap.clear
    @arrow_sprite.y = (@index * 80) + 52
    x = @sprite_last_draw_x + @sprite_inc_x   
    @sprite_last_draw_x = x
    @arrow_sprite.bitmap.blt(x, 0, @arrow_image, @arrow_image.rect)   
  end
 
  def draw_background_window( y )
    self.contents.blt(0, y, @bg_image, @bg_image.rect)   
  end 
 
  alias :eds_pre_ff9_win_stat_dispose :dispose
  def dispose
    eds_pre_ff9_win_stat_dispose
    @arrow_sprite.dispose
  end
 
end

class Scene_Menu
     
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  alias :eds_old_pre_ff9_create_command_window :create_command_window
  def create_command_window
    eds_old_pre_ff9_create_command_window   
    @command_window.font_name = FF9_Config::DEFAULT_FONT
    @command_window.x = 528 - @command_window.width
    @command_window.y = 16
    @command_window.back_opacity = 255
  end
  #--------------------------------------------------------------------------
  # * OVERWRITTEN
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_TimeGold.new(372, 360)
    @gold_window.y -= @gold_window.height
    @gold_window.x = 528 - @gold_window.width
    @status_window = Window_MenuStatus.new(0, 12)
    @location_window = Window_MenuLocation.new(0, 0)
    @location_window.x = 528 - @location_window.width 
    @location_window.y = 416 - @location_window.height 
  end
 
  #--------------------------------------------------------------------------
  # * Termination Processing
  #--------------------------------------------------------------------------
  alias :eds_pre_ff9_menu_scene_menu_terminate :terminate
  def terminate
    eds_pre_ff9_menu_scene_menu_terminate
    @location_window.dispose
  end
 
end