¡Bienvenido a Universo Maker!
¿Es esta la primera vez que visitas el foro? Si es así te recomendamos que te registres para tener completo acceso a todas las áreas y secciones del foro, así también podrás participar activamente en la comunidad. Si ya tienes una cuenta, conectate cuanto antes.
Iniciar Sesión Registrarme

No estás conectado. Conéctate o registrate

Ver el tema anterior Ver el tema siguiente Ir abajo Mensaje [Página 1 de 1.]

#1 [RMXP] OZ Customizable Menu el Miér Jun 13, 2012 10:35 pm

orochii

avatar
OZ Customizable Menu
Autor: Orochii Zouveleki Versión 1.1 (probado con RGSS102J.dll)
Descripción:
Esto es un script de personalización del menú principal. Desde posiciones, tamaños, o estilos en que se muestran las distintas "informaciones", aparte de la personalización de los efectos de cada comando, su orden, entre otras cosas. Todo hecho para ser personalizado a travez de una configuración.

Características:

  • Cambio de posiciones, tamaños y estilos a travez de una configuración (supuestamente es "user-friendly").
  • Posibilidad de agregar/remover/reordenar todos los comandos a travez de la configuración (nombre, escena que llamará y si necesita escoger un personaje).
  • Posibilidad de poner como fondo imágenes tanto móviles como estáticas, así como el mapa actual (o las tres cosas al mismo tiempo).
  • Ventana de nombre de mapa.
  • ¡NUEVA! (1.1) Posibilidad de crear "submenúes" dentro del menú, con opciones de posición.
  • ¡AÑADIDO! (1.1) soporte para faces.


Imágenes:



Demo:
La demo incluye el "Imagen de fondo para menúes" (script mío), y el "Sistema de posiciones mejorado" que hace poco hicimos entre gerrtunk, Wecoc, Pokepik y... yo jaja.
Sólo como para probar compatibilidades, y para que fuera más guay (?).
Demo (hosteado en CherryShare)
Demo (hosteado en Sta.sh de DeviantArt)

Script:
Configuración
Código:
#===================================================================#
#========================== CONFIGURATION ==========================#
#===================================================================#

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  Menu general display and behaviour configuration.
#==============================================================================

class Window_Base < Window
  CHECK_FOR_FACE = false
end

