Skip to content

Commit dcf534d

Browse files
renamed some configs
1 parent ea56606 commit dcf534d

21 files changed

+134
-407
lines changed

BossChecklist.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ internal class BossChecklist : Mod {
2121

2222
public static Dictionary<int, int> itemToMusicReference;
2323

24-
internal static ClientConfiguration ClientConfig;
2524
internal static BossLogConfiguration BossLogConfig;
25+
internal static FeatureConfiguration FeatureConfig;
2626
public static List<PersonalRecords>[] ServerCollectedRecords;
2727

2828
public BossChecklist() {
@@ -64,7 +64,7 @@ public override void Unload() {
6464
bossTracker = null;
6565
ToggleBossLog = null;
6666
ServerCollectedRecords = null;
67-
ClientConfig = null;
67+
FeatureConfig = null;
6868
BossLogConfig = null;
6969
}
7070

BossRadarUI.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,13 @@ private bool SetDrawPos() {
164164
//Update
165165
public override void Update(GameTime gameTime) {
166166
base.Update(gameTime);
167-
if (!BossChecklist.ClientConfig.BossRadarBool) return;
167+
if (!BossChecklist.FeatureConfig.EnableBossRadar) return;
168168

169169
if (!whitelistFilled || blacklistChanged) {
170170
List<int> idList = new List<int>();
171171
foreach (EntryInfo entry in BossChecklist.bossTracker.SortedEntries) {
172172
if (entry.type == EntryType.Event) continue;
173-
if (entry.type == EntryType.MiniBoss && !BossChecklist.ClientConfig.RadarMiniBosses) continue;
173+
if (entry.type == EntryType.MiniBoss && !BossChecklist.FeatureConfig.RadarMiniBosses) continue;
174174
foreach (int id in entry.npcIDs) {
175175
if (!BlackListedID(id) && GetBossHead(id) != TextureAssets.NpcHead[0]) idList.Add(id);
176176
}
@@ -187,14 +187,14 @@ public override void Update(GameTime gameTime) {
187187
private Asset<Texture2D> GetBossHead(int boss) => NPCID.Sets.BossHeadTextures[boss] != -1 ? TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[boss]] : TextureAssets.NpcHead[0];
188188

189189
private bool BlackListedID(int ID) {
190-
return BossChecklist.ClientConfig.RadarBlacklist.Any(npcDef => npcDef.Type == ID);
190+
return BossChecklist.FeatureConfig.RadarBlacklist.Any(npcDef => npcDef.Type == ID);
191191
}
192192

193193
//Draw
194194
protected override void DrawSelf(SpriteBatch spriteBatch) {
195195
base.DrawSelf(spriteBatch);
196196

197-
if (!BossChecklist.ClientConfig.BossRadarBool) return;
197+
if (!BossChecklist.FeatureConfig.EnableBossRadar) return;
198198

199199
for (int i = 0; i < type.Count; i++) {
200200
Vector2 ldrawPos = drawPos[i]; //contains top left corner of draw pos
@@ -221,13 +221,13 @@ protected override void DrawSelf(SpriteBatch spriteBatch) {
221221
Rectangle outputRect = new Rectangle((int)ldrawPos.X - (finalWidth / 2), (int)ldrawPos.Y - (finalHeight / 2), finalWidth, finalHeight);
222222

223223
Color color = Color.LightGray;
224-
color *= drawLOS[i] ? BossChecklist.ClientConfig.OpacityFloat : BossChecklist.ClientConfig.OpacityFloat - 0.25f;
224+
color *= drawLOS[i] ? BossChecklist.FeatureConfig.RadarOpacity : BossChecklist.FeatureConfig.RadarOpacity - 0.25f;
225225
spriteBatch.Draw(tex.Value, outputRect, new Rectangle(0, 0, tempWidth, tempHeight), color);
226226

227227
//draw Arrow
228228
Vector2 stupidOffset = drawRotation[i].ToRotationVector2() * 24f;
229229
Vector2 drawPosArrow = ldrawPos + stupidOffset;
230-
color = drawLOS[i] ? Color.Green * BossChecklist.ClientConfig.OpacityFloat : Color.Red * BossChecklist.ClientConfig.OpacityFloat;
230+
color = drawLOS[i] ? Color.Green * BossChecklist.FeatureConfig.RadarOpacity : Color.Red * BossChecklist.FeatureConfig.RadarOpacity;
231231
color.A = 150;
232232
spriteBatch.Draw(arrowTexture.Value, drawPosArrow, null, color, drawRotation[i], arrowTexture.Value.Bounds.Size() / 2, 1f, SpriteEffects.None, 0f);
233233
}

BossUISystem.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public override void ModifyInterfaceLayers(List<GameInterfaceLayer> layers) {
156156
if (Main.netMode != NetmodeID.SinglePlayer)
157157
return true;
158158

159-
if (BossChecklist.bossTracker.FindEntryByNPC(BossChecklist.ClientConfig.DisplayRecordTracking.Type, out int recordIndex) is not EntryInfo entry)
159+
if (BossChecklist.bossTracker.FindEntryByNPC(BossChecklist.FeatureConfig.DisplayRecordTracking.Type, out int recordIndex) is not EntryInfo entry)
160160
return true;
161161

162162
PlayerAssist modplayer = Main.LocalPlayer.GetModPlayer<PlayerAssist>();

Configs.cs

+8-18
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,9 @@ public override bool AcceptClientChanges(ModConfig pendingConfig, int whoAmI, re
234234
}
235235
}
236236

237-
public class ClientConfiguration : ModConfig {
237+
public class FeatureConfiguration : ModConfig {
238238
public override ConfigScope Mode => ConfigScope.ClientSide;
239-
public override void OnLoaded() => BossChecklist.ClientConfig = this;
239+
public override void OnLoaded() => BossChecklist.FeatureConfig = this;
240240

241241
private bool TrackingEnabled;
242242
private bool NewRecordsEnabled;
@@ -311,45 +311,35 @@ public bool AllowNewRecords {
311311
[Header("ItemMapDetection")]
312312

313313
[DefaultValue(true)]
314-
[LabelKey("$Mods.BossChecklist.Configs.ClientConfiguration.TreasureBags.Label")]
315-
[TooltipKey("$Mods.BossChecklist.Configs.ClientConfiguration.TreasureBags.Tooltip")]
316-
public bool TreasureBagsBool { get; set; }
314+
public bool TreasureBagsOnMap { get; set; }
317315

318316
[DefaultValue(true)]
319-
[LabelKey("$Mods.BossChecklist.Configs.ClientConfiguration.Fragments.Label")]
320-
[TooltipKey("$Mods.BossChecklist.Configs.ClientConfiguration.Fragments.Tooltip")]
321-
public bool FragmentsBool { get; set; }
317+
public bool FragmentsOnMap { get; set; }
322318

323319
[DefaultValue(false)]
324-
[LabelKey("$Mods.BossChecklist.Configs.ClientConfiguration.Scales.Label")]
325-
[TooltipKey("$Mods.BossChecklist.Configs.ClientConfiguration.Scales.Tooltip")]
326-
public bool ScalesBool { get; set; }
320+
public bool ScalesOnMap { get; set; }
327321

328322
[Header("BossRadar")]
329323

330324
[DefaultValue(true)]
331-
[LabelKey("$Mods.BossChecklist.Configs.ClientConfiguration.BossRadar.Label")]
332-
[TooltipKey("$Mods.BossChecklist.Configs.ClientConfiguration.BossRadar.Tooltip")]
333-
public bool BossRadarBool { get; set; }
325+
public bool EnableBossRadar { get; set; }
334326

335327
[DefaultValue(false)]
336328
public bool RadarMiniBosses { get; set; }
337329

338330
public const float OpacityFloatMin = 0.35f;
339331
public const float OpacityFloatMax = 0.85f;
340-
[LabelKey("$Mods.BossChecklist.Configs.ClientConfiguration.RadarOpacity.Label")]
341-
[TooltipKey("$Mods.BossChecklist.Configs.ClientConfiguration.RadarOpacity.Tooltip")]
342332
[Range(OpacityFloatMin, OpacityFloatMax)]
343333
[DefaultValue(0.75f)]
344-
public float OpacityFloat { get; set; }
334+
public float RadarOpacity { get; set; }
345335

346336
public List<NPCDefinition> RadarBlacklist { get; set; } = new List<NPCDefinition>();
347337

348338
[OnDeserialized]
349339
internal void OnDeserializedMethod(StreamingContext context) {
350340
//Range attribute doesn't enforce it onto the value, it's a limit for the UI only, so we have to clamp it here again if user decides to edit it through the json
351341
//If this isn't in here, OpacityFloat can get negative for example, which will lead to a crash later
352-
OpacityFloat = Utils.Clamp(OpacityFloat, OpacityFloatMin, OpacityFloatMax);
342+
RadarOpacity = Utils.Clamp(RadarOpacity, OpacityFloatMin, OpacityFloatMax);
353343
}
354344

355345
public override void OnChanged() {

EntryInfo.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ internal bool IsRecordIndexed(out int recordIndex) {
136136
/// <returns>A LocalizedText of the despawn message of the passed npc. Returns null if no message can be found.</returns>
137137
internal LocalizedText GetDespawnMessage(NPC npc) {
138138
// When unique despawn messages are enabled, pass the NPC for the custom message function provided by the entry
139-
if (BossChecklist.ClientConfig.DespawnMessageType == "Unique" && customDespawnMessages(npc) is LocalizedText message)
139+
if (BossChecklist.FeatureConfig.DespawnMessageType == "Unique" && customDespawnMessages(npc) is LocalizedText message)
140140
return message; // this will only return a unique message if the custom message function properly assigns one
141141

142142
// If the Unique message was empty/null or the player is using Generic despawn messages, try to find an appropriate despawn message to send
143143
// Return a generic despawn message if any player is left alive or return a boss victory despawn message if all player's were killed
144-
if (BossChecklist.ClientConfig.DespawnMessageType != "Disabled")
144+
if (BossChecklist.FeatureConfig.DespawnMessageType != "Disabled")
145145
return Language.GetText(Main.player.Any(plr => plr.active && !plr.dead) ? $"{NPCAssist.LangChat}.Despawn.Generic" : $"{NPCAssist.LangChat}.Loss.Generic");
146146

147147
return null; // The despawn message feature was disabled. Return an empty message.
@@ -152,10 +152,10 @@ internal LocalizedText GetDespawnMessage(NPC npc) {
152152
/// These messages will not appear if the related configs are disabled.
153153
/// </summary>
154154
internal LocalizedText GetLimbMessage(NPC npc) {
155-
if (BossChecklist.ClientConfig.LimbMessages == "Unique" && npcLimbs[npc.type] is LocalizedText message)
155+
if (BossChecklist.FeatureConfig.LimbMessages == "Unique" && npcLimbs[npc.type] is LocalizedText message)
156156
return message;
157157

158-
if (BossChecklist.ClientConfig.LimbMessages != "Disabled") {
158+
if (BossChecklist.FeatureConfig.LimbMessages != "Disabled") {
159159
string specialCase = (npc.type == NPCID.SkeletronHand || npc.type == NPCID.MoonLordHead) ? new NPCDefinition(npc.type).Name : "";
160160
return Language.GetText($"{NPCAssist.LangChat}.Defeated.Generic" + specialCase);
161161
}

Localization/TranslationsNeeded.txt

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
en-US, 311/311, 100%, missing 0
2-
de-DE, 0/311, 0%, missing 311
3-
it-IT, 0/311, 0%, missing 311
4-
fr-FR, 0/311, 0%, missing 311
5-
es-ES, 82/311, 26%, missing 229
6-
ru-RU, 269/311, 86%, missing 42
7-
zh-Hans, 308/311, 99%, missing 3
8-
pt-BR, 61/311, 20%, missing 250
9-
pl-PL, 0/311, 0%, missing 311
1+
en-US, 302/302, 100%, missing 0
2+
de-DE, 0/302, 0%, missing 302
3+
it-IT, 0/302, 0%, missing 302
4+
fr-FR, 0/302, 0%, missing 302
5+
es-ES, 80/302, 26%, missing 222
6+
ru-RU, 260/302, 86%, missing 42
7+
zh-Hans, 299/302, 99%, missing 3
8+
pt-BR, 61/302, 20%, missing 241
9+
pl-PL, 0/302, 0%, missing 302

Localization/de-DE.hjson

+10-39
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ Mods: {
316316
}
317317

318318
Configs: {
319+
Common: {
320+
// InvalidChange: You cannot change this config while {0} is active!
321+
// HostChange: Only the host is allowed to change this config.
322+
}
323+
319324
BossLogConfiguration: {
320325
// DisplayName: Boss Log Customization
321326

@@ -531,7 +536,7 @@ Mods: {
531536
}
532537
}
533538

534-
ClientConfiguration: {
539+
FeatureConfiguration: {
535540
// DisplayName: Other features
536541

537542
Headers: {
@@ -609,22 +614,22 @@ Mods: {
609614
// Tooltip: If enabled, the last 3 seconds of your respawn time will have sound indicators.
610615
}
611616

612-
TreasureBags: {
617+
TreasureBagsOnMap: {
613618
// Label: Treasure bags display on the map
614619
// Tooltip: ""
615620
}
616621

617-
Fragments: {
622+
FragmentsOnMap: {
618623
// Label: Fragments display on the map
619624
// Tooltip: ""
620625
}
621626

622-
Scales: {
627+
ScalesOnMap: {
623628
// Label: Shadow Scales and Tissue Samples display on the map
624629
// Tooltip: ""
625630
}
626631

627-
BossRadar: {
632+
EnableBossRadar: {
628633
// Label: Enable Boss Radar
629634
// Tooltip: ""
630635
}
@@ -644,40 +649,6 @@ Mods: {
644649
// Tooltip: The selected NPCs will not be tracked by the radar.
645650
}
646651
}
647-
648-
DebugConfiguration: {
649-
// DisplayName: Debug Interface
650-
651-
Headers: {
652-
// Debug: "[i:3625] [c/ffeb6e:Mod Developer Tools]"
653-
// DebugRecordTracker: "[i:3619] [c/ffeb6e:Record Tracker Debug Tools]"
654-
// DebugResetData: "[i:575] [c/ffeb6e:Reset Data Options]"
655-
// FeatureTesting: "[i:2172] [c/ffeb6e:Feature Testing]"
656-
}
657-
658-
RecordFeatureTesting: {
659-
// Label: Disable 'Boss Record' feature testing
660-
/* Tooltip:
661-
'''
662-
Prevents Boss Records code from running, effectively disabling it while its in feature testing.
663-
This feature will need testing and bug reports before its taken out of feature testing and fully enabled across all users.
664-
''' */
665-
}
666-
667-
WorldRecordFeatureTesting: {
668-
// Label: Disable 'World Record' feature testing
669-
/* Tooltip:
670-
'''
671-
Prevents World Records code from running, effectively disabling it while its in feature testing.
672-
As of now this feature is known to not work and may cause issues.
673-
''' */
674-
}
675-
}
676-
677-
Common: {
678-
// InvalidChange: You cannot change this config while {0} is active!
679-
// HostChange: Only the host is allowed to change this config.
680-
}
681652
}
682653
}
683654
}

Localization/en-US.hjson

+10-39
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,11 @@ Mods: {
316316
}
317317

318318
Configs: {
319+
Common: {
320+
InvalidChange: You cannot change this config while {0} is active!
321+
HostChange: Only the host is allowed to change this config.
322+
}
323+
319324
BossLogConfiguration: {
320325
DisplayName: Boss Log Customization
321326

@@ -531,7 +536,7 @@ Mods: {
531536
}
532537
}
533538

534-
ClientConfiguration: {
539+
FeatureConfiguration: {
535540
DisplayName: Other features
536541

537542
Headers: {
@@ -609,22 +614,22 @@ Mods: {
609614
Tooltip: If enabled, the last 3 seconds of your respawn time will have sound indicators.
610615
}
611616

612-
TreasureBags: {
617+
TreasureBagsOnMap: {
613618
Label: Treasure bags display on the map
614619
Tooltip: ""
615620
}
616621

617-
Fragments: {
622+
FragmentsOnMap: {
618623
Label: Fragments display on the map
619624
Tooltip: ""
620625
}
621626

622-
Scales: {
627+
ScalesOnMap: {
623628
Label: Shadow Scales and Tissue Samples display on the map
624629
Tooltip: ""
625630
}
626631

627-
BossRadar: {
632+
EnableBossRadar: {
628633
Label: Enable Boss Radar
629634
Tooltip: ""
630635
}
@@ -644,40 +649,6 @@ Mods: {
644649
Tooltip: The selected NPCs will not be tracked by the radar.
645650
}
646651
}
647-
648-
DebugConfiguration: {
649-
DisplayName: Debug Interface
650-
651-
Headers: {
652-
Debug: "[i:3625] [c/ffeb6e:Mod Developer Tools]"
653-
DebugRecordTracker: "[i:3619] [c/ffeb6e:Record Tracker Debug Tools]"
654-
DebugResetData: "[i:575] [c/ffeb6e:Reset Data Options]"
655-
FeatureTesting: "[i:2172] [c/ffeb6e:Feature Testing]"
656-
}
657-
658-
RecordFeatureTesting: {
659-
Label: Disable 'Boss Record' feature testing
660-
Tooltip:
661-
'''
662-
Prevents Boss Records code from running, effectively disabling it while its in feature testing.
663-
This feature will need testing and bug reports before its taken out of feature testing and fully enabled across all users.
664-
'''
665-
}
666-
667-
WorldRecordFeatureTesting: {
668-
Label: Disable 'World Record' feature testing
669-
Tooltip:
670-
'''
671-
Prevents World Records code from running, effectively disabling it while its in feature testing.
672-
As of now this feature is known to not work and may cause issues.
673-
'''
674-
}
675-
}
676-
677-
Common: {
678-
InvalidChange: You cannot change this config while {0} is active!
679-
HostChange: Only the host is allowed to change this config.
680-
}
681652
}
682653
}
683654
}

0 commit comments

Comments
 (0)