diff --git a/binaries/data/mods/public/gui/replaymenu/replay_actions.js b/binaries/data/mods/public/gui/replaymenu/replay_actions.js
index 6fe53be63c..cf0f4b143a 100644
--- a/binaries/data/mods/public/gui/replaymenu/replay_actions.js
+++ b/binaries/data/mods/public/gui/replaymenu/replay_actions.js
@@ -127,6 +127,12 @@ function showReplaySummary()
});
}
+function reloadCache()
+{
+ let selected = Engine.GetGUIObjectByName("replaySelection").selected;
+ loadReplays(selected > -1 ? createReplaySelectionData(g_ReplaysFiltered[selected].directory) : "", true);
+}
+
/**
* Callback.
*/
diff --git a/binaries/data/mods/public/gui/replaymenu/replay_menu.js b/binaries/data/mods/public/gui/replaymenu/replay_menu.js
index 80266c8919..b98d19df86 100644
--- a/binaries/data/mods/public/gui/replaymenu/replay_menu.js
+++ b/binaries/data/mods/public/gui/replaymenu/replay_menu.js
@@ -59,7 +59,7 @@ function init(data)
return;
}
- loadReplays(data && data.replaySelectionData);
+ loadReplays(data && data.replaySelectionData, false);
if (!g_Replays)
{
@@ -75,10 +75,13 @@ function init(data)
* Store the list of replays loaded in C++ in g_Replays.
* Check timestamp and compatibility and extract g_Playernames, g_MapNames, g_VictoryConditions.
* Restore selected filters and item.
+ * @param replaySelectionData - Currently selected filters and item to be restored after the loading.
+ * @param compareFiles - If true, compares files briefly (which might be slow with optical harddrives),
+ * otherwise blindly trusts the replay cache.
*/
-function loadReplays(replaySelectionData)
+function loadReplays(replaySelectionData, compareFiles)
{
- g_Replays = Engine.GetReplays();
+ g_Replays = Engine.GetReplays(compareFiles);
if (!g_Replays)
return;
diff --git a/binaries/data/mods/public/gui/replaymenu/replay_menu.xml b/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
index cc7b904143..0f1ca03865 100644
--- a/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
+++ b/binaries/data/mods/public/gui/replaymenu/replay_menu.xml
@@ -249,6 +249,13 @@
deleteReplayButtonPressed();
+
+
+