mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-17 20:43:07 -04:00
Update Aurora & use new texture replacements API (#1935)
Cherry picked from TPHD branch Co-authored-by: Luke Street <luke@street.dev>
This commit is contained in:
committed by
GitHub
parent
bc3cdcc955
commit
81caa89e12
@@ -0,0 +1,38 @@
|
||||
#include "dusk/texture_replacements.hpp"
|
||||
|
||||
#include <aurora/texture.hpp>
|
||||
|
||||
#include "dusk/logging.h"
|
||||
#include "dusk/main.h"
|
||||
#include "dusk/settings.h"
|
||||
|
||||
namespace dusk::texture_replacements {
|
||||
namespace {
|
||||
aurora::texture::ReplacementGroup s_directoryGroup;
|
||||
}
|
||||
|
||||
void reload() {
|
||||
aurora::texture::unregister_replacements(s_directoryGroup);
|
||||
s_directoryGroup.registrations.clear();
|
||||
|
||||
if (!getSettings().game.enableTextureReplacements) {
|
||||
return;
|
||||
}
|
||||
|
||||
const auto root = ConfigPath / "texture_replacements";
|
||||
s_directoryGroup = aurora::texture::load_replacement_directory(root);
|
||||
DuskLog.info("Texture replacement directory loaded: {} registration(s)",
|
||||
s_directoryGroup.registrations.size());
|
||||
}
|
||||
|
||||
void set_enabled(bool enabled) {
|
||||
getSettings().game.enableTextureReplacements.setValue(enabled);
|
||||
reload();
|
||||
}
|
||||
|
||||
void shutdown() {
|
||||
aurora::texture::unregister_replacements(s_directoryGroup);
|
||||
s_directoryGroup.registrations.clear();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user