Partagez
Aller en bas
dalanx
dalanx
Membre

Nombre de messages : 39
Age : 23
Distinction : aucune
Date d'inscription : 29/05/2010

[résolu]Modification de 2script pour metre compatible a VXace Empty [résolu]Modification de 2script pour metre compatible a VXace

le Lun 25 Juin 2012 - 21:49
Bonjour, excusez moi je viens rarement, je passe plus de temps sur mon projet xD
Je viens vous demander une aide pour modifier 2script de VX normal pour les mettres compatible a Vxace
Voici les scripts :


Le 1er : c'est le MOG-menu ou un truck comme sa, il sert a modifier le menu(et seulement le menu Very Happy) quand on fait echap :

Spoiler:
Code:
#################################################
# Mog Basic Menu Plus V 1.0 #
##################################################
# By Moghunter
# revu par Berka puis dricc
##################################################

#===============================================================
#
# www.rpgmakervx-fr.com
#
#===============================================================

##############
# Game_Actor #
##############
class Game_Actor < Game_Battler
def now_exp
return @exp - @exp_list[@level]
end
def next_exp
return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0
end
end
###############
# Window_Base #
###############
class Window_Base < Window
def draw_item_icon(item, x, y)
if item != nil
draw_icon(item.icon_index, x, y)
end
end
def draw_actor_level_menu(actor, x, y)
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 + 16, y, 24, WLH, actor.level, 2)
end
def draw_actor_class_menu(actor, x, y)
self.contents.font.color = normal_color
self.contents.draw_text(x, y, 85, WLH, actor.class.name)
end
def exp_gauge_color1
return text_color(30)
end
def exp_gauge_color2
return text_color(31)
end
def draw_actor_exp_meter(actor, x, y, width = 100)
if actor.next_exp != 0
exp = actor.now_exp
else
exp = 1
end
gw = width * exp / [actor.next_exp, 1].max
gc1 = exp_gauge_color1
gc2 = exp_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 30, WLH, "Exp")
self.contents.font.color = normal_color
xr = x + width
self.contents.draw_text(xr - 60, y, 60, WLH, actor.next_rest_exp_s, 2)
end
#--------------------------------------------------------------------------
# modif dricc pour gérer l'animation des 2 methodes qui suivent
#--------------------------------------------------------------------------
def draw_character_move(character_name, character_index, x, y,index_move)
return if character_name == nil
bitmap = Cache.character(character_name)
sign = 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 = character_index
index_move_tp = index_move
index_move_tp = 1 if index_move_tp ==3
# src_rect = Rect.new((n%4*3+1)*cw + (index_move*(cw+1)) , (n/4*4)*ch, cw, ch)
src_rect = Rect.new((n%4*3)*cw + (index_move_tp*(cw)) , (n/4*4)*ch, cw, ch)
self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
end
def draw_actor_graphic_move(actor, x, y,index_move)
draw_character_move(actor.character_name, actor.character_index, x, y,index_move)
end

end
#####################
# Window_MenuStatus #
#####################
class Window_MenuStatus < Window_Selectable
attr_reader :move_index #dricc
attr_reader :move_refresh #dricc
def initialize(x, y)
super(x, y, 384, 416)
@move_index = 0
@move_refresh = Graphics.frame_count
refresh
self.active = false
self.index = -1
end
def move_index=(move_index) #dricc
@move_index = move_index
end
def move_refresh=(move_refresh) #dricc
@move_refresh = move_refresh
end
def refresh
self.contents.clear
@item_max = $game_party.members.size
self.move_index=self.move_index+1
self.move_index =0 if self.move_index==4
for actor in $game_party.members
x = 104
y = actor.index * 96 + WLH / 2
draw_item_icon($data_weapons[actor.weapon_id], x -92, y + 20)
if actor.two_swords_style
draw_item_icon($data_weapons[actor.armor1_id], x -35, y + 20)
else
draw_item_icon($data_armors[actor.armor4_id], x -35, y + 20)
end
draw_actor_graphic_move(actor, x -50, y +46,self.move_index)
draw_actor_name(actor, x, y)
draw_actor_class_menu(actor, x + 120, y)
draw_actor_level_menu(actor, x + 200, y)
draw_actor_state(actor, x, y + WLH * 2)
draw_actor_hp(actor, x + 120, y + WLH * 1)
draw_actor_mp(actor, x + 120, y + WLH * 2)
draw_actor_exp_meter(actor, x , y + WLH * 1)
end
end
def update_cursor
if @index < 0
self.cursor_rect.empty
elsif @index < @item_max
self.cursor_rect.set(0, @index * 96, contents.width, 96)
elsif @index >= 100
self.cursor_rect.set(0, (@index - 100) * 96, contents.width, 96)
else
self.cursor_rect.set(0, 0, contents.width, @item_max * 96)
end
end
def update
super
if Graphics.frame_count - self.move_refresh >= 12
self.move_refresh=Graphics.frame_count
refresh
end
end
end
############
# Game_Map #
############
class Game_Map
attr_reader :map_id
def mpname
$mpname = load_data("Data/MapInfos.rvdata")
$mpname[@map_id].name
end
end
###############
# Window_Time #
###############
class Window_Mapname < Window_Base
def initialize(x, y)
super(x, y, 160, WLH + 70)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Lieu :")
self.contents.font.color = normal_color
self.contents.draw_text(4, 32, 120, 32, $game_map.mpname.to_s, 2)
end
end
###############
# Window_Time #
###############
class Window_Time < Window_Base
def initialize(x, y)
super(x, y, 160, WLH + 66)
refresh
end
def refresh
self.contents.clear
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 120, 32, "Temps de Jeu")
@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
##############
# Scene_Menu #
##############
class Scene_Menu
def main
start
perform_transition
Input.update
loop do
Graphics.update
Input.update
update
break if $scene != self
end
Graphics.update
pre_terminate
Graphics.freeze
terminate
end
def initialize(menu_index = 0)
@menu_index = menu_index
end
def create_menu_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.color.set(16, 16, 16, 128)
update_menu_background
end
def create_menu_background
@menuback_sprite = Sprite.new
@menuback_sprite.bitmap = $game_temp.background_bitmap
@menuback_sprite.color.set(16, 16, 16, 128)
update_menu_background
end
def dispose_menu_background
@menuback_sprite.dispose
end
def update_menu_background
end
def perform_transition
Graphics.transition(10)
end
def start
create_menu_background
create_command_window
@gold_window = Window_Gold.new(0, 360)
@status_window = Window_MenuStatus.new(160, 0)
@playtime_window = Window_Time .new(0, 270)
@mapname_window = Window_Mapname.new(0, 176)
@status_window.openness = 0
@playtime_window.openness = 0
@mapname_window.openness = 0
@gold_window.openness = 0
@status_window.open
@playtime_window.open
@mapname_window.open
@gold_window.open
end
def pre_terminate
@status_window.close
@playtime_window.close
@mapname_window.close
@gold_window.close
@command_window.close
begin
@status_window.update
@playtime_window.update
@mapname_window.update
@gold_window.update
@command_window.update
Graphics.update
end until @status_window.openness == 0
end
def terminate
dispose_menu_background
@command_window.dispose
@gold_window.dispose
@status_window.dispose
@playtime_window.dispose
@mapname_window.dispose
end
def update
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
@mapname_window.update
@playtime_window.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
def create_command_window
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.openness = 0
@command_window.open
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
$mogscript = {} if $mogscript == nil
$mogscript["basic_menu_plus"] = true

Le 2e est le fameux Neo_Save que l'on vois dans la plupar des jeu maintenant xD J'ai testé sur Vx normal ça marche bien et non sur VXace donc j'imagine qu'il y a un changement a faire :

