mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-10 01:13:45 +02:00
toggle help
This commit is contained in:
parent
7389475281
commit
30b57b62da
5 changed files with 25 additions and 2 deletions
|
@ -147,3 +147,7 @@ void MenuScriptingInterface::triggerOption(const QString& menuOption) {
|
|||
QMetaObject::invokeMethod(Menu::getInstance(), "triggerOption", Q_ARG(const QString&, menuOption));
|
||||
}
|
||||
|
||||
void MenuScriptingInterface::closeInfoView(const QString& path) {
|
||||
QMetaObject::invokeMethod(Menu::getInstance(), "closeInfoView", Q_ARG(const QString&, path));
|
||||
}
|
||||
|
||||
|
|
|
@ -182,6 +182,8 @@ public slots:
|
|||
*/
|
||||
void setMenuEnabled(const QString& menuName, bool isEnabled);
|
||||
|
||||
void closeInfoView(const QString& path);
|
||||
|
||||
signals:
|
||||
/**jsdoc
|
||||
* This is a signal that is emitted when a menu item is clicked.
|
||||
|
|
|
@ -256,6 +256,11 @@ bool Menu::isOptionChecked(const QString& menuOption) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
void Menu::closeInfoView(const QString& path) {
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
offscreenUi->hide(path);
|
||||
}
|
||||
|
||||
void Menu::triggerOption(const QString& menuOption) {
|
||||
QAction* action = _actionHash.value(menuOption);
|
||||
if (action) {
|
||||
|
|
|
@ -114,6 +114,8 @@ public slots:
|
|||
|
||||
void toggleDeveloperMenus();
|
||||
void toggleAdvancedMenus();
|
||||
|
||||
void closeInfoView(const QString& path);
|
||||
|
||||
void triggerOption(const QString& menuOption);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
icon: "icons/tablet-icons/help-i.svg",
|
||||
text: "HELP"
|
||||
});
|
||||
|
||||
var enabled = false;
|
||||
function onClicked() {
|
||||
var HELP_URL = Script.resourcesPath() + "html/help.html";
|
||||
|
||||
|
@ -38,7 +38,17 @@
|
|||
defaultTab = "gamepad";
|
||||
}
|
||||
var queryParameters = "handControllerName=" + handControllerName + "&defaultTab=" + defaultTab;
|
||||
Menu.triggerOption('Help...');
|
||||
print("Help enabled " + Menu.isMenuEnabled("Help..."))
|
||||
|
||||
if (enabled) {
|
||||
Menu.closeInfoView('InfoView_html/help.html');
|
||||
enabled = !enabled;
|
||||
button.editProperties({isActive: enabled});
|
||||
} else {
|
||||
Menu.triggerOption('Help...');
|
||||
enabled = !enabled;
|
||||
button.editProperties({isActive: enabled});
|
||||
}
|
||||
}
|
||||
|
||||
button.clicked.connect(onClicked);
|
||||
|
|
Loading…
Reference in a new issue