Skip to content

Commit f5502e6

Browse files
committed
1.3.3
1 parent f404784 commit f5502e6

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

ClickerCompat.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal class ClickerCompat : ModSystem
2323

2424
//This is the version of the calls that are used for the mod.
2525
//If Clicker Class updates, it will keep working on the outdated calls, but new features might not be available
26-
internal static readonly Version apiVersion = new Version(1, 3, 2, 6);
26+
internal static readonly Version apiVersion = new Version(1, 3, 3);
2727

2828
internal static string versionString;
2929

@@ -128,10 +128,11 @@ internal static void RegisterClickerWeapon(ModItem modItem, string borderTexture
128128
/// <param name="amount">The amount of clicks required to trigger the effect</param>
129129
/// <param name="colorFunc">The (dynamic) text color representing the effect in the tooltip</param>
130130
/// <param name="action">The method that runs when the effect is triggered</param>
131+
/// <param name="preHardMode">If this effect primarily belongs to something available pre-hardmode</param>
131132
/// <returns>The unique identifier, null if an exception occured. READ THE LOGS!</returns>
132-
internal static string RegisterClickEffect(Mod mod, string internalName, string displayName, string description, int amount, Func<Color> colorFunc, Action<Player, EntitySource_ItemUse_WithAmmo, Vector2, int, int, float> action)
133+
internal static string RegisterClickEffect(Mod mod, string internalName, string displayName, string description, int amount, Func<Color> colorFunc, Action<Player, EntitySource_ItemUse_WithAmmo, Vector2, int, int, float> action, bool preHardMode = false)
133134
{
134-
return ClickerClass?.Call("RegisterClickEffect", versionString, mod, internalName, displayName, description, amount, colorFunc, action) as string;
135+
return ClickerClass?.Call("RegisterClickEffect", versionString, mod, internalName, displayName, description, amount, colorFunc, action, preHardMode) as string;
135136
}
136137

137138
/// <summary>
@@ -144,11 +145,12 @@ internal static string RegisterClickEffect(Mod mod, string internalName, string
144145
/// <param name="amount">The amount of clicks required to trigger the effect</param>
145146
/// <param name="color">The text color representing the effect in the tooltip</param>
146147
/// <param name="action">The method that runs when the effect is triggered</param>
148+
/// <param name="preHardMode">If this effect primarily belongs to something available pre-hardmode</param>
147149
/// <remarks>For dynamic colors, use the Func[Color] overload</remarks>
148150
/// <returns>The unique identifier, null if an exception occured. READ THE LOGS!</returns>
149-
internal static string RegisterClickEffect(Mod mod, string internalName, string displayName, string description, int amount, Color color, Action<Player, EntitySource_ItemUse_WithAmmo, Vector2, int, int, float> action)
151+
internal static string RegisterClickEffect(Mod mod, string internalName, string displayName, string description, int amount, Color color, Action<Player, EntitySource_ItemUse_WithAmmo, Vector2, int, int, float> action, bool preHardMode = false)
150152
{
151-
return RegisterClickEffect(mod, internalName, displayName, description, amount, () => color, action);
153+
return RegisterClickEffect(mod, internalName, displayName, description, amount, () => color, action, preHardMode);
152154
}
153155

154156
/// <summary>
@@ -180,6 +182,7 @@ internal static List<string> GetAllEffectNames()
180182
/// | "Amount": The amount of clicks to trigger the effect (int).
181183
/// | "ColorFunc": The color (Color) if invoked.
182184
/// | "Action": The method ran when triggered (Action[Player, EntitySource_ItemUse_WithAmmo, Vector2, int, int, float]).
185+
/// | "PreHardMode": Belongs to something available pre-hardmode (bool).
183186
/// </summary>
184187
/// <param name="effect">The unique effect name</param>
185188
/// <returns>Dictionary[string, object]</returns>

Items/Weapons/Clickers/ExampleClickerWithEffect.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ public override void SetStaticDefaults()
3737
{
3838
Projectile.NewProjectile(source, position + 20 * Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi), Vector2.Zero, ModContent.ProjectileType<MiniClicker>(), (int)(damage * 0.2f), 0f, Main.myPlayer);
3939
}
40-
});
40+
},
41+
preHardMode: true);
42+
//The last parameter flags it as available in pre-hardmode, useful for content referencing other effects
4143

4244
//We want to cache the result to make accessing it easier in other places.
4345
//(Make sure to unload the saved string again!)

build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
author = DivermanSam, Barometz and direwolf420
2-
version = 1.3.2.6
2+
version = 1.3.3
33
displayName = The Clicker Class Example Mod
44
homepage = https://github.com/SamsonAllen13/ClickerClassExampleMod
55
includePDB = true

0 commit comments

Comments
 (0)