Skip to content

Commit

Permalink
Cheats: Fix override array reset
Browse files Browse the repository at this point in the history
  • Loading branch information
benediktwerner committed Dec 19, 2020
1 parent 2f0656e commit f587b45
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
Allow disabling skills and characters
- 1.2.1 Fix overrides not getting disabled when whole mod is disabled
- 1.2.2 Fix overrides messing up a lot of stuff
- 1.2.3 Fix overrides array reset

# BetterLevelEditor
- 1.0 Initial release
Expand Down
2 changes: 1 addition & 1 deletion ExtendedCheats/CharacterOverride.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void Draw(ref string charToShow)
if (!showChar) return;

GUILayout.BeginVertical("box");
SkillOverride.DrawIntArrayField("Max Health", "", maxHealth, maxHealthDefault);
SkillOverride.DrawIntArrayField("Max Health", "", ref maxHealth, maxHealthDefault);
foreach (var o in skillOverrides) o.Draw();
GUILayout.EndVertical();
}
Expand Down
4 changes: 3 additions & 1 deletion ExtendedCheats/Commands.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using BepInEx.Configuration;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using System.Collections;
using System.IO;
using System.Reflection;
using UnityEngine;

Expand Down
4 changes: 2 additions & 2 deletions ExtendedCheats/SkillOverride.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void Draw()
range = DrawFloatField(name, "Range", range, rangeDefault);
cooldown = DrawFloatField(name, "Cooldown", cooldown, cooldownDefault);
maxAmmo = DrawIntField(name, "Max Ammo", maxAmmo, maxAmmoDefault);
DrawIntArrayField(name, "Starting Ammo", startingAmmo, startingAmmoDefault);
DrawIntArrayField(name, "Starting Ammo", ref startingAmmo, startingAmmoDefault);
}

public void Reset()
Expand Down Expand Up @@ -118,7 +118,7 @@ public string ToJson(string indent)
return newVal;
}

internal static void DrawIntArrayField(string mainLabel, string subLabel, int[] value, int[] valueDefault)
internal static void DrawIntArrayField(string mainLabel, string subLabel, ref int[] value, int[] valueDefault)
{
if (valueDefault == null) return;
DrawFieldHeader(mainLabel, subLabel);
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ Alternatively, you can install the [BepInEx.ConfigurationManager](https://github
- **Convenience**: [Convenience.dll v1.0.2](https://github.com/benediktwerner/Desperados3Mods/releases/download/cheats-v1.2.0/Convenience.dll)
- **D1CooperGun**: [D1CooperGun.dll v1.0](https://github.com/benediktwerner/Desperados3Mods/releases/download/v1.0.0/D1CooperGun.dll)
- **DevKillsList**: [DevKillsList.dll v1.0.1](https://github.com/benediktwerner/Desperados3Mods/releases/download/cheats-v1.1.0/DevKillsList.dll)
- **ExtendedCheats**: [ExtendedCheats.dll v1.2.2](https://github.com/benediktwerner/Desperados3Mods/releases/download/cheats-v1.2.2/ExtendedCheats.dll)
- **ExtendedCheats**: [ExtendedCheats.dll v1.2.3](https://github.com/benediktwerner/Desperados3Mods/releases/download/cheats-v1.2.3/ExtendedCheats.dll)
- **KingsmanEasterEgg**: [KingsmanEasterEgg.dll v1.0](https://github.com/benediktwerner/Desperados3Mods/releases/download/v1.0.0/KingsmanEasterEgg.dll)
- **ShowdownModePauseOnDesperadoDiff**: [ShowdownModePauseOnDesperadoDiff.dll v1.0](https://github.com/benediktwerner/Desperados3Mods/releases/download/v1.0.0/ShowdownModePauseOnDesperadoDiff.dll)

0 comments on commit f587b45

Please sign in to comment.