class Scene_Menu
 
  #====DISPLAY====
  #-General
  FONT_NAME = "Times New Roman"
  FONT_SIZE = 16
 
  #-Background
  #--
  USE_MAP_AS_BACK = true  #Map as background when menu is open?
 
  #--
  BACK = "menu_back"      #Background static image name,
  BACK_OPACITY = 220        #...its opacity,
  BACK_X = 0                #...its X position
  BACK_Y = 0                #...and its Y position.
 
  #--
  FOGS = ["001-Fog01","001-Fog01"]            #Arrays containing the fogs names,
  FOGS_OPACITY = [20,20]  #...their opacity,
  FOGS_SPEED_X = [4,-3]    #...their x_speed
  FOGS_SPEED_Y = [4,-5]    #...and their y_speed.
  FOGS_HUE =    [0,0]
 
  #-Windows
  COMMAND_OPACITY=0        #Command window oppacity,
  COMMAND_X=0              #...its X position,
  COMMAND_Y=388            #...Y position,
  COMMAND_WIDTH=320        #...width and height.
  COMMAND_HEIGHT=0      #Zero: size depends of commands
  COMMAND_COLUMNS=3
  #--
  PLAYTIME = true          #You want playtime window?
  PLAYTIME_OPACITY=0        #Put in here its opacity,
  PLAYTIME_X=320            #...X position
  PLAYTIME_Y=416            #...and Y position.
  PLAYTIME_WIDTH=160
  PLAYTIME_MODE=2
  #--
  STEPS = false              #You want steps window?
  STEPS_OPACITY=0          #Put in here its opacity,
  STEPS_X=160              #...X position
  STEPS_Y=416              #...and Y position.
  STEPS_WIDTH=160
  STEPS_MODE=2
  #--
  LOCATION = true              #You want steps window?
  LOCATION_OPACITY=0          #Put in here its opacity,
  LOCATION_X=0                #...X position
  LOCATION_Y=416              #...and Y position.
  LOCATION_WIDTH=320
  LOCATION_MODE=2
  #--
  GOLD = true              #You want gold window?
  GOLD_OPACITY=0            #Put in here its opacity,
  GOLD_X=480                #...X position
  GOLD_Y=416                #...and Y position.
  GOLD_WIDTH=160
  GOLD_MODE=0
  #--
  STATUS = true            #Wanna see the status window?
  STATUS_OPACITY=0          #Put in here its opacity,
  STATUS_X=240              #...X position
  STATUS_Y=0                #...and Y position.
 
  #====COMMANDS====
  #-Command Definition
 
  COMMANDS = {}
 
  COMMANDS= { #Set command display name, "target" scene
              #and if they need you to select an actor
             
              #Behaviour: if
  #Command name  Display name  Behaviour      Needs selection? Submenu?
  "item"  =>    ["Objetos",    "Scene_Item",    false,          false],
  "skill" =>    ["Técnicas",    "Scene_Skill",  true,            false],
  "equip" =>    ["Equipo",      "Scene_Equip",  true,            false],
  "status"=>    ["Estados",    "Scene_Status",  true,            false],
  "save"  =>    ["Guardar",    "Scene_Save",    false,          false],
  #"bpos"  =>    ["Posición",    "Scene_Position",true,            false],
  "exit"  =>    ["Salir",      "Scene_End",    false,          false],
  "char"  =>    ["Personaje",  "Character",    false,          true],
  "system"=>    ["Sistema",    "System",        false,          true],
 
  #You can add more commands adding the following for each:
  #"name"  =>  ["Display",    "YourScene",    false,          false],
  }
 
  SUBMENUES = {
  "Character"=>["skill","equip","status"],
  "System"=>["save","exit"]
 
  }
  SUB_WIDTH=160
  SUB_COLUMNS=1
  SUB_X = {
    :default => -1,
    "Character"=>5,
  }
  SUB_Y = {
    :default => -1,
    "Character"=>5,
  }
  #-Command order
  #Here, you can modify order, or select which you'll include.
  USED_COMMANDS= [ "item", "char","system" ]
 
  #-Command properties
  SAVE_COMMAND= "save" #Put in here the Save command ONLY
  NOPARTY_DISABLE= ["item","skill","equip","status"] #When party has zero actors,
                                                #these commands will be disabled.
  COMMAND_RESTRICTION= "skill"
 
end

#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  Menu Status info display configuration.
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #-General
  ACTOR_SPACING=96
  X_OFFSET=64
  MAIN_WIDTH=400
  MAIN_HEIGHT=416
 
  #-Info Table
  #          Graphic Name  Class Level State Exp  HP    SP    Face
  INCLUSION = [true, true, true, true, true, true, true, true, true]
  X_POS =    [-40,  40,    144,  40,    112,  40,    196,  196, -96]
  Y_POS =    [80,    0,    0,    32,  32,  64,  32,  64, 0]
 
  #      Exp  HP  SP
  WIDTH=[80,  80,  80] #Changes information when < 140.
 
  #===================================================================#
  #====================== END OF CONFIGURATION =======================#
  #===================================================================#

end

Principal
Código:
#==============================================================================
# ** Window_Command
#------------------------------------------------------------------------------
#  This window deals with general command choices.
#  Modified to make it possible to vary number of columns.
#==============================================================================

#=========================================
# Piece of code from: AMS
#=========================================
class Scene_Title
 $map_info = load_data("Data/MapInfos.rxdata")
end

class Game_Map
  def name
  $map_info[@map_id].name
  end
end
#=========================================
class Window_Base < Window
  def draw_actor_face(actor, x, y)
    return if CHECK_FOR_FACE and !(FileTest.exist?("Picture/Face/"+actor.character_name+".png"))
    bitmap = RPG::Cache.picture("Face/"+actor.character_name)
    cw = bitmap.width
    ch = bitmap.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x, y, bitmap, src_rect)
  end
end

