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

Project1

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

[交流讨论] YEP_PictureCommonEvents演示工程

[复制链接]

Lv2.观梦者

梦石
0
星屑
343
在线时间
40 小时
注册时间
2021-8-24
帖子
60
11
发表于 2022-10-24 18:28:05 | 只看该作者
mz能否做一个
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
5449
在线时间
392 小时
注册时间
2021-12-4
帖子
417
12
发表于 2022-10-24 23:13:51 | 只看该作者

D:\Steam\steamapps\common\RPG Maker MZ\newdata\js\plugins\ButtonPicture.js
MZ官方自带了一个耶。
JAVASCRIPT 代码复制下载
  1. (() => {
  2.     const pluginName = "ButtonPicture";
  3.  
  4.     PluginManager.registerCommand(pluginName, "set", args => {
  5.         const pictureId = Number(args.pictureId);
  6.         const commonEventId = Number(args.commonEventId);
  7.         const picture = $gameScreen.picture(pictureId);
  8.         if (picture) {
  9.             picture.mzkp_commonEventId = commonEventId;
  10.         }
  11.     });
  12.  
  13.     Sprite_Picture.prototype.isClickEnabled = function() {
  14.         const picture = this.picture();
  15.         return picture && picture.mzkp_commonEventId && !$gameMessage.isBusy();
  16.     };
  17.  
  18.     Sprite_Picture.prototype.onClick = function() {
  19.         $gameTemp.reserveCommonEvent(this.picture().mzkp_commonEventId);
  20.     };
  21.  
  22.     Spriteset_Base.prototype.mzkp_isAnyPicturePressed = function() {
  23.         return this._pictureContainer.children.some(sprite =>
  24.             sprite.isPressed()
  25.         );
  26.     };
  27.  
  28.     const _Scene_Map_isAnyButtonPressed =
  29.         Scene_Map.prototype.isAnyButtonPressed;
  30.     Scene_Map.prototype.isAnyButtonPressed = function() {
  31.         return (
  32.             _Scene_Map_isAnyButtonPressed.apply(this, arguments) ||
  33.             this._spriteset.mzkp_isAnyPicturePressed()
  34.         );
  35.     };
  36. })();
回复 支持 反对

使用道具 举报

Lv2.观梦者

梦石
0
星屑
343
在线时间
40 小时
注册时间
2021-8-24
帖子
60
13
发表于 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啥都有了,感谢
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-5-2 08:39

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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