Ogłoszenie 

Uwaga! To forum jest w trybie offline.
Wszelką pomoc uzyskasz pod adresem
forum.ultimateam.pl


Administracja Forum


Poprzedni temat «» Następny temat
Zamknięty przez: Angius
Nie 03 Lip, 2011 21:05
Loading Bars
Autor Wiadomość
Angius 

Nie wkurzać



Preferowany:
RPG Maker VX

Pomógł: 104 razy
Dołączył: 30 Paź 2010
Posty: 1276
Skąd: wROCK
Wysłany: Sob 02 Lip, 2011 20:44
Loading Bars
Dostałem od Darknessa ten skrypt. Chciałbym wykorzystać go w grze, ale wygląda na to, że nadpisuje ładowanie i zapisywanie gry, tak jak Neo Save System. Byłbym wdzięczny, jeśliby ktoś dokonał fuzji, albo przerobił ten skrypt tak, by był bardziej skory do współpracy...
Spoiler:

Kod:
#===============================================================================
# +++ MOG - Advanced Load Bar VX (v1.0) +++
#===============================================================================
# By Moghunter
# http://www.atelier-rgss.com 
#===============================================================================
# Apresenta uma barra de carregar entre as cenas de Save e Load.
#
# O propósito deste Script é apresentar alguns artworks de seu jogo
# enquanto o jogador espera a barra de leitura.
#
#===============================================================================
# Você pode adpatar esse script em alguma outra Scene ou ativar pelo evento.
# Basta usar este código.
#
# $scene = Scene_Load_Bar.new
#===============================================================================
module MOG_LOAD_BAR
   # Tempo para fazer load.(Segundos)
   LOAD_DURATION = 3
   # Ativar o sistema ao carregar o jogo.
   ENABLE_LOAD_BAR_FOR_SCENE_LOAD = true
   # Ativar o sistema ao salvar o jogo.
   ENABLE_LOAD_BAR_FOR_SCENE_SAVE = true   
   # Definição das imagens que ficarão no plano de fundo.
   LOAD_BACKGROUND_PICTURES = [
   "Background_1",
   #"Background_2",
   #"Background_3",
   #"Background_4",
   #"Background_5",
   #"Background_6"
   #"Background_7",
   #"Background_8",
   #"Background_9",
   #"Background_10",
   # ...
   ]
   # Ativar ordem aleatória ou sequencial.
   PICTURE_RANDOM_SELECTION = false   
   # Posição do geral da Hud.
   LOAD_BAR_POSITION = [30,350]
   # Posição do medidor.
   LOAD_BAR_METER_POSITION = [11,27]
   # Posição do Texto.
   LOAD_BAR_TEXT_POSITION = [ 10, -3]
   # Som ao carregar o arquivo.
   LOAD_SE = "Bow1"
   # Velocidade da animação do medidor.
   LOAD_BAR_FLOW_SPEED = 25
   # Definição da Cena que será ativada após salvar via menu.
   # Caso o save seja feito pelo evento, a cena será o Mapa.
   RETURN_TO_SCENE = Scene_Menu.new(4)
   # Ativar a animação de levitação do texto.
   ENABLE_FLOAT_TEXT_ANIMATION = true
   # Apresentar o sprite do personagem.
   ENABLE_CHARACTER_SPRITE = true
   # Ativar barras laterais.
   ENABLE_STRIPE_SPRITE = true
   # Velocidade das barras laterais.
   STRIPE_SPEED = 1
end

#=============================================================================
# ■ Game_Temp
#=============================================================================
class Game_Temp
  attr_accessor :load_bar_pre_index
  attr_accessor :save_calling_load_bar
  attr_accessor :load_pre_bgm
  attr_accessor :load_pre_bgs
 
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------             
 alias load_bar_initialize initialize
 def initialize
     load_bar_initialize
     @load_bar_pre_index = -1
     @save_calling_load_bar = false
 end
   
end