class Window_Command2 < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #    width    : window width
  #    commands : command text string array
  #--------------------------------------------------------------------------
  def initialize(width, commands, columns)
    # Compute window height from command quantity
    super(0, 0, width, commands.size/columns * 32 + 32)
    @item_max = commands.size
    @commands = commands
    @column_max = columns
    self.contents = Bitmap.new(width - 32, @item_max/@column_max * 32)
    refresh
    self.index = 0
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i, normal_color)
    end
  end
  #--------------------------------------------------------------------------
  # * Draw Item
  #    index : item number
  #    color : text color
  #--------------------------------------------------------------------------
  def draw_item(index, color)
    self.contents.font.color = color
    x = 4 + index % @column_max * (self.width/@column_max)
    y = index / @column_max * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    self.contents.draw_text(rect, @commands[index])
  end
  #--------------------------------------------------------------------------
  # * Disable Item
  #    index : item number
  #--------------------------------------------------------------------------
  def disable_item(index)
    draw_item(index, disabled_color)
  end
end

#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen.
#==============================================================================

class Window_MenuStatus < Window_Selectable

  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, MAIN_WIDTH, MAIN_HEIGHT)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = X_OFFSET
      y = i * ACTOR_SPACING
      actor = $game_party.actors[i]
      draw_actor_face(actor, x + X_POS[8], y + Y_POS[8]) if INCLUSION[8]
      draw_actor_graphic(actor, x + X_POS[0], y + Y_POS[0]) if INCLUSION[0]
      draw_actor_name(actor, x + X_POS[1], y + Y_POS[1]) if INCLUSION[1]
      draw_actor_class(actor, x + X_POS[2], y + Y_POS[2]) if INCLUSION[2]
      draw_actor_level(actor, x + X_POS[3], y + Y_POS[3]) if INCLUSION[3]
      draw_actor_state(actor, x + X_POS[4], y + Y_POS[4]) if INCLUSION[4]
      draw_actor_exp(actor, x + X_POS[5], y + Y_POS[5], WIDTH[0]) if INCLUSION[5]
      draw_actor_hp(actor, x + X_POS[6], y + Y_POS[6], WIDTH[1]) if INCLUSION[6]
      draw_actor_sp(actor, x + X_POS[7], y + Y_POS[7], WIDTH[2]) if INCLUSION[7]
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
      self.cursor_rect.set(0, @index * ACTOR_SPACING, self.width - 32, ACTOR_SPACING)
    end
  end
   
  #--------------------------------------------------------------------------
  # * Draw EXP
  #    actor : actor
  #    x    : draw spot x-coordinate
  #    y    : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_actor_exp(actor, x, y, width = 144)
    self.contents.font.color = system_color
    self.contents.draw_text(x, y, 24, 32, "E")
    # Calculate if there is draw space for everything
    if width - 32 >= 108
      hp_x = x + width - 108
      flag = true
    elsif width - 32 >= 48
      hp_x = x + width - 48
      flag = false
    end
    self.contents.font.color = normal_color
    if flag
      self.contents.draw_text(x + 24, y, 84, 32, actor.exp_s, 2)
      self.contents.draw_text(x + 108, y, 12, 32, "/", 1)
      self.contents.draw_text(x + 120, y, 84, 32, actor.next_exp_s)
    else
      self.contents.draw_text(x + 120, y, 84, 32, actor.next_rest_exp_s)
    end
  end 
end

#==============================================================================
# ** Window_Location
#------------------------------------------------------------------------------
#  This window displays the map name.
#==============================================================================

class Window_Location < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(mode=0, width=160)
    @mode = mode
    super(0, 0, width, 96)
    self.height = 64 if @mode==2
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    text = $game_map.name
    case @mode
    when 1
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Localización")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 32, self.contents.width-4, 32, text)
    when 2
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Localización")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, text, 2)
    when 3
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, text, 2)
    else
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Localización")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 32, self.contents.width-4, 32, text, 2)
    end
  end
end

#==============================================================================
# ** Window_Gold
#------------------------------------------------------------------------------
#  This window displays amount of gold.
#==============================================================================

