-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.cs
119 lines (97 loc) · 5.12 KB
/
Config.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
using System;
using System.Runtime.Serialization;
using BepInEx.Configuration;
using CompetitiveCompany;
using CSync.Lib;
using CSync.Util;
using GameNetcodeStuff;
using HarmonyLib;
using Unity.Collections;
using Unity.Netcode;
[DataContract]
public class Config : SyncedConfig<Config>
{
[DataMember] internal SyncedEntry<int> team1Suit { get; private set; }
[DataMember] internal SyncedEntry<int> team2Suit { get; private set; }
[DataMember] internal SyncedEntry<string> team1Name { get; private set; }
[DataMember] internal SyncedEntry<string> team2Name { get; private set; }
[DataMember] internal SyncedEntry<string> team1ColorCode { get; private set; }
[DataMember] internal SyncedEntry<string> team2ColorCode { get; private set; }
[DataMember] internal SyncedEntry<int> graceTime { get; private set; }
[DataMember] internal SyncedEntry<int> fineAmount { get; private set; }
[DataMember] internal SyncedEntry<bool> graceInside { get; private set; }
[DataMember] internal SyncedEntry<bool> viewSyncMessages { get; private set; }
public Config(ConfigFile cfg) : base("CompetitiveCompany") {
ConfigManager.Register(this);
//InitInstance(this);
team1Suit = cfg.BindSyncedEntry(
"Suits", // Config section
"Team 1 Suits", // Key of this config
0, // Default value
"Originally the orange suit.\nIf you want to set a custom suit with AdditionalSuits, their suits\nGet logged when the game starts. Simply read the logs\nAnd use their SuitIDs!" // Description
);
team2Suit = cfg.BindSyncedEntry(
"Suits", // Config subsection
"Team 2 Suits", // Key of this config
3, // Default value
"Originally the Pajama Suit" // Description
);
team1Name = cfg.BindSyncedEntry(
"Names", // Config section
"Team 1 Name", // Key of this config
"Orange", // Default value
"Set the name for team 1." // Description
);
team2Name = cfg.BindSyncedEntry(
"Names", // Config subsection
"Team 2 Name", // Key of this config
"Blue", // Default value
"Set the name for team 2." // Description
);
team1ColorCode = cfg.BindSyncedEntry(
"Colors", // Config section
"Team 1 Color", // Key of this config
"orange", // Default value
"Set the color code for team 1. Hex codes can be used." // Description
);
team2ColorCode = cfg.BindSyncedEntry(
"Colors", // Config subsection
"Team 2 Color", // Key of this config
"blue", // Default value
"Set the color code for team 2. Hex codes can be used." // Description
);
graceTime = cfg.BindSyncedEntry(
"Grace Time", // Config subsection
"Grace Time", // Key of this config
14, // Default value
"How long grace lasts for. 12+ = PM" // Description
);
fineAmount = cfg.BindSyncedEntry(
"Grace Time", // Config subsection
"Fine Amount", // Key of this config
200, // Default value
"How much should you be fined for leaving early" // Description
);
graceInside = cfg.BindSyncedEntry(
"Grace Time", // Config subsection
"Grace Inside", // Key of this config
true, // Default value
"If Grace Period should be applied inside the facility, like older versions of the mod." // Description
);
viewSyncMessages = cfg.BindSyncedEntry(
"Debugging", // Config subsection
"View Sync Messages", // Key of this config
false, // Default value
"See [CC*] Syncing messages, as if you didn't have the mod installed." // Description
);
}
[HarmonyPostfix]
[HarmonyPatch(typeof(PlayerControllerB), "ConnectClientToPlayerObject")]
public static void InitializeLocalPlayer() {
if (IsHost) {
Synced = true;
return;
}
Synced = false;
}
}