查看: 3353|回复: 7

[有事请教] 如何将存档行走图改为脸图

[复制链接]
梦石
0
星屑
1036
在线时间
193 小时
注册时间
2016-1-14
回帖
13
发表于 2022-1-9 13:31:53 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

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

×
存档图标默认是行走图,我用的人物是3头身,会导致身体显示不全,求个方法把行走图改为脸图
梦石
0
星屑
4649
在线时间
570 小时
注册时间
2018-11-12
回帖
120
发表于 2022-1-9 17:54:27 | 显示全部楼层
把下列代码 复制粘贴成插件,插件名字:CD
然后就可以使用了。
——————————————————————
  1. /*:
  2. * @plugindesc 存档行走图改为脸图
  3. * @author CHK
  4. *
  5. * @help
  6. * 即插即用。仅限存/读 档界面。
  7. *
  8. *
  9. * @param 脸图X轴偏移
  10. * @desc 默认190。
  11. * @default 190
  12. *
  13. * @param 脸图Y轴偏移
  14. * @desc 默认0。
  15. * @default 0
  16. *
  17. * @param 自定义脸图宽度
  18. * @desc 默认根据 列表宽度 自动缩放。
  19. * @default 0
  20. *
  21. * @param 自定义脸图高度
  22. * @desc 默认根据 列表高度 自动缩放。
  23. * @default 0
  24. *
  25. * @param 显示几个成员的脸图
  26. * @desc 填写0,则默认为 所有战斗成员(候补未出战的不算)。
  27. * @default 0
  28. */

  29. (function() {
  30.        
  31.   var parameters = PluginManager.parameters('CD');
  32.   var XP = Number(parameters['脸图X轴偏移'] || 190);
  33.   var YP = Number(parameters['脸图Y轴偏移'] || 0);
  34.   var WP = Number(parameters['自定义脸图宽度'] || 0);
  35.   var HP = Number(parameters['自定义脸图高度'] || 0);
  36.   var RS = Number(parameters['显示几个成员的脸图'] || 0);
  37.   
  38. Window_SavefileList.prototype.drawContents = function(info, rect, valid) {
  39.     var bottom = rect.y + rect.height;
  40.     if (rect.width >= 420) {
  41.                 if (valid) this.drawPartyFace(info, rect.x + XP, rect.y + YP);
  42.         this.drawGameTitle(info, rect.x + 192, rect.y, rect.width - 192);
  43.     }
  44.     var lineHeight = this.lineHeight();
  45.     var y2 = bottom - lineHeight;
  46.     if (y2 >= lineHeight) {
  47.         this.drawPlaytime(info, rect.x, y2, rect.width);
  48.     }
  49. };

  50. Window_SavefileList.prototype.drawPartyFace = function(info, x, y) {
  51.     if (info.faces) {
  52.                 var ChangDu = RS>0?RS:info.faces.length;
  53.                 if (RS>info.faces.length) ChangDu = info.faces.length;
  54.         for (var i = 0; i < ChangDu; i++) {
  55.             var width = WP>0?WP:this.itemHeight();
  56.                         var height = HP>0?HP:this.itemHeight();
  57.                         this.contents._context.imageSmoothingEnabled = false;
  58.                         this.drawFace(info.faces[i][0], info.faces[i][1], x + i * width, y, width, height);
  59.                         this.contents._context.imageSmoothingEnabled = true;
  60.         }
  61.     }
  62. };

  63. })();
复制代码
回复 1 0

使用道具 举报

梦石
0
星屑
1036
在线时间
193 小时
注册时间
2016-1-14
回帖
13
 楼主| 发表于 2022-1-9 21:58:43 | 显示全部楼层
cenhangkai 发表于 2022-1-9 17:54
把下列代码 复制粘贴成插件,插件名字:CD
然后就可以使用了。
———————————————————— ...

太感谢啦
回复

使用道具 举报

梦石
0
星屑
221
在线时间
10 小时
注册时间
2022-12-18
回帖
17
发表于 2023-3-14 22:13:12 | 显示全部楼层
感谢分享!!
回复

使用道具 举报

梦石
2
星屑
8479
在线时间
463 小时
注册时间
2021-12-4
回帖
486

MZ评测员

发表于 2023-3-14 23:36:26 | 显示全部楼层
weixin截图_20230314233354.png
直接使用官方插件AltSaveScreen.js即可,效果如图:
01_11_05_img02.png
[pre lang="javascript" line="1" file="AltSaveScreen.js"]//=============================================================================
// AltSaveScreen.js
//=============================================================================

/*:
* @plugindesc Alternative save/load screen layout.
* @author Yoji Ojima
*
* @help This plugin does not provide plugin commands.
*/

