查看: 3107|回复: 3

[有事请教] 请教如何在标题加浏览器打开的超链接

[复制链接]
梦石
0
星屑
1550
在线时间
155 小时
注册时间
2017-8-18
回帖
99
发表于 2020-9-26 15:14:48 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
想请教如何在标题加一个选项,里面是一个网址,然后玩家点击以后会用玩家默认的浏览器打开这个网址
梦石
0
星屑
4399
在线时间
552 小时
注册时间
2017-12-2
回帖
41
发表于 2020-9-26 20:39:24 | 显示全部楼层
试试这个
插件内容

  1. (function() {
  2.     'use strict';
  3.     var _Scene_Title_createCommandWindow = Scene_Title.prototype.createCommandWindow;
  4.     Scene_Title.prototype.createCommandWindow = function() {
  5.         _Scene_Title_createCommandWindow.apply(this, arguments);
  6.         this._commandWindow.setHandler('close',  this.commandClose.bind(this));
  7.     };
  8.    
  9.     Scene_Title.prototype.commandClose = function() {
  10.         var width = ~~(Graphics.boxWidth * 0.8);
  11.         var height = ~~(Graphics.boxHeight * 0.6);
  12.         var x = (Graphics.boxWidth - width) / 2;
  13.         var y = 100;
  14.         if (typeof nw === "object" && nw.Window) {
  15.             x += nw.Window.get().x;
  16.             y += nw.Window.get().y;
  17.         }
  18.         var qqWindow = window.open('https://jq.qq.com/?_wv=1027&k=V4UwdbTR', '新窗口', `
  19.             top=${y},left=${x},height=${height},width=${width}
  20.             status=yes,resizable=yes,scrollbars=yes,alwaysLowered=yes
  21.         `);
  22.         var timer = setTimeout(function() {
  23.             if (!qqWindow.closed) {
  24.                 qqWindow.opener.focus();
  25.                 qqWindow.close();
  26.             }
  27.             clearTimeout(timer);
  28.             // 关闭游戏窗口
  29.             // window.close();
  30.         }, 5000);
  31.         this._commandWindow.activate();
  32.     };

  33.     var _Window_TitleCommand_makeCommandList = Window_TitleCommand.prototype.makeCommandList;
  34.     Window_TitleCommand.prototype.makeCommandList = function() {
  35.         _Window_TitleCommand_makeCommandList.apply(this, arguments);
  36.         this.addCommand("退出游戏", 'close');
  37.     };
  38. })();
复制代码
回复

使用道具 举报

梦石
0
星屑
1550
在线时间
155 小时
注册时间
2017-8-18
回帖
99
 楼主| 发表于 2020-9-26 22:07:52 | 显示全部楼层
Mehmet 发表于 2020-9-26 20:39
试试这个
[fold=插件内容]

大佬,你这个插件可以打开新窗口,但是还是游戏的新窗口,不是浏览器的。我这里要放p站https://www.patreon.com/
这个的链接啊,用这个游戏的新窗口打不开,只显示白屏。
回复

使用道具 举报

梦石
0
星屑
1550
在线时间
155 小时
注册时间
2017-8-18
回帖
99
 楼主| 发表于 2020-9-27 00:36:40 | 显示全部楼层
Mehmet 发表于 2020-9-26 20:39
试试这个
[fold=插件内容]

已经解决了,感谢大佬你的脚本啊!
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部