99
1010namespace MiniMapLibrary
1111{
12+ public enum LogLevel {
13+ none ,
14+ info ,
15+ debug ,
16+ all
17+ }
18+
1219 public static class Settings
1320 {
1421 public static Dimension2D MinimapSize { get ; set ; } = new Dimension2D ( 100 , 100 ) ;
@@ -27,14 +34,18 @@ public static class Settings
2734
2835 public const string DefaultResourcePath = "Textures/MiscIcons/texMysteryIcon" ;
2936
37+ public static LogLevel LogLevel => _logLevel . Value ;
38+
39+ private static IConfigEntry < LogLevel > _logLevel ;
40+
3041 static Settings ( )
3142 {
3243 InitializeDefaultSettings ( ) ;
3344 }
3445
3546 private static void InitializeDefaultSettings ( )
3647 {
37- static void AddSize ( InteractableKind type ,
48+ static void Add ( InteractableKind type ,
3849 float width = - 1 ,
3950 float height = - 1 ,
4051 Color ActiveColor = default ,
@@ -65,52 +76,52 @@ static void AddSize(InteractableKind type,
6576 InteractibleSettings . Add ( type , setting ) ;
6677 }
6778
68- AddSize ( InteractableKind . Chest , 10 , 8 ,
79+ Add ( InteractableKind . Chest , 10 , 8 ,
6980 description : "Chests, including shops" ,
7081 path : "Textures/MiscIcons/texInventoryIconOutlined" ) ;
7182
72- AddSize ( InteractableKind . Shrine ,
83+ Add ( InteractableKind . Shrine ,
7384 description : "All shrines (excluding Newt)" ,
7485 path : "Textures/MiscIcons/texShrineIconOutlined" ) ;
7586
76- AddSize ( InteractableKind . Teleporter , 15 , 15 ,
87+ Add ( InteractableKind . Teleporter , 15 , 15 ,
7788 ActiveColor : Color . white ,
7889 InactiveColor : Color . green ,
7990 description : "Boss teleporters" ,
8091 path : "Textures/MiscIcons/texTeleporterIconOutlined" ) ;
8192
82- AddSize ( InteractableKind . Player , 8 , 8 ,
93+ Add ( InteractableKind . Player , 8 , 8 ,
8394 ActiveColor : PlayerIconColor ,
8495 InactiveColor : PlayerIconColor ,
8596 description : "" ,
8697 path : "Textures/MiscIcons/texBarrelIcon" ) ;
8798
88- AddSize ( InteractableKind . Barrel , 5 , 5 ,
99+ Add ( InteractableKind . Barrel , 5 , 5 ,
89100 description : "Barrels" ,
90101 path : "Textures/MiscIcons/texBarrelIcon" ) ;
91102
92- AddSize ( InteractableKind . Drone , 7 , 7 ,
103+ Add ( InteractableKind . Drone , 7 , 7 ,
93104 description : "Drones" ,
94105 path : "Textures/MiscIcons/texDroneIconOutlined" ) ;
95106
96- AddSize ( InteractableKind . Special , 7 , 7 ,
107+ Add ( InteractableKind . Special , 7 , 7 ,
97108 description : "Special interactibles such as the landing pod and fans" ,
98109 path : DefaultResourcePath ) ;
99110
100- AddSize ( InteractableKind . Enemy , 3 , 3 ,
111+ Add ( InteractableKind . Enemy , 3 , 3 ,
101112 ActiveColor : Color . red ,
102113 description : "Enemies" ,
103114 path : "Textures/MiscIcons/texBarrelIcon" ) ;
104115
105- AddSize ( InteractableKind . Utility ,
116+ Add ( InteractableKind . Utility ,
106117 description : "Scrappers" ,
107118 path : "Textures/MiscIcons/texLootIconOutlined" ) ;
108119
109- AddSize ( InteractableKind . Printer , 10 , 8 ,
120+ Add ( InteractableKind . Printer , 10 , 8 ,
110121 description : "Printers" ,
111122 path : "Textures/MiscIcons/texInventoryIconOutlined" ) ;
112123
113- AddSize ( InteractableKind . LunarPod , 7 , 7 ,
124+ Add ( InteractableKind . LunarPod , 7 , 7 ,
114125 description : "Lunar pods (chests)" ,
115126 path : "Textures/MiscIcons/texLootIconOutlined" ) ;
116127 }
@@ -126,7 +137,9 @@ public static InteractibleSetting GetSetting(InteractableKind type)
126137 {
127138 Dimensions = DefaultUIElementSize ,
128139 ActiveColor = DefaultActiveColor ,
129- InactiveColor = DefaultInactiveColor
140+ InactiveColor = DefaultInactiveColor ,
141+ Description = "NO_DESCRIPTION" ,
142+ IconPath = DefaultResourcePath
130143 } ;
131144 }
132145
@@ -152,6 +165,11 @@ public static Dimension2D GetInteractableSize(InteractableKind type)
152165 return DefaultUIElementSize ;
153166 }
154167
168+ public static void LoadApplicationSettings ( IConfig config )
169+ {
170+ _logLevel = config . Bind < LogLevel > ( $ "Settings.General", "LogLevel" , LogLevel . info , "The amount of information that the minimap mod should output to the console during runtime" ) ;
171+ }
172+
155173 public static void LoadConfigEntries ( InteractableKind type , IConfig config )
156174 {
157175 InteractibleSetting setting = InteractibleSettings [ type ] ;
@@ -171,18 +189,5 @@ public static void LoadConfigEntries(InteractableKind type, IConfig config)
171189 setting . Dimensions . Width = width . Value ;
172190 setting . IconPath = path . Value ;
173191 }
174-
175- public static void UpdateSetting ( InteractableKind type , float width , float height , Color active , Color inactive )
176- {
177- if ( InteractibleSettings . ContainsKey ( type ) )
178- {
179- var setting = InteractibleSettings [ type ] ;
180-
181- setting . ActiveColor = active ;
182- setting . InactiveColor = inactive ;
183- setting . Dimensions . Height = height ;
184- setting . Dimensions . Width = width ;
185- }
186- }
187192 }
188193}
0 commit comments