From c89b1f7c088eb46d75b3bbf9c45bbf33251c2031 Mon Sep 17 00:00:00 2001 From: Jofairden Date: Thu, 15 Feb 2018 20:10:08 +0100 Subject: [PATCH] ModPrefix.Category now Getter only --- ExampleMod/Prefixes/AwesomePrefix.cs | 3 +++ patches/tModLoader/Terraria.ModLoader/ModPrefix.cs | 11 ++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ExampleMod/Prefixes/AwesomePrefix.cs b/ExampleMod/Prefixes/AwesomePrefix.cs index 309ba98c1d0..6cbca697239 100644 --- a/ExampleMod/Prefixes/AwesomePrefix.cs +++ b/ExampleMod/Prefixes/AwesomePrefix.cs @@ -8,6 +8,9 @@ public class AwesomePrefix : ModPrefix { private byte power = 0; + // change your category this way + public override PrefixCategory Category { get { return PrefixCategory.Custom; } } + public AwesomePrefix() { } diff --git a/patches/tModLoader/Terraria.ModLoader/ModPrefix.cs b/patches/tModLoader/Terraria.ModLoader/ModPrefix.cs index eda9d7a9d82..7940a59b532 100644 --- a/patches/tModLoader/Terraria.ModLoader/ModPrefix.cs +++ b/patches/tModLoader/Terraria.ModLoader/ModPrefix.cs @@ -86,11 +86,10 @@ public ModTranslation DisplayName internal set; } - public PrefixCategory Category - { - get; - set; - } + /// + /// The category your prefix belongs to, PrefixCategory.Custom by default + /// + public virtual PrefixCategory Category => PrefixCategory.Custom; public virtual bool Autoload(ref string name) { @@ -99,8 +98,6 @@ public virtual bool Autoload(ref string name) public virtual void AutoDefaults() { - Category = PrefixCategory.Custom; - if (DisplayName.IsDefault()) DisplayName.SetDefault(Regex.Replace(Name, "([A-Z])", " $1").Trim()); }