//============================================================================= // RPG Maker MZ - VideoAbort // // Copyright 2024 Panzer-IV. All rights reserved. // This source code or any portion thereof must not be // reproduced or used without licensed in any manner whatsoever. //============================================================================= /*: * @target MZ * @plugindesc 動画再生の中断プラグイン * @author 四号戦車 * @base PluginCommonBase * @orderAfter PluginCommonBase * * @help VideoAbort.js * * Version: 0.0.2 * * 動画再生の中断を行うプラグインです。 * */ (() => { "use strict"; //======================================================================== // プラグイン定義 //======================================================================== const pluginName = "VideoAbort"; const script = document.currentScript; const param = PluginManagerEx.createParameter(script); //======================================================================== // コアスクリプト変更部 (SceneManager) //======================================================================== const _SceneManager_update = SceneManager.update; SceneManager.update = function(deltaTime) { _SceneManager_update.apply(this, arguments); if (Video.isPlaying()) { if (Input.isTriggered(InputClass.INPUT_CLASS_CANCEL) || Input.isTriggered(InputClass.INPUT_CLASS_CTRL) || TouchInput.isCancelled()) { Video._element.pause(); Video._updateVisibility(false); } } } //======================================================================== // 定数定義 () //======================================================================== //======================================================================== // クラス定義 () //======================================================================== //======================================================================== // プラグインコマンド //======================================================================== })();