#=============================================================================
# ■ Game_System
#=============================================================================
class Game_System
  attr_accessor :load_bar_pre_index
 
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------             
 alias load_bar_initialize initialize
 def initialize
     load_bar_initialize
     @load_bar_pre_index = 0
 end
 
 #--------------------------------------------------------------------------
 # ● BGS Stop
 #--------------------------------------------------------------------------             
 def bgs_stop
     Audio.bgs_stop
 end
end

#=============================================================================
# ■ Scene Load Bar
#=============================================================================
class Scene_Load_Bar
 include MOG_LOAD_BAR
 
 #--------------------------------------------------------------------------
 # ● Initialize
 #--------------------------------------------------------------------------           
 def initialize(type = 0) 
     @bar_type = type
     @load_duration_max = 60 * LOAD_DURATION
     @load_duration_max = 60 if @load_duration_max < 60 
     @load_duration = 0
     @pictures = LOAD_BACKGROUND_PICTURES
     create_background
     create_layout 
     create_load_bar
     create_text
     create_side_strip
 end
   
 #--------------------------------------------------------------------------
 # &#9679; Create Background
 #--------------------------------------------------------------------------           
 def create_background 
     @background = Sprite.new
     if PICTURE_RANDOM_SELECTION
        $game_system.load_bar_pre_index = rand(@pictures.size)
        no_repeat_picture
     end
     image_name = @pictures[$game_system.load_bar_pre_index]   
     image_name = "" if image_name == nil     
     @background.bitmap = Cache.picture(image_name)
     $game_temp.load_bar_pre_index = $game_system.load_bar_pre_index
     unless PICTURE_RANDOM_SELECTION
        $game_system.load_bar_pre_index += 1
        $game_system.load_bar_pre_index = 0 if $game_system.load_bar_pre_index > @pictures.size - 1
     end   
 end
   
 #--------------------------------------------------------------------------
 # &#9679; No Repeat Picture
 #--------------------------------------------------------------------------           
 def no_repeat_picture
     if $game_system.load_bar_pre_index == $game_temp.load_bar_pre_index
        $game_system.load_bar_pre_index += 1
        $game_system.load_bar_pre_index = 0 if $game_system.load_bar_pre_index > @pictures.size - 1
     end 
 end
 
 #--------------------------------------------------------------------------
 # &#9679; Create Layout
 #--------------------------------------------------------------------------           
 def create_layout 
     @hud = Sprite.new
     @hud.bitmap = Cache.system("Load_Bar_Layout")
     @hud.x = LOAD_BAR_POSITION[0]
     @hud.y = LOAD_BAR_POSITION[1]
     @hud.z = 10
 end
 
 #--------------------------------------------------------------------------
 # &#9679; Create Layout
 #--------------------------------------------------------------------------           
 def create_side_strip
     if @bar_type == 0
        image_name_1 = "Load_Bar_Stripe1_L"
        image_name_2 = "Load_Bar_Stripe2_L"
     else 
        image_name_1 = "Load_Bar_Stripe1_S"
        image_name_2 = "Load_Bar_Stripe2_S"
     end 
     @stripe1 = Plane.new
     @stripe1.bitmap = Cache.system(image_name_1)
     @stripe1.z = 1
     @stripe2 = Plane.new
     @stripe2.bitmap = Cache.system(image_name_2)
     @stripe2.z = 1         
     @stripe1.visible = ENABLE_STRIPE_SPRITE
     @stripe2.visible = ENABLE_STRIPE_SPRITE
 end
 
 #--------------------------------------------------------------------------
 # &#9679; Create Load Bar
 #--------------------------------------------------------------------------           
 def create_load_bar
     @bar_flow = 0
     @bar_image = Cache.system("Load_Bar_Meter")
     @bar_bitmap = Bitmap.new(@bar_image.width,@bar_image.height)
     @bar_range = @bar_image.width / 3
     @bar_width = @bar_range  * @load_duration / @load_duration_max
     @bar_height = @bar_image.height
     @bar_width_old = @bar_width
     @bar_src_rect = Rect.new(@bar_flow, 0, @bar_width, @bar_height)
     @bar_bitmap.blt(0,0, @bar_image, @bar_src_rect)
     @bar_sprite = Sprite.new
     @bar_sprite.bitmap = @bar_bitmap
     @bar_sprite.z = 11
     @bar_sprite.x = LOAD_BAR_POSITION[0] + LOAD_BAR_METER_POSITION[0]
     @bar_sprite.y = LOAD_BAR_POSITION[1] + LOAD_BAR_METER_POSITION[1]
     update_bar_flow
 end
 
 #--------------------------------------------------------------------------
 # &#9679; Create Text
 #--------------------------------------------------------------------------           
 def create_text
     @text_float_time = 0
     @text_float_y = 0
     @text_image = Cache.system("Load_Bar_Text")
     @text_bitmap = Bitmap.new(@text_image.width,@text_image.height)
     @text_width = @text_image.width
     @text_height = @text_image.height / 2
     @text_src_rect = Rect.new(0, @text_height * @bar_type, @text_width, @text_height)
     @text_bitmap.blt(0,0, @text_image, @text_src_rect)   
     @text_sprite = Sprite.new
     @text_sprite.bitmap = @text_bitmap   
     @text_fy = LOAD_BAR_POSITION[1] + LOAD_BAR_TEXT_POSITION[1]
     @text_sprite.x = LOAD_BAR_POSITION[0] + LOAD_BAR_TEXT_POSITION[0]
     @text_sprite.y = @text_fy
     @text_sprite.z = 12
 end
 
 #--------------------------------------------------------------------------
 # &#9679; Main
 #--------------------------------------------------------------------------         
 def main
     Graphics.transition
     execute_loop
     execute_dispose
 end   
 
 #--------------------------------------------------------------------------
 # &#9679; Execute Loop
 #--------------------------------------------------------------------------           
 def execute_loop
     loop do
         Graphics.update
         update
         if $scene != self
            break
         end
     end 
  end
 
 #--------------------------------------------------------------------------
 # &#9679; Execute Dispose
 #--------------------------------------------------------------------------           
 def execute_dispose
     @hud.bitmap.dispose
     @hud.dispose
     @stripe1.bitmap.dispose
     @stripe1.dispose     
     @stripe2.bitmap.dispose
     @stripe2.dispose       
     @bar_image.dispose
     @bar_bitmap.dispose
     @bar_sprite.bitmap.dispose
     @bar_sprite.dispose     
     @background.bitmap.dispose
     @background.dispose
     @text_image.dispose
     @text_bitmap.dispose
     @text_sprite.bitmap.dispose
     @text_sprite.dispose
     Graphics.transition
     Graphics.freeze
 end 
 
 #--------------------------------------------------------------------------
 # &#9679; Update
 #--------------------------------------------------------------------------             
 def update
     update_bar_flow
     update_bar_duration
     update_float_text
     update_slide_stripe
 end
 
 #--------------------------------------------------------------------------
 # &#9679; Update Slide Stripe
 #--------------------------------------------------------------------------             
 def update_slide_stripe
     @stripe1.oy += STRIPE_SPEED
     @stripe2.ox += STRIPE_SPEED
 end   
   
 #--------------------------------------------------------------------------
 # &#9679; update_float_text
 #--------------------------------------------------------------------------             
 def update_float_text
     return unless ENABLE_FLOAT_TEXT_ANIMATION
     @text_float_time += 1
     case @text_float_time
        when 1..10
           @text_float_y += 1
        when 11..20
           @text_float_y -= 1
        else
          @text_float_y = 0
          @text_float_time = 0
     end
     @text_sprite.y = @text_fy + @text_float_y
 end
 
 #--------------------------------------------------------------------------
 # &#9679; Update Bar Flow
 #--------------------------------------------------------------------------           
 def update_bar_flow
     @bar_sprite.bitmap.clear
     @bar_width = @bar_range  * @load_duration / @load_duration_max
     @bar_width = @bar_range if @load_duration > @load_duration_max
     @bar_src_rect = Rect.new(@bar_flow, 0,@bar_width, @bar_height)
     @bar_bitmap.blt(0,0, @bar_image, @bar_src_rect)
     @bar_flow += LOAD_BAR_FLOW_SPEED
     if @bar_flow >= @bar_image.width - @bar_range
        @bar_flow = 0     
     end
 end   
   
 #--------------------------------------------------------------------------
 # &#9679; Update Bar Duration
 #--------------------------------------------------------------------------             
 def update_bar_duration
     @load_duration += 1
     if @load_duration == @load_duration_max
        Audio.se_play("Audio/SE/" + LOAD_SE,100,100) rescue nil
     elsif @load_duration == @load_duration_max + 10
        if @bar_type == 0 or $game_temp.save_calling_load_bar
           if @bar_type == 0
              $game_temp.load_pre_bgm.play
              $game_temp.load_pre_bgs.play     
           end
           $scene = Scene_Map.new
        else   
           $scene = MOG_LOAD_BAR::RETURN_TO_SCENE
        end 
        $game_temp.save_calling_load_bar = false
     end
 end 
 
