楼主: wabcmcc

[交流讨论] YEP_PictureCommonEvents演示工程

[复制链接]
梦石
0
星屑
343
在线时间
40 小时
注册时间
2021-8-24
回帖
53
发表于 2022-10-24 18:28:05 | 显示全部楼层
mz能否做一个
回复

使用道具 举报

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

MZ评测员

发表于 2022-10-24 23:13:51 | 显示全部楼层

D:\Steam\steamapps\common\RPG Maker MZ\newdata\js\plugins\ButtonPicture.js
MZ官方自带了一个耶。
  1. (() => {
  2.     const pluginName = "ButtonPicture";

  3.     PluginManager.registerCommand(pluginName, "set", args => {
  4.         const pictureId = Number(args.pictureId);
  5.         const commonEventId = Number(args.commonEventId);
  6.         const picture = $gameScreen.picture(pictureId);
  7.         if (picture) {
  8.             picture.mzkp_commonEventId = commonEventId;
  9.         }
  10.     });

  11.     Sprite_Picture.prototype.isClickEnabled = function() {
  12.         const picture = this.picture();
  13.         return picture && picture.mzkp_commonEventId && !$gameMessage.isBusy();
  14.     };

  15.     Sprite_Picture.prototype.onClick = function() {
  16.         $gameTemp.reserveCommonEvent(this.picture().mzkp_commonEventId);
  17.     };

  18.     Spriteset_Base.prototype.mzkp_isAnyPicturePressed = function() {
  19.         return this._pictureContainer.children.some(sprite =>
  20.             sprite.isPressed()
  21.         );
  22.     };

  23.     const _Scene_Map_isAnyButtonPressed =
  24.         Scene_Map.prototype.isAnyButtonPressed;
  25.     Scene_Map.prototype.isAnyButtonPressed = function() {
  26.         return (
  27.             _Scene_Map_isAnyButtonPressed.apply(this, arguments) ||
  28.             this._spriteset.mzkp_isAnyPicturePressed()
  29.         );
  30.     };
  31. })();
复制代码
回复

使用道具 举报

梦石
0
星屑
343
在线时间
40 小时
注册时间
2021-8-24
回帖
53
发表于 2022-10-24 23:25:49 | 显示全部楼层
小秋橙 发表于 2022-10-24 23:13
D:\Steam\steamapps\common\RPG Maker MZ\newdata\js\plugins\ButtonPicture.js
MZ官方自带了一个耶。
(( ...

找了很久都不知道有这个,我以为直接买了mz啥都有了,感谢
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部