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

Merge pull request #3387 from dydzio0614/instant-animations

New setting to skip adventure map fadein/fadeout
This commit is contained in:
Ivan Savenko
2023-12-24 19:21:56 +02:00
committed by GitHub
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.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.hover" : "Smooth Map Dragging",
"vcmi.adventureOptions.smoothDragging.help" : "{Smooth Map Dragging}\n\nWhen enabled, map dragging has a modern run out effect.", "vcmi.adventureOptions.smoothDragging.help" : "{Smooth Map Dragging}\n\nWhen enabled, map dragging has a modern run out effect.",
"vcmi.adventureOptions.skipAdventureMapAnimations.hover" : "Skip fading effects",
"vcmi.adventureOptions.skipAdventureMapAnimations.help" : "{Skip fading effects}\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.mapScrollSpeed1.hover": "",
"vcmi.adventureOptions.mapScrollSpeed5.hover": "", "vcmi.adventureOptions.mapScrollSpeed5.hover": "",
"vcmi.adventureOptions.mapScrollSpeed6.hover": "", "vcmi.adventureOptions.mapScrollSpeed6.hover": "",

View File

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

View File

@@ -130,6 +130,10 @@ AdventureOptionsTab::AdventureOptionsTab()
{ {
return setBoolSetting("adventure", "smoothDragging", value); return setBoolSetting("adventure", "smoothDragging", value);
}); });
addCallback("skipAdventureMapAnimationsChanged", [](bool value)
{
return setBoolSetting("gameTweaks", "skipAdventureMapAnimations", value);
});
build(config); build(config);
std::shared_ptr<CToggleGroup> playerHeroSpeedToggle = widget<CToggleGroup>("heroMovementSpeedPicker"); std::shared_ptr<CToggleGroup> playerHeroSpeedToggle = widget<CToggleGroup>("heroMovementSpeedPicker");
@@ -172,4 +176,7 @@ AdventureOptionsTab::AdventureOptionsTab()
std::shared_ptr<CToggleButton> smoothDraggingCheckbox = widget<CToggleButton>("smoothDraggingCheckbox"); std::shared_ptr<CToggleButton> smoothDraggingCheckbox = widget<CToggleButton>("smoothDraggingCheckbox");
if (smoothDraggingCheckbox) if (smoothDraggingCheckbox)
smoothDraggingCheckbox->setSelected(settings["adventure"]["smoothDragging"].Bool()); 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", "infoBarPick",
"skipBattleIntroMusic", "skipBattleIntroMusic",
"infoBarCreatureManagement", "infoBarCreatureManagement",
"enableLargeSpellbook" "enableLargeSpellbook",
"skipAdventureMapAnimations"
], ],
"properties" : { "properties" : {
"showGrid" : { "showGrid" : {
@@ -620,6 +621,10 @@
"enableLargeSpellbook" : { "enableLargeSpellbook" : {
"type": "boolean", "type": "boolean",
"default": true "default": true
},
"skipAdventureMapAnimations": {
"type": "boolean",
"default": false
} }
} }
} }

View File

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