end

#=============================================================================
# &#9632; Game_Temp
#=============================================================================
class Scene_File < Scene_Base
 
  #--------------------------------------------------------------------------
  # * Return to Original Screen
  #--------------------------------------------------------------------------
  alias mog_adv_load_bar_return_scene return_scene
  def return_scene
      mog_adv_load_bar_return_scene
      $game_temp.save_calling_load_bar = true if @from_event
      $scene = Scene_Load_Bar.new(1)
  end
 
  #--------------------------------------------------------------------------
  # * Execute Load
  #--------------------------------------------------------------------------
  def do_load   
      file = File.open(@savefile_windows[@index].filename, "rb")
      read_save_data(file)
      file.close
      $scene = Scene_Load_Bar.new(0)
      RPG::BGM.fade(1500)
      RPG::BGS.fade(1500)
      $game_temp.load_pre_bgm = @last_bgm
      $game_temp.load_pre_bgs = @last_bgs
  end
end 

$mog_vx_advanced_load_bar = true


I Neo SS:
Spoiler:

Kod:
#===============================================================
# &#9679; [VX] &#9702; Neo Save System III &#9702; &#9633;
#--------------------------------------------------------------
# &#9702; by Woratana [woratana@hotmail.com]
# &#9702; Thaiware RPG Maker Community
# &#9702; Released on: 15/02/2009
# &#9702; Version: 3.0
#--------------------------------------------------------------
# &#9702; Log III:
# - Change back to draw tilemap as screenshot. Don't need any image.
# - For drawing tilemap, the characters won't show on the tilemap.
#--------------------------------------------------------------
# &#9702; 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.
#--------------------------------------------------------------
# &#9702; Features:
# - Unlimited save slots, you can choose max save slot
# - 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 tilemap for map that player is currently in.
# - 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 its name
# - Include save confirmation window before overwrite old save
#=================================================================

