XP 스크립트

http://www.phylomortis.com/resource/script/scr039.html
http://www.phylomortis.com/resource/script/scr031.html
  아래 스크립트는 이 둘을 합친 것입니다.(끼워넣는 형태로 만들려면 약간의 노력 요함?)

class Window_SaveFile < Window_Base
#Unlimited Save Files by RPG Advocate
  def initialize(file_index, filename, position)
    y = 64 + position * 104
    super(0, y, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype  # "File" (File #) window font
    self.contents.font.size = $defaultfontsize
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.sav"
    @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
......
end

class Scene_File
#Unlimited Save Files by RPG Advocate
  SAVEFILE_MAX = 99   
# -------------------
  def initialize(help_text)
    @help_text = help_text
  end
# -------------------
  def main
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    @savefile_windows = []
    @cursor_displace = 0
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
    end
    @file_index = 0
    @savefile_windows[@file_index].selected = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    for i in @savefile_windows
      i.dispose
    end
    if self.is_a?(Scene_Save) #추가-세이브 덮어씌울 때 확인
    @confirm_window.dispose #Prompt for Overwrite Confirmation when Saving by RPG Advocate
    @yes_no_window.dispose
  end #추가끝
  end
# -------------------
  def update
    @help_window.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 < SAVEFILE_MAX - 1
        if @file_index == SAVEFILE_MAX - 1
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @cursor_displace += 1
        if @cursor_displace == 4
          @cursor_displace = 3
          for i in @savefile_windows
            i.dispose
          end
          @savefile_windows = []
          for i in 0..3
            f = i - 2 + @file_index
            name = make_filename(f)
            @savefile_windows.push(Window_SaveFile.new(f, name, i))
            @savefile_windows[i].selected = false
          end
        end
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index + 1)
        if @file_index == SAVEFILE_MAX
          @file_index = SAVEFILE_MAX - 1
        end
        for i in 0..3
          @savefile_windows[i].selected = false
        end
        @savefile_windows[@cursor_displace].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        if @file_index == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @cursor_displace -= 1
        if @cursor_displace == -1
          @cursor_displace = 0
          for i in @savefile_windows
            i.dispose
          end
          @savefile_windows = []
          for i in 0..3
            f = i - 1 + @file_index
            name = make_filename(f)
            @savefile_windows.push(Window_SaveFile.new(f, name, i))
            @savefile_windows[i].selected = false
          end
        end
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index - 1)
        if @file_index == -1
          @file_index = 0
        end
        for i in 0..3
          @savefile_windows[i].selected = false
        end
        @savefile_windows[@cursor_displace].selected = true
        return
      end
    end
  end
# -------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.sav"
  end
# -------------------
end

class Scene_Save < Scene_File
def initialize
    super("Save to which file?")
    @confirm_window = Window_Base.new(120, 188, 400, 64) #추가
    @confirm_window.contents = Bitmap.new(368, 32)
    string = "이 파일에 덮어쓰시겠습니까?"
    @confirm_window.contents.font.name = $defaultfonttype
    @confirm_window.contents.font.size = 24
    @confirm_window.contents.draw_text(4, 0, 368, 32, string)
    @yes_no_window = Window_Command.new(100, ["Yes", "No"])
    @confirm_window.visible = false
    @confirm_window.z = 1500
    @yes_no_window.visible = false
    @yes_no_window.active = false
    @yes_no_window.index = 1
    @yes_no_window.x = 270
    @yes_no_window.y = 252
    @yes_no_window.z = 1500
    @mode = 0 #추가 끝
  end
#--------------------------------
def on_decision(filename)
    if FileTest.exist?(filename) #추가-저장할 파일을 덮어쓸 것인가?
      @confirm_window.visible = true
      @yes_no_window.visible = true
      @yes_no_window.active = true
      @mode = 1
    else
    $game_system.se_play($data_system.save_se)
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    $scene = Scene_Menu.new(4)
    end
  end
 # -----------------------------
  def update
    if @mode == 0
      super
    else
      @help_window.update
      @yes_no_window.update
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        if @yes_no_window.index == 0
          filename = make_filename(@file_index)
          $game_system.se_play($data_system.save_se)
          file = File.open(filename, "wb")
          write_save_data(file)
          file.close
          if $game_temp.save_calling
            $game_temp.save_calling = false
            $scene = Scene_Map.new
          else
            $scene = Scene_Menu.new(4)
          end
        else
          @confirm_window.visible = false
          @yes_no_window.visible = false
          @yes_no_window.active = false
          @yes_no_window.index = 1
          @mode = 0
        end
      end
      if Input.trigger?(Input::B)
        @confirm_window.visible = false
        @yes_no_window.visible = false
        @yes_no_window.active = false
        @yes_no_window.index = 1
        @mode = 0
      return
    end
  end
end
.......
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '5'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
501 스킬 SG_Skill Invoking Battle Items by sandgolem (SDK호환) 백호 2009.02.22 894
» 저장 세이브 슬롯 갯수 증가와 세이브 덮어씌울 때 확인 by RPG Advocate 5 백호 2009.02.22 1505
499 기타 스크린샷 찍는 스크립트 9 file 백호 2009.02.22 1363
498 스킬 Skill Shop by Trickster@rmxp.org file 백호 2009.02.22 1073
497 기타 데미지 출력 스크립트 예제 9 file 백호 2009.02.22 1559
496 메뉴 수정, 추가 링메뉴 10 file 백호 2009.02.22 2912
495 전투 데미지 출력 스크립트 6 백호 2009.02.22 1810
494 기타 Economy System by Nick@Creation Asylum 1 file 백호 2009.02.22 934
493 이동 및 탈것 3D 캐릭 스크립트 7 백호 2009.02.22 3443
492 키입력 텍스트입력 이벤트명령 2.0 by wachunga@rmxp.org (SDK호환) file 백호 2009.02.22 1825
491 전투 RPG Advocate의 데모에서 발췌한 사이드뷰용 전투상태창 4 file 백호 2009.02.22 3597
490 변수/스위치 SG_Self Variables by sandgolem 백호 2009.02.22 1275
489 기타 SG_Settings Control by sandgolem 백호 2009.02.22 884
488 메뉴 SG_Hide zero SP cost by sandgolem (SDK호환) 백호 2009.02.22 1064
487 아이템 SG_Hide free item cose by sandgolem (SDK호환) 백호 2009.02.22 935
486 메뉴 SG_Artifact Colors by sandgolem (SDK 호환) 1 백호 2009.02.22 1003
485 상태/속성 SG_State Immunity Message by sandgolem (SDK 호환) 백호 2009.02.22 1056
484 전투 보행그래픽으로 싸우는 턴알 17 백호 2009.02.22 3782
483 전투 ATB전투 5 백호 2009.02.22 3369
482 기타 어디에 쓰이는지 불확실한 스크립트 1 백호 2009.02.22 1063
Board Pagination Prev 1 ... 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 ... 52 Next
/ 52