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

Script HUD Menu

2 participantes

Ir para baixo

Scripts Script HUD Menu

Mensagem por DigiMatheus Seg Jul 19, 2010 5:01 pm

HUD Menu

Criado por: OriginalWij
Disponibilizado por: DigiMatheus

Este é um encrivel menu muito compacto que não precisa de numa picture! E ainda vem com um contador de HP MP EXP e Nivel *-*

Código:
#==============================================================================
# HUD Menu 2
#==============================================================================
# Autor  : OriginalWij
# Versão : 1.0
#==============================================================================

#==============================================================================
# Config
#==============================================================================

module OW_HUD2
  # Disable switch (ID) [default = 1]
  DISABLE_SWITCH = 1
  # Rotação Reversa no Menu | switch (ID) [default = 2] (switch ON = reverse)
  REVERSE = 2
  # Button to change HUD display type [default = InputZ]
  BUTTON = Input::Z
  # Above button toggles display? (false = HOLD to display) [default = true]
  BUTTON_TOGGLE = true
  # Botões para mudar o char-lider (no mapa) [defaults = Input::L & Input::R]
  MAP_BUTTON_L = Input::L # cycle backward
  MAP_BUTTON_R = Input::R # cycle forward
  # Retornar à seleção de actor depois dos sub-menus? (se aplicavel) [default = true]
  RETURN_SELECT = true
  # Icones
  GOLD_ICON = 205 # money/gold window icon [default = 205]
  TIME_ICON = 188 # time window icon      [default = 188]
  # Cores
  BACK_COLOR    = Color.new(  0,  0,  0, 128) # HUD background color
  BAR_BACK_COLOR = Color.new(255, 255, 255, 255) # bar background color
  # Comandos padrão do Menu
  # (adicionar/remover/inserir comandos aqui)
  # Syntax: COMMAND[index] = [Texto, Icone-ID, Scene a ser chamada, chamar seleção de actor?]
  COMMAND = [] # ← Ñ modifique!
  COMMAND[0] = ["Itens",    144, "Scene_Item.new"                    , false]
  COMMAND[1] = ["Habilidades",    128, "Scene_Skill.new(actor_index)"      , true ]
  COMMAND[2] = ["Equipamentos",  40, "Scene_Equip.new(actor_index)"      , true ]
  COMMAND[3] = ["Status",    137, "Scene_Status.new(actor_index)"      , true ]
  COMMAND[4] = ["Salvar", 143, "Scene_File.new(true, false, false)" , false]
  COMMAND[5] = ["Load", 142, "Scene_File.new(false, false, false)", false]
  COMMAND[6] = ["Sair", 112, "Scene_End.new"                      , false]
end

#==============================================================================
# Game_Temp
#==============================================================================

class Game_Temp
  #--------------------------------------------------------------------------
  # Public Instance Variables (New)
  #--------------------------------------------------------------------------
  attr_accessor :no_blur
  attr_accessor :return_index
  #--------------------------------------------------------------------------
  # Initialize (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_game_temp_initialize initialize unless $@
  def initialize
    ow_hud2_game_temp_initialize
    @no_blur = false
    @return_index = 0
  end
end

#==============================================================================
# Game_System
#==============================================================================

class Game_System
  #--------------------------------------------------------------------------
  # Public Instance Variables (New)
  #--------------------------------------------------------------------------
  attr_accessor :pressing_z
  #--------------------------------------------------------------------------
  # Initialize (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_game_system_initialize initialize unless $@
  def initialize
    ow_hud2_game_system_initialize
    @pressing_z = false
  end
end

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler
  #--------------------------------------------------------------------------
  # Get Current XP (New)
  #--------------------------------------------------------------------------
  def now_exp
    return @exp - @exp_list[@level]
  end
  #--------------------------------------------------------------------------
  # Get Next Level Xp (New)
  #--------------------------------------------------------------------------
  def next_exp
    lvl = @level + 1
    return @exp_list[lvl] > 0 ? @exp_list[lvl] - @exp_list[@level] : 0
  end
end

#==============================================================================
# Window_Base
#==============================================================================