module Wora_NSS
  #==========================================================================
  # * START NEO SAVE SYSTEM - SETUP
  #--------------------------------------------------------------------------
  NSS_WINDOW_OPACITY = 200 # 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
 
  MAX_SAVE_SLOT = 20 # Max save slots no.
  SLOT_NAME = 'Historia {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 = 'Save/' # 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 = '-Tabula Rasa-' # 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
 
  PLAYTIME_TEXT = 'Czas grania: '
  GOLD_TEXT = 'Złoto: '
  LOCATION_TEXT = 'Lokacja: '
  LV_TEXT = 'Poziom '
 
  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
  MAP_NO_NAME_LIST = [] # ID of Map that will not show map name, e.g. [1,2,3]
  MAP_NO_NAME_NAME = '.-.-.-.-.' # What you will use to call map in no name list
 
  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 = 'Nadpisz dawną Historię' # Text to confirm to save file
  SFC_Text_Cancel = 'Wróć' # Text to cancel to save
  SFC_Window_Width = 300 # 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
  #=========================================================================
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
    @help_window.opacity = NSS_WINDOW_OPACITY
    @window_slotdetail.opacity = @window_slotlist.opacity = NSS_WINDOW_OPACITY
   
  # 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
    file = File.open(make_filename(@last_slot_index), "wb")
    write_save_data(file)
    file.close
    $scene = Scene_Map.new
  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
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]
      # DRAW SCREENSHOT~
      contents.fill_rect(0,30,352,160, MAP_BORDER)
      create_tilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
    save_data['gamemap'].display_y)
      if DRAW_GOLD
        # 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.draw_text(goldt_textsize + gold_textsize,0,200,WLH, Vocab::gold)
        contents.font.color = normal_color
        contents.draw_text(goldt_textsize, 0, gold_textsize, WLH, save_data['gamepar'].gold)
      end
      if DRAW_PLAYTIME
        # 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.font.color = normal_color
        contents.draw_text(0, 0, contents.width, WLH, time_string, 2)
      end
      if DRAW_LOCATION
        # 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 FACE & 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
          # 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
          # 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
          # 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
      @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_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)
        @map_name[map_id] = MAP_NO_NAME_NAME
      else
        @map_name[map_id] = @map_data[map_id].name
        MAP_NAME_TEXT_SUB.each_index do |i|
          @map_name[map_id].sub!(MAP_NAME_TEXT_SUB[i], '')
        end
      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 dispose_tilemap
    unless @tilemap.nil?
      @tilemap.dispose
      @tilemap = nil
    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
