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
381 메뉴 Ring menu edit (Non-SDK ver.) Alkaid 2010.09.08 1538
380 장비 Multislots! 2.1 by DerVVulfman 3 file Alkaid 2010.09.02 1537
379 기타 Seph's Test Bed v.4 (파일첨부) (SDK2.x용) Alkaid 2010.10.08 1533
378 기타 My메세지(메세지 출력 스크립트) 1 file 백호 2009.02.22 1533
377 메뉴 MOG - Scroll Bar for XP file 습작 2014.07.06 1532
376 상점 간단한 여관 by Tsunokiette@Creation Asylum 2 백호 2009.02.22 1530
375 기타 ↓ 날씨 자동설정 스크립트 3 백호 2009.02.22 1530
374 전투 KGC_SPdeath (SP전투불능) file 백호 2009.02.22 1527
373 기타 참 시스템 완성! 1 file 백호 2009.02.22 1523
372 상점 상점 시세 변동 스크립트 수정판 3 백호 2009.02.22 1518
371 기타 KGC - RMXP 스크립트 개발용 프로젝트 1.01 4 file 백호 2009.02.22 1515
370 기타 SFont 사용 스크립트 by Trickster Alkaid 2010.10.05 1512
369 이동 및 탈것 Mouse_move 호환 100%강화버전 4 file 백호 2009.02.21 1512
368 기타 Character Creator by Leon@Creation Asylum 2 file 백호 2009.02.22 1511
367 스킬 Grouping and Detail 7.2 by DerVVulfman 1 file Alkaid 2010.09.02 1510
366 이동 및 탈것 데쉬 기능 스크립트 8 file 백호 2009.02.21 1508
365 이동 및 탈것 비공정 스크립트 5 file 백호 2009.02.22 1506
» 저장 세이브 슬롯 갯수 증가와 세이브 덮어씌울 때 확인 by RPG Advocate 5 백호 2009.02.22 1505
363 아이템 아이템소지수 한계돌파 (중복일지도) 12 카르닉스 2010.02.26 1500
362 넷플2.0(펌) 2번째 2 오동훈 2008.02.25 1498
Board Pagination Prev 1 ... 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 ... 52 Next
/ 52