class Window_Gold < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(mode=0, width=160)
    @mode = mode
    super(0, 0, width, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    case @mode
    when 1
      self.contents.clear
      cx = contents.text_size($game_party.gold.to_s).width
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.contents.width, 32, $game_party.gold.to_s)
      self.contents.font.color = system_color
      self.contents.draw_text(4+cx, 0, 60, 32, $data_system.words.gold)
    else
      self.contents.clear
      cx = contents.text_size($data_system.words.gold).width
      self.contents.font.color = normal_color
      self.contents.draw_text(4-cx, 0, self.contents.width-cx-2, 32, $game_party.gold.to_s, 2)
      self.contents.font.color = system_color
      self.contents.draw_text(124-cx, 0, cx, 32, $data_system.words.gold, 2)
    end
  end
end

#==============================================================================
# ** Window_PlayTime
#------------------------------------------------------------------------------
#  This window displays play time on the menu screen.
#==============================================================================

class Window_PlayTime < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(mode=0, width=160)
    @mode = mode
    super(0, 0, width, 96)
    self.height = 64 if @mode==2
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    @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)
    case @mode
    when 1
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Tiempo")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 32, self.contents.width-4, 32, text)
    when 2
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Tiempo")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, text, 2)
    when 3
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, text, 2)
    else
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Tiempo")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 32, self.contents.width-4, 32, text, 2)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    super
    if Graphics.frame_count / Graphics.frame_rate != @total_sec
      refresh
    end
  end
end

#==============================================================================
# ** Window_Steps
#------------------------------------------------------------------------------
#  This window displays step count on the menu screen.
#==============================================================================

class Window_Steps < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(mode=0, width=160)
    @mode = mode
    super(0, 0, width, 96)
    self.height = 64 if @mode>=2
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    case @mode
    when 1
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Pasos")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 32, self.contents.width-4, 32, $game_party.steps.to_s)
    when 2
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Pasos")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, $game_party.steps.to_s, 2)
    when 3
      self.contents.clear
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, $game_party.steps.to_s, 2)
    else
      self.contents.clear
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, self.contents.width-4, 32, "Pasos")
      self.contents.font.color = normal_color
      self.contents.draw_text(4, 32, self.contents.width-4, 32, $game_party.steps.to_s, 2)
    end
  end
end


