From 54af3789ee26cd9948e4978749cc4dc3c4e70c06 Mon Sep 17 00:00:00 2001 From: catsmackaroo <85026722+catsmackaroo@users.noreply.github.com> Date: Fri, 6 Oct 2023 11:03:35 -0400 Subject: [PATCH] 1.2.1 Changes --- LibertyTweaks/GunMags/WeaponMagazines.cs | 138 +++++++++--------- .../HolsterWeapons/HolsterWeapons.cs | 11 +- .../IceCreamSpeech/IceCreamSpeechFix.cs | 2 +- LibertyTweaks/ImprovedAI/HigherPedAccuracy.cs | 9 -- LibertyTweaks/Main.cs | 10 +- .../MoveWithSniper/MoveWithSniper.cs | 13 +- LibertyTweaks/NoOvertaking/NoOvertaking.cs | 2 +- .../RemoveWeaponsOnDeath/RemoveWeapons.cs | 2 +- LibertyTweaks/TweakableFOV/TweakableFOV.cs | 2 +- LibertyTweaks/WheelFix/WheelFix.cs | 4 +- 10 files changed, 80 insertions(+), 113 deletions(-) diff --git a/LibertyTweaks/GunMags/WeaponMagazines.cs b/LibertyTweaks/GunMags/WeaponMagazines.cs index 2358abb..d27413b 100644 --- a/LibertyTweaks/GunMags/WeaponMagazines.cs +++ b/LibertyTweaks/GunMags/WeaponMagazines.cs @@ -22,7 +22,7 @@ internal class WeaponMagazines private static float currentReloadAnimTime; private static bool isAnyGunReloadingAnimPlaying; private static int magObj1, magObj2; - + public static void Init(SettingsFile settings) { enableFix = settings.GetBoolean("Main", "Gun Magazines", true); @@ -73,8 +73,8 @@ private static void ProcessHandgunReloading(CPed playerPed, int playerPedHandle, return; // Handgun / Deagle - bool isHandgunReloading = animController.IsPlaying("gun@handgun", isPlayerDucking ? "reload_crouch" : "reload"); - bool isDeagleReloading = animController.IsPlaying("gun@deagle", isPlayerDucking ? "reload_crouch" : "reload"); + bool isHandgunReloading = animController.IsPlaying("gun@handgun", isPlayerDucking ? "reload_crouch" : "reload"); + bool isDeagleReloading = animController.IsPlaying("gun@deagle", isPlayerDucking ? "reload_crouch" : "reload"); if (isHandgunReloading || isDeagleReloading) { @@ -185,8 +185,8 @@ private static void ProcessUziReloading(CPed playerPed, int playerPedHandle, Ped if (!enableFix) return; - bool isUziReloading = animController.IsPlaying("gun@uzi", isPlayerDucking ? "reload_crouch" : "reload"); - bool isMp5Reloading = animController.IsPlaying("gun@mp5k", isPlayerDucking ? "reload_crouch" : "p_load"); + bool isUziReloading = animController.IsPlaying("gun@uzi", isPlayerDucking ? "reload_crouch" : "reload"); + bool isMp5Reloading = animController.IsPlaying("gun@mp5k", isPlayerDucking ? "reload_crouch" : "p_load"); if (isUziReloading || isMp5Reloading) { @@ -292,8 +292,8 @@ private static void ProcessRifleReloading(CPed playerPed, int playerPedHandle, P if (!enableFix) return; - bool isRifleReloading = animController.IsPlaying("gun@rifle", isPlayerDucking ? "reload_crouch" : "p_load"); - bool isRifle2Reloading = animController.IsPlaying("gun@rifle", isPlayerDucking ? "reload_crouch" : "reload"); + bool isRifleReloading = animController.IsPlaying("gun@rifle", isPlayerDucking ? "reload_crouch" : "p_load"); + bool isRifle2Reloading = animController.IsPlaying("gun@rifle", isPlayerDucking ? "reload_crouch" : "reload"); if (isRifleReloading || isRifle2Reloading) { @@ -348,7 +348,7 @@ private static void ProcessRPGReloading(CPed playerPed, int playerPedHandle, Ped return; bool isRPGReloading = animController.IsPlaying("gun@rocket", isPlayerDucking ? "reload_crouch" : "reload"); - + if (isRPGReloading) { isAnyGunReloadingAnimPlaying = true; @@ -378,22 +378,20 @@ private static void ProcessRPGReloading(CPed playerPed, int playerPedHandle, Ped isAnyGunReloadingAnimPlaying = false; } } - - public static void LoadFiles() - { - if (!enableFix) - return; - CdStream.CdStreamAddImage("IVSDKDotNet/scripts/LibertyTweaks/WeaponMagazineFiles/mags.img", 1, -1); - CFileLoader.LoadLevel("IVSDKDotNet/scripts/LibertyTweaks/WeaponMagazineFiles/mags.dat", 0); - } + // Below was removed as results were inconsistent. IV Tweaker is required for now + //public static void LoadFiles() + //{ + // CdStream.CdStreamAddImage("IVSDKDotNet/scripts/LibertyTweaks/WeaponMagazineFiles/mags.img", 1, -1); + // CFileLoader.LoadLevel("IVSDKDotNet/scripts/LibertyTweaks/WeaponMagazineFiles/mags.dat", 0); + //} public static void Tick() { if (!enableFix) return; - // If amb_magazine is not in cdimage then return so game will not crash when we try to use this model (Does it even crash?) + // If amb_magazine is not in cdimage then return so game will not crash when we try to use this model if (!IS_MODEL_IN_CDIMAGE(GET_HASH_KEY("amb_magazine"))) return; @@ -403,12 +401,6 @@ public static void Tick() // Gets the handle of the player ped int playerPedHandle = playerPed.GetHandle(); - // Debug - //if (Helper.IsKeyPressedAsync(System.Windows.Forms.Keys.K)) - //NativeGame.TimeScale = 0.15f; - //if (Helper.IsKeyPressedAsync(System.Windows.Forms.Keys.L)) - //NativeGame.TimeScale = 1f; - // Gets the current weapon of the player GET_CURRENT_CHAR_WEAPON(playerPedHandle, out uint currentWeapon); @@ -488,56 +480,56 @@ public static void Tick() break; // TODO(Clonk): Do episode weapons later... - //case eWeaponType.WEAPON_EPISODIC_1: - // break; - //case eWeaponType.WEAPON_EPISODIC_2: - // break; - //case eWeaponType.WEAPON_EPISODIC_3: - // break; - //case eWeaponType.WEAPON_EPISODIC_4: - // break; - //case eWeaponType.WEAPON_EPISODIC_5: - // break; - //case eWeaponType.WEAPON_EPISODIC_6: - // break; - //case eWeaponType.WEAPON_EPISODIC_7: - // break; - //case eWeaponType.WEAPON_EPISODIC_8: - // break; - //case eWeaponType.WEAPON_EPISODIC_9: - // break; - //case eWeaponType.WEAPON_EPISODIC_10: - // break; - //case eWeaponType.WEAPON_EPISODIC_11: - // break; - //case eWeaponType.WEAPON_EPISODIC_12: - // break; - //case eWeaponType.WEAPON_EPISODIC_13: - // break; - //case eWeaponType.WEAPON_EPISODIC_14: - // break; - //case eWeaponType.WEAPON_EPISODIC_15: - // break; - //case eWeaponType.WEAPON_EPISODIC_16: - // break; - //case eWeaponType.WEAPON_EPISODIC_17: - // break; - //case eWeaponType.WEAPON_EPISODIC_18: - // break; - //case eWeaponType.WEAPON_EPISODIC_19: - // break; - //case eWeaponType.WEAPON_EPISODIC_20: - // break; - //case eWeaponType.WEAPON_EPISODIC_21: - // break; - //case eWeaponType.WEAPON_EPISODIC_22: - // break; - //case eWeaponType.WEAPON_EPISODIC_23: - // break; - //case eWeaponType.WEAPON_EPISODIC_24: - // break; + //case eWeaponType.WEAPON_EPISODIC_1: + // break; + //case eWeaponType.WEAPON_EPISODIC_2: + // break; + //case eWeaponType.WEAPON_EPISODIC_3: + // break; + //case eWeaponType.WEAPON_EPISODIC_4: + // break; + //case eWeaponType.WEAPON_EPISODIC_5: + // break; + //case eWeaponType.WEAPON_EPISODIC_6: + // break; + //case eWeaponType.WEAPON_EPISODIC_7: + // break; + //case eWeaponType.WEAPON_EPISODIC_8: + // break; + //case eWeaponType.WEAPON_EPISODIC_9: + // break; + //case eWeaponType.WEAPON_EPISODIC_10: + // break; + //case eWeaponType.WEAPON_EPISODIC_11: + // break; + //case eWeaponType.WEAPON_EPISODIC_12: + // break; + //case eWeaponType.WEAPON_EPISODIC_13: + // break; + //case eWeaponType.WEAPON_EPISODIC_14: + // break; + //case eWeaponType.WEAPON_EPISODIC_15: + // break; + //case eWeaponType.WEAPON_EPISODIC_16: + // break; + //case eWeaponType.WEAPON_EPISODIC_17: + // break; + //case eWeaponType.WEAPON_EPISODIC_18: + // break; + //case eWeaponType.WEAPON_EPISODIC_19: + // break; + //case eWeaponType.WEAPON_EPISODIC_20: + // break; + //case eWeaponType.WEAPON_EPISODIC_21: + // break; + //case eWeaponType.WEAPON_EPISODIC_22: + // break; + //case eWeaponType.WEAPON_EPISODIC_23: + // break; + //case eWeaponType.WEAPON_EPISODIC_24: + // break; } } - + } -} +} \ No newline at end of file diff --git a/LibertyTweaks/HolsterWeapons/HolsterWeapons.cs b/LibertyTweaks/HolsterWeapons/HolsterWeapons.cs index 6280834..4f3d72f 100644 --- a/LibertyTweaks/HolsterWeapons/HolsterWeapons.cs +++ b/LibertyTweaks/HolsterWeapons/HolsterWeapons.cs @@ -41,16 +41,7 @@ public static void Process() GIVE_DELAYED_WEAPON_TO_CHAR(playerId, 0, 1, true); } else - { - // This if statement is for MoveWithSniper compatibility - // Need to use GET_CHAR_WEAPON_IN_SLOT or smth - //if (lastWeaponSlot == 16) - //{ - // GET_CHAR_WEAPON_IN_SLOT(playerId, 6, out uint pSniper, out uint temp1, out uint temp2); - // SET_CURRENT_CHAR_WEAPON(playerId, pSniper, true); - // CGame.ShowSubtitleMessage(pSniper.ToString()); - // //GIVE_DELAYED_WEAPON_TO_CHAR(playerId, 16, 1, true); - //} + { GIVE_DELAYED_WEAPON_TO_CHAR(playerId, (int)lastWeapon, 1, true); } } diff --git a/LibertyTweaks/IceCreamSpeech/IceCreamSpeechFix.cs b/LibertyTweaks/IceCreamSpeech/IceCreamSpeechFix.cs index 5d3e92c..e003096 100644 --- a/LibertyTweaks/IceCreamSpeech/IceCreamSpeechFix.cs +++ b/LibertyTweaks/IceCreamSpeech/IceCreamSpeechFix.cs @@ -6,7 +6,7 @@ // Credits: ClonkAndre -namespace LibertyTweaks.IceCreamSpeech +namespace LibertyTweaks { internal class IceCreamSpeechFix { diff --git a/LibertyTweaks/ImprovedAI/HigherPedAccuracy.cs b/LibertyTweaks/ImprovedAI/HigherPedAccuracy.cs index 1caadab..4f4c0c2 100644 --- a/LibertyTweaks/ImprovedAI/HigherPedAccuracy.cs +++ b/LibertyTweaks/ImprovedAI/HigherPedAccuracy.cs @@ -24,7 +24,6 @@ public static void Tick(int pedAccuracy, int pedFirerate) if (!enableFix) return; - //GET_CURRENT_BASIC_COP_MODEL(out uint copModel); // Grab all peds CPool pedPool = CPools.GetPedPool(); @@ -35,16 +34,8 @@ public static void Tick(int pedAccuracy, int pedFirerate) { int pedHandle = (int)pedPool.GetIndex(ptr); - //GET_CHAR_MODEL(pedHandle, out uint pedModel); - SET_CHAR_ACCURACY(pedHandle, (uint)pedAccuracy); SET_CHAR_SHOOT_RATE(pedHandle, pedFirerate); - - //if (pedModel == copModel) - //{ - // SET_CHAR_ACCURACY(pedHandle, (uint)Main.GenerateRandomNumber(80, 100)); - // SET_CHAR_SHOOT_RATE(pedHandle, Main.GenerateRandomNumber(95, 100)); - //} } } } diff --git a/LibertyTweaks/Main.cs b/LibertyTweaks/Main.cs index 426390d..6418aae 100644 --- a/LibertyTweaks/Main.cs +++ b/LibertyTweaks/Main.cs @@ -77,11 +77,11 @@ private void Main_Initialized(object sender, EventArgs e) WheelFix.Init(Settings); // HOTKEYS & CONFIG - quickSaveKey = Settings.GetKey("HOTKEYS", "Quick Save Key", Keys.F9); - holsterKey = Settings.GetKey("HOTKEYS", "Holster Key", Keys.H); - fovMulti = Settings.GetFloat("SETTINGS", "Field of View Modifier", 1.07f); - pedAccuracy = Settings.GetInteger("SETTINGS", "Ped Accuracy", 85); - pedFirerate = Settings.GetInteger("SETTINGS", "Ped Firerate", 85); + quickSaveKey = Settings.GetKey("Hotkeys", "Quick Save Key", Keys.F9); + holsterKey = Settings.GetKey("Hotkeys", "Holster Key", Keys.H); + fovMulti = Settings.GetFloat("Settings", "Field of View Modifier", 1.07f); + pedAccuracy = Settings.GetInteger("Settings", "Ped Accuracy", 85); + pedFirerate = Settings.GetInteger("Settings", "Ped Firerate", 85); } diff --git a/LibertyTweaks/MoveWithSniper/MoveWithSniper.cs b/LibertyTweaks/MoveWithSniper/MoveWithSniper.cs index f484654..ed8da47 100644 --- a/LibertyTweaks/MoveWithSniper/MoveWithSniper.cs +++ b/LibertyTweaks/MoveWithSniper/MoveWithSniper.cs @@ -1,18 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; - -using CCL.GTAIV; +using CCL.GTAIV; using IVSDKDotNet; using static IVSDKDotNet.Native.Natives; // Credits: catsmackaroo -namespace LibertyTweaks.MoveWithSniper +namespace LibertyTweaks { internal class MoveWithSniper { @@ -40,7 +33,7 @@ public static void Tick() { if (NativeControls.IsGameKeyPressed(0, GameKey.Aim)) { - CWeaponInfo.GetWeaponInfo(currentWeapon).Slot = 15; + CWeaponInfo.GetWeaponInfo(currentWeapon).Slot = 16; } else if (!NativeControls.IsGameKeyPressed(0, GameKey.Aim)) { diff --git a/LibertyTweaks/NoOvertaking/NoOvertaking.cs b/LibertyTweaks/NoOvertaking/NoOvertaking.cs index 8bdc6ad..9c05657 100644 --- a/LibertyTweaks/NoOvertaking/NoOvertaking.cs +++ b/LibertyTweaks/NoOvertaking/NoOvertaking.cs @@ -5,7 +5,7 @@ // Credits: AssaultKifle47, catsmackaroo & ClonkAndre -namespace LibertyTweaks.NoOvertaking +namespace LibertyTweaks { internal class NoOvertaking { diff --git a/LibertyTweaks/RemoveWeaponsOnDeath/RemoveWeapons.cs b/LibertyTweaks/RemoveWeaponsOnDeath/RemoveWeapons.cs index 4649bac..7d024d8 100644 --- a/LibertyTweaks/RemoveWeaponsOnDeath/RemoveWeapons.cs +++ b/LibertyTweaks/RemoveWeaponsOnDeath/RemoveWeapons.cs @@ -5,7 +5,7 @@ // Credits: ClonkAndre -namespace LibertyTweaks.RemoveWeapons +namespace LibertyTweaks { internal class RemoveWeapons { diff --git a/LibertyTweaks/TweakableFOV/TweakableFOV.cs b/LibertyTweaks/TweakableFOV/TweakableFOV.cs index e6b2acc..4136d8f 100644 --- a/LibertyTweaks/TweakableFOV/TweakableFOV.cs +++ b/LibertyTweaks/TweakableFOV/TweakableFOV.cs @@ -12,7 +12,7 @@ // Credits: catsmackaroo, ClonkAndre -namespace LibertyTweaks.TweakableFOV +namespace LibertyTweaks { internal class TweakableFOV { diff --git a/LibertyTweaks/WheelFix/WheelFix.cs b/LibertyTweaks/WheelFix/WheelFix.cs index eb00e86..ce2fc7b 100644 --- a/LibertyTweaks/WheelFix/WheelFix.cs +++ b/LibertyTweaks/WheelFix/WheelFix.cs @@ -5,7 +5,7 @@ // Credits: ClonkAndre -namespace LibertyTweaks.WheelFix +namespace LibertyTweaks { internal class WheelFix { @@ -17,7 +17,7 @@ internal class WheelFix public static void Init(SettingsFile settings) { - enableFix = settings.GetBoolean("Main", "Wheel Fix", true); + enableFix = settings.GetBoolean("Fixes", "Wheel Fix", true); } public static void PreChecks()