Spoiler:
Code:
#==========================================================================
# ? [VX] ? Neo Save System VI ? ?
#---------------------------------------------------------------------------
# ? Author: Woratana [woratana@hotmail.com]
# ? Thaiware RPG Maker Community
# ? Last Updated:
# ? Version: III -> VI (By Helladen)
# ? Screenshot image credit Andreas21, and Cybersam
# ? Commerical usage ask Wortana.
#---------------------------------------------------------------------------
# ? Log VI:
# - Cleaned up comments and code format.
# - Added corresponding map variables system to MAP_NO_NAME.
# - Added where you can use premade images that use a map's name.
#---------------------------------------------------------------------------
# ? Log V:
# - Screenshot support for those who want tone/weather/sprites.
# - Added an option to stay in save screen after you save the game.
#---------------------------------------------------------------------------
# ? Log IV:
# - New addition for hiding map names. You can control the switch to
#  allow MAP_NO_NAME_LIST to work or not.
# - Revised some of the settings and script organization.
# - Added an option to disable the vocab::Gold text right of the number.
# - Added an option to use default opacity or not.
# - Swap tile compatibility support.
#---------------------------------------------------------------------------
# ? Log III:
# - Changed back to draw tile map for save image, don't need any image.
# - For drawing tile map, the characters won't show on the tile map.
#---------------------------------------------------------------------------
# ? Log II:
# - Screenshot DLL is not work with Vista Aero, so I remove it
#  and use image for each map instead of screenshot.
# - Actor's level in last version (V.1) is incorrect.
#---------------------------------------------------------------------------
# ? Features:
# - Unlimited save slots, you can choose max save slot
# - Many configuration options
# - Swap tile support
# - You can use image for scene's background
# - Choose your save file's name, and folder to store save files
# - Choose to show only information you want
# - Editable text for information's title
# - Draw tile map for map that player is currently on.
# - Remove text you don't want from map's name (e.g. tags for special script)
# - Choose map that you don't want to show the name on
# - Include save confirmation window before overwrite old save
#===========================================================================

module Wora_NSS Wora_NSS
  #==========================================================================
  # * START NEO SAVE SYSTEM - SETUP
  #--------------------------------------------------------------------------
  OPACITY_DEFAULT = true # This will use the default opacity for windows.
  # Please note that this will affect both opacitys below.
 
  NSS_WINDOW_OPACITY = 255 # All windows' opacity (Lowest 0 - 255 Highest).
 
  # You can change this to 0 in case you want to use image for background.
  NSS_IMAGE_BG = '' # Background image file name, it must be in folder picture
  #              use '' for no background.
  NSS_IMAGE_BG_OPACITY = 255 # Opacity for background image.
 
  # If you use the screenshot method this does not matter.
  SWAP_TILE = true # Make this false if you don't use the swap_tile script
  SWAP_TILE_SWITCH = 84 # The switch needs to be the same as your swap tile
  #                 switch, but if SWAP_TILE is false it does not matter.
 
  # If this is true it will screenshot the map, if false it will draw it.
  SCREENSHOT_IMAGE = true # Drawing the map is good because it doesn't require
  # a .DLL or images for the screenshot, and it will have tone and
  # weather. If you are using SwapXT and this value is false you need to turn
  # on swap tile.
 
  # Do you want to use your own custom images for each map via map name.
  PREMADE_IMAGE = false # If this is true it sets its priority over
  #                 screenshots/etc.
 
  # Image type for screenshot '.bmp', or '.jpg', or '.png'.
  IMAGE_FILETYPE = '.png'
 
  # If this is true then the scene will not change when you save the game.
  SCENE_CHANGE = true # Changes scene to map instead of remaining in Save screen.

  MAX_SAVE_SLOT = 20 # Max save slots.
  SLOT_NAME = 'SLOT {id}'
 
  # Name of the slot (show in save slots list), use {id} for slot ID.
  SAVE_FILE_NAME = 'Save {id}.rvdata'
  # Save file name, you can also change its file type from .rvdata to other.
 
  # Use {id} for save slot ID.
  SAVE_PATH = '' # Path to store save file, e.g. 'Save/' or '' (for game folder).
  SAVED_SLOT_ICON = 133 # Icon Index for saved slot.
 
  EMPTY_SLOT_ICON = 141 # Icon Index for empty slot.
  EMPTY_SLOT_TEXT = 'Empty' # Text to show for empty slot's data.
 
  DRAW_GOLD = true # Draw Gold.
  DRAW_PLAYTIME = true # Draw playtime.
  DRAW_LOCATION = true # Draw location.
  DRAW_FACE = true # Draw actor's face.
  DRAW_LEVEL = true # Draw actor's level.
  DRAW_NAME = true # Draw actor's name.
  DRAW_TEXT_GOLD = false # Draw the vocab::Gold text to the right of the number.
 
  PLAYTIME_TEXT = 'Temps de jeu: '
  GOLD_TEXT = 'Argent: '
  LOCATION_TEXT = 'Emplacement: '
  LV_TEXT = 'Lvl. '
 
  MAP_NAME_TEXT_SUB = %w{}
  # Text that you want to remove from map name,
  # e.g. %w{[LN] [DA]} will remove text '[LN]' and '[DA]' from map name.
 
  # Do we want to use corresponding variables for each map number in MAP_NO_NAME_LIST?
  MAP_NO_NAME_VARIABLE = true # You just apply the value one to the variable which
                       # is the map number to change it from MAP_NO_NAME.
 
  MAP_NO_NAME_LIST = [2] # ID of Map that will not show map name, e.g. [1,2,3].
  MAP_NO_NAME = '???' # What you will use to call the map in the no name list.

  # This is a switch that can activate or deactivate maps from being displayed as
  # MAP_NO_NAME. If it is off then maps will return back to normal.
  MAP_NO_NAME_SWITCH = 95 # This switch has to be on for MAP_NO_NAME_LIST to work.
 
  MAP_BORDER = Color.new(0,0,0,200) # Map image border color (R,G,B,Opacity).
  FACE_BORDER = Color.new(0,0,0,200) # Face border color.
 
  # Save confirmation window
  SFC_Text_Confirm = 'Confirmer la sauvegarde' # Text to confirm to save file.
  SFC_Text_Cancel = 'Annuler' # Text to cancel to save.
  SFC_Window_Width = 200 # Width of Confirmation Window.
  SFC_Window_X_Offset = 0 # Move Confirmation Window horizontally.
  SFC_Window_Y_Offset = 0 # Move Confirmation Window vertically.
 
  #-------------------------------------------------------------------------
  # END NEO SAVE SYSTEM - SETUP (Edit below at your own risk)
  #=========================================================================
 
  #-------------------------------------------------------------
  # Screenshot V2 by Andreas21 and Cybersam
  #-------------------------------------------------------------
  @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  module_function
 
  def self.shot(file_name)
   case IMAGE_FILETYPE
     when '.bmp'; typid = 0
     when '.jpg'; typid = 1
     when '.png'; typid = 2
   end
   
   # Get Screenshot
   filename = file_name + IMAGE_FILETYPE
   @screen.call(0, 0, Graphics.width, Graphics.height, filename, self.handel,
   typid)
  end
 
  def self.handel
   game_name = "\0" * 256
   @readini.call('Game','Title','',game_name,255,".\\Game.ini")
   game_name.delete!("\0")
   
   return @findwindow.call('RGSS Player',game_name)
  end
end

