本帖最后由 汪汪 于 2016-1-5 19:16 编辑
//============================================================================= // ConfigBaocun.js //============================================================================= /*: * @plugindesc 用选项内容保存一些数数据 * @author wangwang * * @help *这个借用的是原来游戏保存音量的那个存档......因为一般不会有大变化,所以经常保存也不会造成其他数据错误, 保存我们的东西正好.... *读取 *ConfigManager.load() *保存 *ConfigManager.save() *数据 * ConfigManager.other.xxx ( = yyy ) */ (function() { //添加命令 ConfigManager.other = {} //制作数据 ConfigManager.makeData = function() { var config = {}; config.alwaysDash = this.alwaysDash; config.commandRemember = this.commandRemember; config.bgmVolume = this.bgmVolume; config.bgsVolume = this.bgsVolume; config.meVolume = this.meVolume; config.seVolume = this.seVolume; config.other = this.other; return config; }; //应用数据 ConfigManager.applyData = function(config) { this.alwaysDash = this.readFlag(config, 'alwaysDash'); this.commandRemember = this.readFlag(config, 'commandRemember'); this.bgmVolume = this.readVolume(config, 'bgmVolume'); this.bgsVolume = this.readVolume(config, 'bgsVolume'); this.meVolume = this.readVolume(config, 'meVolume'); this.seVolume = this.readVolume(config, 'seVolume'); this.other = this.readOther(config, 'other'); }; ConfigManager.readOther = function(config, name) { var value = config[name]; if (value !== undefined) { return value ; } else { return {}; } }; })();
//=============================================================================
// ConfigBaocun.js
//=============================================================================
/*:
* @plugindesc 用选项内容保存一些数数据
* @author wangwang
*
* @help
*这个借用的是原来游戏保存音量的那个存档......因为一般不会有大变化,所以经常保存也不会造成其他数据错误, 保存我们的东西正好....
*读取
*ConfigManager.load()
*保存
*ConfigManager.save()
*数据
* ConfigManager.other.xxx ( = yyy )
*/
(function() {
//添加命令
ConfigManager.other = {}
//制作数据
ConfigManager.makeData = function() {
var config = {};
config.alwaysDash = this.alwaysDash;
config.commandRemember = this.commandRemember;
config.bgmVolume = this.bgmVolume;
config.bgsVolume = this.bgsVolume;
config.meVolume = this.meVolume;
config.seVolume = this.seVolume;
config.other = this.other;
return config;
};
//应用数据
ConfigManager.applyData = function(config) {
this.alwaysDash = this.readFlag(config, 'alwaysDash');
this.commandRemember = this.readFlag(config, 'commandRemember');
this.bgmVolume = this.readVolume(config, 'bgmVolume');
this.bgsVolume = this.readVolume(config, 'bgsVolume');
this.meVolume = this.readVolume(config, 'meVolume');
this.seVolume = this.readVolume(config, 'seVolume');
this.other = this.readOther(config, 'other');
};
ConfigManager.readOther = function(config, name) {
var value = config[name];
if (value !== undefined) {
return value ;
} else {
return {};
}
};
})();
其实数据一些简单的数据不用保存得这么麻烦....... |