设为首页收藏本站

仙剑之十里坡

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
查看: 3039|回复: 3
打印 上一主题 下一主题

覆盖提示

[复制链接]

1008

主题

5

听众

2万

积分

返璞归真

不器用な星の瞬き

会员等级: 10

  • TA的每日心情
    擦汗
    昨天 19:06
  • 签到天数: 1366 天

    [LV.10]以坛为家III

    精华
    2
    积分
    23737
    历练
    3
    声望
    133
    人气
    2542

    转帖之王 金融巨子 黑色羽翼

    单身中……
    帮我摆脱单身吧
    跳转到指定楼层
    1
    发表于 2010-4-4 18:59:52 |只看该作者 |倒序浏览
    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.       @yes_no_window.update
    52.       if Input.trigger?(Input::C)
    53.         $game_system.se_play($data_system.decision_se)
    54.         if @yes_no_window.index == 0
    55.           @yes_no_window.visible = false
    56.           @yes_no_window.active = false
    57.           @confirm_window.visible = false
    58.           filename = make_filename(@file_index)
    59.           $game_system.se_play($data_system.save_se)
    60.           file = File.open(filename, "wb")
    61.           write_save_data(file)
    62.           file.close
    63.           if $game_temp.save_calling
    64.             $game_temp.save_calling = false
    65.             $scene = Scene_Map.new
    66.           else
    67.             $scene = Scene_Menu.new(4)
    68.           end
    69.         else
    70.           @confirm_window.visible = false
    71.           @yes_no_window.visible = false
    72.           @yes_no_window.active = false
    73.           @yes_no_window.index = 1
    74.           @mode = 0
    75.         end
    76.       end
    77.       if Input.trigger?(Input::B)
    78.         @confirm_window.visible = false
    79.         @yes_no_window.visible = false
    80.         @yes_no_window.active = false
    81.         @yes_no_window.index = 1
    82.         @mode = 0
    83.       return
    84.     end
    85.   end
    86. end
    87. # -----------------------------
    88.   def on_cancel
    89.     $game_system.se_play($data_system.cancel_se)
    90.     if $game_temp.save_calling
    91.       $game_temp.save_calling = false
    92.       $scene = Scene_Map.new
    93.       return
    94.     end
    95.     $scene = Scene_Menu.new(4)
    96.   end
    97. # -----------------------------
    98.   def write_save_data(file)
    99.     characters = []
    100.     for i in 0...$game_party.actors.size
    101.       actor = $game_party.actors[i]
    102.       characters.push([actor.character_name, actor.character_hue])
    103.     end
    104.     Marshal.dump(characters, file)
    105.     Marshal.dump(Graphics.frame_count, file)
    106.     $game_system.save_count += 1
    107.     $game_system.magic_number = $data_system.magic_number
    108.     Marshal.dump($game_system, file)
    109.     Marshal.dump($game_switches, file)
    110.     Marshal.dump($game_variables, file)
    111.     Marshal.dump($game_self_switches, file)
    112.     Marshal.dump($game_screen, file)
    113.     Marshal.dump($game_actors, file)
    114.     Marshal.dump($game_party, file)
    115.     Marshal.dump($game_troop, file)
    116.     Marshal.dump($game_map, file)
    117.     Marshal.dump($game_player, file)
    118.   end
    119. end

    120. class Scene_File
    121.   alias carol3_main main
    122.   def main
    123.     carol3_main
    124.     if self.is_a?(Scene_Save)
    125.       @confirm_window.dispose
    126.       @yes_no_window.dispose
    127.     end
    128.   end
    129. end


    130. #==============================================================================
    131. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
    132. #==============================================================================


    复制代码
    与存档类脚本……
    分享到: QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    转播转播0 分享淘帖0 分享分享0 收藏收藏0
    夜空の星に 捧げた願いの
    欠片積めて 爆誕する奇跡

    160

    主题

    6

    听众

    1万

    积分

    超级版主

    蜀山剑侠银行行长

    超级版主

  • TA的每日心情
    开心
    4 小时前
  • 签到天数: 860 天

    [LV.10]以坛为家III

    精华
    3
    积分
    13202
    历练
    7
    声望
    24
    人气
    2367

    金融巨子 润泽万物 坚若磐石

    单身中……
    帮我摆脱单身吧
    2
    发表于 2010-4-5 19:39:50 |只看该作者
    这个啊,比较实用的……
    于是饮酒乐甚,扣舷而歌之。歌曰:“桂棹兮兰桨,击空明兮溯流光。残阳阳兮是羊羊,吾乃最爱南宫煌。”
    回复

    使用道具 举报

    1008

    主题

    5

    听众

    2万

    积分

    返璞归真

    不器用な星の瞬き

    会员等级: 10

  • TA的每日心情
    擦汗
    昨天 19:06
  • 签到天数: 1366 天

    [LV.10]以坛为家III

    精华
    2
    积分
    23737
    历练
    3
    声望
    133
    人气
    2542

    转帖之王 金融巨子 黑色羽翼

    单身中……
    帮我摆脱单身吧
    3
    发表于 2010-4-9 18:17:01 |只看该作者
    就是可惜会与存档类脚本冲突——只能用一个,除非仔细研究自己改
    夜空の星に 捧げた願いの
    欠片積めて 爆誕する奇跡
    回复

    使用道具 举报

    160

    主题

    6

    听众

    1万

    积分

    超级版主

    蜀山剑侠银行行长

    超级版主

  • TA的每日心情
    开心
    4 小时前
  • 签到天数: 860 天

    [LV.10]以坛为家III

    精华
    3
    积分
    13202
    历练
    7
    声望
    24
    人气
    2367

    金融巨子 润泽万物 坚若磐石

    单身中……
    帮我摆脱单身吧
    4
    发表于 2010-4-9 18:34:01 |只看该作者
    晕菜,还起冲突啊?
    于是饮酒乐甚,扣舷而歌之。歌曰:“桂棹兮兰桨,击空明兮溯流光。残阳阳兮是羊羊,吾乃最爱南宫煌。”
    回复

    使用道具 举报

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

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

    GMT+8, 2024-5-5 18:12 , Processed in 0.302620 second(s), 40 queries .

    Powered by Discuz! X2.5

    © 2001-2012 Comsenz Inc.

    回顶部