1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

add setting for disabling overlay

This commit is contained in:
Laserlicht
2025-02-21 21:35:17 +01:00
parent ad68773f81
commit db23cc2ffa
7 changed files with 30 additions and 4 deletions

View File

@ -307,6 +307,8 @@
"vcmi.systemOptions.enableLargeSpellbookButton.help" : "{Large Spell Book}\n\nEnables larger spell book that fits more spells per page. Spell book page change animation does not work with this setting enabled.", "vcmi.systemOptions.enableLargeSpellbookButton.help" : "{Large Spell Book}\n\nEnables larger spell book that fits more spells per page. Spell book page change animation does not work with this setting enabled.",
"vcmi.systemOptions.audioMuteFocus.hover" : "Mute on inactivity", "vcmi.systemOptions.audioMuteFocus.hover" : "Mute on inactivity",
"vcmi.systemOptions.audioMuteFocus.help" : "{Mute on inactivity}\n\nMute audio on inactive window focus. Exceptions are ingame messages and new turn sound.", "vcmi.systemOptions.audioMuteFocus.help" : "{Mute on inactivity}\n\nMute audio on inactive window focus. Exceptions are ingame messages and new turn sound.",
"vcmi.systemOptions.enableOverlayButton.hover" : "Enable Overlay",
"vcmi.systemOptions.enableOverlayButton.help" : "{Enable Overlay}\n\nEnable overlays for showing additional infos such as building names using the ALT key or the two finger gesture.",
"vcmi.adventureOptions.infoBarPick.hover" : "Show Messages in Info Panel", "vcmi.adventureOptions.infoBarPick.hover" : "Show Messages in Info Panel",
"vcmi.adventureOptions.infoBarPick.help" : "{Show Messages in Info Panel}\n\nWhenever possible, game messages from visiting map objects will be shown in the info panel, instead of popping up in a separate window.", "vcmi.adventureOptions.infoBarPick.help" : "{Show Messages in Info Panel}\n\nWhenever possible, game messages from visiting map objects will be shown in the info panel, instead of popping up in a separate window.",

View File

@ -307,6 +307,8 @@
"vcmi.systemOptions.enableLargeSpellbookButton.help" : "{Großes Zauberbuch}\n\nErmöglicht ein größeres Zauberbuch, in das mehr Zaubersprüche pro Seite passen. Die Animation des Seitenwechsels im Zauberbuch funktioniert nicht, wenn diese Einstellung aktiviert ist.", "vcmi.systemOptions.enableLargeSpellbookButton.help" : "{Großes Zauberbuch}\n\nErmöglicht ein größeres Zauberbuch, in das mehr Zaubersprüche pro Seite passen. Die Animation des Seitenwechsels im Zauberbuch funktioniert nicht, wenn diese Einstellung aktiviert ist.",
"vcmi.systemOptions.audioMuteFocus.hover" : "Stumm bei Inaktivität", "vcmi.systemOptions.audioMuteFocus.hover" : "Stumm bei Inaktivität",
"vcmi.systemOptions.audioMuteFocus.help" : "{Stumm bei Inaktivität}\n\nSchaltet Audio bei inaktiven Fenster-Fokus stumm. Ausnahmen sind Ingame-Nachrichten und der Neuer-Zug-Sound.", "vcmi.systemOptions.audioMuteFocus.help" : "{Stumm bei Inaktivität}\n\nSchaltet Audio bei inaktiven Fenster-Fokus stumm. Ausnahmen sind Ingame-Nachrichten und der Neuer-Zug-Sound.",
"vcmi.systemOptions.enableOverlayButton.hover" : "Overlay aktivieren",
"vcmi.systemOptions.enableOverlayButton.help" : "{Overlay aktivieren}\n\nAktiviere Overlays, die zusätzliche Infos, wie Gebäudenamen anzeigen, wenn die ALT-Taste gedrückt oder die Zwei-Finger-Geste genutzt wird.",
"vcmi.adventureOptions.infoBarPick.hover" : "Meldungen im Infobereich anzeigen", "vcmi.adventureOptions.infoBarPick.hover" : "Meldungen im Infobereich anzeigen",
"vcmi.adventureOptions.infoBarPick.help" : "{Meldungen im Infobereich anzeigen}\n\nWann immer möglich, werden Spielnachrichten von besuchten Kartenobjekten in der Infoleiste angezeigt, anstatt als Popup-Fenster zu erscheinen", "vcmi.adventureOptions.infoBarPick.help" : "{Meldungen im Infobereich anzeigen}\n\nWann immer möglich, werden Spielnachrichten von besuchten Kartenobjekten in der Infoleiste angezeigt, anstatt als Popup-Fenster zu erscheinen",

View File

@ -224,7 +224,7 @@ void MapViewController::updateState()
adventureContext->settingShowVisitable = settings["session"]["showVisitable"].Bool(); adventureContext->settingShowVisitable = settings["session"]["showVisitable"].Bool();
adventureContext->settingShowBlocked = settings["session"]["showBlocked"].Bool(); adventureContext->settingShowBlocked = settings["session"]["showBlocked"].Bool();
adventureContext->settingSpellRange = settings["session"]["showSpellRange"].Bool(); adventureContext->settingSpellRange = settings["session"]["showSpellRange"].Bool();
adventureContext->settingTextOverlay = GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2; adventureContext->settingTextOverlay = (GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2) && settings["general"]["enableOverlay"].Bool();
} }
} }

