MOG_PictureGalleryのマウススクロールについて

もりフクロウ
記事: 16
登録日時: 2020年12月21日(月) 12:27

MOG_PictureGalleryのマウススクロールについて

投稿記事by もりフクロウ » 2023年2月06日(月) 11:52

いつもお世話になっております。

MOG_PictureGallery.js
https://plugin.fungamemake.com/archives/19259

ギャラリーを開いてマウスのスクロールを上にするとエラーで落ちてしまいます。
エラーの内容が
rpg_managers.js:1949 TypeError: Cannot set property 'opacity' of undefined
at Window_PictureList.update (MOG_PictureGallery.js:568)
at rpg_scenes.js:262
at Array.forEach (<anonymous>)
at Scene_Picture_Gallery.Scene_Base.updateChildren (rpg_scenes.js:260)
at Scene_Picture_Gallery.Scene_Base.update (rpg_scenes.js:113)
at Scene_Picture_Gallery.update (MOG_PictureGallery.js:1165)
at Function.SceneManager.updateScene (rpg_managers.js:2024)
at Function.SceneManager.updateMain (rpg_managers.js:1983)
at Function.SceneManager.update (rpg_managers.js:1907)

となっており、568行目の
//==============================
// * Update
//==============================
Window_PictureList.prototype.update = function () {
Window_Selectable.prototype.update.call(this);
if (this.opacity === 0) { this.visible = false }
else { this.visible = true };
for (var i = 0; i < this._pic_thumb.length; i++) {
this._pic_thumb[i].opacity = this.contentsOpacity;
this._pic_name[i].opacity = this.contentsOpacity;
};
};

この部分が原因となっているようなのですが、どこを直したら解決するのか分かる方いらっしゃいますか?
海外のフォーラムでも質問されている方がいらっしゃったのですが
https://forums.rpgmakerweb.com/index.ph ... el.153396/
解決されていないようなので難しい内容なのかと思いますが、よろしくお願いいたします。

もりフクロウ
記事: 16
登録日時: 2020年12月21日(月) 12:27

Re: MOG_PictureGalleryのマウススクロールについて

投稿記事by もりフクロウ » 2023年2月06日(月) 16:45

//==============================
// * processWheel
//==============================
Window_PictureList.prototype.processWheel = function () {
if (Imported.MOG_MenuCursor) { return };
if (this.active) {
var threshold = 20;
if (TouchInput.wheelY >= threshold) {
this._index++;
SoundManager.playCursor();
if (this._index > (this.maxItems() - 1)) { this._index = 0 };
this.select(this._index)
};
if (TouchInput.wheelY <= -threshold) {
this._index--;
SoundManager.playCursor();
if (this._index < 0) { this._index = (this.maxItems() - 1) };
this.select(this._index)
};
};
};

この部分を全部削除したらエラーは出なくなりました。
これが正しいのか分かりませんが、どなたかのお役に立てれば幸いです。
色々間違ってるよ~などあればご意見下さい。

“MV:質問” へ戻る