-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgressLockConfig.cs
More file actions
92 lines (59 loc) · 2.49 KB
/
ProgressLockConfig.cs
File metadata and controls
92 lines (59 loc) · 2.49 KB
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
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Newtonsoft.Json;
using ProgressLock.Enums;
using ProgressLock.Models.Entries;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using Terraria;
using Terraria.Chat;
using Terraria.GameContent.UI.Elements;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader.Config;
using Terraria.ModLoader.Config.UI;
using Terraria.UI;
using tModPorter;
namespace ProgressLock
{
public class ProgressLockConfig : ModConfig
{
public override ConfigScope Mode => ConfigScope.ServerSide;
public static ProgressLockConfig Config;
[DefaultValue("2025-12-19 10:30:10")]
public string FirstTime { get; set; } = "2025-12-19 10:30:10";
public List<NpcEntry> NpcEntries { get; set; }
public List<EventEntry> EventEntries { get; set; }
// 构造函数设置默认值
public ProgressLockConfig()
{
NpcEntries = new List<NpcEntry>
{
new NpcEntry { DefinitionList = new List<NPCDefinition>{ new NPCDefinition("Terraria", "KingSlime")}, UnlockTimeSec = 50000 },
new NpcEntry { DefinitionList = new List<NPCDefinition>{new ("Terraria", "EaterofWorldsHead"), new ("Terraria", "EaterofWorldsBody") , new ("Terraria", "EaterofWorldsTail") }, UnlockTimeSec = 100000 },
new NpcEntry { DefinitionList = new List<NPCDefinition>{new ("CalamityMod", "SlimeGodCore") } , UnlockTimeSec = 70000 },
};
EventEntries = new List<EventEntry>
{
new EventEntry { Name = VanillaEvent.FrostLegion, UnlockTimeSec = 80000,Alias = new List<string>{"Legion"} },
new EventEntry { Name = VanillaEvent.MartianMadness, UnlockTimeSec = 150000 },
new EventEntry { Name = VanillaEvent.PumpkinMoon, UnlockTimeSec = 200000 },
};
}
public override void OnLoaded()
{
Config = this;
}
public override void OnChanged()
{
if (Main.netMode == NetmodeID.SinglePlayer || Main.netMode == NetmodeID.Server)
{
ChatHelper.BroadcastChatMessage(NetworkText.FromLiteral(Utils.GetMentionMsg("ConfigChanged")),Color.Aqua);
}
}
}
}