forked from VVV101/AlchemistNPC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModConfig.cs
182 lines (153 loc) · 5.56 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using Terraria;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;
using Terraria.ModLoader.Config;
using Terraria.ModLoader.Config.UI;
using Terraria.UI;
using Terraria.Localization;
namespace AlchemistNPC
{
public class ModConfiguration : ModConfig
{
public override ConfigScope Mode => ConfigScope.ServerSide;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.AlchemistSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.AlchemistSpawntoggleTooltip")]
public bool AlchemistSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.BrewerSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.BrewerSpawntoggleTooltip")]
public bool BrewerSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.JewelerSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.JewelerSpawntoggleTooltip")]
public bool JewelerSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.YoungBrewerSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.YoungBrewerSpawntoggleTooltip")]
public bool YoungBrewerSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.TinkererSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.TinkererSpawntoggleTooltip")]
public bool TinkererSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.ArchitectSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.ArchitectSpawntoggleTooltip")]
public bool ArchitectSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.OperatorSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.OperatorSpawntoggleTooltip")]
public bool OperatorSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.MusicianSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.MusicianSpawntoggleTooltip")]
public bool MusicianSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.ExplorerSpawntoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.ExplorerSpawntoggleTooltip")]
public bool ExplorerSpawn;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.TreasureBagsShopstoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.TreasureBagsShopstoggleTooltip")]
public bool TS;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.TornNotesdroptoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.TornNotesdroptoggleTooltip")]
public bool TornNotesDrop;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.ReversityCoinsdroptoggle")]
[Tooltip("$Mods.AlchemistNPC.Common.ReversityCoinsdroptoggleTooltip")]
public bool CoinsDrop;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.AlchemistNPCLite")]
[Tooltip("$Mods.AlchemistNPC.Common.AlchemistNPCLiteTooltip")]
public bool StartMessage;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.LifeformAnalyzer")]
[Tooltip("$Mods.AlchemistNPC.Common.LifeformAnalyzerTooltip")]
public bool LifeformAnalyzer;
[Range(40, 4000)]
[DefaultValue(4000)]
[Label("$Mods.AlchemistNPC.Common.LocatorRange")]
[Tooltip("$Mods.AlchemistNPC.Common.LocatorRangeTooltip")]
public int LocatorRange;
[Label("$Mods.AlchemistNPC.Common.DisabledLocatorNpcs")]
[Tooltip("$Mods.AlchemistNPC.Common.DisabledLocatorNpcsTooltip")]
public HashSet<NPCDefinition> DisabledLocatorNpcs = new HashSet<NPCDefinition>();
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.Revengeancemode")]
[Tooltip("$Mods.AlchemistNPC.Common.RevengeancemodeTooltip")]
public bool RevPrices;
[DefaultValue(true)]
[Label("$Mods.AlchemistNPC.Common.CatcheableNPCToggle")]
[Tooltip("$Mods.AlchemistNPC.Common.CatcheableNPCToggleTooltip")]
public bool CatchNPC;
[Range(1, 1000)]
[DefaultValue(1)]
[Label("$Mods.AlchemistNPC.Common.Potionspricemultiplier")]
[Tooltip("$Mods.AlchemistNPC.Common.PotionspricemultiplierTooltip")]
public int PotsPriceMulti;
[Range(1, 1000000)]
[DefaultValue(1000)]
[Label("$Mods.AlchemistNPC.Common.FallenStarsPrice")]
[Tooltip("$Mods.AlchemistNPC.Common.FallenStarsPriceTooltip")]
public int StarPrice;
[Range(1, 1000000)]
[DefaultValue(1000)]
[Label("$Mods.AlchemistNPC.Common.RecallPrice")]
[Tooltip("$Mods.AlchemistNPC.Common.RecallPriceTooltip")]
public int RecallPrice;
[Range(1, 1000000)]
[DefaultValue(1000)]
[Label("$Mods.AlchemistNPC.Common.WormholePrice")]
[Tooltip("$Mods.AlchemistNPC.Common.WormholePriceTooltip")]
public int WormholePrice;
[Range(0, 100)]
[DefaultValue(10)]
[Label("$Mods.AlchemistNPC.Common.ShopChangeDelay")]
[Tooltip("$Mods.AlchemistNPC.Common.ShopChangeDelayTooltip")]
public int ShopChangeDelay;
public override ModConfig Clone() {
var clone = (ModConfiguration)base.Clone();
return clone;
}
public override void OnLoaded() {
AlchemistNPC.modConfiguration = this;
}
public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, ref string messageline) {
string message = "";
string messagech = "";
if(Language.ActiveCulture == GameCulture.Chinese)
{
messageline = messagech;
}
else
{
messageline = message;
}
if (whoAmI == 0) {
message = "Changes accepted!";
messagech = "设置改动成功!";
return true;
}
if (whoAmI != 0)
{
message = "You have no rights to change config.";
messagech = "你没有设置改动权限.";
return false;
}
return false;
}
}
}