1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Add new setting for instant adventure map fade in / fadeout effects

This commit is contained in:
Dydzio
2023-12-24 17:18:48 +01:00
parent 172e385f67
commit 046d3abee4
5 changed files with 32 additions and 7 deletions

View File

@@ -136,6 +136,8 @@
"vcmi.adventureOptions.leftButtonDrag.help" : "{Left Click Drag Map}\n\nWhen enabled, moving mouse with left button pressed will drag adventure map view.",
"vcmi.adventureOptions.smoothDragging.hover" : "Smooth Map Dragging",
"vcmi.adventureOptions.smoothDragging.help" : "{Smooth Map Dragging}\n\nWhen enabled, map dragging has a modern run out effect.",
"vcmi.adventureOptions.skipAdventureMapAnimations.hover" : "Skip delay-based animations",
"vcmi.adventureOptions.skipAdventureMapAnimations.help" : "{Skip delay-based animations}\n\nWhen enabled, Skips object fadeout and similar effects (resource collection, ship embark etc). Makes UI more reactive in some cases at the expense of aesthetics. Especially useful in PvP games. For maximum movement speed skipping is active regardless of this setting.",
"vcmi.adventureOptions.mapScrollSpeed1.hover": "",
"vcmi.adventureOptions.mapScrollSpeed5.hover": "",
"vcmi.adventureOptions.mapScrollSpeed6.hover": "",

View File

@@ -269,6 +269,9 @@ void MapViewController::afterRender()
bool MapViewController::isEventInstant(const CGObjectInstance * obj, const PlayerColor & initiator)
{
if(settings["gameTweaks"]["skipAdventureMapAnimations"].Bool())
return true;
if (!isEventVisible(obj, initiator))
return true;

View File

@@ -130,6 +130,10 @@ AdventureOptionsTab::AdventureOptionsTab()
{
return setBoolSetting("adventure", "smoothDragging", value);
});
addCallback("skipAdventureMapAnimationsChanged", [](bool value)
{
return setBoolSetting("gameTweaks", "skipAdventureMapAnimations", value);
});
build(config);
std::shared_ptr<CToggleGroup> playerHeroSpeedToggle = widget<CToggleGroup>("heroMovementSpeedPicker");
@@ -172,4 +176,7 @@ AdventureOptionsTab::AdventureOptionsTab()
std::shared_ptr<CToggleButton> smoothDraggingCheckbox = widget<CToggleButton>("smoothDraggingCheckbox");
if (smoothDraggingCheckbox)
smoothDraggingCheckbox->setSelected(settings["adventure"]["smoothDragging"].Bool());
std::shared_ptr<CToggleButton> skipAdventureMapAnimationsCheckbox = widget<CToggleButton>("skipAdventureMapAnimationsCheckbox");
skipAdventureMapAnimationsCheckbox->setSelected(settings["gameTweaks"]["skipAdventureMapAnimations"].Bool());
}

View File

@@ -582,7 +582,8 @@
"infoBarPick",
"skipBattleIntroMusic",
"infoBarCreatureManagement",
"enableLargeSpellbook"
"enableLargeSpellbook",
"skipAdventureMapAnimations"
],
"properties" : {
"showGrid" : {
@@ -620,6 +621,10 @@
"enableLargeSpellbook" : {
"type": "boolean",
"default": true
},
"skipAdventureMapAnimations": {
"type": "boolean",
"default": false
}
}
}

View File

@@ -279,7 +279,7 @@
"callback": "mapScrollSpeedChanged"
},
/////////////////////////////////////// Right section - Original H3 options
/////////////////////////////////////// Right section - Original H3 options + some custom
{
"type" : "verticalLayout",
"customType" : "labelDescription",
@@ -294,6 +294,9 @@
},
{
"text": "core.genrltxt.574" // quick combat
},
{
"text": "vcmi.adventureOptions.showGrid.hover"
}
]
},
@@ -305,7 +308,7 @@
[
{
"name": "showMovePathPlaceholder",
"type": "checkboxFake",
"type": "checkboxFake"
},
{
"name": "heroReminderCheckbox",
@@ -317,6 +320,11 @@
"help": "core.help.362",
"callback": "quickCombatChanged"
},
{
"name": "showGridCheckbox",
"help": "vcmi.adventureOptions.showGrid",
"callback": "showGridChanged"
}
]
},
/////////////////////////////////////// Bottom section - VCMI Options
@@ -333,7 +341,7 @@
"text": "vcmi.adventureOptions.forceMovementInfo.hover"
},
{
"text": "vcmi.adventureOptions.showGrid.hover"
"text": "vcmi.adventureOptions.skipAdventureMapAnimations.hover"
},
{
"text": "vcmi.adventureOptions.infoBarPick.hover"
@@ -370,9 +378,9 @@
"callback": "forceMovementInfoChanged"
},
{
"name": "showGridCheckbox",
"help": "vcmi.adventureOptions.showGrid",
"callback": "showGridChanged"
"name": "skipAdventureMapAnimationsCheckbox",
"help": "vcmi.adventureOptions.skipAdventureMapAnimations",
"callback": "skipAdventureMapAnimationsChanged"
},
{
"name": "infoBarPickCheckbox",