class Window_Base < Window
  #--------------------------------------------------------------------------
  # Initialize (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_window_base_initialize initialize unless $@
  def initialize(x, y, width, height)
    ow_hud2_window_base_initialize(x, y, width, height)
    @moving = false
  end
  #--------------------------------------------------------------------------
  # Update (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_window_base_update update unless $@
  def update
    ow_hud2_window_base_update
    if @moving
      if (self.x - @dest_x).abs > 0 or (self.y - @dest_y).abs > 0
        self.x += @x_step
        self.y += @y_step
        self.opacity += @opacity_step
        self.contents_opacity += @opacity_step
      else
        @moving = false
      end
    end
  end
  #--------------------------------------------------------------------------
  # Draw Class (Rewrite)
  #--------------------------------------------------------------------------
  def draw_actor_class(actor, x, y)
    self.contents.font.color = text_color(20)
    self.contents.draw_text(x, y, 108, WLH, actor.class.name)
  end
  #--------------------------------------------------------------------------
  # Move Window (New)
  #--------------------------------------------------------------------------
  def move_to(dest_x, dest_y, duration, dest_opacity = 255)
    @dest_opacity = dest_opacity
    @moving = true
    @dest_x = dest_x
    @dest_y = dest_y
    @opacity_step = (@dest_opacity - self.opacity) / duration
    self.opacity += (@dest_opacity - self.opacity) % duration
    @x_step = (@dest_x - self.x) / duration
    @y_step = (@dest_y - self.y) / duration
    self.x += (@dest_x - self.x) % duration
    self.y += (@dest_y - self.y) % duration
  end
  #--------------------------------------------------------------------------
  # Draw HUD Face Graphic (New)
  #--------------------------------------------------------------------------
  def draw_hudface(actor, x, y, size = 96, enabled = true, character = false)
    bitmap = Cache.face(actor.face_name)
    rect = Rect.new(0, 0, 0, 0)
    rect.x = actor.face_index % 4 * 96 + (96 - size) / 2
    rect.y = actor.face_index / 4 * 96 + (96 - size) / 2
    rect.width = size
    rect.height = size
    alpha = enabled ? 255 : 128
    self.contents.blt(x, y, bitmap, rect, alpha)
    bitmap.dispose
    draw_hudcharacter(actor, x + 96, y + 34, true) if character
  end
  #--------------------------------------------------------------------------
  # Draw HUD Character Graphic (New)
  #--------------------------------------------------------------------------
  def draw_hudcharacter(actor, x, y, enabled = true)
    return if actor.character_name == nil
    bitmap = Cache.character(actor.character_name)
    sign = actor.character_name[/^[\!\$]./]
    if sign != nil and sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end
    n = actor.character_index
    src_rect = Rect.new((n % 4 * 3 + 1) * cw, (n / 4 * 4) * ch, cw, ch)
    alpha = enabled ? 255 : 128
    self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, alpha)
  end
  #--------------------------------------------------------------------------
  # Draw Gauge (New)
  #--------------------------------------------------------------------------
  def draw_gauge(x, y, now, max, gc1, gc2, width = 120)
    gw = width * now / max
    black = Color.new(0, 0, 0, gc1.alpha)
    white = Color.new(255, 255, 255, gc1.alpha)
    self.contents.fill_rect(x - 2, y + WLH - 10, width + 4, 10, black)
    self.contents.fill_rect(x - 1, y + WLH - 9, width + 2, 8, white)
    self.contents.fill_rect(x, y + WLH - 8, width, 6, black)
    self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
  end
  #--------------------------------------------------------------------------
  # Draw Mini Xp (New)
  #--------------------------------------------------------------------------
  def draw_actor_mini_exp(actor, x, y, width = 120)
    xp = actor.now_exp.to_f / actor.next_exp * 100
    self.contents.font.color = knockout_color
    self.contents.font.color = crisis_color if xp > 33.3
    self.contents.font.color = power_up_color if xp > 66.6
    self.contents.font.size = 14
    text = sprintf("%3.1f" , xp) + "%"
    text = ' ' if actor.level == 99
    self.contents.draw_text(x, y + 2, width + 4, WLH, text, 2)
    self.contents.font.size = Font.default_size
  end
  #--------------------------------------------------------------------------
  # Draw Xp Gauge (New)
  #--------------------------------------------------------------------------
  def draw_actor_exp_gauge(actor, x, y, width = 120, mini = false)
    now = actor.now_exp
    max = actor.next_exp
    c1 = Color.new(128, 0, 255)
    c2 = Color.new(255, 0, 255)
    draw_gauge(x, y, now, max, c1, c2, width)
    draw_actor_mini_exp(actor, x, y, width) if mini
  end
