本帖最后由 Heiko 于 2022-8-23 20:52 编辑
插件指令都是调用的脚本,与其费劲的转MZ指令,不如直接调用
var _alias_mog_picturegallery_pluginCommand = Game_Interpreter.prototype.pluginCommand
Game_Interpreter.prototype.pluginCommand = function(command, args) {
_alias_mog_picturegallery_pluginCommand.call(this,command, args)
if (command === "open_picture_gallery") {$gameSystem.picturegallery()};
if (command === "enable_picture"
&& Number(args[1]) <= Moghunter.global_mog_picturegallery.length ) {
Moghunter.global_mog_picturegallery[Number(args[1])-1] = true;
DataManager.forceSaveGlobalInfo();
$gameSystem.enable_picture(Number(args[1]),true);
};
if (command === "disable_picture"
&& Number(args[1]) <= Moghunter.global_mog_picturegallery.length ) {
Moghunter.global_mog_picturegallery[Number(args[1])-1] = false;
DataManager.forceSaveGlobalInfo();
$gameSystem.enable_picture(Number(args[1]),false);
};
return true;
};
打开画廊: $gameSystem.picturegallery()
解锁第一张cg: $gameSystem.enable_picture(1,true);
上锁第一张cg:$gameSystem.enable_picture(1,false);
想在MZ上用更多MV插件可以用它:https://rpg.blue/thread-486769-1-1.html
目前体验良好,MV的插件指令也可以通过这个插件去使用
不过我估计你是想把插件转成MZ酱紫,所以我又试了下,或许你可以这么写:
不知道有没写错什么,我也是临时看了看别人写的,照葫芦画瓢23333
/* * @command enable_picture * @text 解锁图片 * @arg AA * @type number * @min 1 * @default 1 * @text 图片编号 * @desc 对应编号 * * @command disable_picture * @text 上锁图片 * @arg AA * @type number * @min 1 * @default 1 * @text 图片编号 * @desc 对应编号 * * @command open_picture_gallery * @text 打开画廊 * * @help */ (() => { PluginManager.registerCommand("MOG_PictureGallery", 'enable_picture', args => { let AA = Number(args.AA); Moghunter.global_mog_picturegallery[Number(args.AA)] = true; DataManager.forceSaveGlobalInfo(); $gameSystem.enable_picture(Number(args.AA),true); }); })(); (() => { PluginManager.registerCommand("MOG_PictureGallery", 'disable_picture', args => { let AA = Number(args.AA); Moghunter.global_mog_picturegallery[Number(args.AA)] = true; DataManager.forceSaveGlobalInfo(); $gameSystem.enable_picture(Number(args.AA),false); }); })(); (() => { PluginManager.registerCommand("MOG_PictureGallery", 'open_picture_gallery', args => { $gameSystem.picturegallery() }); })();
/*
* @command enable_picture
* @text 解锁图片
* @arg AA
* @type number
* @min 1
* @default 1
* @text 图片编号
* @desc 对应编号
*
* @command disable_picture
* @text 上锁图片
* @arg AA
* @type number
* @min 1
* @default 1
* @text 图片编号
* @desc 对应编号
*
* @command open_picture_gallery
* @text 打开画廊
*
* @help
*/
(() => {
PluginManager.registerCommand("MOG_PictureGallery", 'enable_picture', args => {
let AA = Number(args.AA);
Moghunter.global_mog_picturegallery[Number(args.AA)] = true;
DataManager.forceSaveGlobalInfo();
$gameSystem.enable_picture(Number(args.AA),true);
});
})();
(() => {
PluginManager.registerCommand("MOG_PictureGallery", 'disable_picture', args => {
let AA = Number(args.AA);
Moghunter.global_mog_picturegallery[Number(args.AA)] = true;
DataManager.forceSaveGlobalInfo();
$gameSystem.enable_picture(Number(args.AA),false);
});
})();
(() => {
PluginManager.registerCommand("MOG_PictureGallery", 'open_picture_gallery', args => {
$gameSystem.picturegallery()
});
})();
|