Prevent Alt Toggle Crash

This commit is contained in:
Patrick12115 2025-01-28 20:38:52 -05:00
parent f3410ae3ec
commit f87f988920
3 changed files with 6 additions and 3 deletions

View File

@ -852,6 +852,10 @@ void RegisterPatchCustomEquipmentDlistsHandler() {
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnSceneSpawnActors>([]() {
UpdatePatchCustomEquipmentDlists();
});
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnAssetAltChange>([]() {
UpdatePatchCustomEquipmentDlists();
});
}
void RegisterResetNaviTimer() {

View File

@ -1439,6 +1439,7 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) {
bool curAltAssets = CVarGetInteger(CVAR_ENHANCEMENT("AltAssets"), 0);
if (prevAltAssets != curAltAssets) {
prevAltAssets = curAltAssets;
UpdatePatchCustomEquipmentDlists();
Ship::Context::GetInstance()->GetResourceManager()->SetAltAssetsEnabled(curAltAssets);
gfx_texture_cache_clear();
SOH::SkeletonPatcher::UpdateSkeletons();

View File

@ -1319,9 +1319,7 @@ void DrawEnhancementsMenu() {
if (ImGui::BeginMenu("Graphics"))
{
if (ImGui::BeginMenu("Mods")) {
if (UIWidgets::PaddedEnhancementCheckbox("Use Alternate Assets", CVAR_ENHANCEMENT("AltAssets"), false, false)) {
UpdatePatchCustomEquipmentDlists();
}
UIWidgets::PaddedEnhancementCheckbox("Use Alternate Assets", CVAR_ENHANCEMENT("AltAssets"), false, false);
UIWidgets::Tooltip("Toggle between standard assets and alternate assets. Usually mods will indicate if this setting has to be used or not.");
UIWidgets::PaddedEnhancementCheckbox("Disable Bomb Billboarding", CVAR_ENHANCEMENT("DisableBombBillboarding"), true, false);
UIWidgets::Tooltip("Disables bombs always rotating to face the camera. To be used in conjunction with mods that want to replace bombs with 3D objects.");