mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 02:06:32 +01:00
open help popup when the option is set.
This commit is contained in:
parent
57551c791d
commit
ce3a1da1dc
1 changed files with 21 additions and 3 deletions
|
|
@ -77,10 +77,12 @@ let options_plugin = (function () {
|
|||
if (code === 27) { // Escape key
|
||||
if ($('#helpdialog').is(':visible')) {
|
||||
plugins['popups'].closePopup("#helpdialog");
|
||||
} else {
|
||||
plugins['popups'].closePopup("#optionsdialog");
|
||||
return true;
|
||||
}
|
||||
if ($('#optionsdialog').is(':visible')) {
|
||||
plugins['popups'].closePopup("#optionsdialog");
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -129,6 +131,21 @@ let options_plugin = (function () {
|
|||
plugins['popups'].closePopup("#helpdialog");
|
||||
}
|
||||
|
||||
//
|
||||
// Make sure to close any dialogs on connection lost
|
||||
var onText = function (args, kwargs) {
|
||||
// is helppopup set? and if so, does this Text have type 'help'?
|
||||
if ('helppopup' in options && options['helppopup'] ) {
|
||||
if (kwargs && ('type' in kwargs) && (kwargs['type'] == 'help') ) {
|
||||
$('#helpdialogcontent').append('<div>'+ args + '</div>');
|
||||
plugins['popups'].togglePopup("#helpdialog");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Register and init plugin
|
||||
var init = function () {
|
||||
|
|
@ -155,6 +172,7 @@ let options_plugin = (function () {
|
|||
onGotOptions: onGotOptions,
|
||||
onPrompt: onPrompt,
|
||||
onConnectionClose: onConnectionClose,
|
||||
onText: onText,
|
||||
}
|
||||
})()
|
||||
plugin_handler.add('options', options_plugin);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue