RPGMZ 游戏场景全局提示框 带三秒隐藏插件

个人记录保存

Project1论坛 小圈子 人才 不得学习我的技术

javascript 复制代码
//=================================================================================================
// GlobalPopupTip.js
//=================================================================================================
/*:
 * @target MZ
 * @plugindesc 游戏场景全局提示框 带三秒隐藏。
 * @author 希夷先生
 *
 * @help
 * 插件功能:游戏场景全局提示框 带三秒隐藏
 * 使用方法 SceneManager._scene.showTip(" 金钱 + 300$");
*/
(() => {
	
	const _Scene_Base_prototype_create = Scene_Base.prototype.create;
	Scene_Base.prototype.create = function() {
        _Scene_Base_prototype_create.call(this);
		this._popupTipWindow = null;
		this._popupTipDelayCount = 0;
    };
	
	const _Scene_Base_prototype_update = Scene_Base.prototype.update;
	Scene_Base.prototype.update = function() {
        _Scene_Base_prototype_update.call(this);
		if(this._popupTipWindow == null){
			this._popupTipWindow = new _New_Window(new Rectangle(1, 1, 10, 10));
            this._popupTipWindow.paddingScale = 2;
		    this._popupTipWindow.npc_text = "提示框";
		    this._popupTipWindow.isWindow=0;
            this.addChild(this._popupTipWindow);
		}
	    if (this._popupTipDelayCount > 0) {
            this._popupTipDelayCount--;
        } else {
            // 已经彻底关闭,直接退出
            if (this._popupTipWindow.isClosed()) {
                return;
            }
            // 不在关闭动画中,才只关一次
            if (!this._popupTipWindow.isClosing()) {
                this._popupTipWindow.close();
            }
        }
    };
	Scene_Base.prototype.showTip = function(text) {
		this._popupTipWindow.npc_text = text;
		this._popupTipDelayCount = 180;
		this._popupTipWindow.open();
	};

})();

窗口源码

相关推荐
图扑可视化26 分钟前
基于图扑软件智慧制硅厂 Web SCADA 开发实践
前端·三维可视化·scada·hmi·组态软件
前端fighter1 小时前
2026年前端面试题总结(pdf版)
前端·pdf
谢小飞1 小时前
运维加了个参数,我们的网页挂掉了
前端·浏览器
CoderYanger2 小时前
Java EE 进阶:12.Spring AOP(第二弹)
java·前端·数据库·spring boot·spring·java-ee·mybatis
用户69371750013845 小时前
大模型蒸馏到底在蒸什么?一篇文章搞懂知识蒸馏概念
前端·后端·github
徐小夕5 小时前
实测 10 个前端 UI 生成开源 Skill|AI 输出直达上线标准
前端·vue.js·github
tong_li5 小时前
给娃做个 AI 陪写作业助手:LangChain4j 入门(八):AI 知道这字哪课学的(SQLite 结构化查询入门)
前端·langchain
bai2735 小时前
同一条 q=a+b:URLSearchParams 读成空格、decodeURIComponent 读成加号,11 条查询串打进裸 socket 的实测
javascript·后端
用户69371750013845 小时前
当 Claude 开始反对蒸馏,我想起了那 700 万份盗版书籍
前端·后端·面试
tryCbest5 小时前
Python 爬虫扩展篇(一):APP 抓包与 JS 逆向入门——从看见流量到读懂签名
javascript·爬虫·python