From 6c81232256c2339304ac5a0d5d02e3d382faf4b8 Mon Sep 17 00:00:00 2001 From: zingballyhoo Date: Wed, 13 Dec 2023 15:29:40 +0000 Subject: [PATCH] slightly fix weapon variants --- DataTool/DataModels/Unlock.cs | 3 ++- DataTool/SaveLogic/Unlock/SkinTheme.cs | 2 +- DataTool/ToolLogic/Extract/ExtractHeroUnlocks.cs | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DataTool/DataModels/Unlock.cs b/DataTool/DataModels/Unlock.cs index 6be76b18..249beee3 100644 --- a/DataTool/DataModels/Unlock.cs +++ b/DataTool/DataModels/Unlock.cs @@ -121,7 +121,8 @@ private void Init(STU_3021DDED unlock, ulong key) { Type == UnlockType.VictoryPose || Type == UnlockType.VoiceLine || Type == UnlockType.Emote || Type == UnlockType.Souvenir || Type == UnlockType.NameCard || Type == UnlockType.PlayerTitle || - Type == UnlockType.WeaponCharm || Type == UnlockType.WeaponSkin; + Type == UnlockType.WeaponCharm || Type == UnlockType.WeaponSkin || + Type == UnlockType.WeaponVariant; if (unlock.m_BEE9BCDA != null) { Categories = unlock.m_BEE9BCDA diff --git a/DataTool/SaveLogic/Unlock/SkinTheme.cs b/DataTool/SaveLogic/Unlock/SkinTheme.cs index fdabebd4..fb350e3d 100644 --- a/DataTool/SaveLogic/Unlock/SkinTheme.cs +++ b/DataTool/SaveLogic/Unlock/SkinTheme.cs @@ -188,7 +188,7 @@ private static void SetPreviewWeaponNames(FindLogic.Combo.ComboInfo info, Dictio /// Pass these replacements into Combo.Find to make sure you're getting the right files for a specific skin theme. /// public static Dictionary GetReplacements(STU_21276722 skin) { - if (skin == null) return null; + if (skin == null) return new Dictionary(); var replacements = new Dictionary(); if (skin.m_runtimeOverrides != null) { diff --git a/DataTool/ToolLogic/Extract/ExtractHeroUnlocks.cs b/DataTool/ToolLogic/Extract/ExtractHeroUnlocks.cs index f288aa81..2ae19f1f 100644 --- a/DataTool/ToolLogic/Extract/ExtractHeroUnlocks.cs +++ b/DataTool/ToolLogic/Extract/ExtractHeroUnlocks.cs @@ -336,6 +336,11 @@ public static void SaveUnlock( } if (ShouldDo(unlock, config, tags, UnlockType.WeaponVariant)) { + if (unlock.STU.m_rarity == STUUnlockRarity.Common) { + Logger.Debug("ExtractHeroUnlock", $"skipping common rarity weapon {unlock.Name}"); + return; + } + LoudLog($"\tExtracting weapon variant {unlock.Name}"); WeaponVariant.Save(flags, thisPath, unlock, hero); }