设为首页收藏本站

仙剑之十里坡

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 3066|回复: 1
打印 上一主题 下一主题

覆盖存档提示

[复制链接]

67

主题

2

听众

2064

积分

仗剑行侠

会员等级: 5

  • TA的每日心情
    无聊
    2013-8-16 09:01
  • 签到天数: 161 天

    [LV.7]常住仙友III

    精华
    0
    积分
    2064
    历练
    0
    声望
    43
    人气
    3
    单身中……
    帮我摆脱单身吧
    跳转到指定楼层
    1
    发表于 2010-11-7 20:33:15 |只看该作者 |倒序浏览
    本帖最后由 御剑奇侠 于 2010-11-9 19:34 编辑
    1. #==============================================================================
    2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
    3. #==============================================================================
    4. #在覆盖存档的时候弹出对话框提示
    5. class Scene_Save < Scene_File
    6. # -----------------------------
    7. def initialize
    8. super("储存到哪一个进度")
    9. @confirm_window = Window_Base.new(120, 188, 400, 64)
    10. @confirm_window.contents = Bitmap.new(368, 32)
    11. string = "确定要覆盖这个进度吗?"
    12. @confirm_window.contents.font.name = "黑体"
    13. @confirm_window.contents.font.size = 24
    14. @confirm_window.contents.draw_text(4, 0, 368, 32, string)
    15. @yes_no_window = Window_Command.new(100, ["覆盖", "取消"])
    16. @confirm_window.visible = false
    17. @confirm_window.z = 1500
    18. @yes_no_window.visible = false
    19. @yes_no_window.active = false
    20. @yes_no_window.index = 1
    21. @yes_no_window.x = 270
    22. @yes_no_window.y = 252
    23. @yes_no_window.z = 1500
    24. @mode = 0
    25. end
    26. # -----------------------------
    27. def on_decision(filename)
    28. if FileTest.exist?(filename)
    29. @confirm_window.visible = true
    30. @yes_no_window.visible = true
    31. @yes_no_window.active = true
    32. @mode = 1
    33. else
    34. $game_system.se_play($data_system.save_se)
    35. file = File.open(filename, "wb")
    36. write_save_data(file)
    37. file.close
    38. if $game_temp.save_calling
    39. $game_temp.save_calling = false
    40. $scene = Scene_Map.new
    41. return
    42. end
    43. $scene = Scene_Menu.new(4)
    44. end
    45. end
    46. # -----------------------------
    47. def update
    48. if @mode == 0
    49. super
    50. else
    51. @help_window.update
    52. @yes_no_window.update
    53. if Input.trigger?(Input::C)
    54. $game_system.se_play($data_system.decision_se)
    55. if @yes_no_window.index == 0
    56. @yes_no_window.visible = false
    57. @yes_no_window.active = false
    58. @confirm_window.visible = false
    59. filename = make_filename(@file_index)
    60. $game_system.se_play($data_system.save_se)
    61. file = File.open(filename, "wb")
    62. write_save_data(file)
    63. file.close
    64. if $game_temp.save_calling
    65. $game_temp.save_calling = false
    66. $scene = Scene_Map.new
    67. else
    68. $scene = Scene_Menu.new(4)
    69. end
    70. else
    71. @confirm_window.visible = false
    72. @yes_no_window.visible = false
    73. @yes_no_window.active = false
    74. @yes_no_window.index = 1
    75. @mode = 0
    76. end
    77. end
    78. if Input.trigger?(Input::B)
    79. @confirm_window.visible = false
    80. @yes_no_window.visible = false
    81. @yes_no_window.active = false
    82. @yes_no_window.index = 1
    83. @mode = 0
    84. return
    85. end
    86. end
    87. end
    88. # -----------------------------
    89. def on_cancel
    90. $game_system.se_play($data_system.cancel_se)
    91. if $game_temp.save_calling
    92. $game_temp.save_calling = false
    93. $scene = Scene_Map.new
    94. return
    95. end
    96. $scene = Scene_Menu.new(4)
    97. end
    98. # -----------------------------
    99. def write_save_data(file)
    100. characters = []
    101. for i in 0...$game_party.actors.size
    102. actor = $game_party.actors
    103. characters.push([actor.character_name, actor.character_hue])
    104. end
    105. Marshal.dump(characters, file)
    106. Marshal.dump(Graphics.frame_count, file)
    107. $game_system.save_count += 1
    108. $game_system.magic_number = $data_system.magic_number
    109. Marshal.dump($game_system, file)
    110. Marshal.dump($game_switches, file)
    111. Marshal.dump($game_variables, file)
    112. Marshal.dump($game_self_switches, file)
    113. Marshal.dump($game_screen, file)
    114. Marshal.dump($game_actors, file)
    115. Marshal.dump($game_party, file)
    116. Marshal.dump($game_troop, file)
    117. Marshal.dump($game_map, file)
    118. Marshal.dump($game_player, file)
    119. end
    120. end
    121. class Scene_File
    122. alias carol3_main main
    123. def main
    124. carol3_main
    125. if self.is_a?(Scene_Save)
    126. @confirm_window.dispose
    127. @yes_no_window.dispose
    128. end
    129. end
    130. end
    131. #==============================================================================
    132. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
    133. #==============================================================================
    复制代码

    复制全部脚本内容,在Main脚本之前按insert,插入此脚本全部内容。功能:覆盖存档的时候弹出提示“是否覆盖”
    1

    查看全部评分

    分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    转播转播0 分享淘帖0 分享分享0 收藏收藏0
    蜉蝣之羽,衣裳楚楚。心之忧矣,於我归处?
    蜉蝣之翼,采采衣服。心之忧矣,於我归息?
    蜉蝣掘阅,麻衣如雪。心之忧矣,於我归说?

    107

    主题

    6

    听众

    4719

    积分

    版主

    [- 血夜系列作者 -]

    版主

  • TA的每日心情
    无聊
    2015-7-18 22:25
  • 签到天数: 123 天

    [LV.7]常住仙友III

    精华
    1
    积分
    4719
    历练
    3
    声望
    20
    人气
    548

    黑色羽翼 神仙眷侣 出神入化 妙笔生花 灵动清风 匠心独运 鬼斧神工

    吳述兒
    幸福:72℃
    2
    发表于 2010-11-8 04:56:58 |只看该作者
    这次有用代码插入...很好很有爱...
    这脚本比较常有,不错...支持~

           
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 加入我们

    手机版|Archiver|仙剑之十里坡 ( 苏ICP备11022766号 )  

    GMT+8, 2024-5-4 16:39 , Processed in 0.732519 second(s), 41 queries .

    Powered by Discuz! X2.5

    © 2001-2012 Comsenz Inc.

    回顶部