end

#==============================================================================
# Window_Gold
#==============================================================================

class Window_Gold < Window_Base
  #--------------------------------------------------------------------------
  # Refresh (Rewrite)
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    draw_icon(OW_HUD2::GOLD_ICON, 108, 0)
    self.contents.draw_text(0, 0, 104, WLH, $game_party.gold, 2)
  end
end

#==============================================================================
# HUD Window (New)
#==============================================================================

class Hud_Window < Window_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize
    super(-13, -19, Graphics.width + 32, 104)
    self.opacity = 0
    if $game_system.pressing_z
      refresh_party
    else
      refresh
    end
  end
  #--------------------------------------------------------------------------
  # Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @hud_actor = $game_party.members[0]
    self.contents.fill_rect(-2, 6, 136, 92, OW_HUD2::BACK_COLOR)
    draw_actor_graphic(@hud_actor, 15, 44)
    self.contents.fill_rect( 31, 15, 102, 8, OW_HUD2::BAR_BACK_COLOR)
    self.contents.fill_rect( 31, 37, 102, 8, OW_HUD2::BAR_BACK_COLOR)
    draw_actor_hp(@hud_actor, 32, 0, 100)
    draw_actor_mp(@hud_actor, 32, 22, 100)
    draw_hudactor_level(@hud_actor, 2, 48)
  end
  #--------------------------------------------------------------------------
  # Refresh Party
  #--------------------------------------------------------------------------
  def refresh_party
    self.contents.clear
    offset = self.contents.width / 4 - 1
    for actor in $game_party.members
      index = $game_party.members.index(actor)
      x = index * offset
      self.contents.fill_rect(x - 2, 6, 136, 92, OW_HUD2::BACK_COLOR)
      draw_actor_graphic(actor, x + 15, 44)
      self.contents.fill_rect(x + 31, 15, 102, 8, OW_HUD2::BAR_BACK_COLOR)
      self.contents.fill_rect(x + 31, 37, 102, 8, OW_HUD2::BAR_BACK_COLOR)
      draw_actor_hp(actor, x + 32, 0, 100)
      draw_actor_mp(actor, x + 32, 22, 100)
      draw_hudactor_level(actor, x + 2, 48)
    end
  end
  #--------------------------------------------------------------------------
  # Draw Level for HUD
  #--------------------------------------------------------------------------
  def draw_hudactor_level(actor, x, y)
    draw_actor_exp_gauge(actor, x + 4, y - 4, 122, true)
    self.contents.font.size = 16
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 32, WLH, Vocab::level_a)
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 12, y, 24, WLH, actor.level, 2)
    self.contents.font.size = Font.default_size
  end
end

#==============================================================================
# Command_Window (New)
#==============================================================================

class Command_Window < Window_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, text, index)
    super(x, y, 160, 56)
    @text = text
    @index = index
    refresh
  end
  #--------------------------------------------------------------------------
  # Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    enabled = true
    if ($game_system.save_disabled and
        OW_HUD2::COMMAND[@index][2].include?("Scene_File.new(true,")) or
        (Dir.glob('Save*.rvdata').size == 0 and
        OW_HUD2::COMMAND[@index][2].include?("Scene_File.new(false,"))
      self.contents.font.color.alpha = 128
      enabled = false
    end
    draw_icon(OW_HUD2::COMMAND[@index][1], 0, 0, enabled)
    self.contents.draw_text(28, 0, 100, WLH, @text, 0)
  end
end

#==============================================================================
# Time_Window (New)
#==============================================================================

class Time_Window < Window_Base
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y)
    super(x, y, 160, 56)
    refresh
  end
  #--------------------------------------------------------------------------
  # Update
  #--------------------------------------------------------------------------
  def update
    super
    refresh
  end
  #--------------------------------------------------------------------------
  # Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @count = Graphics.frame_count / Graphics.frame_rate
    hour = @count / 60 / 60
    min = @count / 60 % 60
    sec = @count % 60
    time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
    draw_icon(OW_HUD2::TIME_ICON, 100, 0)
    self.contents.draw_text(0, 0, 96, WLH, time_string, 1)
  end
end

#==============================================================================
# ActorStatus_Window (New)
#==============================================================================