class Scene_File < Scene_Base
  include Wora_NSS
  attr_reader :window_slotdetail
 
  #-------------------------------------------------------------------------
  # * Start processing
  #-------------------------------------------------------------------------
  def start
   super
   
   create_menu_background
   
   if NSS_IMAGE_BG != ''
     @bg = Sprite.new
     @bg.bitmap = Cache.picture(NSS_IMAGE_BG)
     @bg.opacity = NSS_IMAGE_BG_OPACITY
   end
   
   @help_window = Window_Help.new
   command = []
   
   (1..MAX_SAVE_SLOT).each do |i|
     command << SLOT_NAME.clone.gsub!(/\{ID\}/i) { i.to_s }
   end
   
   @window_slotdetail = Window_NSS_SlotDetail.new
   @window_slotlist = Window_SlotList.new(160, command)
   @window_slotlist.y = @help_window.height
   @window_slotlist.height = Graphics.height - @help_window.height
   
   if !OPACITY_DEFAULT
     @help_window.opacity = NSS_WINDOW_OPACITY
     @window_slotdetail.opacity = @window_slotlist.opacity = NSS_WINDOW_OPACITY
   end

   # Create folder for save file
   if SAVE_PATH != ''
     Dir.mkdir(SAVE_PATH) if !FileTest.directory?(SAVE_PATH)
   end
   
   if @saving
     @index = $game_temp.last_file_index
     @help_window.set_text(Vocab::SaveMessage)
   else
     @index = self.latest_file_index
     @help_window.set_text(Vocab::LoadMessage)
    
     (1..MAX_SAVE_SLOT).each do |i|
      @window_slotlist.draw_item(i-1, false) if !@window_slotdetail.file_exist?(i)
     end
   end
   
   @window_slotlist.index = @index
   
   # Draw information
   @last_slot_index = @window_slotlist.index
   @window_slotdetail.draw_data(@last_slot_index + 1)
  end
 
  #-------------------------------------------------------------------------- 
  # * Termination Processing
  #--------------------------------------------------------------------------
  def terminate
   super
   
   dispose_menu_background
   
   unless @bg.nil?
     @bg.bitmap.dispose
     @bg.dispose
   end
   
   @window_slotlist.dispose
   @window_slotdetail.dispose
   @help_window.dispose
  end
 
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
   super
   
   if !@confirm_window.nil?
     @confirm_window.update
    
     if Input.trigger?(Input::C)
      if @confirm_window.index == 0
        determine_savefile
        @confirm_window.dispose
        @confirm_window = nil
      else
        Sound.play_cancel
        @confirm_window.dispose
        @confirm_window = nil
      end
     elsif Input.trigger?(Input::B)
      Sound.play_cancel
      @confirm_window.dispose
      @confirm_window = nil
     end
   else
     update_menu_background
     @window_slotlist.update
    
     if @window_slotlist.index != @last_slot_index
      @last_slot_index = @window_slotlist.index
      @window_slotdetail.draw_data(@last_slot_index + 1)
     end
    
     @help_window.update
     update_savefile_selection
   end
  end
 
  #--------------------------------------------------------------------------
  # * Update Save File Selection
  #--------------------------------------------------------------------------
  def update_savefile_selection
   if Input.trigger?(Input::C)
     if @saving and @window_slotdetail.file_exist?(@last_slot_index + 1)
      Sound.play_decision
      text1 = SFC_Text_Confirm
      text2 = SFC_Text_Cancel
      @confirm_window = Window_Command.new(SFC_Window_Width,[text1,text2])
      @confirm_window.x = ((544 - @confirm_window.width) / 2) + SFC_Window_X_Offset
      @confirm_window.y = ((416 - @confirm_window.height) / 2) + SFC_Window_Y_Offset
     else
      determine_savefile
     end
   elsif Input.trigger?(Input::B)
     Sound.play_cancel
     return_scene
   end
  end
 
  #--------------------------------------------------------------------------
  # * Execute Save
  #--------------------------------------------------------------------------
  def do_save
   if SCREENSHOT_IMAGE
     File.rename(SAVE_PATH + 'temp' + IMAGE_FILETYPE,
     make_filename(@last_slot_index).gsub(/\..*$/){ '_ss' } + IMAGE_FILETYPE) 
   end 
   
   file = File.open(make_filename(@last_slot_index), "wb")
   write_save_data(file)
   file.close 
   
   # Alter the scene after the saving is done
   if SCENE_CHANGE
     $scene = Scene_Map.new
   else
     $scene = Scene_File.new(true, false, false)
   end
  end
 
  #--------------------------------------------------------------------------
  # * Execute Load
  #--------------------------------------------------------------------------
  def do_load
   file = File.open(make_filename(@last_slot_index), "rb")
   read_save_data(file)
   file.close
   $scene = Scene_Map.new
   RPG::BGM.fade(1500)
   Graphics.fadeout(60)
   Graphics.wait(40)
   @last_bgm.play
   @last_bgs.play
  end
 
  #--------------------------------------------------------------------------
  # * Confirm Save File
  #--------------------------------------------------------------------------
  def determine_savefile
   if @saving
     Sound.play_save
     do_save
   else
     if @window_slotdetail.file_exist?(@last_slot_index + 1)
      Sound.play_load
      do_load
     else
      Sound.play_buzzer
      return
     end
   end
   
   $game_temp.last_file_index = @last_slot_index
  end
 
  #--------------------------------------------------------------------------
  # * Create Filename
  #    file_index : save file index (0-3)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
   return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index + 1).to_s }
  end
 
  #--------------------------------------------------------------------------
  # * Select File With Newest Timestamp
  #--------------------------------------------------------------------------
  def latest_file_index
   latest_index = 0
   latest_time = Time.at(0)
   
   (1..MAX_SAVE_SLOT).each do |i|
     file_name = make_filename(i - 1)
     next if !@window_slotdetail.file_exist?(i)
     file_time = File.mtime(file_name)
    
     if file_time > latest_time
      latest_time = file_time
      latest_index = i - 1
     end
   end
   
   return latest_index
  end

class Window_SlotList < Window_Command
  #--------------------------------------------------------------------------
  # * Draw Item
  #--------------------------------------------------------------------------
  def draw_item(index, enabled = true)
   rect = item_rect(index)
   rect.x += 4
   rect.width -= 8
   icon_index = 0
   self.contents.clear_rect(rect)
   
   if $scene.window_slotdetail.file_exist?(index + 1)
     icon_index = Wora_NSS::SAVED_SLOT_ICON
   else
     icon_index = Wora_NSS::EMPTY_SLOT_ICON
   end
   
   if !icon_index.nil?
     rect.x -= 4
     draw_icon(icon_index, rect.x, rect.y, enabled) # Draw Icon
     rect.x += 26
     rect.width -= 20
   end
   
   self.contents.clear_rect(rect)
   self.contents.font.color = normal_color
   self.contents.font.color.alpha = enabled ? 255 : 128
   self.contents.draw_text(rect, @commands[index])
  end
 
  def cursor_down(wrap = false)
   if @index < @item_max - 1 or wrap
     @index = (@index + 1) % @item_max
   end
  end

  def cursor_up(wrap = false)
   if @index > 0 or wrap
     @index = (@index - 1 + @item_max) % @item_max
   end
  end
end

