-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenderProfiles.cs
51 lines (39 loc) · 1.8 KB
/
GenderProfiles.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.GameContent;
using Terraria.ModLoader;
namespace GenderVariety
{
public class GenderProfile : ITownNPCProfile
{
public int RollVariation() => 0;
public string GetNameForVariant(NPC npc) => npc.getNewNPCName();
public int GetHeadTextureIndex(NPC npc) => GenderVariety.townNPCList.GetNPCInfo(npc.type).headIndex;
public Asset<Texture2D> GetTextureNPCShouldUse(NPC npc) {
TownNPCInfo info = GenderVariety.townNPCList.GetNPCInfo(npc.type);
if (GenderVariety.townNPCList.IsAltGender(npc.type)) {
if (npc.IsABestiaryIconDummy && !npc.ForcePartyHatOn)
return ModContent.Request<Texture2D>(info.defaultPath_Alt);
if (npc.altTexture == 1 && !string.IsNullOrEmpty(info.partyPath_Alt))
return ModContent.Request<Texture2D>(info.partyPath_Alt);
if (npc.altTexture == 2 && !string.IsNullOrEmpty(info.transformedPath_Alt))
return ModContent.Request<Texture2D>(info.transformedPath_Alt);
if (npc.altTexture == 3 && !string.IsNullOrEmpty(info.creditsPath_Alt))
return ModContent.Request<Texture2D>(info.creditsPath_Alt);
return ModContent.Request<Texture2D>(info.defaultPath_Alt);
}
else {
if (npc.IsABestiaryIconDummy && !npc.ForcePartyHatOn)
return Main.Assets.Request<Texture2D>(info.defaultPath);
if (npc.altTexture == 1 && !string.IsNullOrEmpty(info.partyPath))
return Main.Assets.Request<Texture2D>(info.partyPath);
if (npc.altTexture == 2 && !string.IsNullOrEmpty(info.transformedPath))
return Main.Assets.Request<Texture2D>(info.transformedPath);
if (npc.altTexture == 3 && !string.IsNullOrEmpty(info.creditsPath))
return Main.Assets.Request<Texture2D>(info.creditsPath);
return Main.Assets.Request<Texture2D>(info.defaultPath);
}
}
}
}