mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:52:26 +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));
|
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 setMenuEnabled(const QString& menuName, bool isEnabled);
|
||||||
|
|
||||||
|
void closeInfoView(const QString& path);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* This is a signal that is emitted when a menu item is clicked.
|
* 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Menu::closeInfoView(const QString& path) {
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
offscreenUi->hide(path);
|
||||||
|
}
|
||||||
|
|
||||||
void Menu::triggerOption(const QString& menuOption) {
|
void Menu::triggerOption(const QString& menuOption) {
|
||||||
QAction* action = _actionHash.value(menuOption);
|
QAction* action = _actionHash.value(menuOption);
|
||||||
if (action) {
|
if (action) {
|
||||||
|
|
|
@ -114,6 +114,8 @@ public slots:
|
||||||
|
|
||||||
void toggleDeveloperMenus();
|
void toggleDeveloperMenus();
|
||||||
void toggleAdvancedMenus();
|
void toggleAdvancedMenus();
|
||||||
|
|
||||||
|
void closeInfoView(const QString& path);
|
||||||
|
|
||||||
void triggerOption(const QString& menuOption);
|
void triggerOption(const QString& menuOption);
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
icon: "icons/tablet-icons/help-i.svg",
|
icon: "icons/tablet-icons/help-i.svg",
|
||||||
text: "HELP"
|
text: "HELP"
|
||||||
});
|
});
|
||||||
|
var enabled = false;
|
||||||
function onClicked() {
|
function onClicked() {
|
||||||
var HELP_URL = Script.resourcesPath() + "html/help.html";
|
var HELP_URL = Script.resourcesPath() + "html/help.html";
|
||||||
|
|
||||||
|
@ -38,7 +38,17 @@
|
||||||
defaultTab = "gamepad";
|
defaultTab = "gamepad";
|
||||||
}
|
}
|
||||||
var queryParameters = "handControllerName=" + handControllerName + "&defaultTab=" + defaultTab;
|
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);
|
button.clicked.connect(onClicked);
|
||||||
|
|
Loading…
Reference in a new issue