class Window_NSS_SlotDetail < Window_Base
  include Wora_NSS
 
  def initialize
   super(160, 56, 384, 360)
   
   @data = []
   @exist_list = []
   @bitmap_list = {}
   @map_name = []
  end
 
  def dispose
   dispose_tilemap
   super
  end

  def draw_data(slot_id)
   contents.clear # 352, 328
   dispose_tilemap
   
   load_save_data(slot_id) if @data[slot_id].nil?
     if @exist_list[slot_id]
      save_data = @data[slot_id]
      contents.fill_rect(0,30,352,152, MAP_BORDER)
      
      if PREMADE_IMAGE
        bitmap = get_bitmap("Graphics/Save/" + @data[slot_id]['map_name'] + IMAGE_FILETYPE)
        rect = Rect.new((Graphics.width-348)/2,(Graphics.height-156)/2,348,156)
        contents.blt(2,32,bitmap,rect)
      elsif SCREENSHOT_IMAGE and save_data['ss']
        bitmap = get_bitmap(save_data['ss_path'])
        rect = Rect.new((Graphics.width-348)/2,(Graphics.height-156)/2,348,156)
        contents.blt(2,32,bitmap,rect)
      elsif SWAP_TILE and $game_switches[SWAP_TILE_SWITCH]
        create_swaptilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
        save_data['gamemap'].display_y)
      else
        create_tilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
        save_data['gamemap'].display_y)
      end
      
      if DRAW_GOLD
        gold_textsize = contents.text_size(save_data['gamepar'].gold).width
        goldt_textsize = contents.text_size(GOLD_TEXT).width 
        contents.font.color = system_color
        contents.draw_text(0, 0, goldt_textsize, WLH, GOLD_TEXT)
        contents.font.color = normal_color
        contents.draw_text(goldt_textsize, 0, gold_textsize, WLH, save_data['gamepar'].gold) 
      
        if DRAW_TEXT_GOLD
         contents.draw_text(goldt_textsize + gold_textsize, 0, 200, WLH, Vocab::gold)

        else
         gold_textsize = 0
         goldt_textsize = 0            
        end
      end
    
      if DRAW_PLAYTIME
        hour = save_data['total_sec'] / 60 / 60
        min = save_data['total_sec'] / 60 % 60
        sec = save_data['total_sec'] % 60
        time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
        pt_textsize = contents.text_size(PLAYTIME_TEXT).width
        ts_textsize = contents.text_size(time_string).width
        contents.font.color = system_color
        contents.draw_text(contents.width - ts_textsize - pt_textsize, 0,
        pt_textsize, WLH, PLAYTIME_TEXT)
        contents.draw_text(goldt_textsize + gold_textsize,0,200,WLH, Vocab::gold)
        contents.font.color = normal_color
        contents.draw_text(0, 0, contents.width, WLH, time_string, 2)
      end
      
      if DRAW_LOCATION
        lc_textsize = contents.text_size(LOCATION_TEXT).width
        mn_textsize = contents.text_size(save_data['map_name']).width
        contents.font.color = system_color
        contents.draw_text(0, 190, contents.width, WLH, LOCATION_TEXT)
        contents.font.color = normal_color
        contents.draw_text(lc_textsize, 190, contents.width, WLH, save_data['map_name'])
      end
      
      # Draw level & name
      save_data['gamepar'].members.each_index do |i|
        actor = save_data['gameactor'][save_data['gamepar'].members[i].id]
        face_x_base = (i*80) + (i*8)
        face_y_base = 216
        lvn_y_plus = 10
        lv_textsize = contents.text_size(actor.level).width
        lvt_textsize = contents.text_size(LV_TEXT).width
       
      if DRAW_FACE
        contents.fill_rect(face_x_base, face_y_base, 84, 84, FACE_BORDER)
        draw_face(actor.face_name, actor.face_index, face_x_base + 2,
        face_y_base + 2, 80)
      end
      
      if DRAW_LEVEL
        contents.font.color = system_color
        contents.draw_text(face_x_base + 2 + 80 - lv_textsize - lvt_textsize,
        face_y_base + 2 + 80 - WLH + lvn_y_plus, lvt_textsize, WLH, LV_TEXT)
        contents.font.color = normal_color
        contents.draw_text(face_x_base + 2 + 80 - lv_textsize,
        face_y_base + 2 + 80 - WLH + lvn_y_plus, lv_textsize, WLH, actor.level)
      end
      
      if DRAW_NAME
        contents.draw_text(face_x_base, face_y_base + 2 + 80 + lvn_y_plus - 6, 84,
        WLH, actor.name, 1)
      end
     end
   else
     contents.draw_text(0,0, contents.width, contents.height - WLH, EMPTY_SLOT_TEXT, 1)
   end
  end
 
  def load_save_data(slot_id)
   file_name = make_filename(slot_id)
   
   if file_exist?(slot_id) or FileTest.exist?(file_name)
     @exist_list[slot_id] = true
     @data[slot_id] = {}
    
     # Start load data
     file = File.open(file_name, "r")
     @data[slot_id]['time'] = file.mtime
     @data[slot_id]['char'] = Marshal.load(file)
     @data[slot_id]['frame'] = Marshal.load(file)
     @data[slot_id]['last_bgm'] = Marshal.load(file)
     @data[slot_id]['last_bgs'] = Marshal.load(file)
     @data[slot_id]['gamesys'] = Marshal.load(file)
     @data[slot_id]['gamemes'] = Marshal.load(file)
     @data[slot_id]['gameswi'] = Marshal.load(file)
     @data[slot_id]['gamevar'] = Marshal.load(file)
     @data[slot_id]['gameselfvar'] = Marshal.load(file)
     @data[slot_id]['gameactor'] = Marshal.load(file)
     @data[slot_id]['gamepar'] = Marshal.load(file)
     @data[slot_id]['gametro'] = Marshal.load(file)
     @data[slot_id]['gamemap'] = Marshal.load(file)
     @data[slot_id]['total_sec'] = @data[slot_id]['frame'] / Graphics.frame_rate
    
     # Save the image
     if SCREENSHOT_IMAGE
      @data[slot_id]['ss_path'] = file_name.gsub(/\..*$/){'_ss'} + IMAGE_FILETYPE
      @data[slot_id]['ss'] = FileTest.exist?(@data[slot_id]['ss_path'])
     end
    
     @data[slot_id]['map_name'] = get_mapname(@data[slot_id]['gamemap'].map_id)
     file.close
   else
     @exist_list[slot_id] = false
     @data[slot_id] = -1
   end
  end

  def make_filename(file_index)
   return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index).to_s }
  end
 
  def file_exist?(slot_id)
   return @exist_list[slot_id] if !@exist_list[slot_id].nil?
   
   @exist_list[slot_id] = FileTest.exist?(make_filename(slot_id))
   
   return @exist_list[slot_id]
  end
 
  def get_bitmap(path)
   if !@bitmap_list.include?(path)
     @bitmap_list[path] = Bitmap.new(path)
   end
   
   return @bitmap_list[path]
  end
 
  def get_mapname(map_id)
   if @map_data.nil?
     @map_data = load_data("Data/MapInfos.rvdata")
   end
 
   if @map_name[map_id].nil?
     if MAP_NO_NAME_LIST.include?(map_id) and $game_switches[MAP_NO_NAME_SWITCH]
      if $game_variables[map_id] == 0 or !MAP_NO_NAME_VARIABLE
        @map_name[map_id] = MAP_NO_NAME
      else
        @map_name[map_id] = @map_data[map_id].name
      end 
     else
      @map_name[map_id] = @map_data[map_id].name
     end
   
     MAP_NAME_TEXT_SUB.each_index do |i|
      @map_name[map_id].sub!(MAP_NAME_TEXT_SUB[i], '')
      @mapname = @map_name[map_id]
     end
   end
   
   return @map_name[map_id]
  end 
 
  def create_tilemap(map_data, ox, oy)
   @viewport = Viewport.new(self.x + 2 + 16, self.y + 32 + 16, 348,156)
   @viewport.z = self.z
   @tilemap = Tilemap.new(@viewport)
   @tilemap.bitmaps[0] = Cache.system("TileA1")
   @tilemap.bitmaps[1] = Cache.system("TileA2")
   @tilemap.bitmaps[2] = Cache.system("TileA3")
   @tilemap.bitmaps[3] = Cache.system("TileA4")
   @tilemap.bitmaps[4] = Cache.system("TileA5")
   @tilemap.bitmaps[5] = Cache.system("TileB")
   @tilemap.bitmaps[6] = Cache.system("TileC")
   @tilemap.bitmaps[7] = Cache.system("TileD")
   @tilemap.bitmaps[8] = Cache.system("TileE")
   @tilemap.map_data = map_data
   @tilemap.ox = ox / 8 + 99
   @tilemap.oy = oy / 8 + 90
  end
 
  def create_swaptilemap(map_data, ox, oy)
   @viewport = Viewport.new(self.x + 2 + 16, self.y + 32 + 16, 348,156)
   @viewport.z = self.z
   @tilemap = Tilemap.new(@viewport)
   
   tile1 = Cache_Swap_Tiles.swap($tileA1 + ".png") rescue nil
   tile2 = Cache_Swap_Tiles.swap($tileA2 + ".png") rescue nil
   tile3 = Cache_Swap_Tiles.swap($tileA3 + ".png") rescue nil
   tile4 = Cache_Swap_Tiles.swap($tileA4 + ".png") rescue nil
   tile5 = Cache_Swap_Tiles.swap($tileA5 + ".png") rescue nil
   tile6 = Cache_Swap_Tiles.swap($tileB + ".png") rescue nil
   tile7 = Cache_Swap_Tiles.swap($tileC + ".png") rescue nil
   tile8 = Cache_Swap_Tiles.swap($tileD + ".png") rescue nil
   tile9 = Cache_Swap_Tiles.swap($tileE + ".png") rescue nil
   
   if $tileA1 != nil
     @tilemap.bitmaps[0] = tile1
   else
     @tilemap.bitmaps[0] = Cache.system("TileA1")
   end

   if $tileA2 != nil
     @tilemap.bitmaps[1] = tile2
   else
     @tilemap.bitmaps[1] = Cache.system("TileA2")
   end

   if $tileA3 != nil
     @tilemap.bitmaps[2] = tile3 
   else
     @tilemap.bitmaps[2] = Cache.system("TileA3")
   end 

   if $tileA4 != nil
     @tilemap.bitmaps[3] = tile4
   else
     @tilemap.bitmaps[3] = Cache.system("TileA4")
   end

   if $tileA5 != nil
     @tilemap.bitmaps[4] = tile5 
   else
     @tilemap.bitmaps[4] = Cache.system("TileA5")
   end

   if $tileB != nil
     @tilemap.bitmaps[5] = tile6
   else
     @tilemap.bitmaps[5] = Cache.system("TileB") 
   end 

   if $tileC != nil
     @tilemap.bitmaps[6] = tile7
   else
     @tilemap.bitmaps[6] = Cache.system("TileC")
   end 

   if $tileD != nil
     @tilemap.bitmaps[7] = tile8
   else
     @tilemap.bitmaps[7] = Cache.system("TileD") 
   end

   if $tileE != nil
     @tilemap.bitmaps[8] = tile9
   else
     @tilemap.bitmaps[8] = Cache.system("TileE") 
   end
 
   @tilemap.map_data = map_data
   @tilemap.ox = ox / 8 + 99
   @tilemap.oy = oy / 8 + 90
  end
   
  def dispose_tilemap
   unless @tilemap.nil?
     @tilemap.dispose
     @tilemap = nil
     end
   end
  end