View File

@ -177,7 +177,7 @@ void CBuildingRect::show(Canvas & to)
{ {
uint32_t stageDelay = BUILDING_APPEAR_TIMEPOINT; uint32_t stageDelay = BUILDING_APPEAR_TIMEPOINT;
bool showTextOverlay = GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2; bool showTextOverlay = (GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2) && settings["general"]["enableOverlay"].Bool();
if(stateTimeCounter < BUILDING_APPEAR_TIMEPOINT) if(stateTimeCounter < BUILDING_APPEAR_TIMEPOINT)
{ {
@ -770,7 +770,7 @@ void CCastleBuildings::show(Canvas & to)
{ {
CIntObject::show(to); CIntObject::show(to);
bool showTextOverlay = GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2; bool showTextOverlay = (GH.isKeyboardAltDown() || GH.input().getNumTouchFingers() == 2) && settings["general"]["enableOverlay"].Bool();
if(showTextOverlay) if(showTextOverlay)
drawOverlays(to, buildings); drawOverlays(to, buildings);
} }

View File

@ -160,6 +160,10 @@ GeneralOptionsTab::GeneralOptionsTab()
{ {
setBoolSetting("general", "hapticFeedback", value); setBoolSetting("general", "hapticFeedback", value);
}); });
addCallback("enableOverlayChanged", [](bool value)
{
setBoolSetting("general", "enableOverlay", value);
});
addCallback("enableUiEnhancementsChanged", [](bool value) addCallback("enableUiEnhancementsChanged", [](bool value)
{ {
setBoolSetting("general", "enableUiEnhancements", value); setBoolSetting("general", "enableUiEnhancements", value);
@ -223,6 +227,10 @@ GeneralOptionsTab::GeneralOptionsTab()
if (hapticFeedbackCheckbox) if (hapticFeedbackCheckbox)
hapticFeedbackCheckbox->setSelected(settings["general"]["hapticFeedback"].Bool()); hapticFeedbackCheckbox->setSelected(settings["general"]["hapticFeedback"].Bool());
std::shared_ptr<CToggleButton> enableOverlayCheckbox = widget<CToggleButton>("enableOverlayCheckbox");
if (enableOverlayCheckbox)
enableOverlayCheckbox->setSelected(settings["general"]["enableOverlay"].Bool());
std::shared_ptr<CToggleButton> enableUiEnhancementsCheckbox = widget<CToggleButton>("enableUiEnhancementsCheckbox"); std::shared_ptr<CToggleButton> enableUiEnhancementsCheckbox = widget<CToggleButton>("enableUiEnhancementsCheckbox");
if (enableUiEnhancementsCheckbox) if (enableUiEnhancementsCheckbox)
enableUiEnhancementsCheckbox->setSelected(settings["general"]["enableUiEnhancements"].Bool()); enableUiEnhancementsCheckbox->setSelected(settings["general"]["enableUiEnhancements"].Bool());

View File

@ -42,7 +42,8 @@
"savePrefix", "savePrefix",
"startTurnAutosave", "startTurnAutosave",
"enableUiEnhancements", "enableUiEnhancements",
"audioMuteFocus" "audioMuteFocus",
"enableOverlay"
], ],
"properties" : { "properties" : {
"playerName" : { "playerName" : {
@ -146,6 +147,10 @@
"audioMuteFocus" : { "audioMuteFocus" : {
"type": "boolean", "type": "boolean",
"default": false "default": false
},
"enableOverlay" : {
"type": "boolean",
"default": true
} }
} }
}, },

View File

@ -67,6 +67,9 @@
"text": "vcmi.systemOptions.hapticFeedbackButton.hover", "text": "vcmi.systemOptions.hapticFeedbackButton.hover",
"created" : "mobile" "created" : "mobile"
}, },
{
"text": "vcmi.systemOptions.enableOverlayButton.hover"
},
{ {
"text": "vcmi.systemOptions.enableUiEnhancementsButton.hover" "text": "vcmi.systemOptions.enableUiEnhancementsButton.hover"
} }
@ -98,6 +101,7 @@
{ {
"created" : "mobile" "created" : "mobile"
}, },
{},
{} {}
] ]
}, },
@ -159,6 +163,11 @@
"callback": "hapticFeedbackChanged", "callback": "hapticFeedbackChanged",
"created" : "mobile" "created" : "mobile"
}, },
{
"name": "enableOverlayCheckbox",
"help": "vcmi.systemOptions.enableOverlayButton",
"callback": "enableOverlayChanged"
},
{ {
"name": "enableUiEnhancementsCheckbox", "name": "enableUiEnhancementsCheckbox",
"help": "vcmi.systemOptions.enableUiEnhancementsButton", "help": "vcmi.systemOptions.enableUiEnhancementsButton",