class ActorStatus_Window < Window_Selectable
  #--------------------------------------------------------------------------
  # Initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, right = false)
    super(x, y, 160, 336)
    @right = right
    @party = []
    if @right
      @party.push($game_party.members[2]) if $game_party.members[2] != nil
      @party.push($game_party.members[3]) if $game_party.members[3] != nil
    else
      @party.push($game_party.members[0])
      @party.push($game_party.members[1]) if $game_party.members[1] != nil
    end
    refresh
    self.active = false
    self.index = -1
    self.openness = 0
  end
  #--------------------------------------------------------------------------
  # Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = @party.size
    count = 0
    for actor in @party
      y = count * 160
      draw_hudface(actor, 16, y + 2, 96, false, true)
      draw_actor_name(actor, 0, y)
      draw_actor_class(actor, 0, y + WLH * 1)
      draw_actor_state(actor, 16, y + WLH * 2)
      draw_actor_exp_gauge(actor, 4, y + WLH * 3, 120, true)
      draw_actor_level(actor, 0, y + WLH * 3)
      draw_actor_hp(actor, 0, y + WLH * 4, 128)
      draw_actor_mp(actor, 0, y + WLH * 5, 128)
      count += 1
    end
  end
  #--------------------------------------------------------------------------
  # Update cursor
  #--------------------------------------------------------------------------
  def update_cursor
    if @index < 0
      self.cursor_rect.empty
    elsif @index < @item_max
      self.cursor_rect.set(0, @index * 160, self.contents.width, 144)
    elsif @index >= 100
      self.cursor_rect.set(0, (@index - 100) * 160, self.contents.width, 144)
    else
      self.cursor_rect.set(0, 0, self.contents.width, @item_max * 144)
    end
  end
end

#==============================================================================
# Scene_Base
#==============================================================================

class Scene_Base
  #--------------------------------------------------------------------------
  # Create Snapshot for Using as Background of Another Screen (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_scene_base_snap_for_back snapshot_for_background unless $@
  def snapshot_for_background
    if $game_temp.no_blur
      $game_temp.background_bitmap.dispose
      $game_temp.background_bitmap = Graphics.snap_to_bitmap
    else
      ow_hud2_scene_base_snap_for_back
    end
  end
  #--------------------------------------------------------------------------
  # Create Background for Menu Screen (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_scene_base_create_menu_back create_menu_background unless $@
  def create_menu_background
    if $game_temp.no_blur
      @menuback_sprite = Sprite.new
      @menuback_sprite.bitmap = $game_temp.background_bitmap
      @menuback_sprite.color.set(0, 0, 0, 0)
      update_menu_background
    else
      ow_hud2_scene_base_create_menu_back
    end
  end
end

#==============================================================================
# Scene_Map
#==============================================================================

class Scene_Map < Scene_Base
  #--------------------------------------------------------------------------
  # Start (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_scene_map_start start unless $@
  def start
    ow_hud2_scene_map_start
    @hud_window = Hud_Window.new
  end
  #--------------------------------------------------------------------------
  # Terminate (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_scene_map_terminate terminate unless $@
  def terminate
    ow_hud2_scene_map_terminate
    @hud_window.dispose
  end
  #--------------------------------------------------------------------------
  # Update (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_scene_map_update update unless $@
  def update
    ow_hud2_scene_map_update
    unless $game_message.visible
      @hud_window.visible = !$game_switches[OW_HUD2DISABLE_SWITCH]
      return if $game_map.interpreter.running?
      update_hud if @hud_window.visible
    end
  end
  #--------------------------------------------------------------------------
  # Update HUD (New)
  #--------------------------------------------------------------------------
  def update_hud
    @hud_window.update
    return if $game_player.moving?
    return if $game_party.members.size < 2
    if Graphics.frame_count % 10 == 0
      if $game_system.pressing_z
        @hud_window.refresh_party
      else
        @hud_window.refresh
      end
    end
    if Input.trigger?(OW_HUD2::MAP_BUTTON_R)
      Sound.play_save
      old_lead = $game_party.members.shift.id
      $game_party.remove_actor(old_lead)
      $game_party.add_actor(old_lead)
      $game_player.refresh
      if $game_system.pressing_z
        @hud_window.refresh_party
      else
        @hud_window.refresh
      end
    elsif Input.trigger?(OW_HUD2::MAP_BUTTON_L)
      Sound.play_save
      actors = []
      $game_party.members.each{|actor| actors.push(actor.id)}
      actors.unshift(actors.pop)
      actors.each{|id| $game_party.remove_actor(id);$game_party.add_actor(id)}
      $game_player.refresh
      if $game_system.pressing_z
        @hud_window.refresh_party
      else
        @hud_window.refresh
      end
    elsif Input.trigger?(OW_HUD2::BUTTON) and OW_HUD2::BUTTON_TOGGLE
      Sound.play_cursor
      $game_system.pressing_z = !$game_system.pressing_z
      if $game_system.pressing_z
        @hud_window.refresh_party
      else
        @hud_window.refresh
      end
    elsif Input.trigger?(OW_HUD2::BUTTON) and !$game_system.pressing_z and
        !OW_HUD2::BUTTON_TOGGLE
      Sound.play_cursor
      @hud_window.refresh_party
      $game_system.pressing_z = true
    elsif !Input.press?(OW_HUD2::BUTTON) and $game_system.pressing_z and
        !OW_HUD2::BUTTON_TOGGLE
      Sound.play_cursor
      @hud_window.refresh
      $game_system.pressing_z = false
    end
  end
  #--------------------------------------------------------------------------
  # Switch to Menu Screen (Mod)
  #--------------------------------------------------------------------------
  alias ow_hud2_scene_map_call_menu call_menu unless $@
  def call_menu
    $game_temp.no_blur = true
    ow_hud2_scene_map_call_menu
  end