#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu

  #--------------------------------------------------------------------------
  # * Object Initialization
  #    menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = 0 #menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    @spriteset = Spriteset_Map.new if USE_MAP_AS_BACK
    @back = Sprite.new
    @back.bitmap = RPG::Cache.picture(BACK)
    if BACK != ""
      @back.opacity = BACK_OPACITY; @back.x = BACK_X; @back.y = BACK_Y
    end
    @fogs = []
    @vpx = Viewport.new(0,0,640,480)
    for i in 0..FOGS.size-1
      if FOGS[i] != ""
        @fogs[i] = Plane.new(@vpx)
        @fogs[i].bitmap = RPG::Cache.fog(FOGS[i],FOGS_HUE[i])
        @fogs[i].opacity = FOGS_OPACITY[i]
      end
    end
    comm_arr = []
    @comm_names = []
    @comm_scene = []
    @comm_sel = []
    @comm_sub = []
    @comm_disable = []
    # Make command window
    for i in 0..USED_COMMANDS.size-1
      comm_arr = COMMANDS[USED_COMMANDS[i]]
      @comm_names[i] = comm_arr[0]
      @comm_scene[i] = comm_arr[1]
      @comm_sel[i] = comm_arr[2]
      @comm_sub[i] = comm_arr[3]
    end
    @command_window = Window_Command2.new(COMMAND_WIDTH, @comm_names, COMMAND_COLUMNS)
    @command_window.index = @menu_index
    @command_window.contents.font.name= FONT_NAME
    @command_window.contents.font.size= FONT_SIZE
    @command_window.refresh
   
    #Command window properties
    @command_window.opacity = COMMAND_OPACITY
    @command_window.x = COMMAND_X
    @command_window.y = COMMAND_Y
    @command_window.height = COMMAND_HEIGHT unless COMMAND_HEIGHT==0
   
    # If save is forbidden
    if PLAYTIME==true
      # Make play time window
      @playtime_window = Window_PlayTime.new(PLAYTIME_MODE,PLAYTIME_WIDTH)
      @playtime_window.opacity = PLAYTIME_OPACITY
      @playtime_window.x = PLAYTIME_X
      @playtime_window.y = PLAYTIME_Y
      @playtime_window.contents.font.name= FONT_NAME
      @playtime_window.contents.font.size= FONT_SIZE
      @playtime_window.refresh
    end
   
    if STEPS == true              #You want steps window?
      # Make steps window
      @steps_window = Window_Steps.new(STEPS_MODE,STEPS_WIDTH)
      @steps_window.opacity = STEPS_OPACITY
      @steps_window.x = STEPS_X
      @steps_window.y = STEPS_Y
      @steps_window.contents.font.name= FONT_NAME
      @steps_window.contents.font.size= FONT_SIZE
      @steps_window.refresh
    end
   
    if LOCATION == true              #You want location window?
      # Make location window
      @location_window = Window_Location.new(LOCATION_MODE,LOCATION_WIDTH)
      @location_window.opacity = LOCATION_OPACITY
      @location_window.x = LOCATION_X
      @location_window.y = LOCATION_Y
      @location_window.contents.font.name= FONT_NAME
      @location_window.contents.font.size= FONT_SIZE
      @location_window.refresh
    end
   
    if GOLD == true
      # Make gold window
      @gold_window = Window_Gold.new(GOLD_MODE,GOLD_WIDTH)
      @gold_window.opacity = GOLD_OPACITY
      @gold_window.x = GOLD_X
      @gold_window.y = GOLD_Y
      @gold_window.contents.font.name= FONT_NAME
      @gold_window.contents.font.size= FONT_SIZE
      @gold_window.refresh
    end
   
    if STATUS == true
      # Make status window
      @status_window = Window_MenuStatus.new
      @status_window.opacity = STATUS_OPACITY
      @status_window.x = STATUS_X
      @status_window.y = STATUS_Y
      @status_window.contents.font.name= FONT_NAME
      @status_window.contents.font.size= FONT_SIZE
      @status_window.refresh
    end
    @submenu={}
    @subc_names = {}
    @subc_scene = {}
    @subc_sel = {}
    @subc_sub = {}
    @subc_disable = {}
    for j in @comm_scene
      next unless SUBMENUES.include?(j)
      sub_info=SUBMENUES[j]
      @subc_names[j] = []
      @subc_scene[j] = []
      @subc_sel[j] = []
      @subc_sub[j] = []
      for i in 0..sub_info.size-1
        subc_arr = COMMANDS[sub_info[i]]
        @subc_names[j][i] = subc_arr[0]
        @subc_scene[j][i] = subc_arr[1]
        @subc_sel[j][i] = subc_arr[2]
        @subc_sub[j][i] = false #subc_arr[3]
      end
      @submenu[j]= Window_Command2.new(SUB_WIDTH, @subc_names[j], SUB_COLUMNS)
      sub_x_t= SUB_X.include?(j) ? SUB_X[j] : SUB_X[:default]
      sub_y_t= SUB_Y.include?(j) ? SUB_Y[j] : SUB_Y[:default]
      sxt = sub_x_t == -1 ? COMMAND_X : sub_x_t
      syt = sub_y_t == -1 ? (COMMAND_Y-@submenu[j].height) : sub_y_t
      @submenu[j].x = sxt
      @submenu[j].y = syt
      @submenu[j].visible = false
      @submenu[j].active = false
    end
     
    # If number of party members is 0
   
      # No party disable
    for i in 0..USED_COMMANDS.size-1
      if $game_party.actors.size == 0
        if NOPARTY_DISABLE.include?(USED_COMMANDS[i])
          @comm_disable.push(i)
          @command_window.disable_item(i)
        end
      end
      if $game_system.save_disabled
        if SAVE_COMMAND == USED_COMMANDS[i]
          # Disable save
          @comm_disable.push(i)
          @command_window.disable_item(i)
        end
      end
    end
   
    for j in @comm_scene
      next unless SUBMENUES.include?(j)
      @subc_disable[j] = []
      if $game_party.actors.size == 0
        for i in 0..@subc_names[j].size-1
          if NOPARTY_DISABLE.include?(SUBMENUES[j][i])
            @subc_disable[j].push(i)
            @submenu[j].disable_item(i)
          end
        end
      end
    end
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @spriteset.dispose if USE_MAP_AS_BACK
    for i in 0..FOGS.size-1
      @fogs[i].dispose if FOGS[i] != ""
    end
    @back.bitmap.dispose if @back.bitmap != nil
    @back.dispose
    @command_window.dispose
    for j in @comm_scene
        next unless SUBMENUES.include?(j)
        @submenu[j].dispose
    end
    @playtime_window.dispose if PLAYTIME==true
    @steps_window.dispose if STEPS == true
    @location_window.dispose if LOCATION == true
    @gold_window.dispose if GOLD == true
    @status_window.dispose if STATUS == true
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @spriteset.update if USE_MAP_AS_BACK
    for i in 0..FOGS.size-1
      if FOGS[i] != ""
        @fogs[i].ox += FOGS_SPEED_X[i]=nil ? 0 : FOGS_SPEED_X[i]
        @fogs[i].oy += FOGS_SPEED_Y[i]=nil ? 0 : FOGS_SPEED_Y[i]
      end
    end
    @command_window.update
    @playtime_window.update if PLAYTIME==true
    @steps_window.update if STEPS == true
    @location_window.update if LOCATION == true
    @gold_window.update if GOLD == true
    @status_window.update if STATUS == true
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    for j in @comm_scene
      next unless SUBMENUES.include?(j)
      if @submenu[j].active
        update_subcommand(j)
        return
      end
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if @comm_disable.include?(@command_window.index)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      $game_system.se_play($data_system.decision_se)
      if @comm_sel[@command_window.index]
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      else
        if @comm_sub[@command_window.index]
          #print @comm_scene[@command_window.index]
          @submenu[@comm_scene[@command_window.index]].active = true
          @submenu[@comm_scene[@command_window.index]].visible = true
          @submenu[@comm_scene[@command_window.index]].index = 0
          @command_window.active = false
        else
          result = eval("$scene = "+@comm_scene[@command_window.index]+".new")
        end
      end
    end
  end
 
  def update_subcommand(j)
    #print j
    # If B button was pressed
    @submenu[j].update
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @submenu[j].visible = false
      @submenu[j].active = false
      @submenu[j].index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if @subc_disable[j].include?(@submenu[j].index)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end                                                                #=============TO BE DONE!
      # Branch by command window cursor position
      $game_system.se_play($data_system.decision_se)
      if @subc_sel[j][@submenu[j].index]
        @submenu[j].active = false
        #@submenu[j].visible = true
        @status_window.active = true
        @status_window.index = 0
      else
        result = eval("$scene = "+@subc_scene[j][@submenu[j].index]+".new")
      end
    end
  end
 
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
 
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      for j in @comm_scene
        #print j
        next unless SUBMENUES.include?(j)
        if @submenu[j].visible
          #print j
          @submenu[j].active = true
          @command_window.active = false
        end
      end
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      for j in @comm_scene
        next unless SUBMENUES.include?(j)
        if @submenu[j].visible
          #=================================================================TO DO!!
          if $game_party.actors[@status_window.index].restriction >= 2 && @submenu[j].index==SUBMENUES[j].index(COMMAND_RESTRICTION)
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          $game_system.se_play($data_system.decision_se)
          result = eval("$scene = "+@subc_scene[j][@submenu[j].index]+".new("+@status_window.index.to_s+")")
          return
        end
      end
      if $game_party.actors[@status_window.index].restriction >= 2 && @command_window.index==USED_COMMANDS.index(COMMAND_RESTRICTION)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      result = eval("$scene = "+@comm_scene[@command_window.index]+".new("+@status_window.index.to_s+")")
      return
    end
  end
end

Instrucciones de uso:
Pegar ambos scripts sobre Main.
Revisar el script de Configuración y modificar lo que se vea necesario (hay mucho dónde mirar).

Preguntas Frecuentes:
No hay.

Salut,
OZ

PD: Ah y no, no me interesa si me ponen en los créditos =D. Como quieran.

Ver el tema anterior Ver el tema siguiente Volver arriba  Mensaje [Página 1 de 1.]

Permisos de este foro:
No puedes responder a temas en este foro.