end

class Scene_Title < Scene_Base
  def check_continue
   file_name = Wora_NSS::SAVE_PATH + Wora_NSS::SAVE_FILE_NAME.gsub(/\{ID\}/i) { '*' }
   @continue_enabled = (Dir.glob(file_name).size > 0)
  end
end

class Scene_Map < Scene_Base
  alias wora_nss_scemap_ter terminate
 
  def terminate
   Wora_NSS.shot(Wora_NSS::SAVE_PATH + 'temp')
   wora_nss_scemap_ter
  end
end
#======================================================================
# END - NEO SAVE SYSTEM by Woratana and Helladen
#======================================================================


Dernière édition par dalanx le Mar 26 Juin 2012 - 13:12, édité 1 fois
Ewaldar
Ewaldar
Membre

Nombre de messages : 1387
Age : 26
Localisation : Suisse
Distinction : aucune
Date d'inscription : 29/12/2011
http://ewaldar.wixsite.com/les-ames-perdues

[résolu]Modification de 2script pour metre compatible a VXace Empty Re: [résolu]Modification de 2script pour metre compatible a VXace

le Mar 26 Juin 2012 - 10:11
Bonjour,

J'ai une solution pour ton deuxième script, il y en a déjà un mieux existant sur VX Ace : http://yanflychannel.wordpress.com/rmvxa/menu-scripts/ace-save-engine/

Le premier, je ne comprends pas le principe, il change, ok, mais qu'est-ce qui change ?
Spytje
Spytje
Administrateur

