1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-21 12:06:49 +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.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.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.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.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.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.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->settingShowBlocked = settings["session"]["showBlocked"].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;
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)
{
@ -770,7 +770,7 @@ void CCastleBuildings::show(Canvas & 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)
drawOverlays(to, buildings);
}

View File

@ -160,6 +160,10 @@ GeneralOptionsTab::GeneralOptionsTab()
{
setBoolSetting("general", "hapticFeedback", value);
});
addCallback("enableOverlayChanged", [](bool value)
{
setBoolSetting("general", "enableOverlay", value);
});
addCallback("enableUiEnhancementsChanged", [](bool value)
{
setBoolSetting("general", "enableUiEnhancements", value);
@ -223,6 +227,10 @@ GeneralOptionsTab::GeneralOptionsTab()
if (hapticFeedbackCheckbox)
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");
if (enableUiEnhancementsCheckbox)
enableUiEnhancementsCheckbox->setSelected(settings["general"]["enableUiEnhancements"].Bool());

View File

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

View File

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