diff --git a/src/API/OpenAnimationReplacerAPI-Animations.h b/src/API/OpenAnimationReplacerAPI-Animations.h
index 53dde72..1d57960 100644
--- a/src/API/OpenAnimationReplacerAPI-Animations.h
+++ b/src/API/OpenAnimationReplacerAPI-Animations.h
@@ -43,6 +43,11 @@ namespace OAR_API::Animations
///
/// The refr to clear related condition state data for.
virtual void ClearConditionStateData(RE::TESObjectREFR* a_refr) noexcept = 0;
+
+ ///
+ /// Reloads all animations and mod configurations.
+ ///
+ virtual void ReloadAnimations() noexcept = 0;
};
using IAnimationsInterface = IAnimationsInterface1;
diff --git a/src/Jobs.cpp b/src/Jobs.cpp
index 1b5bf86..31ed661 100644
--- a/src/Jobs.cpp
+++ b/src/Jobs.cpp
@@ -27,4 +27,8 @@ namespace Jobs
}
}
}
+ void ReloadAnimationsJob::Run()
+ {
+ OpenAnimationReplacer::GetSingleton().ReloadAnimations();
+ }
}
diff --git a/src/Jobs.h b/src/Jobs.h
index dc711a7..7b5454c 100644
--- a/src/Jobs.h
+++ b/src/Jobs.h
@@ -201,4 +201,9 @@ namespace Jobs
replacerMod->RemoveConditionPreset(conditionPresetName);
}
};
+
+ struct ReloadAnimationsJob : GenericJob
+ {
+ void Run() override;
+ };
}
diff --git a/src/ModAPI.cpp b/src/ModAPI.cpp
index 0044520..cc20b5c 100644
--- a/src/ModAPI.cpp
+++ b/src/ModAPI.cpp
@@ -47,6 +47,10 @@ namespace OAR_API
{
OpenAnimationReplacer::GetSingleton().ClearConditionStateDataForRefr(a_refr);
}
+ void AnimationsInterface::ReloadAnimations() noexcept
+ {
+ OpenAnimationReplacer::GetSingleton().QueueJob();
+ }
}
namespace Conditions
diff --git a/src/ModAPI.h b/src/ModAPI.h
index 7fa2457..ea07481 100644
--- a/src/ModAPI.h
+++ b/src/ModAPI.h
@@ -21,6 +21,7 @@ namespace OAR_API
[[nodiscard]] ReplacementAnimationInfo GetCurrentReplacementAnimationInfo(RE::hkbClipGenerator* a_clipGenerator) noexcept override;
void ClearConditionStateData(RE::hkbClipGenerator* a_clipGenerator) noexcept override;
void ClearConditionStateData(RE::TESObjectREFR* a_refr) noexcept override;
+ void ReloadAnimations() noexcept override;
private:
AnimationsInterface() = default;
diff --git a/src/OpenAnimationReplacer.cpp b/src/OpenAnimationReplacer.cpp
index cde03e0..33dbd9a 100644
--- a/src/OpenAnimationReplacer.cpp
+++ b/src/OpenAnimationReplacer.cpp
@@ -691,6 +691,23 @@ void OpenAnimationReplacer::ForEachSortedReplacerMod(const std::function& a_func) const;
void ForEachReplacerMod(const std::function& a_func) const;
void ForEachSortedReplacerMod(const std::function& a_func) const;
+ void ReloadAnimations();
void SetSynchronizedClipsIDOffset(RE::hkbCharacterStringData* a_stringData, uint16_t a_offset);
[[nodiscard]] uint16_t GetSynchronizedClipsIDOffset(RE::hkbCharacterStringData* a_stringData) const;
diff --git a/src/UI/UIMain.cpp b/src/UI/UIMain.cpp
index 844ea94..265a826 100644
--- a/src/UI/UIMain.cpp
+++ b/src/UI/UIMain.cpp
@@ -596,6 +596,14 @@ namespace UI
}
ImGui::SameLine();
UICommon::HelpMarker("Enable to increase the animation limit to double the default value. Should generally work fine, but I might have missed some places to patch in the game code so this is still considered to be experimental. There's no benefit in enabling this if you're not going over the limit.");
+ ImGui::Spacing();
+ ImGui::Separator();
+
+ if (ImGui::Button("Reload animations")) {
+ OpenAnimationReplacer::GetSingleton().QueueJob();
+ }
+ ImGui::SameLine();
+ UICommon::HelpMarker("Reload all animations mod config");
}
ImGui::End();