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

Project1

 找回密码
 注册会员
搜索
12
返回列表 发新帖
楼主: 汪叉
打印 上一主题 下一主题

[有事请教] 环形命令菜单如何添加整队(直接打开)?

[复制链接]

Lv1.梦旅人

梦石
0
星屑
187
在线时间
27 小时
注册时间
2024-1-17
帖子
10
11
 楼主| 发表于 2024-2-15 22:07:11 | 只看该作者
Arrose 发表于 2024-2-9 12:29
主要是整队它不是单独在另外一个场景整队的,而是直接在主菜单场景,像其他的装备,状态之类的都是跳转( ...

呜呜呜非常感谢!!新年快乐!!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1031
在线时间
204 小时
注册时间
2023-5-18
帖子
104
12
发表于 2024-2-17 22:14:48 | 只看该作者
汪叉 发表于 2024-2-15 22:07
呜呜呜非常感谢!!新年快乐!!

新年快乐,之前你应该有看过默认的整队是咋样的吧,就是嵌在主菜单的整队,然后我现在准备写一个单独的整队场景,想问问你对整队的UI有啥要求的,最好有个整队界面的草图给我,没有的话我就按系统默认的整队做了。
我的B站传送门
回复 支持 1 反对 0

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
187
在线时间
27 小时
注册时间
2024-1-17
帖子
10
13
 楼主| 发表于 2024-2-18 11:37:42 | 只看该作者
Arrose 发表于 2024-2-17 22:14
新年快乐,之前你应该有看过默认的整队是咋样的吧,就是嵌在主菜单的整队,然后我现在准备写一个单独的整 ...

就按系统默认的来就好!!真的是麻烦您了~
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1031
在线时间
204 小时
注册时间
2023-5-18
帖子
104
14
发表于 2024-2-18 19:35:02 | 只看该作者
汪叉 发表于 2024-2-18 11:37
就按系统默认的来就好!!真的是麻烦您了~

发了,在这里下载:https://rpg.blue/forum.php?mod=v ... p;extra=#pid2988671
有bug或者问题再反馈给我。
我的B站传送门
回复 支持 1 反对 0

使用道具 举报

Lv2.观梦者

梦石
0
星屑
738
在线时间
110 小时
注册时间
2014-12-5
帖子
109
15
发表于 2024-3-21 04:04:00 | 只看该作者
JAVASCRIPT 代码复制
  1. /*:
  2.  * @plugindesc 整队界面替换
  3.  * @author
  4.  * @license MIT
  5.  *
  6.  * @target MZ
  7.  *
  8.  * @param characterWidth
  9.  * @desc 角色步行图形的横向尺寸
  10.  * @text 角色的横向尺寸
  11.  * @type number
  12.  * @default 48
  13.  *
  14.  * @param characterHeight
  15.  * @desc キャラクター歩行グラフィックの縦サイズ
  16.  * @text 角色的纵向尺寸
  17.  * @type number
  18.  * @default 72
  19.  *
  20.  * @param characterDirectionToLeft
  21.  * @desc キャラクターグラフィックを左向きで表示するかどうか
  22.  * @text 角色朝向左
  23.  * @type boolean
  24.  * @default false
  25.  *
  26.  * @param inheritMenuBackground
  27.  * @desc メニュー系の画面から遷移した場合に背景を引き継ぐかどうか
  28.  * @text 使用菜单背景
  29.  * @type boolean
  30.  * @default true
  31.  *
  32.  * @param cancelButtonLeftMergin
  33.  * @desc 返回按钮与调整队列文本窗口之间的距离
  34.  * @text 返回与整队文本的距离
  35.  * @type number
  36.  * @default 20
  37.  *
  38.  * @param cancelButtonRightMergin
  39.  * @desc 返回按钮和屏幕右侧边缘之间的宽度
  40.  * @text 返回和右侧边缘的距离
  41.  * @type number
  42.  * @default 4
  43.  *
  44.  * @param showHelpWindow
  45.  * @desc 如果关闭,则隐藏顶部的帮助窗口,并相应地扩大装备状态窗口。
  46.  * @text 显示帮助窗口
  47.  * @type boolean
  48.  * @default true
  49.  *
  50.  * @command openFormationScene
  51.  * @text 打开整理队列场景
  52.  *
  53.  * @help
  54.  * 插件版本: 1.4.1
  55.  * 提供调整队列的场景。
  56.  *
  57.  * 插件命令可以开始重新排列的场景。
  58.  * 只有这个插件不会改变菜单的重新排列命令的行为。
  59.  * 改变菜单的行为和插件一起使用,可以改变。
  60.  * 例如,darkplasma_formationinmenu
  61.  * トリアコンタンさん的菜单子命令。
  62.  * 打开重新排列场景所需的脚本代码:
  63.  * SceneManager.push(Scene_Formation);
  64.  */
  65.  
  66. (() => {
  67.   'use strict';
  68.  
  69.   const pluginName = document.currentScript.src.replace(/^.*\/(.*).js$/, function () {
  70.     return arguments[1];
  71.   });
  72.  
  73.   const pluginParametersOf = (pluginName) => PluginManager.parameters(pluginName);
  74.  
  75.   const pluginParameters = pluginParametersOf(pluginName);
  76.  
  77.   const settings = {
  78.     characterWidth: Number(pluginParameters.characterWidth || 48),
  79.     characterHeight: Number(pluginParameters.characterHeight || 72),
  80.     characterDirectionToLeft: String(pluginParameters.characterDirectionToLeft || true) === 'true',
  81.     inheritMenuBackground: String(pluginParameters.inheritMenuBackground || true) === 'true',
  82.     cancelButtonLeftMergin: Number(pluginParameters.cancelButtonLeftMergin || 4),
  83.     cancelButtonRightMergin: Number(pluginParameters.cancelButtonRightMergin || 4),
  84.     showHelpWindow: String(pluginParameters.showHelpWindow || true) === 'true',
  85.   };
  86.  
  87.   const command_openFormationScene = 'openFormationScene';
  88.  
  89.   /**
  90.    * 默认的角色大小
  91.    * @type {number}
  92.    */
  93.   const DEFAULT_CHARACTER_SIZE = 48;
  94.   /**
  95.    * 待机窗口的上下填充宽度(右侧未参战角色栏的宽度)
  96.    * @type {number}
  97.    */
  98.   const WAITING_WINDOW_PADDING = 36;
  99.   PluginManager.registerCommand(pluginName, command_openFormationScene, function () {
  100.     SceneManager.push(Scene_Formation);
  101.   });
  102.   SceneManager.isPreviousSceneExtendsMenuBase = function () {
  103.     return !!this._previousClass && new this._previousClass() instanceof Scene_MenuBase;
  104.   };
  105.   function Game_Temp_FormationMixIn(gameTemp) {
  106.     const _initialize = gameTemp.initialize;
  107.     gameTemp.initialize = function () {
  108.       _initialize.call(this);
  109.       this._needsFormationBattleMemberWindowRefresh = false;
  110.       this._needsFormationWaitingMemberWindowRefresh = false;
  111.     };
  112.     const _requestBattleRefresh = gameTemp.requestBattleRefresh;
  113.     gameTemp.requestBattleRefresh = function () {
  114.       _requestBattleRefresh.call(this);
  115.       this.requestFormationMemberWindowsRefresh();
  116.     };
  117.     gameTemp.requestFormationMemberWindowsRefresh = function () {
  118.       this._needsFormationBattleMemberWindowRefresh = true;
  119.       this._needsFormationWaitingMemberWindowRefresh = true;
  120.     };
  121.     gameTemp.clearFormationBattleMemberWindowRefreshRequest = function () {
  122.       this._needsFormationBattleMemberWindowRefresh = false;
  123.     };
  124.     gameTemp.clearFormationWaitingMemberWindowRefreshRequest = function () {
  125.       this._needsFormationWaitingMemberWindowRefresh = false;
  126.     };
  127.     gameTemp.isFormationBattleMemberWindowRefreshRequested = function () {
  128.       return this._needsFormationBattleMemberWindowRefresh;
  129.     };
  130.     gameTemp.isFormationWaitingMemberWindowRefreshRequested = function () {
  131.       return this._needsFormationWaitingMemberWindowRefresh;
  132.     };
  133.   }
  134.   Game_Temp_FormationMixIn(Game_Temp.prototype);
  135.   function Scene_FormationMixIn(sceneClass) {
  136.     return class extends sceneClass {
  137.       /**
  138.        * @return {Rectangle}
  139.        */
  140.       helpWindowRect() {
  141.         if (settings.showHelpWindow) {
  142.           const width = ConfigManager.touchUI
  143.             ? Graphics.boxWidth -
  144.               this.cancelButtonWidth() -
  145.               settings.cancelButtonRightMergin -
  146.               settings.cancelButtonLeftMergin
  147.             : Graphics.boxWidth;
  148.           return new Rectangle(0, 0, width, this.calcWindowHeight(1, false));
  149.         } else {
  150.           return new Rectangle(0, 0, 0, 0);
  151.         }
  152.       }
  153.       /**
  154.        * @return {Rectangle}
  155.        */
  156.       statusWindowRect() {
  157.         return new Rectangle(
  158.           0,
  159.           this.formationHelpWindow().height + this.waitingMemberWindowHeight(),
  160.           this.formationStatusWindowWidth(),
  161.           this.formationStatusWindowHeight()
  162.         );
  163.       }
  164.       formationStatusWindowWidth() {
  165.         return Graphics.boxWidth;
  166.       }
  167.           //原本是4 改为6
  168.       formationStatusWindowHeight() {
  169.         return this.calcWindowHeight(6, false);
  170.       }
  171.       /**
  172.        * @return {Rectangle}
  173.        */
  174.       battleMemberWindowRect() {
  175.         return new Rectangle(
  176.           0,
  177.           this.formationHelpWindow().height,
  178.           this.battleMemberWindowWidth(),
  179.           this.waitingMemberWindowHeight()
  180.         );
  181.       }
  182.       battleMemberWindowWidth() {
  183.         const characterSpacing = Window_FormationBattleMember.prototype.spacing();
  184.         return settings.characterHeight > DEFAULT_CHARACTER_SIZE
  185.           ? (settings.characterWidth + characterSpacing) * $gameParty.maxBattleMembers()
  186.           : (settings.characterWidth + characterSpacing) * Math.floor(($gameParty.maxBattleMembers() + 1) / 2) + 32;
  187.       }
  188.       /**
  189.        * @return {Rectangle}
  190.        */
  191.       waitingMemberWindowRect() {
  192.         return new Rectangle(
  193.           this.formationBattleMemberWindow().width,
  194.           this.formationHelpWindow().height,
  195.           Graphics.boxWidth - this.formationBattleMemberWindow().width,
  196.           this.waitingMemberWindowHeight()
  197.         );
  198.       }
  199.       waitingMemberWindowHeight() {
  200.         return settings.characterHeight > DEFAULT_CHARACTER_SIZE
  201.           ? settings.characterHeight + WAITING_WINDOW_PADDING
  202.           : settings.characterHeight * 2 + Math.floor((WAITING_WINDOW_PADDING * 4) / 3);
  203.       }
  204.       cancelButtonWidth() {
  205.         return 0;
  206.       }
  207.       formationHelpWindow() {
  208.         return new Window_Help(new Rectangle(0, 0, 0, 0));
  209.       }
  210.       formationBattleMemberWindow() {
  211.         return new Window_FormationBattleMember(new Rectangle(0, 0, 0, 0));
  212.       }
  213.       formationWaitingMemberWindow() {
  214.         return new Window_FormationWaitingMember(new Rectangle(0, 0, 0, 0));
  215.       }
  216.       formationSelectWindow() {
  217.         return new Window_FormationSelect(new Rectangle(0, 0, 0, 0));
  218.       }
  219.       formationStatusWindow() {
  220.         return new Window_FormationStatus(new Rectangle(0, 0, 0, 0));
  221.       }
  222.       formationStatusParamsWindow() {
  223.         return new Window_StatusParams(new Rectangle(0, 0, 0, 0));
  224.       }
  225.       formationEquipStatusWindow() {
  226.         return new Window_StatusEquip(new Rectangle(0, 0, 0, 0));
  227.       }
  228.       setupFormationSelectWindow() {
  229.         this.formationSelectWindow().setStatusWindow(this.formationStatusWindow());
  230.         this.formationSelectWindow().setBattleMemberWindow(this.formationBattleMemberWindow());
  231.         this.formationSelectWindow().setWaitingMemberWindow(this.formationWaitingMemberWindow());
  232.         this.formationSelectWindow().setStatusParamsWindow(this.formationStatusParamsWindow());
  233.         this.formationSelectWindow().setEquipWindow(this.formationEquipStatusWindow());
  234.         this.formationSelectWindow().setHandler('ok', this.onFormationOk.bind(this));
  235.         this.formationSelectWindow().setHandler('cancel', this.onFormationCancel.bind(this));
  236.         this.formationSelectWindow().select(0);
  237.         /**
  238.          * 为了实现光标重叠透明窗口的显示,请准备一个专用层
  239.          */
  240.         this._selectWindowLayer = new WindowLayer();
  241.         this._selectWindowLayer.x = (Graphics.width - Graphics.boxWidth);
  242.         this._selectWindowLayer.y = (Graphics.height - Graphics.boxHeight);
  243.         this.addChild(this._selectWindowLayer);
  244.         this._selectWindowLayer.addChild(this.formationSelectWindow());
  245.       }
  246.       /**
  247.        * @return {Rectangle}
  248.        */
  249.       selectWindowRect() {
  250.         return new Rectangle(
  251.           0,
  252.           this.formationWaitingMemberWindow().y,
  253.           Graphics.boxWidth,
  254.           this.formationWaitingMemberWindow().height
  255.         );
  256.       }
  257.       onFormationOk() {
  258.         const index = this.formationSelectWindow().index();
  259.         const pendingIndex = this.formationSelectWindow().pendingIndex();
  260.         if (pendingIndex >= 0) {
  261.           $gameParty.swapOrder(index, pendingIndex);
  262.           this.formationSelectWindow().setPendingIndex(-1);
  263.           $gameTemp.requestFormationMemberWindowsRefresh();
  264.         } else {
  265.           this.formationSelectWindow().setPendingIndex(index);
  266.         }
  267.         this.formationSelectWindow().activate();
  268.       }
  269.       onFormationCancel() {
  270.         if (this.formationSelectWindow().pendingIndex() >= 0) {
  271.           this.formationSelectWindow().setPendingIndex(-1);
  272.           this.formationSelectWindow().activate();
  273.         } else {
  274.           this.quitFromFormation();
  275.         }
  276.       }
  277.       quitFromFormation() {}
  278.     };
  279.   }
  280.   globalThis.Scene_FormationMixIn = Scene_FormationMixIn;
  281.   class Scene_Formation extends Scene_FormationMixIn(Scene_Base) {
  282.     constructor() {
  283.       super(...arguments);
  284.       this._backgroundSprite = null;
  285.       this._cancelButton = null;
  286.       this._selectWindow = null;
  287.       this._helpWindow = null;
  288.       this._statusWindow = null;
  289.       this._statusParamsWindow = null;
  290.       this._equipWindow = null;
  291.       this._battleMemberWindow = null;
  292.       this._waitingMemberWindow = null;
  293.     }
  294.     create() {
  295.       super.create();
  296.       this.createBackground();
  297.       this.createWindowLayer();
  298.       this.createButtons();
  299.       this.createHelpWindow();
  300.       this.createBattleMemberWindow();
  301.       this.createWaitingMemberWindow();
  302.       this.createStatusWindow();
  303.       this.createStatusParamsWindow();
  304.       this.createStatusEquipWindow();
  305.       this.createSelectWindow();
  306.     }
  307.     start() {
  308.       super.start();
  309.       this._selectWindow.activate();
  310.     }
  311.     createBackground() {
  312.       if (settings.inheritMenuBackground && SceneManager.isPreviousSceneExtendsMenuBase()) {
  313.         Scene_MenuBase.prototype.createBackground.call(this);
  314.       } else {
  315.         this._backgroundSprite = new Sprite();
  316.         this._backgroundSprite.bitmap = SceneManager.backgroundBitmap();
  317.         this.addChild(this._backgroundSprite);
  318.       }
  319.     }
  320.     setBackgroundOpacity(opacity) {
  321.       if (this._backgroundSprite) {
  322.         this._backgroundSprite.opacity = opacity;
  323.       }
  324.     }
  325.     createHelpWindow() {
  326.       this._helpWindow = new Window_Help(this.helpWindowRect());
  327.       this._helpWindow.setText(this.helpWindowText());
  328.       this.addWindow(this._helpWindow);
  329.     }
  330.     helpWindowText() {
  331.       return TextManager.formation;
  332.     }
  333.     createButtons() {
  334.       if (ConfigManager.touchUI) {
  335.         this._cancelButton = new Sprite_Button('cancel');
  336.         this._cancelButton.x = Graphics.boxWidth - this.cancelButtonWidth() - settings.cancelButtonRightMergin;
  337.         this._cancelButton.y = this.buttonY();
  338.         this.addChild(this._cancelButton);
  339.       }
  340.     }
  341.     cancelButtonWidth() {
  342.       return this._cancelButton ? this._cancelButton.width : 0;
  343.     }
  344.     formationHelpWindow() {
  345.       return this._helpWindow;
  346.     }
  347.     createStatusWindow() {
  348.       this._statusWindow = new Window_FormationStatus(this.statusWindowRect());
  349.  
  350.       this.addWindow(this._statusWindow);
  351.     }
  352.     formationStatusWindow() {
  353.       return this._statusWindow;
  354.     }
  355.     createStatusParamsWindow() {
  356.       this._statusParamsWindow = new Window_StatusParams(this.statusParamsWindowRect());
  357.       this.addWindow(this._statusParamsWindow);
  358.     }
  359.     statusParamsWindowRect() {
  360.       return new Rectangle(
  361.         0,
  362.         this.formationHelpWindow().height + this.formationStatusWindow().height + this.waitingMemberWindowHeight(),
  363.         Scene_Status.prototype.statusParamsWidth.call(this),
  364.         this.formationStatusParamsWindowHeight()
  365.       );
  366.     }
  367.     formationStatusParamsWindowHeight() {
  368.       return (
  369.         Graphics.boxHeight -
  370.         this.waitingMemberWindowHeight() -
  371.         this.formationStatusWindow().height -
  372.         this.formationHelpWindow().height
  373.       );
  374.     }
  375.     formationStatusParamsWindow() {
  376.       return this._statusParamsWindow;
  377.     }
  378.     createStatusEquipWindow() {
  379.       this._equipWindow = new Window_StatusEquip(this.equipStatusWindowRect());
  380.       this.addWindow(this._equipWindow);
  381.     }
  382.     equipStatusWindowRect() {
  383.       return new Rectangle(
  384.         this._statusParamsWindow.width,
  385.         this._statusParamsWindow.y,
  386.         Graphics.boxWidth - this._statusParamsWindow.width,
  387.         this._statusParamsWindow.height
  388.       );
  389.     }
  390.     formationEquipStatusWindow() {
  391.       return this._equipWindow;
  392.     }
  393.     createBattleMemberWindow() {
  394.       this._battleMemberWindow = new Window_FormationBattleMember(this.battleMemberWindowRect());
  395.       this.addWindow(this._battleMemberWindow);
  396.     }
  397.     formationBattleMemberWindow() {
  398.       return this._battleMemberWindow;
  399.     }
  400.     createWaitingMemberWindow() {
  401.       this._waitingMemberWindow = new Window_FormationWaitingMember(this.waitingMemberWindowRect());
  402.       this.addWindow(this._waitingMemberWindow);
  403.     }
  404.     formationWaitingMemberWindow() {
  405.       return this._waitingMemberWindow;
  406.     }
  407.     createSelectWindow() {
  408.       this._selectWindow = new Window_FormationSelect(this.selectWindowRect());
  409.       this.setupFormationSelectWindow();
  410.     }
  411.     formationSelectWindow() {
  412.       return this._selectWindow;
  413.     }
  414.     quitFromFormation() {
  415.       $gamePlayer.refresh();
  416.       this.popScene();
  417.     }
  418.   }
  419.   globalThis.Scene_Formation = Scene_Formation;
  420.   //Window_FormationStatus 带有脸图的窗口
  421.   class Window_FormationStatus extends Window_SkillStatus {
  422.     constructor() {
  423.       super(...arguments);
  424.       this._topFaceBitmap = null;
  425.       this._topFaceIsVisible = false;
  426.     }
  427.     loadFaceImages() {
  428.       super.loadFaceImages();
  429.       /**
  430.        * 开头的面部图
  431.        */
  432.       this._topFaceBitmap = ImageManager.loadFace($gameParty.leader().faceName());
  433.       this._topFaceIsVisible = false;
  434.     }
  435.         //可见行数? 原本是4 该为6 ,好像没用
  436.     numVisibleRows() {
  437.       return 10;
  438.     }
  439.     windowHeight() {
  440.       return this.fittingHeight(this.numVisibleRows());
  441.     }
  442.     update() {
  443.       super.update();
  444.           //$gameParty.members()[0]._name,0,0,400,200,'left'
  445.           //Bitmap.prototype.drawText = function(text, x, y, maxWidth, lineHeight, align)
  446.     this.contents.drawText(this.convertEscapeCharacters(this._actor._profile),0,90,900,220,'left');
  447.       /**
  448.        * 先頭のみ顔グラの読み込みが間に合わないケースがあるため、
  449.        * 等待准备工作仅运行一次重绘过程。
  450.        */
  451.       if (!this._topFaceIsVisible && this._topFaceBitmap && this._topFaceBitmap.isReady()) {
  452.                 //在这里绘制?
  453.         this.refresh();
  454.         this._topFaceIsVisible = true;
  455.       }
  456.     }
  457.   }
  458.   class Window_DrawActorCharacter extends Window_StatusBase {
  459.     initialize(rect) {
  460.       super.initialize(rect);
  461.       this._bitmapsMustBeRedraw = [];
  462.       this.refresh();
  463.     }
  464.     drawActorCharacter(actor, x, y) {
  465.       super.drawActorCharacter(actor, x, y);
  466.       const bitmap = ImageManager.loadCharacter(actor.characterName());
  467.       if (!bitmap.isReady()) {
  468.         this._bitmapsMustBeRedraw.push(bitmap);
  469.       }
  470.     }
  471.     drawActorCharacterLeft(actor, x, y) {
  472.       const bitmap = ImageManager.loadCharacter(actor.characterName());
  473.       const big = ImageManager.isBigCharacter(actor.characterName());
  474.       const pw = bitmap.width / (big ? 3 : 12);
  475.       const ph = bitmap.height / (big ? 4 : 8);
  476.       const n = big ? 0 : actor.characterIndex();
  477.       const sx = ((n % 4) * 3 + 1) * pw;
  478.       const sy = (Math.floor(n / 4) * 4 + 1) * ph;
  479.       this.contents.blt(bitmap, sx, sy, pw, ph, x - pw / 2, y - ph);
  480.       if (!bitmap.isReady()) {
  481.         this._bitmapsMustBeRedraw.push(bitmap);
  482.       }
  483.     }
  484.     members() {
  485.       return [];
  486.     }
  487.     spacing() {
  488.       return 12;
  489.     }
  490.     offsetX() {
  491.       return 0;
  492.     }
  493.     offsetY() {
  494.       return 0;
  495.     }
  496.     itemHeight() {
  497.       return settings.characterHeight + 4;
  498.     }
  499.     itemRect(index) {
  500.       const x = this.x + this.offsetX() + (index % this.maxCols()) * (settings.characterWidth + this.spacing());
  501.       const y = -4 + this.offsetY() + Math.floor(index / this.maxCols()) * (settings.characterHeight + this.spacing());
  502.       return new Rectangle(x, y, settings.characterWidth, this.itemHeight());
  503.     }
  504.     update() {
  505.       super.update();
  506.       /**
  507.        * 由于有些情况下只能第一次及时完成加载,因此重新绘制
  508.        */
  509.       if (this._bitmapsMustBeRedraw.length > 0 && this._bitmapsMustBeRedraw.every((bitmap) => bitmap.isReady())) {
  510.         this.refresh();
  511.         this._bitmapsMustBeRedraw = [];
  512.       }
  513.     }
  514.     refresh() {
  515.       this.contents.clear();
  516.       this.members().forEach((actor, index) => {
  517.         const x =
  518.           this.offsetX() +
  519.           settings.characterWidth / 2 +
  520.           (index % this.maxCols()) * (settings.characterWidth + this.spacing());
  521.         const y =
  522.           this.offsetY() +
  523.           settings.characterHeight +
  524.           Math.floor(index / this.maxCols()) * (settings.characterHeight + this.spacing());
  525.         if (settings.characterDirectionToLeft) {
  526.           this.drawActorCharacterLeft(actor, x, y);
  527.         } else {
  528.           this.drawActorCharacter(actor, x, y);
  529.         }
  530.       });
  531.     }
  532.   }
  533.   class Window_FormationBattleMember extends Window_DrawActorCharacter {
  534.     update() {
  535.       super.update();
  536.       if ($gameTemp.isFormationBattleMemberWindowRefreshRequested()) {
  537.         this.refresh();
  538.         $gameTemp.clearFormationBattleMemberWindowRefreshRequest();
  539.       }
  540.     }
  541.     members() {
  542.       return $gameParty.battleMembers();
  543.     }
  544.     maxCols() {
  545.       return settings.characterHeight > DEFAULT_CHARACTER_SIZE
  546.         ? $gameParty.maxBattleMembers()
  547.         : $gameParty.maxBattleMembers() / 2;
  548.     }
  549.     offsetX() {
  550.       return settings.characterHeight > DEFAULT_CHARACTER_SIZE ? 0 : 12;
  551.     }
  552.     offsetY() {
  553.       return settings.characterHeight > DEFAULT_CHARACTER_SIZE ? 0 : 4;
  554.     }
  555.     spacing() {
  556.       return settings.characterHeight > DEFAULT_CHARACTER_SIZE ? 24 : 12;
  557.     }
  558.   }
  559.   class Window_FormationWaitingMember extends Window_DrawActorCharacter {
  560.     update() {
  561.       super.update();
  562.       if ($gameTemp.isFormationWaitingMemberWindowRefreshRequested()) {
  563.         this.refresh();
  564.         $gameTemp.clearFormationWaitingMemberWindowRefreshRequest();
  565.       }
  566.     }
  567.     members() {
  568.       return $gameParty.allMembers().filter((actor) => !actor.isBattleMember());
  569.     }
  570.     maxCols() {
  571.       return settings.characterHeight > DEFAULT_CHARACTER_SIZE ? 9 : 11;
  572.     }
  573.   }
  574.   class Window_FormationSelect extends Window_Selectable {
  575.     constructor() {
  576.       super(...arguments);
  577.       this._pendingIndex = -1;
  578.       this._pendingCursorSprite = null;
  579.       this._pendingCursorRect = new Rectangle(0, 0, 0, 0);
  580.       this._statusWindow = null;
  581.       this._battleMemberWindow = null;
  582.       this._waitingMemberWindow = null;
  583.       this._statusParamsWindow = null;
  584.       this._equipWindow = null;
  585.     }
  586.     initialize(rect) {
  587.       super.initialize(rect);
  588.       this.setBackgroundType(2);
  589.       if (!this._pendingCursorSprite) {
  590.         this._pendingCursorSprite = new Sprite();
  591.         this.addChild(this._pendingCursorSprite);
  592.       }
  593.     }
  594.  
  595.     setStatusWindow(statusWindow) {
  596.       this._statusWindow = statusWindow;
  597.     }
  598.     setBattleMemberWindow(battleMemberWindow) {
  599.       this._battleMemberWindow = battleMemberWindow;
  600.     }
  601.     setWaitingMemberWindow(waitingMemberWindow) {
  602.       this._waitingMemberWindow = waitingMemberWindow;
  603.     }
  604.     setStatusParamsWindow(statusParamsWindow) {
  605.       this._statusParamsWindow = statusParamsWindow;
  606.     }
  607.     setEquipWindow(equipWindow) {
  608.       this._equipWindow = equipWindow;
  609.     }
  610.     maxCols() {
  611.       return this.maxItems();
  612.     }
  613.     maxItems() {
  614.       return $gameParty.allMembers().length;
  615.     }
  616.     isHorizontal() {
  617.       return true;
  618.     }
  619.     isSelectBattleMember() {
  620.       return this.index() < $gameParty.battleMembers().length;
  621.     }
  622.     isSelectUpperLineBattleMember() {
  623.       return !this.useTallCharacter() && this.index() < this._battleMemberWindow.maxCols();
  624.     }
  625.     isSelectLowerLineBattleMember() {
  626.       return (
  627.         !this.useTallCharacter() &&
  628.         this.index() >= this._battleMemberWindow.maxCols() &&
  629.         this.index() < $gameParty.battleMembers().length
  630.       );
  631.     }
  632.     isSelectRightLineBattleMember() {
  633.       const maxCols = this.isSelectUpperLineBattleMember()
  634.         ? Math.ceil(this._battleMemberWindow.maxCols())
  635.         : Math.floor(this._battleMemberWindow.maxCols());
  636.       return (
  637.         !this.useTallCharacter() &&
  638.         this.index() < $gameParty.battleMembers().length &&
  639.         this.index() % maxCols === maxCols - 1
  640.       );
  641.     }
  642.     isSelectUpperLineWaitingMember() {
  643.       return (
  644.         !this.useTallCharacter() &&
  645.         this.index() >= $gameParty.battleMembers().length &&
  646.         this.index() < $gameParty.battleMembers().length + this._waitingMemberWindow.maxCols()
  647.       );
  648.     }
  649.     isSelectLowerLineWaitingMember() {
  650.       return (
  651.         !this.useTallCharacter() &&
  652.         this.index() >= $gameParty.battleMembers().length + this._waitingMemberWindow.maxCols()
  653.       );
  654.     }
  655.     isSelectLeftLineWaitingMember() {
  656.       return (
  657.         !this.useTallCharacter() &&
  658.         this.index() >= $gameParty.battleMembers().length &&
  659.         (this.index() - $gameParty.battleMembers().length) % this._waitingMemberWindow.maxCols() === 0
  660.       );
  661.     }
  662.     /**
  663.      * 是否使用了比默认值高的角色
  664.      * @return {boolean}
  665.      */
  666.     useTallCharacter() {
  667.       return settings.characterHeight > DEFAULT_CHARACTER_SIZE;
  668.     }
  669.     cursorDown() {
  670.       if (this.isSelectUpperLineBattleMember()) {
  671.         if (this.index() + Math.ceil(this._battleMemberWindow.maxCols()) < $gameParty.battleMembers().length) {
  672.           this.select(this.index() + Math.ceil(this._battleMemberWindow.maxCols()));
  673.         } else if ($gameParty.battleMembers().length > Math.ceil(this._battleMemberWindow.maxCols())) {
  674.           this.select($gameParty.battleMembers().length - 1);
  675.         }
  676.       } else if (
  677.         this.isSelectUpperLineWaitingMember() &&
  678.         this.index() + this._waitingMemberWindow.maxCols() < this.maxItems()
  679.       ) {
  680.         this.select(this.index() + this._waitingMemberWindow.maxCols());
  681.       }
  682.     }
  683.     cursorUp() {
  684.       if (this.isSelectLowerLineBattleMember()) {
  685.         this.select(this.index() - Math.floor(this._battleMemberWindow.maxCols()));
  686.       } else if (this.isSelectLowerLineWaitingMember()) {
  687.         this.select(this.index() - this._waitingMemberWindow.maxCols());
  688.       }
  689.     }
  690.     cursorRight() {
  691.       if (this.isSelectRightLineBattleMember() && this.maxItems() > $gameParty.battleMembers().length) {
  692.         if (
  693.           this.isSelectLowerLineBattleMember() &&
  694.           this.maxItems() > $gameParty.battleMembers().length + this._waitingMemberWindow.maxCols()
  695.         ) {
  696.           this.select($gameParty.battleMembers().length + this._waitingMemberWindow.maxCols());
  697.         } else {
  698.           this.select($gameParty.battleMembers().length);
  699.         }
  700.       } else {
  701.         super.cursorRight(true);
  702.       }
  703.     }
  704.     cursorLeft() {
  705.       if (this.isSelectLeftLineWaitingMember()) {
  706.         if (this.isSelectUpperLineWaitingMember()) {
  707.           this.select(Math.ceil(this._battleMemberWindow.maxCols()) - 1);
  708.         } else {
  709.           this.select($gameParty.battleMembers().length - 1);
  710.         }
  711.       } else {
  712.         super.cursorLeft(true);
  713.       }
  714.     }
  715.     actor() {
  716.       return $gameParty.allMembers()[this.index()];
  717.     }
  718.  
  719.         //如果在菜单中选中
  720.         //alert(this.actor()._profile);
  721.     select(index) {
  722.       super.select(index);
  723.       if (this._statusWindow) {
  724.         this._statusWindow.setActor(this.actor());
  725.       }
  726.       if (this._statusParamsWindow) {
  727.         this._statusParamsWindow.setActor(this.actor());
  728.       }
  729.       if (this._equipWindow) {
  730.         this._equipWindow.setActor(this.actor());
  731.       }
  732.     }
  733.     processCancel() {
  734.       if (this.processCancelEnabled()) {
  735.         super.processCancel();
  736.       } else {
  737.         this.playBuzzerSound();
  738.       }
  739.     }
  740.     processCancelEnabled() {
  741.       if (this.pendingIndex() >= 0) {
  742.         return true;
  743.       }
  744.       if ($gameParty.forwardMembersAreAllDead) {
  745.         return !$gameParty.forwardMembersAreAllDead();
  746.       }
  747.       return !$gameParty.isAllDead();
  748.     }
  749.     itemRect(index) {
  750.       if (index < $gameParty.battleMembers().length) {
  751.         return this._battleMemberWindow.itemRect(index);
  752.       } else {
  753.         return this._waitingMemberWindow.itemRect(index - $gameParty.battleMembers().length);
  754.       }
  755.     }
  756.     pendingIndex() {
  757.       return this._pendingIndex;
  758.     }
  759.     setPendingIndex(pendingIndex) {
  760.       this._pendingIndex = pendingIndex;
  761.       this.drawPendingItemBackGround();
  762.     }
  763.     drawPendingItemBackGround() {
  764.       if (this._pendingIndex >= 0) {
  765.         const rect = this.itemRect(this._pendingIndex);
  766.         const color = ColorManager.pendingColor();
  767.         this.changePaintOpacity(false);
  768.         this.contents.fillRect(rect.x, rect.y, rect.width, rect.height, color);
  769.         this.changePaintOpacity(true);
  770.       } else {
  771.         this.contents.clear();
  772.       }
  773.     }
  774.   }
  775.   globalThis.Window_FormationStatus = Window_FormationStatus;
  776.   globalThis.Window_FormationBattleMember = Window_FormationBattleMember;
  777.   globalThis.Window_FormationWaitingMember = Window_FormationWaitingMember;
  778.   globalThis.Window_FormationSelect = Window_FormationSelect;
  779. })();


自用整队界面插件,但不知道为什么光标会右移5像素?打开重新排列场景所需的脚本代码:
SceneManager.push(Scene_Formation);
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-30 08:27

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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