end

#==============================================================================
# Scene_Menu
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # Initialize (Rewrite)
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
    @return_to_select = false
    if OW_HUD2::RETURN_SELECT
      @return_to_select = OW_HUD2::COMMAND[@menu_index][3]
    end
  end
  #--------------------------------------------------------------------------
  # Start (Rewrite)
  #--------------------------------------------------------------------------
  def start
    super
    @size = OW_HUD2::COMMAND.size - 1
    @com_y = [182, 266]
    if @size > 2
      min = 2
      max = @size - 1
      amount = max - min
      if amount > 0
        offset = 108 / amount
      else
        offset = 0
      end
      counter = 0
      for i in min..max
        @com_y.push(236 - offset * counter)
        counter += 1
      end
    end
    @com_y.push(98)
    @y_off = (Graphics.height - 416) / 2
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, Graphics.height - 56)
    @time_window = Time_Window.new(Graphics.width - 160, Graphics.height - 56)
    x = (Graphics.width - 192) / 2
    y = (Graphics.height - 88) / 2 + 2
    @selection = Window_Base.new(x, y, 192, 88)
    @selection.back_opacity = 192
    @selection.z = 64
    @actor_window_left = ActorStatus_Window.new(-160, 0)
    @actor_window_right = ActorStatus_Window.new(Graphics.width, 0, true)
  end
  #--------------------------------------------------------------------------
  # Terminate (Rewrite)
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    for i in 0..@size
      @command_window[i].dispose
    end
    @gold_window.dispose
    @time_window.dispose
    @selection.dispose
    @actor_window_left.dispose
    @actor_window_right.dispose
  end
  #--------------------------------------------------------------------------
  # Update (Rewrite)
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    if @return_to_select
      @return_to_select = false
      @scene_call = "$scene = " + OW_HUD2::COMMAND[@menu_index][2]
      $game_temp.return_index = @menu_index
      start_actor_selection
    end
    for i in 0..@size
      @command_window[i].update
    end
    @gold_window.update
    @time_window.update
    @selection.update
    @actor_window_left.update
    @actor_window_right.update
    if @command_window[@menu_index].active
      update_command_selection
    elsif
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # Wait (New)
  #--------------------------------------------------------------------------
  def wait(duration)
    for w in 1..duration
      for i in 0..@size
        @command_window[i].update
      end
      @gold_window.update
      @time_window.update
      @selection.update
      @actor_window_left.update
      @actor_window_right.update
      Graphics.update
    end
  end
  #--------------------------------------------------------------------------
  # Create Command Window (Rewrite)
  #--------------------------------------------------------------------------
  def create_command_window
    @command_window = []
    count = 0
    x = (Graphics.width - 160) / 2
    for i in @menu_index..@size
      y = @com_y[count] + @y_off
      @command_window[i] = Command_Window.new(x, y, OW_HUD2::COMMAND[i][0], i)
      if i == @menu_index
        op = 255
      elsif (i == @menu_index + 1) or (@menu_index == 0 and i == @size)
        op = 255
      else
        op = 128
      end
      @command_window[i].opacity = op
      @command_window[i].back_opacity = op
      @command_window[i].contents_opacity = op
      @command_window[i].z = 1
      @command_window[i].active = i == @menu_index
      count += 1
    end
    if @menu_index != 0
      for i in 0...@menu_index
        y = @com_y[count] + @y_off
        @command_window[i] = Command_Window.new(x, y, OW_HUD2::COMMAND[i][0], i)
        if (i == @menu_index - 1) or (@menu_index == @size and i == 0)
          op = 255
        else
          op = 128
        end
        @command_window[i].opacity = op
        @command_window[i].back_opacity = op
        @command_window[i].contents_opacity = op
        @command_window[i].z = 1
        count += 1
      end
    end
    @command_window[@menu_index].z = 100
    if @menu_index == 0
      @command_window[@size].z = 100
    else
      @command_window[@menu_index - 1].z = 100
    end
    if @menu_index == @size
      @command_window[0].z = 100
    else
      @command_window[@menu_index + 1].z = 100
    end
  end
  #--------------------------------------------------------------------------
  # Move Command Windows (New)
  #--------------------------------------------------------------------------
  def move_command_windows
    count = 0
    for i in @menu_index..@size
      if i == @menu_index
        op = 255
      elsif (i == @menu_index + 1) or (@menu_index == 0 and i == @size)
        op = 255
      else
        op = 128
      end
      cx = (Graphics.width - 160) / 2
      y = @com_y[count] + @y_off
      @command_window[i].move_to(cx, y, 15, op)
      @command_window[i].back_opacity = op
      @command_window[i].contents_opacity = op
      @command_window[i].active = i == @menu_index
      count += 1
    end
    if @menu_index != 0
      for i in 0...@menu_index
        if (i == @menu_index - 1) or (@menu_index == @size and i == 0)
          op = 255
        else
          op = 128
        end
        cx = (Graphics.width - 160) / 2
        y = @com_y[count] + @y_off
        @command_window[@menu_index].z = 100
        @command_window[i].move_to(cx, y, 15, op)
        @command_window[i].back_opacity = op
        @command_window[i].contents_opacity = op
        count += 1
      end
    end
    wait(10)
    for i in 0..@size
      @command_window[i].z = 1
      @command_window[i].refresh
    end
    if @menu_index == 0
      @command_window[@size].z = 100
    else
      @command_window[@menu_index - 1].z = 100
    end
    if @menu_index == @size
      @command_window[0].z = 100
    else
      @command_window[@menu_index + 1].z = 100
    end
    @command_window[@menu_index].z = 100
  end
  #--------------------------------------------------------------------------
  # Update Command Selection (Rewrite)
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $game_temp.no_blur = false
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @menu_index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and
          OW_HUD2::COMMAND[@menu_index][2].include?("Scene_File.new(true,")
        Sound.play_buzzer
        return
      elsif Dir.glob('Save*.rvdata').size == 0 and
          OW_HUD2::COMMAND[@menu_index][2].include?("Scene_File.new(false,")
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      @scene_call = "$scene = " + OW_HUD2::COMMAND[@menu_index][2]
      $game_temp.return_index = @menu_index
      if OW_HUD2::COMMAND[@menu_index][3] == true
        start_actor_selection
      else
        eval(@scene_call)
      end
    elsif (Input.repeat?(Input::DOWN) and $game_switches[OW_HUD2REVERSE]) or
        (Input.repeat?(Input::UP) and !$game_switches[OW_HUD2REVERSE])
      Sound.play_cursor
      @menu_index += 1
      @menu_index = 0 if @menu_index == @size + 1
      move_command_windows
    elsif (Input.repeat?(Input::UP) and $game_switches[OW_HUD2REVERSE]) or
        (Input.repeat?(Input::DOWN) and !$game_switches[OW_HUD2REVERSE])
      Sound.play_cursor
      @menu_index -= 1
      @menu_index = @size if @menu_index == -1
      move_command_windows
    end
  end
  #--------------------------------------------------------------------------
  # Start Actor Selection (Rewrite)
  #--------------------------------------------------------------------------
  def start_actor_selection
    @actor_window_left.move_to(0, 0, 15)
    @actor_window_right.move_to(Graphics.width - 160, 0, 15)
    wait(7)
    @actor_window_left.open
    @actor_window_right.open
    @command_window[@menu_index].active = false
    if $game_party.last_actor_index > 1
      @actor_window_right.active = true
      @actor_window_right.index = $game_party.last_actor_index - 2
    else
      @actor_window_left.active = true
      @actor_window_left.index = $game_party.last_actor_index
    end
  end
  #--------------------------------------------------------------------------
  # End Actor Selection (Rewrite)
  #--------------------------------------------------------------------------
  def end_actor_selection
    @actor_window_left.move_to(-160, 0, 15)
    @actor_window_right.move_to(Graphics.width, 0, 15)
    wait(7)
    @actor_window_left.close
    @actor_window_right.close
    @command_window[@menu_index].active = true
    @actor_window_left.active = false
    @actor_window_right.active = false
    @actor_window_left.index = -1
    @actor_window_right.index = -1
  end
  #--------------------------------------------------------------------------
  # Update Actor Selection (Rewrite)
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      if @actor_window_left.active
        actor_index = @actor_window_left.index
      else
        actor_index = @actor_window_right.index + 2
      end
      $game_party.last_actor_index = actor_index
      Sound.play_decision
      eval(@scene_call)
    elsif Input.trigger?(Input::RIGHT) and @actor_window_left.active and
        $game_party.members.size > 2
      Sound.play_cursor
      @actor_window_left.active = false
      @actor_window_right.index = @actor_window_left.index
      @actor_window_right.index = 0 if $game_party.members.size == 3
      @actor_window_right.active = true
      @actor_window_left.index = -1
    elsif Input.trigger?(Input::LEFT) and @actor_window_right.active
      Sound.play_cursor
      @actor_window_right.active = false
      @actor_window_left.index = @actor_window_right.index
      @actor_window_left.active = true
      @actor_window_right.index = -1
    end
  end
