Skip to content

Commit 1b3faba

Browse files
committed
Resonite release
1 parent d18a3ba commit 1b3faba

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

Status/Status.cs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,41 @@ public class Status : ResoniteMod
1313
public override string Version => "2.0.0";
1414
public override string Link => "https://github.com/dfgHiatus/Status";
1515

16-
internal ModConfiguration config;
16+
internal static ModConfiguration Config;
1717

1818
[AutoRegisterConfigKey]
19-
internal ModConfigurationKey<string> tagLine =
19+
internal static readonly ModConfigurationKey<string> tagLine =
2020
new("tagLine", "Tagline", () => "Tagline");
2121

2222
[AutoRegisterConfigKey]
23-
internal ModConfigurationKey<string> description =
23+
internal static readonly ModConfigurationKey<string> description =
2424
new("description", "Description", () => "Description");
2525

2626
[AutoRegisterConfigKey]
27-
internal ModConfigurationKey<string> profileWorldUri =
27+
internal static readonly ModConfigurationKey<string> profileWorldUri =
2828
new("profileWorldUri", "Featured World URL", () => "");
2929

3030
public override void OnEngineInit()
3131
{
3232
new Harmony("net.dfgHiatus.Status").PatchAll();
33-
config = GetConfiguration();
34-
config.OnThisConfigurationChanged += OnConfigChange;
33+
Config = GetConfiguration();
34+
Config.OnThisConfigurationChanged += OnConfigChange;
3535
}
3636

3737
private async void OnConfigChange(ConfigurationChangedEvent configurationChangedEvent)
3838
{
3939
UserProfile profile = Engine.Current.Cloud.CurrentUser.Profile;
4040

41-
// Update everything else
4241
switch (configurationChangedEvent.Key.Name)
4342
{
4443
case "tagLine":
45-
profile.Tagline = config.GetValue(tagLine);
44+
profile.Tagline = Config.GetValue(tagLine);
4645
break;
4746
case "description":
48-
profile.Description = config.GetValue(description);
47+
profile.Description = Config.GetValue(description);
4948
break;
5049
case "profileWorldUri":
51-
profile.IconUrl = config.GetValue(profileWorldUri);
50+
profile.IconUrl = Config.GetValue(profileWorldUri);
5251
break;
5352
default:
5453
throw new ArgumentOutOfRangeException(configurationChangedEvent.Key.Name);

0 commit comments

Comments
 (0)