#======================================================================
# END - NEO SAVE SYSTEM by Woratana
#======================================================================

________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."


 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Nie 03 Lip, 2011 20:09
Wejdź w skrypt 'Neo Save System III' i znajdź:
Kod:
$scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    @last_bgm.play
    @last_bgs.play

zamień na:
Kod:
$scene = Scene_Load_Bar.new(0)
    RPG::BGM.fade(1500)
    RPG::BGS.fade(1500)
    $game_temp.load_pre_bgm = @last_bgm
    $game_temp.load_pre_bgs = @last_bgs

wejdź w skrypt 'MOG - Adv Load Bar', znajdź i usuń fragment:
Kod:
def do_load   
      file = File.open(@savefile_windows[@index].filename, "rb")
      read_save_data(file)
      file.close
      $scene = Scene_Load_Bar.new(0)
      RPG::BGM.fade(1500)
      RPG::BGS.fade(1500)
      $game_temp.load_pre_bgm = @last_bgm
      $game_temp.load_pre_bgs = @last_bgs
    end
________________________


 
 
 
Angius 

Nie wkurzać



Preferowany:
RPG Maker VX

Pomógł: 104 razy
Dołączył: 30 Paź 2010
Posty: 1276
Skąd: wROCK
Wysłany: Nie 03 Lip, 2011 20:16
Przy wczytywaniu jest wszystko w jak najlepszym porządku.
Niestety - przy zapisie już się paski nie wyświetlają, po prostu następuje zapis.
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."


 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Nie 03 Lip, 2011 20:22
W 'Neo Save System III' znajdź fragment:
Kod:
def do_save
    file = File.open(make_filename(@last_slot_index), "wb")
    write_save_data(file)
    file.close
    $scene = Scene_Map.new
  end

i zamień go na:
Kod:
def do_save
    file = File.open(make_filename(@last_slot_index), "wb")
    write_save_data(file)
    file.close
    $game_temp.save_calling_load_bar = true if @from_event
    $scene = Scene_Load_Bar.new(1)
  end
________________________


 
 
 
Angius 

Nie wkurzać



Preferowany:
RPG Maker VX

Pomógł: 104 razy
Dołączył: 30 Paź 2010
Posty: 1276
Skąd: wROCK
Wysłany: Nie 03 Lip, 2011 21:05
Dzięki, Ayene, jesteś nieoceniona :aww:
Zamykam
________________________
"Na trolla pewne są tylko dwie pewne metody, jedna samopowtarzalna i druga, wymagająca przeładowania ręcznego."


 
 
Wyświetl posty z ostatnich:   
Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi
Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Nie możesz załączać plików na tym forum
Możesz ściągać załączniki na tym forum
Dodaj temat do Ulubionych
Wersja do druku

Skocz do:  

Powered by phpBB modified by Przemo © 2003 phpBB Group | Template Klam by Ayene