查看: 126|回复: 0

[转载发布] 【MZ】MV插件适配器 (更新:8/22)

[复制链接]
  • TA的每日心情
    开心
    昨天 10:15
  • 签到天数: 73 天

    连续签到: 1 天

    [LV.6]常住居民II

    2044

    主题

    86

    回帖

    8602

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    -2
    卡币
    6460
    OK点
    16
    积分
    8602
    发表于 2024-1-19 15:51:24 | 显示全部楼层 |阅读模式
    一个MZ出来之前的想法,做一个 中转或者说是适配插件 ,来让MZ尽可能的兼容MV的插件。

      该插件个人在发现有适配内容时,有空时会持续更新。

      也可以将MZ使用MV插件时,报错截图发出来,个人会视情况来更改和更新。


    [JavaScript] 纯文本查看 复制代码
    //==============================================================================================================
    // MV -> MZ  Adapter.js
    //==============================================================================================================
    /*:
     * @target MZ
     * @plugindesc MV插件适配器.
     * @author 芯☆淡茹水
     *
     * @help 
     * 
     * 使用该插件,尽可能的将 MV系列插件 兼容到 MZ 。
     * 
     * 调用 MV插件命令 方法:
     * 事件 - 脚本:
     * 第一行写标志 <MvPluginCommand>
     * 第二行写需要执行的MV插件命令
     * 第三行以及以下,依次序写该插件命令的参数。注意:一个参数就是一行 !!!
     * 
     * 示例:执行MV插件命令 CommandTest , 参数依次为 5, ABC, true
     * 事件 - 脚本:
     * <MvPluginCommand>
     * CommandTest
     * 5
     * ABC
     * true
     * 
     *==============================================================================================================
     *
     * @param closeSmoothing
     * @text 是否关闭图像平滑处理。
     * @type boolean
     * @desc 是否关闭图像平滑处理。
     * @default false
     * 
     * 
    */
    //==============================================================================================================
    ;var XdRsData = XdRsData || {};
    XdRsData.adapter = {};
    XdRsData.adapter.parameters = PluginManager.parameters('XdRs_MvPluginAdapter');
    //==============================================================================================================
    XdRsData.adapter.isCloseSmooth = function() {
        return this.parameters['closeSmoothing'] === 'true';
    };
    //==============================================================================================================
    Bitmap.prototype._setDirty = function() {
        this._baseTexture.update();
    };
    //==============================================================================================================
    DataManager.isThisGameFile = function(savefileId) {
        return !!this.savefileInfo(savefileId);
    };
    DataManager.loadSavefileInfo = function(savefileId) {
        return this.savefileInfo(savefileId);
    };
    DataManager.lastAccessedSavefileId = function() {
        return $gameSystem.savefileId();
    };
    //==============================================================================================================
    BattleManager.setStatusWindow = function(window) {
        // 弃用。
    };
    //==============================================================================================================
    XdRsData.adapter.Bitmap_initialize = Bitmap.prototype.initialize;
    Bitmap.prototype.initialize = function(width, height) {
        XdRsData.adapter.Bitmap_initialize.call(this, width, height);
        this._smooth = !XdRsData.adapter.isCloseSmooth();
    };
    //==============================================================================================================
    Game_Battler.prototype.startAnimation = function(animationId, mirror) {
        $gameTemp.requestAnimation([this], animationId, mirror);
    };
    Game_Battler.prototype.isAnimationRequested = function() {
        return false;
    };
    Game_Battler.prototype.shiftAnimation = function() {
        return null;
    };
    //==============================================================================================================
    Game_CharacterBase.prototype.requestAnimation = function(animationId) {
        $gameTemp.requestAnimation([this], animationId);
    };
    Game_CharacterBase.prototype.animationId = function() {
        return 0;
    };
    //==============================================================================================================
    XdRsData.adapter.Game_Interpreter_command355 = Game_Interpreter.prototype.command355;
    Game_Interpreter.prototype.command355 = function() {
        if (/<MvPluginCommand>/.test(this.currentCommand().parameters[0])) {
            return this.analysisMvPluginCommand();
        }
        return XdRsData.adapter.Game_Interpreter_command355.call(this);
    };
    Game_Interpreter.prototype.analysisMvPluginCommand = function() {
        var command = null, args = [];
        if (this.nextEventCode() === 655) {
            this._index++;
            command = this.currentCommand().parameters[0];
        }
        while (this.nextEventCode() === 655) {
            this._index++;
            args.push(this.currentCommand().parameters[0]);
        }
        this.pluginCommand(command, args);
        return true;
    };
    //==============================================================================================================
    function Sprite_Base() {
        this.initialize(...arguments);
    }
    Sprite_Base.prototype = Object.create(Sprite.prototype);
    Sprite_Base.prototype.constructor = Sprite_Base;
    //==============================================================================================================
    Window_Base._iconWidth  = ImageManager.iconWidth;
    Window_Base._iconHeight = ImageManager.iconHeight;
    Window_Base._faceWidth  = ImageManager.faceWidth;
    Window_Base._faceHeight = ImageManager.faceHeight;
     
    XdRsData.adapter.Window_Base_initialize = Window_Base.prototype.initialize;
    Window_Base.prototype.initialize = function() {
        const [x, y, w, h] = arguments;
        if (y === undefined) XdRsData.adapter.Window_Base_initialize.call(this, x);
        else XdRsData.adapter.Window_Base_initialize.call(this, new Rectangle(x, y, w, h));
    };
    Window_Base.prototype.standardFontFace = function() {
        return $gameSystem.mainFontFace();
    };
    Window_Base.prototype.standardFontSize = function() {
        return $gameSystem.mainFontSize();
    };
    Window_Base.prototype.standardPadding = function() {
        return $gameSystem.windowPadding();
    };
    Window_Base.prototype.textPadding = function() {
        return this.itemPadding();
    };
    Window_Base.prototype.textColor = function(n) {
        return ColorManager.textColor(n);
    };
    //==============================================================================================================
    // end
    //==============================================================================================================


      
                本帖来自P1论坛作者芯☆淡茹水,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg. blue/forum.php?mod=viewthread&tid=482959  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2024-9-21 08:51 , Processed in 0.048009 second(s), 41 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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