Ogłoszenie 

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


Administracja Forum


Poprzedni temat «» Następny temat
8 SaveSlots
Autor Wiadomość
PaKiTos 




Preferowany:
RPG Maker 2003

Ranga RM:
2 gry

Pomógł: 16 razy
Dołączył: 05 Lis 2009
Posty: 359
Skąd: spytaj innych
Wysłany: Nie 16 Sty, 2011 14:29
8 SaveSlots
Opis:
Mamy 8 slotów na zapis gry.

Kod:
Spoiler:

Kod:
#==============================================================================
# ■ 8 SaveSlots
#------------------------------------------------------------------------------
# Pako Script Pack 1
#==============================================================================

class Window_SaveFile < Window_Base
  #--------------------------------------------------------------------------
  attr_reader   :filename                 
  attr_reader   :selected         
  #--------------------------------------------------------------------------
  def initialize(file_index, filename)
    super(0, 0 + file_index % 8 * 59, 640, 69)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear   
    self.contents.font.color = normal_color
    name = "Zapis #{@file_index + 1}"
    self.contents.draw_text(4, 0, 600, 32, name)
    @name_width = contents.text_size(name).width   
    if @file_exist     
      self.contents.font.color = normal_color
      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
      self.contents.draw_text(334, 1, 600, 32, "Zapisany")
    end
  end
  #--------------------------------------------------------------------------
  def selected=(selected)
    @selected = selected
    update_cursor_rect
  end
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @selected
      self.cursor_rect.set(0, 0, @name_width + 8, 32)
    else
      self.cursor_rect.empty
    end
  end
end
#==============================================================================
# &#9632; Scene_File
#==============================================================================

class Scene_File
  #--------------------------------------------------------------------------
  def initialize(help_text)
    @help_text = help_text
  end
  #--------------------------------------------------------------------------
  def main
    @savefile_windows = []
    for i in 0..7
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @file_index = $game_temp.last_file_index
    @savefile_windows[@file_index].selected = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    for i in @savefile_windows
      i.dispose
    end
  end
  #--------------------------------------------------------------------------
  def update
    for i in @savefile_windows
      i.update
    end
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < 7
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 1) % 8
        @savefile_windows[@file_index].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        $game_system.se_play($data_system.cursor_se)
        @savefile_windows[@file_index].selected = false
        @file_index = (@file_index + 7) % 8
        @savefile_windows[@file_index].selected = true
        return
      end
    end
  end
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rxdata"
  end
end

________________________
po co to kopiujesz? ;d
Spoiler:

Fakty:
1.Widzisz mój podpis
2.Jesteś w internecie
3.Czytasz
4.Siedzisz przy komputerze
5.Jesteś na UltimaForum
6.Twój nick to Gość


kiedys tu bylo fajniej... coz gospoda rma forever
chwala tym ktorzy nadal robia w 2k
 
 
tracersgta 




Preferowany:
RPG Maker VX

Pomógł: 45 razy
Dołączył: 10 Sty 2011
Posty: 612
Skąd: mam wiedzieć?
Wysłany: Nie 16 Sty, 2011 21:02
Dziwna treść skryptu... same &i tu jakaś 5 liczbowa cyfra(albo cyfrowa liczba :P).
________________________
I'm a tiger! I roar. I hunt, I climb, I eat, I wash, I sleep!

Gość, jeżeli pomogłem daj "Pomógł" ;-)
 
 
 
Ayene 




Ranga RM:
4 gry

Pomogła: 232 razy
Dołączyła: 18 Wrz 2007
Posty: 2424
Wysłany: Pon 17 Sty, 2011 07:34
PaKiTos, skrypt przydatny, ale kolejnym razem prosiłabym o usuwanie japońskich komentarzy oraz dostosowanie skryptu do 'standardów' wersji angielskiej.

Skrypt zedytowany.
________________________


 
 
 
mic2311 



Preferowany:
RPG Maker XP

Dołączył: 03 Sie 2011
Posty: 5
Wysłany: Sob 20 Sie, 2011 07:13
Dzięki za skrypt, dzięki za "FAKTY" ;-)
 
 
 
Wyświetl posty z ostatnich:   
Odpowiedz do tematu
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