/*:ja
* @plugindesc セーブ/ロード画面のレイアウトを変更します。
* @author Yoji Ojima
*
* @help このプラグインには、プラグインコマンドはありません。
*/

(function() {

    var _Scene_File_create = Scene_File.prototype.create;
    Scene_File.prototype.create = function() {
        _Scene_File_create.call(this);
        this._listWindow.height = this._listWindow.fittingHeight(8);
        var x = 0;
        var y = this._listWindow.y + this._listWindow.height;
        var width = Graphics.boxWidth;
        var height = Graphics.boxHeight - y;
        this._statusWindow = new Window_SavefileStatus(x, y, width, height);
        this._statusWindow.setMode(this.mode());
        this._listWindow.statusWindow = this._statusWindow;
        this._listWindow.callUpdateHelp();
        this.addWindow(this._statusWindow);
    };

    var _Scene_File_start = Scene_File.prototype.start;
    Scene_File.prototype.start = function() {
        _Scene_File_start.call(this);
        this._listWindow.ensureCursorVisible();
        this._listWindow.callUpdateHelp();
    };

    Window_SavefileList.prototype.windowWidth = function() {
        return Graphics.boxWidth;
    };

    Window_SavefileList.prototype.maxCols = function() {
        return 4;
    };

    Window_SavefileList.prototype.numVisibleRows = function() {
        return 5;
    };

    Window_SavefileList.prototype.spacing = function() {
        return 8;
    };

    Window_SavefileList.prototype.itemHeight = function() {
        return this.lineHeight() * 2;
    };

    var _Window_SavefileList_callUpdateHelp =
            Window_SavefileList.prototype.callUpdateHelp;
    Window_SavefileList.prototype.callUpdateHelp = function() {
        _Window_SavefileList_callUpdateHelp.call(this);
        if (this.active && this.statusWindow) {
            this.statusWindow.setId(this.index() + 1);
        }
    };

    function Window_SavefileStatus() {
        this.initialize.apply(this, arguments);
    }

    Window_SavefileStatus.prototype = Object.create(Window_Base.prototype);
    Window_SavefileStatus.prototype.constructor = Window_SavefileStatus;

    Window_SavefileStatus.prototype.initialize = function(x, y, width, height) {
        Window_Base.prototype.initialize.call(this, x, y, width, height);
        this._id = 1;
    };

    Window_SavefileStatus.prototype.setMode = function(mode) {
        this._mode = mode;
    };

    Window_SavefileStatus.prototype.setId = function(id) {
        this._id = id;
        this.refresh();
    };

    Window_SavefileStatus.prototype.refresh = function() {
        this.contents.clear();
        var id = this._id;
        var valid = DataManager.isThisGameFile(id);
        var info = DataManager.loadSavefileInfo(id);
        var rect = this.contents.rect;
        this.resetTextColor();
        if (this._mode === 'load') {
            this.changePaintOpacity(valid);
        }
        this.drawFileId(id, rect.x, rect.y);
        if (info) {
            this.changePaintOpacity(valid);
            this.drawContents(info, rect, valid);
            this.changePaintOpacity(true);
        }
    };

    Window_SavefileStatus.prototype.drawFileId = function(id, x, y) {
        this.drawText(TextManager.file + ' ' + id, x, y, 180);
    };

    Window_SavefileStatus.prototype.drawContents = function(info, rect, valid) {
        var bottom = rect.y + rect.height;
        var playtimeY = bottom - this.lineHeight();
        this.drawText(info.title, rect.x + 192, rect.y, rect.width - 192);
        if (valid) {
            this.drawPartyfaces(info, rect.x, bottom - 144);
        }
        this.drawText(info.playtime, rect.x, playtimeY, rect.width, 'right');
    };

    Window_SavefileStatus.prototype.drawPartyfaces = function(info, x, y) {
        if (info && info.faces) {
            for (var i = 0; i < info.faces.length; i++) {
                var data = info.faces;
                this.drawFace(data[0], data[1], x + i * 150, y);
            }
        }
    };

})();
[/pre]
回复

使用道具 举报

梦石
0
星屑
541
在线时间
57 小时
注册时间
2022-12-9
回帖
14
发表于 2023-5-17 23:16:16 | 显示全部楼层
cenhangkai 发表于 2022-1-9 17:54
把下列代码 复制粘贴成插件,插件名字:CD
然后就可以使用了。
———————————————————— ...

请问可以商用吗

点评

您可以随意使用  发表于 2023-5-19 01:15
回复

使用道具 举报

梦石
0
星屑
541
在线时间
57 小时
注册时间
2022-12-9
回帖
14
发表于 2023-5-19 15:58:16 | 显示全部楼层
cenhangkai 发表于 2022-1-9 17:54
把下列代码 复制粘贴成插件,插件名字:CD
然后就可以使用了。
———————————————————— ...

谢谢大佬~
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部