end

#==============================================================================
# Scene_Item
#==============================================================================

class Scene_Item < Scene_Base
  #--------------------------------------------------------------------------
  # Return to Original Screen (Rewrite)
  #--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new($game_temp.return_index)
  end
end

#==============================================================================
# Scene_Skill
#==============================================================================

class Scene_Skill < Scene_Base
  #--------------------------------------------------------------------------
  # Return to Original Screen (Rewrite)
  #--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new($game_temp.return_index)
  end
end

#==============================================================================
# Scene_Equip
#==============================================================================

class Scene_Equip < Scene_Base
  #--------------------------------------------------------------------------
  # Return to Original Screen (Rewrite)
  #--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new($game_temp.return_index)
  end
end

#==============================================================================
# Scene_Status
#==============================================================================

class Scene_Status < Scene_Base
  #--------------------------------------------------------------------------
  # Return to Original Screen (Rewrite)
  #--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new($game_temp.return_index)
  end
end

#==============================================================================
# Scene_File
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # Return to Original Screen (Rewrite)
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new($game_temp.return_index)
    end
  end
end

#==============================================================================
# Scene_End
#==============================================================================

class Scene_End < Scene_Base
  #--------------------------------------------------------------------------
  # Return to Original Screen (Rewrite)
  #--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new($game_temp.return_index)
  end
end

Demo: Não precisa

Screen: Não precisa

Qualquer coisa é só me procurar! Comentem
8D


Última edição por DigiMatheus em Qua Jul 21, 2010 8:52 am, editado 2 vez(es)
DigiMatheus
DigiMatheus
Ativo
Ativo

Mensagens : 45
LM Pontos : 128
Up's : 12
Data de inscrição : 18/07/2010
Idade : 26
Localização : Konoha

Ficha Maker
Premios:

http://animemperor.blogspot.com

Ir para o topo Ir para baixo

Scripts Re: Script HUD Menu

Mensagem por XxBestxX Seg Jul 19, 2010 6:26 pm

Muito bom +1UP
XxBestxX
XxBestxX
ADM
ADM

Mensagens : 104
LM Pontos : 188
Up's : 16
Data de inscrição : 09/04/2010
Idade : 27

Ficha Maker
Premios:

https://legendarymakers.forumeiros.net

Ir para o topo Ir para baixo

Ir para o topo

- Tópicos semelhantes

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