设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 6383|回复: 3
打印 上一主题 下一主题

[原创发布] 一个可控的标题指令,适用通关后开启二周目或彩蛋房间。

[复制链接]

Lv3.寻梦者

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
帖子
1516
1
发表于 2016-1-5 19:05:58 | 显示全部楼层
本帖最后由 汪汪 于 2016-1-5 19:16 编辑

JAVASCRIPT 代码复制下载
  1. //=============================================================================
  2. // ConfigBaocun.js
  3. //=============================================================================
  4. /*:
  5.  * @plugindesc 用选项内容保存一些数数据
  6.  * @author wangwang
  7.  *
  8.  * @help
  9.  *这个借用的是原来游戏保存音量的那个存档......因为一般不会有大变化,所以经常保存也不会造成其他数据错误, 保存我们的东西正好....
  10.  *读取
  11.  *ConfigManager.load()
  12.  *保存
  13.  *ConfigManager.save()
  14.  *数据
  15.  * ConfigManager.other.xxx  ( = yyy )
  16.  */
  17. (function() {
  18.  
  19. //添加命令
  20. ConfigManager.other  = {}
  21.  
  22. //制作数据
  23. ConfigManager.makeData = function() {
  24.     var config = {};
  25.     config.alwaysDash = this.alwaysDash;
  26.     config.commandRemember = this.commandRemember;
  27.     config.bgmVolume = this.bgmVolume;
  28.     config.bgsVolume = this.bgsVolume;
  29.     config.meVolume = this.meVolume;
  30.     config.seVolume = this.seVolume;
  31.     config.other = this.other;
  32.  
  33.     return config;
  34. };
  35. //应用数据
  36. ConfigManager.applyData = function(config) {
  37.     this.alwaysDash = this.readFlag(config, 'alwaysDash');
  38.     this.commandRemember = this.readFlag(config, 'commandRemember');
  39.     this.bgmVolume = this.readVolume(config, 'bgmVolume');
  40.     this.bgsVolume = this.readVolume(config, 'bgsVolume');
  41.     this.meVolume = this.readVolume(config, 'meVolume');
  42.     this.seVolume = this.readVolume(config, 'seVolume');
  43.     this.other = this.readOther(config, 'other');
  44. };
  45.  
  46. ConfigManager.readOther = function(config, name) {
  47.     var value = config[name];
  48.     if (value !== undefined) {
  49.         return value ;
  50.     } else {
  51.         return {};
  52.     }
  53. };
  54.  
  55.  
  56. })();

其实数据一些简单的数据不用保存得这么麻烦.......

点评

于是理解完毕后更新了主楼的插件。  发表于 2016-1-6 10:58
原来如此,十分感谢。  发表于 2016-1-5 20:23
这个数据是在 Scene_Boot.prototype.create 调用时 第一次 读取的....所以用的时候要注意(当然用时直接使用ConfigManager.load()读取就好.....)  发表于 2016-1-5 19:19
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-16 00:22

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表