-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathModConfig.cs
106 lines (81 loc) · 2.27 KB
/
ModConfig.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
namespace AlchemistNPCLite
{
public class ModConfiguration : ModConfig
{
public override ConfigScope Mode => ConfigScope.ServerSide;
[DefaultValue(true)]
public bool AlchemistSpawn;
[DefaultValue(true)]
public bool BrewerSpawn;
[DefaultValue(true)]
public bool JewelerSpawn;
[DefaultValue(true)]
public bool YoungBrewerSpawn;
[DefaultValue(true)]
public bool ArchitectSpawn;
[DefaultValue(true)]
public bool OperatorSpawn;
[DefaultValue(true)]
public bool MusicianSpawn;
[DefaultValue(true)]
public bool TinkererSpawn;
[DefaultValue(true)]
public bool LifeformAnalyzer;
[DefaultValue(false)]
public bool LifeformAnalyzerAlt;
[Range(40, 4000)]
[DefaultValue(4000)]
public int LocatorRange;
//[Range(-4000, 4000)]
public HashSet<NPCDefinition> DisabledLocatorNpcs = new HashSet<NPCDefinition>();
[DefaultValue(true)]
public bool RevPrices;
[DefaultValue(true)]
public bool CatchNPC;
[DefaultValue(true)]
public bool ModItems;
[Range(1, 1000)]
[DefaultValue(1)]
public int PotsPriceMulti;
[Range(1, 1000000)]
[DefaultValue(1000)]
public int StarPrice;
[Range(1, 1000000)]
[DefaultValue(1000)]
public int RecallPrice;
[Range(1, 1000000)]
[DefaultValue(1000)]
public int WormholePrice;
[Range(1, 1000000)]
[DefaultValue(700)]
public int SiltSlushPrice;
[Range(1, 1000000)]
[DefaultValue(1000)]
public int DesertFossilPrice;
[Range(0, 100)]
[DefaultValue(10)]
public int ShopChangeDelay;
public override ModConfig Clone() {
var clone = (ModConfiguration)base.Clone();
return clone;
}
public override void OnLoaded() {
AlchemistNPCLite.modConfiguration = this;
}
public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref NetworkText message) {
if (!NetMessage.DoesPlayerSlotCountAsAHost(whoAmI)) {
message = NetworkText.FromKey("tModLoader.ModConfigRejectChangesNotHost"); // "Only the host can change this config"
return false;
}
message = NetworkText.FromKey("ModConfigAccepted");
return true;
}
}
}