mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-21 07:17:53 +01:00
Remove static Config.
This commit is contained in:
parent
aa4bc45641
commit
be3c1c85aa
30 changed files with 363 additions and 440 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Penumbra.UI.Classes;
|
||||
|
||||
|
|
@ -64,6 +65,13 @@ public static class Colors
|
|||
// @formatter:on
|
||||
};
|
||||
|
||||
public static uint Value(this ColorId color, Configuration config)
|
||||
=> config.Colors.TryGetValue(color, out var value) ? value : color.Data().DefaultColor;
|
||||
private static IReadOnlyDictionary<ColorId, uint> _colors = new Dictionary<ColorId, uint>();
|
||||
|
||||
/// <summary> Obtain the configured value for a color. </summary>
|
||||
public static uint Value(this ColorId color)
|
||||
=> _colors.TryGetValue(color, out var value) ? value : color.Data().DefaultColor;
|
||||
|
||||
/// <summary> Set the configurable colors dictionary to a value. </summary>
|
||||
public static void SetColors(Configuration config)
|
||||
=> _colors = config.Colors;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue