From 9142271c35402b8087f4248b29b592690741c38b Mon Sep 17 00:00:00 2001 From: pheonix99 Date: Sat, 11 Feb 2023 11:52:12 -0500 Subject: [PATCH] 1.2.3: Hopefully fixed the graphics for the last time --- .../Component/EnableThrownMode.cs | 22 ++++++++++- .../Content/BaseWeapons.cs | 39 +++++++++++-------- .../Content/ModeSwitching.cs | 2 +- ToggleableThrowingWeapons/Info.json | 2 +- .../ToggleableThrowingWeapons.csproj | 12 +++--- readme.md | 3 ++ 6 files changed, 55 insertions(+), 25 deletions(-) diff --git a/ToggleableThrowingWeapons/Component/EnableThrownMode.cs b/ToggleableThrowingWeapons/Component/EnableThrownMode.cs index 46b6a48..4962dfb 100644 --- a/ToggleableThrowingWeapons/Component/EnableThrownMode.cs +++ b/ToggleableThrowingWeapons/Component/EnableThrownMode.cs @@ -1,4 +1,6 @@ using Kingmaker.Blueprints; +using Kingmaker.PubSubSystem; +using Kingmaker.UnitLogic; using Kingmaker.UnitLogic.Buffs.Blueprints; using System; using System.Collections.Generic; @@ -9,7 +11,25 @@ namespace ToggleableThrowingWeapons.Component { [AllowedOn(typeof(BlueprintBuff))] - class EnableThrownMode : BlueprintComponent + class EnableThrownMode : UnitFactComponentDelegate { + /* + public override void OnActivate() + { + base.OnActivate(); + EventBus.RaiseEvent(delegate (IUnitActiveEquipmentSetHandler h) + { + h.HandleUnitChangeActiveEquipmentSet(this.Owner); + }, true); + } + public override void OnDeactivate() + { + base.OnDeactivate(); + EventBus.RaiseEvent(delegate (IUnitActiveEquipmentSetHandler h) + { + h.HandleUnitChangeActiveEquipmentSet(this.Owner); + }, true); + } + */ } } diff --git a/ToggleableThrowingWeapons/Content/BaseWeapons.cs b/ToggleableThrowingWeapons/Content/BaseWeapons.cs index d548e54..75e7647 100644 --- a/ToggleableThrowingWeapons/Content/BaseWeapons.cs +++ b/ToggleableThrowingWeapons/Content/BaseWeapons.cs @@ -47,7 +47,9 @@ public static void MakeBaseWeapons() x.Multiplier = 1; }).Configure(); - var throwingStar = Helpers.CreateCopy(BlueprintTool.Get("Starknife"), x => + + var ogstarknife = BlueprintTool.Get("Starknife"); + var throwingStar = Helpers.CreateCopy(ogstarknife, x => { x.AssetGuid = ThrownStarknifeGuid; x.name = "ThrownStarknife"; @@ -58,10 +60,11 @@ public static void MakeBaseWeapons() { m_Projectiles = Dart.VisualParameters.Projectiles, m_WeaponAnimationStyle = Kingmaker.View.Animation.WeaponAnimationStyle.ThrownStraight, - m_WeaponModel = new Kingmaker.ResourceLinks.PrefabLink() { AssetId = "6edd1e90-2239-3ef4-98f1ccb0e606a6a6" }, - - m_WeaponBeltModelOverride = new Kingmaker.ResourceLinks.PrefabLink(), - m_WeaponSheathModelOverride = new Kingmaker.ResourceLinks.PrefabLink(), + m_WeaponModel = ogstarknife.m_VisualParameters.m_WeaponModel, + m_WeaponBeltModelOverride = ogstarknife.m_VisualParameters.m_WeaponBeltModelOverride, + m_WeaponSheathModelOverride = ogstarknife.m_VisualParameters.m_WeaponSheathModelOverride, + //m_WeaponBeltModelOverride = new Kingmaker.ResourceLinks.PrefabLink(), + // m_WeaponSheathModelOverride = new Kingmaker.ResourceLinks.PrefabLink(), m_OverrideAttachSlots = true, m_PossibleAttachSlots = new Kingmaker.View.Equipment.UnitEquipmentVisualSlotType[] { @@ -101,10 +104,10 @@ public static void MakeBaseWeapons() } Main.TTWContext.Logger.Log($"About To Add Strength (thrown) to starknife"); - + WeaponTypeConfigurator.For("5a939137fc039084580725b2b0845c3f").AddToEnchantments("c4d213911e9616949937e1520c80aaf3").Configure(); - + if (Main.TTWContext.Settings.Hotswapping.IsEnabled("EnableHotswapping")) { @@ -114,15 +117,15 @@ public static void MakeBaseWeapons() x.m_OtherForm = BlueprintTool.GetRef("ThrownStarknife"); }); - + } - + Main.TTWContext.Blueprints.GetDerivedMaster("ThrownStarknifeMasterId"); Main.TTWContext.Logger.LogPatch(thrownStarknifeConfig); - - var thrownDaggers = Helpers.CreateCopy(BlueprintTool.Get("Dagger"), x => + var ogdagger = BlueprintTool.Get("Dagger"); + var thrownDaggers = Helpers.CreateCopy(ogdagger, x => { x.name = "TTWThrownDagger"; x.AssetGuid = ThrownDaggerGuid; @@ -132,8 +135,9 @@ public static void MakeBaseWeapons() { m_Projectiles = Dart.VisualParameters.Projectiles, m_WeaponAnimationStyle = Kingmaker.View.Animation.WeaponAnimationStyle.ThrownStraight, - m_WeaponModel = new PrefabLink() { AssetId = "8a068458-1898-ee64-2aa771427d77f9ab" }, - m_WeaponSheathModelOverride = new PrefabLink() { AssetId = "544192df-823e-cd74-6a0fae1c1af7de16" }, + m_WeaponModel =ogdagger.m_VisualParameters.m_WeaponModel, + m_WeaponSheathModelOverride = ogdagger.m_VisualParameters.m_WeaponSheathModelOverride, + m_WeaponBeltModelOverride = ogdagger.m_VisualParameters.m_WeaponBeltModelOverride, m_SoundSize = Kingmaker.Visual.Sound.WeaponSoundSizeType.Small, m_SoundType = Kingmaker.Visual.Sound.WeaponSoundType.PierceMetal, m_WhooshSound = "KnifeWoosh", @@ -171,8 +175,8 @@ public static void MakeBaseWeapons() Main.TTWContext.Blueprints.GetDerivedMaster("DaggerMasterId"); Main.TTWContext.Blueprints.GetDerivedMaster("ThrownDaggerMasterId"); - - var thrownDLC2Daggers = Helpers.CreateCopy(BlueprintTool.Get("DLC2Dagger"), x => + var ogDLC2 = BlueprintTool.Get("DLC2Dagger"); + var thrownDLC2Daggers = Helpers.CreateCopy( ogDLC2, x => { x.name = "TTWThrownDLC2Dagger"; @@ -183,8 +187,9 @@ public static void MakeBaseWeapons() { m_Projectiles = Dart.VisualParameters.Projectiles, m_WeaponAnimationStyle = Kingmaker.View.Animation.WeaponAnimationStyle.ThrownStraight, - m_WeaponModel = new PrefabLink() { AssetId = "c859a560-b553-8854-f8913486e29efc07" }, - m_WeaponSheathModelOverride = new PrefabLink() { AssetId = "3c601278-3bba-9b54-592eb941bd30702e" }, + m_WeaponModel = ogDLC2.m_VisualParameters.m_WeaponModel, + m_WeaponSheathModelOverride = ogDLC2.m_VisualParameters.m_WeaponSheathModelOverride, + m_WeaponBeltModelOverride = ogDLC2.m_VisualParameters.m_WeaponBeltModelOverride, m_SoundSize = Kingmaker.Visual.Sound.WeaponSoundSizeType.Small, m_SoundType = Kingmaker.Visual.Sound.WeaponSoundType.PierceMetal, m_WhooshSound = "KnifeWoosh", diff --git a/ToggleableThrowingWeapons/Content/ModeSwitching.cs b/ToggleableThrowingWeapons/Content/ModeSwitching.cs index 7a4d529..27853d7 100644 --- a/ToggleableThrowingWeapons/Content/ModeSwitching.cs +++ b/ToggleableThrowingWeapons/Content/ModeSwitching.cs @@ -29,7 +29,7 @@ public static void CreateModeSwitchAbilities() var buffDesc = LocalizationTool.CreateString("ThrowWeaponsBuff.Desc", "Use Daggers And Starknives As Ranged Weapons"); var buffconfig = BuffConfigurator.For(buffBP).SetDisplayName(LocalizationTool.CreateString("ThrowWeaponsBuff.Name", "Throw Weapons")).SetDescription(buffDesc).SetDescriptionShort(buffDesc); - + buffconfig.AddComponent(); buffconfig.SetIcon(BlueprintTool.Get("Dagger").Icon); diff --git a/ToggleableThrowingWeapons/Info.json b/ToggleableThrowingWeapons/Info.json index 4445a4c..ff2dbc1 100644 --- a/ToggleableThrowingWeapons/Info.json +++ b/ToggleableThrowingWeapons/Info.json @@ -2,7 +2,7 @@ "Id": "ToggleableThrowingWeapons", "DisplayName": "Toggleable Throwing Weapons", "Author": "pheonix99", - "Version": "1.2.2", + "Version": "1.2.3", "ManagerVersion": "0.21.3", "AssemblyName": "ToggleableThrowingWeapons.dll", "EntryMethod": "ToggleableThrowingWeapons.Main.Load", diff --git a/ToggleableThrowingWeapons/ToggleableThrowingWeapons.csproj b/ToggleableThrowingWeapons/ToggleableThrowingWeapons.csproj index 8fd5730..dc495d7 100644 --- a/ToggleableThrowingWeapons/ToggleableThrowingWeapons.csproj +++ b/ToggleableThrowingWeapons/ToggleableThrowingWeapons.csproj @@ -88,6 +88,10 @@ ..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll + + False + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Pathfinder Second Adventure\Wrath_Data\Managed\Owlcat.Runtime.Core.dll + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Pathfinder Second Adventure\Wrath_Data\Managed\Owlcat.Runtime.Validation.dll @@ -111,8 +115,9 @@ False ..\..\TabletopTweaks-Core\TabletopTweaks-Core\bin\Debug\TabletopTweaks-Core.dll - - ..\lib\UnityEngine.CoreModule_public.dll + + False + ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Pathfinder Second Adventure\Wrath_Data\Managed\UnityEngine.CoreModule.dll ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Pathfinder Second Adventure\Wrath_Data\Managed\UnityEngine.ImageConversionModule.dll @@ -120,9 +125,6 @@ ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Pathfinder Second Adventure\Wrath_Data\Managed\UnityEngine.IMGUIModule.dll - - ..\lib\UnityEngine_public.dll - ..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\Pathfinder Second Adventure\Wrath_Data\Managed\UnityModManager\UnityModManager.dll diff --git a/readme.md b/readme.md index 9621b29..886ec96 100644 --- a/readme.md +++ b/readme.md @@ -17,6 +17,9 @@ Thanks to Truinto for the AddFactOnlyParty code. #Changelog + +1.2.3: Hopefully fixed graphical jank for the last time + 1.2.2: Fixed Rogue Finesse training working with thrown weapons. Turned out to be incredibly imba