Skip to content

Commit

Permalink
ModPrefix.Category now Getter only
Browse files Browse the repository at this point in the history
  • Loading branch information
Jofairden committed Feb 15, 2018
1 parent f5e05e9 commit c89b1f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ExampleMod/Prefixes/AwesomePrefix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
}
Expand Down
11 changes: 4 additions & 7 deletions patches/tModLoader/Terraria.ModLoader/ModPrefix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ public ModTranslation DisplayName
internal set;
}

public PrefixCategory Category
{
get;
set;
}
/// <summary>
/// The category your prefix belongs to, PrefixCategory.Custom by default
/// </summary>
public virtual PrefixCategory Category => PrefixCategory.Custom;

public virtual bool Autoload(ref string name)
{
Expand All @@ -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());
}
Expand Down

0 comments on commit c89b1f7

Please sign in to comment.