Nombre de messages : 5933
Localisation : La terre
Distinction : Spiraliste [Korn']
Forestia : Projet du mois juillet 2014
Papy Pulkigrat [Yama']
Date d'inscription : 16/03/2008

[résolu]Modification de 2script pour metre compatible a VXace Empty Re: [résolu]Modification de 2script pour metre compatible a VXace

le Mar 26 Juin 2012 - 10:26
Lien vers un menu que j'utilise il permet de changer pas mal de chose :

Auteur : Modern Algebra

Code:
#==============================================================================
#    Customizable Main Menu
#    Version: 1.0c
#    Author: modern algebra (rmrk.net)
#    Date: February 17, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script is a base menu script which allows you to create custom menu
#  commands and to move, add, or remove them from the menu easily. Not only 
#  can you easily add a command which directly calls a scene, you can also add
#  commands which call common events or which call a particular method (the
#  method needs to be defined). At the same time, the script is also designed
#  to recongize and include any commands that are added by another script,
#  without requiring setup in this one.
#
#    Additionally, this script allows easy creation of custom windows which
#  show simple data, so you are not limited to just the gold window - you
#  could, for instance, show data such as the value of particular variables or
#  the playtime, etc.. These optional windows can be added and removed at
#  will, and they show up beneath the command window in the menu.
#
#    Since too many windows could overlap with the command window, this script
#  also allows you to set a row max for the command window so that you need to
#  scroll the window down to see the other commands. Additionally, you can
#  change the width of the command and data windows and the Menu Status window
#  will now better accomodate different resolutions. Finally, you can also
#  change the alignment so that the status window is on the left and the
#  command window is on the right.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Paste this script into its own slot in the Script Editor, above Main and
#  below Materials. If you are using any scripts which require this menu, then
#  this script should be above them as well.
#
#    Aside from that, you can go to the Editable Region at line 64 to figure
#  out how to configure the menu. If you do not change anything, then the
#  menu will operate exactly like the default menu.
#
#    I understand that the configuration can be very difficult. If you do not
#  understand it, please do not hesitate to visit me at RMRK and ask for help
#  adding any specific command or window to the menu. The topic link is:
#
#      http://rmrk.net/index.php/topic,44906.0.html
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Thanks:
#
#    Yanfly, as the configuration for my Full Status Menu in VX was inspired
#  by his Menu scripts for VX, and this script borrows from the FSCMS
#==============================================================================

$imported = {} unless $imported
$imported[:MA_CustomizableMenu] = true

#==============================================================================
# *** MA_CustomizableMenu
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This module holds configuration data for the CMS
#==============================================================================

module MA_CustomizableMenu
  #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  #  Editable Region
  #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  #  CUSTOM_COMMANDS - This is where you can set up your own commands. You can
  # add here almost any type of command you want here as long as you know the
  # syntax. Given that, however, I understand that it may be difficult to
  # understand for the scripter, so if you want any assistance in adding a
  # command to the menu for any purpose, then I encourage you to ask me at this
  # script's thread at RMRK and I will be happy to oblige. That said, I will
  # nevertheless go over everything here, starting with the simplest setups and
  # and then going into the rest.
  #
  #  Firstly, I will note that every new command requires a unique symbol by
  # which you can identify it and add it to the command list. I will refer to
  # that symbol as :unique in all generic examples, but essentially it can be
  # anything you choose and must be different for each command. The format for
  # all of the following commands will be:
  #
  #    :unique => [],
  #
  #  The content of the array will change depending on what you are trying
  # to do, so I will go over everything in detail.
  #``````````````````````````````````````````````````````````````````````````
  #  To call a custom scene, the format is as follows:
  #    :unique => ["command name", enable_condition, :Scene_Name, select_actor],
  #
  #  Note that if it ends up being too long, you can press enter after any of
  # the commas and split it into more than one line. That is fine.
  #
  #  To help explain each of these parameters, I will use an example of adding
  # the Debug scene to the menu:
  #    :debug => ["Debug", true, :Scene_Debug],
  # 
  #    -Command Name-
  #
  #  So, the first thing is the name. This is what shows up in the command list
  # when the menu is opened. So, if :debug is added to COMMAND_LIST (see below
  # at line xx), then when the player opens the menu, they will see that Debug
  # is there. The command name must have quotations around it.
  #
  # However, you can also evaluate an expression to return the name. To do so,
  # all you need to do is make a symbol with the expression you want to call.
  # So, for instance, if you used something like:
  #    :debug => [:"Vocab::Continue", true, :Scene_Debug]
  #
  #  When you went to the menu, your Debug command would show up as whatever
  # word you set for Continue in the Terms section of the Database.
  #
  #    -Enable Condition-
  #
  #  Second, we have the enable_condition. This allows you to set a condition
  # such that, if it is not met, the command is unselectable. In our example it
  # is true. This means that it will always be enabled. However, there are a
  # number of ways you can use an enable condition. I will go over them one by
  # one:
  #
  #  1. Always enabled - to set a command to always be enabled, simply use
  #    true, as in the example.
  #  2. In-game switch - if you use an integer instead of true, then the
  #    command can only be selected if the switch with that ID is on. EX:
  #      :debug => ["Debug", 7, :Scene_Debug],
  #    The Debug command will only be enabled if Switch 7 is on.
  #  3. Method call - This requires some knowledge of scripting, but this
  #    allows you to call a method in the Window_MenuCommand class. Just put
  #    a symbol of the method name. By default, there are three that might be
  #    relevant -
  #      (a) :main_commands_enabled - enabled when Skill, Equip, Status are
  #      (b) :save_enabled - enabled when Save is
  #      (c) :formation_enabled - enabled when Formation is
  #    EX:
  #      :debug => ["Debug", :main_commands_enabled, :Scene_Debug],
  #    The Debug command would only be enabled if Status, Equip, and Skill
  #    are (by default, this is when there are actors in the party).
  #  4. Expression - This also requires some knowledge of scripting, but this
  #    option allows you to set the enabled condition to be the result of
  #    any scripting expression. Just set it up as a string Ex:
  #      :debug => ["Debug", "$game_variables[10] > 5", :Scene_Debug],
  #    The Debug command would only be enabled if the variable with ID 10
  #    had a value greater than 5.
  #
  #    -Scene_Name-
  #
  #  This is a symbol containing the name of the class you want to run. In our
  # example, we are calling :Scene_Debug, but we could also use any scene,
  # such as :Scene_Item, :Scene_Equip, :Scene_Load, etc. This is most useful
  # if you are installing a custom script that includes a scene and you want
  # it accessible through the menu.
  #
  #  However, despite the fact that I labelled it as Scene_Name, you can do
  # more than just call a scene. You can also:
  #    (1) call a common event. To do that, just put the ID of the common
  #      event you want to call. Ex:
  #        :sonata => ["Sonata", true, 14],
  #      That would call common event 14 when you choose the "Sonata" option
  #      from the menu.
  #    (2) evaluate an expression. To do this, just put the expression you
  #      want to evaluate when the player selects this option as a string. EX:
  #        :rmrk => ["RMRK", true,
  #                  "Thread.new { system(\"start http://rmrk.net\") }
  #                    @command_window.activate"],
  #      That would be a command called "RMRK" which, when selected, would
  #      open up the RMRK website in the player's browser.
  #
  #    -Select Actor-
  #
  #  If you add a fourth entry, you can do even more. In particular, if you
  # add a true after your command:
  #
  #    :debug => ["Debug", true, :Scene_Debug, true],
  #
  # Then that will mean that when the player selects the Debug command, it
  # will then go on to permit the player to select an actor. That is not
  # useful for Debug, but would be useful for any scene that shows something
  # about a particular actor. For instance, if you were to make a command
  # for showing Equip (which you don't need to do, since it is default), you
  # could do the following:
  #
  #    :equip => [:"Vocab::equip", :main_commands_enabled, :Scene_Equip, true],
  #
  # Then, when the player selects the Equip option, it will behave exactly
  # as the Equip option should - it will let you select an Actor, and it will
  # then bring you to that actor's Equip scene.
  #
  #  However, like with Scene_Name, although I have called this option
  # Select_Actor, that is not the only thing you can put here, although the
  # others require some scripting knowledge. In any case, you can also call a
  # method - it can be useful, but you might need a script specifically
  # designed to use it. As an example though, the following code would be
  # identical to using true in this position:
  #
  #  :equip => [:"Vocab::equip", :main_commands_enabled, :Scene_Equip,
  #              :command_personal],
  #``````````````````````````````````````````````````````````````````````````
  #  EXAMPLES
  #
  #  To assist in your understanding of this script, I will show you,
  # essentially, how you could add the default commands. Obviously, it is
  # unnecessary to do this, since they are set up this way by default, but I
  # just figure that since you know how the default commands behave, it will
  # help you understand how to use custom commands if you see how that
  # behaviour could be captured through the custom command framework.
  # Additionally, I will add just a few other examples. Without further ado:
  #
  #  CUSTOM_COMMANDS = {
  #    :item =>        [:"Vocab::item", :main_commands_enabled, :Scene_Item],
  #    :skill =>      [:"Vocab::skill", :main_commands_enabled, :Scene_Skill,
  #                    true],
  #    :equip =>      [:"Vocab::equip", :main_commands_enabled, :Scene_Equip,
  #                    true],
  #    :status =>      [:"Vocab::status", :main_commands_enabled, :Scene_Status,
  #                    true],
  #    :formation =>  [:"Vocab::formation", :formation_enabled,
  #                    "command_formation"],
  #    :save =>        [:"Vocab::save", :save_enabled, :Scene_Save],
  #    :game_end =>    [:"Vocab::game_end", true, :Scene_Title],
  #    :rmrk =>        ["RMRK", true,
  #                    "Thread.new { system(\"start http://rmrk.net\") }; @command_window.activate"],
  #    :debug =>      ["Debug", "$TEST", :Scene_Debug],
  #    :cust_scene1 => ["Command Name", 5, :Scene_Custom1],
  #    :cust_scene2 => ["Command Name", :main_commands_enabled, :Scene_Custom2,
  #                    true],
  #    :commonevent => ["Camp", "$game_party.item_number($data_items[7]) > 0",
  #                    13],
  #  }
  #
  #    :rmrk would open up the RMRK website when selected. It is always enabled
  #    :debug would open the Debug scene, but is only enabled in Test Play
  #    :cust_scene1 would call Scene_Custom1 (not a real scene), but is only
  #      enabled if Switch 5 is on.
  #    :cust_scene2 would call Scene_Custom2 (not a real scene), but would only
  #      be available when there are actors in the party
  #    :commonevent would call Common Event 13 if the party has one or more of
  #      Item 7.
  #
  #  All that said, it is important to remember that none of the custom
  # commands will show up in the menu unless you add their unique identifier
  # into the COMMAND_LIST array, just below this hash, around line 275. That is
  # a REQUIRED step.
  CUSTOM_COMMANDS = { # <- Do not touch!
    # Call Debug scene - enabled always
    :debug => ["Debug", true, :Scene_Debug],
    # Opens up RMRK in your browser - enabled always
    :rmrk =>  ["RMRK", true,
              "Thread.new { system(\"start http://rmrk.net\") }
              @command_window.activate"],
    # Call Load scene - enabled if a save file is in the game folder
    :load =>  [:"Vocab::continue", "DataManager.save_file_exists?", :Scene_Load],
    # Call common event 4 - enabled if party has Item 7 (a tent).
    :camp =>  ["Camp", "$game_party.has_item?($data_items[7])", 4],
  } # <- Do not touch!
  # COMMAND_LIST - In this array, add the unique identifer of the custom
  # commands that you want added to the menu. Additionally, there are 7 default
  # commands which you can add, each corresponding to the default menu
  # commands. These are:
  #  :item, :skill, :equip, :status, :formation, :save, and :game_end.
  #
  #  You can, of course, delete them from the array and then they won't be
  # available. In fact, no command will show up unless it is included in this
  # array! You can modify the contents of this array in-game with the following
  # script calls:
  #
  #    add_menu_command(:unique, index)
  #    remove_menu_command(:unique)
  #
  #  :unique is the unique identifier of the custom or default command you want
  # to add or remove.
  #  index is an integer which allows you to choose where the command shows up
  # in the list when it is added. If you exclude it and just put:
  #
  #    add_menu_command(:unique)
  #
  # then it will be the last command in the command window.
  COMMAND_LIST = [ # <- Do not touch!
    :item,
    :skill,
    :equip,
    :status,
    :formation,
    :save,
    :game_end,
  ] # <- Do not touch!
  #  COMMAND_WINDOW_ROWMAX - This lets you determine how many commands will be
  # in the command window before the rest are hidden and only become visible
  # when scrolling down. If set to 0, then it will show all commands at once.
  COMMAND_WINDOW_ROWMAX = 0
  #  COMMAND_WINDOW_WIDTH - This determines how wide the command window and
  # optional windows are. If you need more room horizontal room for your
  # commands, then just increase this value.
  COMMAND_WINDOW_WIDTH = 160
  #  COMMAND_WINDOW_ON_RIGHT - If set to true, then the command window will be
  # on the right of the screen and the actor window will be on the left.
  COMMAND_WINDOW_ON_RIGHT = false
  #  CUSTOM_WINDOWS - Here you can set up your own windows to show simple
  # data, like the gold window. Basically, you can show a label, and then real
  # data. The format is as follows:
  #
  #    :unique => ["Label", value],
  #
  #  As with the CUSTOM_COMMANDS, :unique must be a unique identifier so that
  # you can add it into the OPTIONAL_WINDOWS_LIST.
  #
  #  "Label" is a String which will show up on the left hand side. It
  # recognizes special message codes, but if you are using double quotation
  # marks (" "), then you need to use \\, not \. Ie, it would be \\c[16], not
  # \c[16].
  #
  #  value can show one of three things:
  #  (1) The value of a variable - to show this, just put the ID of the
  #      variable you want to show.
  #  (2) Any expression you evaluate - this requires some scripting knowledge,
  #      but if you know the correct code then just put it in a string. Ex:
  #        :steps =>    ["\\c[6]Steps\\c[0]", "$game_party.steps"],
  #        :keys =>      ["Keys", "$game_party.item_number($data_items[8])"],
  #  (3) Playtime - To show playtime, you need to just use :playtime. Ex:
  #        :playtime =>  ["\\i[280]", :playtime],
  #  (4) Other - If you know how to script, then it is possible to add
  #      special data as well, like playtime.
  #
  #  Additionally, you can make windows that have more than one data line,
  # simply by adding further lines. So, for instance:
  #
  #  :combined => ["\\i[280]", :playtime,
  #                "\\i[467]", "$game_party.steps",
  #                "\\i[347]", 5],
  #
  #  That would show all of that data in one line. It is the same format, they
  # just need to be within the same [].
  CUSTOM_WINDOWS = { # <- Do not touch!
    :playtime =>  ["\\i[280]", :playtime],
    :variable5 => ["\\i[122]", 5],
    :steps =>    ["\\c[6]Steps\\c[0]", "$game_party.steps"],
    :item8 =>    ["Keys", "$game_party.item_number($data_items[8])"],
    :combined =>  ["\\i[280]", :playtime,
                  "\\i[467]", "$game_party.steps",
                  "\\i[347]", 5,
                  "\\i[262]", "$game_party.gold"],
  } # <- Do not touch!
  #  OPTIONAL_WINDOWS_LIST - Like the COMMAND_LIST, any windows you want to add
  # to the menu need to be included in this array. Just add the :unique
  # identifier, and that is the position the window will show up. The only
  # default option is :gold, which shows the regular gold window. You can
  # delete it if you want. To add windows in-game, you can use the following
  # script calls:
  # 
  #    add_menu_window(:unique, index)
  #    remove_menu_window(:unique)
  #
  #  :unique is the unique identifier of the window you want to add or remove.
  #  index is an integer which allows you to choose where the command shows up
  # in the list when it is added. If you exclude it and just put:
  #
  #    add_menu_window(:unique)
  #
  # then it will be the placed at the bottom.
  OPTIONAL_WINDOWS_LIST = [ # <- Do not touch!
    :gold,
  ] # <- Do not touch!
  #||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  #  END Editable Region
  #//////////////////////////////////////////////////////////////////////////
  #============================================================================
  # *** Alter_MenuStatus
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  This module is to be mixed in to the metaclass to the Window_MenuStatus
  # created in Scene_Menu, since I don't want to change it in any other scene.
  #============================================================================
 
  module Alter_MenuStatus
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Draw Actor Simple Status
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def draw_actor_simple_status(actor, x, y, *args, &block)
      y += (item_height - 96) / 2
      if contents_width.between?(346, 394)
        # Only need to alter the x value if within this range.
        if contents_width < 354
          x -= (354 - contents_width)
        elsif contents_width > 360
          x += (contents_width - 360) / 2
        end
        super(actor, x, y, *args, &block)
      else # If outside that range, will need to reduce width
        if contents_width < 346
          x -= 8
          room_needed = 346 - contents_width
          space = room_needed > 4 ? 4 : 8 - room_needed
          # Take first four pixels off w2, then equally off w1 and w2
          w1 = room_needed > 8 ? 112 - ((room_needed - 8) / 2) : 112
          w2 = contents_width - w1 - space - x
        else
          x += 17
          room_needed = contents_width - 394
          space = 8
          w2 = 124
          if room_needed > 8
            w1 = 120
            if room_needed > 16
              space += 8
              w2 += (room_needed - 16)
            else
              space += room_needed
            end
          else
            w1 = 112 + room_needed
          end
        end
        draw_actor_name(actor, x, y, w1)
        draw_actor_level(actor, x, y + line_height * 1)
        draw_actor_icons(actor, x, y + line_height * 2, w1)
        draw_actor_class(actor, x + w1 + space, y, w2)
        draw_actor_hp(actor, x + w1 + space, y + line_height * 1, w2)
        draw_actor_mp(actor, x + w1 + space, y + line_height * 2, w2)
      end
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Item Height
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def item_height(*args, &block)
      total_height = height - (standard_padding * 2)
      if total_height > 96
        total_height / (total_height / 96)
      else
        super(*args, &block)
      end
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Item Rect
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    def item_rect(*args, &block)
      rect = super(*args, &block)
      rect.y += [(rect.height - 98) / 2, 0].max
      rect.height = 98
      rect
    end
  end
end

#==============================================================================
# *** DataManager
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - self.extract_save_contents
#==============================================================================

module DataManager
  class << self
    alias macmm_extrctsvcon_2qk8 extract_save_contents
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Extract Save Contents
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def self.extract_save_contents(*args, &block)
    macmm_extrctsvcon_2qk8(*args, &block) # Run Original Method
    # Preserve old save files
    $game_system.macmm_initialize_menubase_data if !$game_system.macmm_command_list
  end
end

#==============================================================================
# ** Game System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new public instance variable - macmm_command_list; macmm_optional_windows
#    aliased method - initialize
#==============================================================================

class Game_System
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader  :macmm_command_list
  attr_reader  :macmm_optional_windows
  attr_accessor :macmm_row_max
  attr_accessor :macmm_command_width
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_cmsb_initilz_6dq1 initialize
  def initialize(*args, &block)
    ma_cmsb_initilz_6dq1(*args, &block) # Run Original Method
    macmm_initialize_menubase_data
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Initialize MenuBase Data
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_initialize_menubase_data
    @macmm_command_list = MA_CustomizableMenu::COMMAND_LIST.compact
    @macmm_optional_windows = MA_CustomizableMenu::OPTIONAL_WINDOWS_LIST.compact
    @macmm_row_max = MA_CustomizableMenu::COMMAND_WINDOW_ROWMAX
    @macmm_command_width = MA_CustomizableMenu::COMMAND_WINDOW_WIDTH
  end
end

#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new methods - add_menu_command; remove_menu_command; add_menu_window;
#      remove_menu_window
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add & Remove Menu Commands
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def add_menu_command(command, index = -1)
    remove_menu_command(command)
    $game_system.macmm_command_list.insert(index, command)
  end
  def remove_menu_command(command)
    $game_system.macmm_command_list.delete(command)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add & Remove Menu Windows
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def add_menu_window(win, index = -1)
    remove_menu_window(win)
    $game_system.macmm_optional_windows.insert(index, win)
  end
  def remove_menu_window(win)
    $game_system.macmm_optional_windows.delete(win)
  end
end

#==============================================================================
# ** Window_MenuCommand
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - window_width
#    aliased method - make_command_list; visible_line_number
#    new method - macmm_remake_command_list; macmm_preserve_noncustom_commands
#      macmm_add_custom_command
#==============================================================================

class Window_MenuCommand
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Window Width
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def window_width
    $game_system.macmm_command_width
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Original Commands
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_cmsb_makecndlist_5fk8 make_command_list
  def make_command_list(*args, &block)
    #  I know that this is a very strange way to do this, but my purpose is to
    # interfere as little as possible with unknown scripts which add scenes
    # to the menu. In order to do that, I call the original method and only
    # afterwards reconfigure things.
    ma_cmsb_makecndlist_5fk8(*args, &block)
    # Retain unknown commands, as well as non-overridden default commands
    macmm_preserve_noncustom_commands
    clear_command_list
    # Remake command list with order specified
    macmm_remake_command_list
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Preserve Non-Custom Commands
  #``````````````````````````````````````````````````````````````````````````
  #  This method scans the current list and retains all commands that are
  # either unknown (from another script) or default and not overridden (so
  # that, unless specified by the user, it will act exactly as it would
  # without having this sctipt. That is important in case there is some other
  # script which modifies the default commands.)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_preserve_noncustom_commands
    default_list = [:item, :skill, :equip, :status, :formation, :save, :game_end]
    @noncustom_commands = {}
    for i in 0...@list.size
      cmnd = @list[i]
      sym = cmnd[:symbol]
      # Don't preserve any command defined in CUSTOM_COMMANDS
      if $game_system.macmm_command_list.include?(sym)
        next if MA_CustomizableMenu::CUSTOM_COMMANDS.key?(sym)
      else # Don't preserve default commands that are not specified
        next if default_list.include?(sym)
      end
      # Retain the index and the command
      @noncustom_commands[sym] = [i, cmnd]
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Remake Command List
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_remake_command_list
    # Go through the command list in order
    $game_system.macmm_command_list.each { |sym|
      if MA_CustomizableMenu::CUSTOM_COMMANDS.key?(sym)
        macmm_add_custom_command(sym)
      elsif @noncustom_commands.key?(sym)
        # Add default command to the list
        @list.push(@noncustom_commands[sym][1])
        @noncustom_commands.delete(sym)
      else
        p "Error: MA_MenuBase - No command is set up for #{sym}"
      end
    }
    #  Add all remaining noncustom commands, under the assumption that they are
    # intentionally placed there by an unknown script.
    @noncustom_commands.values.each { |el| @list.insert([el[0], @list.size].min, el[1]) }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Add Custom Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_add_custom_command(symbol)
    cc = MA_CustomizableMenu::CUSTOM_COMMANDS[symbol] # Get custom command setup
    # Get the command name
    name = cc[0].is_a?(Symbol) ? eval(cc[0].to_s) : cc[0]
    # Add the command to the list
    add_command(name, symbol, macmm_custom_command_enabled(cc[1]))
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Custom Command Enabled
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_custom_command_enabled(enable_condition)
    # Check whether enabled
    return case enable_condition
    when Integer then $game_switches[enable_condition]
    when String then eval(enable_condition)
    when Symbol then self.send(enable_condition)
    else
      return true
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Visible Line Number
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mlgb_cmsb_vislnnum_4rk9 visible_line_number
  def visible_line_number(*args, &block)
    r = mlgb_cmsb_vislnnum_4rk9(*args, &block) # Run Original Method
    return r if $game_system.macmm_row_max < 1
    [r, $game_system.macmm_row_max].min
  end
end

#==============================================================================
# ** Window_MACMM_AutoCustom
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This window displays some specified data, along with an identifying label
#==============================================================================

class Window_MACMM_AutoCustom < Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize(cw_data = ["", 0])
    @cw_data = cw_data
    x = MA_CustomizableMenu::COMMAND_WINDOW_ON_RIGHT ? Graphics.width - window_width : 0
    super(x, 0, window_width, fitting_height(@cw_data.size / 2))
    refresh
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Window Width
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def window_width
    $game_system.macmm_command_width
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Refresh Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def refresh
    contents.clear
    for i in 0...(@cw_data.size / 2)
      draw_text_ex(0, line_height*i, "\\c[16]" + @cw_data[i*2])
      reset_font_settings
      draw_text(0, line_height*i, contents_width, line_height, value(@cw_data[i*2 + 1]), 2)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Value
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def value(val = 0)
    return case val
    when Integer then $game_variables[val].to_s
    when String then (eval(val)).to_s
    when Symbol then manual_value(val)
    else
      return ""
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Manual Value
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def manual_value(val)
    if val == :playtime
      @total_sec = Graphics.frame_count / Graphics.frame_rate
      hour = @total_sec / 60 / 60
      min = @total_sec / 60 % 60
      sec = @total_sec % 60
      return sprintf("%02d:%02d:%02d", hour, min, sec)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Open Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def open
    refresh
    super
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Frame Update
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def update
    super
    refresh if @cw_data.include?(:playtime) && Graphics.frame_count / Graphics.frame_rate != @total_sec
  end
end

#==============================================================================
# ** Scene_Menu
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased method - start; create_command_window; create_gold_window;
#      create_status_window; on_personal_ok
#    new method - macmm_command_custom; macmm_command_common_event;
#      create_optional_windows; manual_custom_window; auto_custom_window;
#      set_custom_window_y; macmm_set_custom_handler
#==============================================================================

class Scene_Menu
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Start
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_cmsb_strt_7tg9 start
  def start(*args, &block)
    @opt_y = Graphics.height
    ma_cmsb_strt_7tg9(*args, &block) # Run Original Method
    create_optional_windows
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Command Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_cmsb_crtcmndwin_5ta4 create_command_window
  def create_command_window(*args, &block)
    ma_cmsb_crtcmndwin_5ta4(*args, &block) # Run Original Method
    # Add handlers for all custom commands
    $game_system.macmm_command_list.each { |sym|
      next unless MA_CustomizableMenu::CUSTOM_COMMANDS.key?(sym)
      macmm_set_custom_handler(sym)
    }
    @command_window.x = Graphics.width - $game_system.macmm_command_width if MA_CustomizableMenu::COMMAND_WINDOW_ON_RIGHT
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Status Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias macmm_createstatusw_9ja2 create_status_window
  def create_status_window(*args, &block)
    macmm_createstatusw_9ja2(*args, &block) # Call Original Method
    @status_window.extend(MA_CustomizableMenu::Alter_MenuStatus)
    @status_window.width = Graphics.width - $game_system.macmm_command_width
    @status_window.x = 0 if MA_CustomizableMenu::COMMAND_WINDOW_ON_RIGHT
    @status_window.create_contents
    @status_window.refresh
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Gold Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_cmsb_crtgldwin_5yx1 create_gold_window
  def create_gold_window(*args, &block)
    if $game_system.macmm_optional_windows.include?(:gold) && !MA_CustomizableMenu::CUSTOM_WINDOWS.key?(:gold)
      ma_cmsb_crtgldwin_5yx1(*args, &block) # Run Original Method
      @gold_window.width = $game_system.macmm_command_width
      @gold_window.x = Graphics.width - $game_system.macmm_command_width if MA_CustomizableMenu::COMMAND_WINDOW_ON_RIGHT
      @gold_window.create_contents
      @gold_window.refresh
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Optional Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def create_optional_windows
    @macmm_optional_windows = []
    $game_system.macmm_optional_windows.reverse.each { |sym|
      cw = MA_CustomizableMenu::CUSTOM_WINDOWS[sym]
      if cw.nil?
        manual_custom_window(sym)
      else
        auto_custom_window(sym)
      end
    }
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Custom Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def auto_custom_window(symbol)
    cw = MA_CustomizableMenu::CUSTOM_WINDOWS[symbol]
    window = Window_MACMM_AutoCustom.new(cw)
    set_custom_window_y(window)
    @macmm_optional_windows << window
    instance_variable_set(:"@macmm_#{symbol.to_s}_window", window)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Create Manually Set Custom Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def manual_custom_window(symbol)
    case symbol
    when :gold then set_custom_window_y(@gold_window)
    else
      p "Error: MA_MenuBase - No window setup for #{symbol}"
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Y for Custom Window
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def set_custom_window_y(window)
    @opt_y -= window.height
    window.y = @opt_y
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Personal OK
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mala_cmsb_prsnlok_8yj7 on_personal_ok
  def on_personal_ok(*args, &block)
    if MA_CustomizableMenu::CUSTOM_COMMANDS.include?(@command_window.current_symbol)
      # If calling a common event
      case MA_CustomizableMenu::CUSTOM_COMMANDS[@command_window.current_symbol][2]
      when Integer then macmm_command_common_event
      when Symbol then send(MA_CustomizableMenu::CUSTOM_COMMANDS[@command_window.current_symbol][2])
      when String then eval(MA_CustomizableMenu::CUSTOM_COMMANDS[@command_window.current_symbol][2])
      else
        macmm_command_custom # If nil or anything else, normal
      end
    else
      mala_cmsb_prsnlok_8yj7(*args, &block) # Run Original Method
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Set Custom Handler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_set_custom_handler(symbol)
    cc = MA_CustomizableMenu::CUSTOM_COMMANDS
    handler = case cc[symbol][3]
    when Symbol then method(cc[symbol][3])
    when TrueClass then method(:command_personal)
    else
      handler = case cc[symbol][2]
      when Integer then method(:macmm_command_common_event)
      when String then lambda { eval(cc[symbol][2]) }
      else
        handler = method(:macmm_command_custom) # If nil or anything else, normal
      end
    end
    @command_window.set_handler(symbol, handler)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Custom Command
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_command_custom
    SceneManager.call(Kernel.const_get(MA_CustomizableMenu::CUSTOM_COMMANDS[@command_window.current_symbol][2]))
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Command Common Event
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def macmm_command_common_event
    $game_temp.reserve_common_event(MA_CustomizableMenu::CUSTOM_COMMANDS[@command_window.current_symbol][2])
    return_scene
  end
end


[résolu]Modification de 2script pour metre compatible a VXace Menu1w10

_________________
[résolu]Modification de 2script pour metre compatible a VXace 911

LE PROJET SUR FACEBOOK

N'hésitez pas à suivre la page  [résolu]Modification de 2script pour metre compatible a VXace 344805
dalanx
dalanx
Membre

Nombre de messages : 39
Age : 23
Distinction : aucune
Date d'inscription : 29/05/2010

[résolu]Modification de 2script pour metre compatible a VXace Empty Re: [résolu]Modification de 2script pour metre compatible a VXace

le Mar 26 Juin 2012 - 11:15
Merci pour la sauvegarde, c'est se que je chercher avant d'avoir trouver l'autre(dont les screen on ne vois pas le perso xD)



Pour le menu, ça n'est pas exactement se que je recherche, car sa ressemble un peut a celui qui est normal, j'en cherche un qui ne ressemblepas du tout quoi Very Happy mais avec les save et tous bien sur
ps : meme si sa ne generai pas, la vie et le mp ne m'ai aucune utilité pour mon jeu Very Happy)



EDIT : j'ai tout simplement suprimé l'accé au menu, servant a rien Very Happy je met les sauvegardes a des endroit precis.



merci a vous
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum