帮我看下这个插连接插件是怎么会事。YEP.21 – External Links
JAVASCRIPT 代码下载//=============================================================================
// Yanfly Engine Plugins - External Links
// YEP_ExternalLinks.js
//=============================================================================
var Imported = Imported || {};
Imported.YEP_ExternalLinks = true;
var Yanfly = Yanfly || {};
Yanfly.LINK = Yanfly.LINK || {};
//=============================================================================
/*:
* @plugindesc v1.00 Link back to your home page through the title screen
* and also be able to link your players from within the game.
* @author Yanfly Engine Plugins
*
* @param Home Page URL
* @desc Places a link to your website homepage at the title screen.
* Leave this blank if you don't wish to enable this feature.
* @default https://www.google.com/
*
* @param Home Page Text
* @desc This is how 'Home Page' will appear on the title screen.
* @default Home Page
*
* @param Popup Blocker Notice
* @desc This is a window to notify the player the link was blocked
* by a pop-up blocker.
* @default The link was blocked by a pop-up blocker.
*
* @help
* ============================================================================
* Introduction .
* ============================================================================
* This plugin allows you to place a "link" to your home page at the title
* screen's command window towards the bottom. To adjust where the link goes,
* change the Home Page URL in the plugin's parameters.
*
* ============================================================================
* Plugin Commands
* ============================================================================
*
* If you wish to send players to other links, you can use the following
* plugin commands.
*
* Plugin Command
* OpenNewTab http://www.google.com/ Opens link in a new tab.
* OpenNewWindow http://www.google.com/Opens link in a new window.
*
* Some web browsers may not differentiate these commands too much.
*/
//=============================================================================
//=============================================================================
// Parameter Variables
//=============================================================================
Yanfly.Parameters = PluginManager.parameters('YEP_ExternalLinks');
Yanfly.Param = Yanfly.Param || {};
Yanfly.Param.HomePageUrl = String(Yanfly.Parameters['Home Page URL']);
Yanfly.Param.HomePageText = String(Yanfly.Parameters['Home Page Text']);
Yanfly.Param.PopupMessage = String(Yanfly.Parameters['Popup Blocker Notice']);
//=============================================================================
// SceneManager
//=============================================================================
SceneManager.openPopupBlockerMessage = function(){
this._scene.openPopupBlockerMessage();
};
//=============================================================================
// Game_Interpreter
//=============================================================================
Yanfly.LINK.Game_Interpreter_pluginCommand =
Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function(command, args){
Yanfly.LINK.Game_Interpreter_pluginCommand.call(this, command, args)
if(command === 'OpenNewTab')this.openNewTab(args);
if(command === 'OpenNewWindow')this.openNewWindow(args);
};
Game_Interpreter.prototype.openNewTab = function(args){
TouchInput.clear();
Input.clear();
var url = String(args);
var win = window.open(url, '_blank');
if(win){
win.focus();
}else{
SceneManager.openPopupBlockerMessage();
}
};
Game_Interpreter.prototype.openNewWindow = function(args){
TouchInput.clear();
Input.clear();
var url = String(args);
var win = window.open(url);
if(win){
win.focus();
}else{
SceneManager.openPopupBlockerMessage();
}
};
//=============================================================================
// Window_TitleCommand
//=============================================================================
Yanfly.LINK.Window_TitleCommand_makeCommandList =
Window_TitleCommand.prototype.makeCommandList;
Window_TitleCommand.prototype.makeCommandList = function(){
Yanfly.LINK.Window_TitleCommand_makeCommandList.call(this);
this.addHomePageCommand();
};
Window_TitleCommand.prototype.addHomePageCommand = function(){
if(Yanfly.Param.HomePageUrl.length0)return;
this.closePopupBlockerMessage();
};
Scene_Base.prototype.openPopupBlockerMessage = function(){
this._popupBlockerWindow.open();
this._popupBlockerWindow.activate();
this._popupCounter = 180;
};
Scene_Base.prototype.closePopupBlockerMessage = function(){
if(!this._popupBlockerWindow)return;
if(this._popupBlockerWindow.isClosed())return;
this._popupBlockerWindow.close();
this._popupBlockerWindow.deactivate();
};
//=============================================================================
// Scene_Base
//=============================================================================
Yanfly.LINK.Scene_Title_createCommandWindow =
Scene_Title.prototype.createCommandWindow;
Scene_Title.prototype.createCommandWindow = function(){
Yanfly.LINK.Scene_Title_createCommandWindow.call(this);
this._commandWindow.setHandler('homePage', this.commandHomePage.bind(this));
};
Scene_Title.prototype.commandHomePage = function(){
TouchInput.clear();
Input.clear();
this._commandWindow.activate();
var win = window.open(Yanfly.Param.HomePageUrl, '_blank');
if(win){
win.focus();
}else{
SceneManager.openPopupBlockerMessage();
}
};
//=============================================================================
// End of File
//=============================================================================
这个是YEP_ExternalLinks这个插件,为游戏插件超连接的,可是为什么添加后,在游戏开始标题上点击后会是空白?可是在游戏中却能打开网址?
https://rpg.blue/data/attachment/forum/201704/30/002915i14x1zny121jcrxu.jpg
https://rpg.blue/data/attachment/forum/201704/30/002916pt3194n08kzutz39.jpg
https://rpg.blue/data/attachment/forum/201704/30/002918h6daitllantz7xjb.jpg
以上是插件代码。各位大神帮我看看是哪里的毛病?
本帖来自P1论坛作者yangdanfeng,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=400267若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。
页:
[1]