@@ -13,13 +13,15 @@ public static class Settings
1313
1414 public static Dimension2D ViewfinderSize { get ; set ; } = new Dimension2D ( 10 , 100 ) ;
1515
16- public static IDictionary < InteractableKind , Dimension2D > InteractableSizes { get ; } = new Dictionary < InteractableKind , Dimension2D > ( ) ;
16+ public static IDictionary < InteractableKind , InteractibleSetting > InteractibleSettings { get ; } = new Dictionary < InteractableKind , InteractibleSetting > ( ) ;
1717
1818 private static readonly Dimension2D DefaultUIElementSize = new Dimension2D ( 10 , 10 ) ;
1919
2020 public static Color PlayerIconColor { get ; set ; } = Color . white ;
2121
22- public static Color DefaultIconColor { get ; set ; } = Color . yellow ;
22+ public static Color DefaultActiveColor { get ; set ; } = Color . yellow ;
23+
24+ public static Color DefaultInactiveColor { get ; set ; } = Color . grey ;
2325
2426 static Settings ( )
2527 {
@@ -28,34 +30,72 @@ static Settings()
2830
2931 private static void InitializeDefaultSettings ( )
3032 {
31- void AddSize ( InteractableKind type , float width = - 1 , float height = - 1 )
33+ void AddSize ( InteractableKind type , float width = - 1 , float height = - 1 , Color ActiveColor = default , Color InactiveColor = default )
3234 {
35+ ActiveColor = ActiveColor == default ? DefaultActiveColor : ActiveColor ;
36+ InactiveColor = InactiveColor == default ? DefaultInactiveColor : InactiveColor ;
37+
3338 Dimension2D size = DefaultUIElementSize ;
3439
3540 if ( width != - 1 || height != - 1 )
3641 {
3742 size = new Dimension2D ( width , height ) ;
3843 }
3944
40- InteractableSizes . Add ( type , size ) ;
45+ var setting = new InteractibleSetting ( )
46+ {
47+ ActiveColor = ActiveColor ,
48+ InactiveColor = InactiveColor ,
49+ Dimensions = size
50+ } ;
51+
52+ InteractibleSettings . Add ( type , setting ) ;
4153 }
4254
43- AddSize ( InteractableKind . Chest ) ;
55+ AddSize ( InteractableKind . Chest , 10 , 8 ) ;
4456 AddSize ( InteractableKind . Shrine ) ;
45- AddSize ( InteractableKind . Teleporter ) ;
46- AddSize ( InteractableKind . Player ) ;
57+ AddSize ( InteractableKind . Teleporter , 15 , 15 , ActiveColor : Color . white , InactiveColor : Color . green ) ;
58+ AddSize ( InteractableKind . Player , 8 , 8 , ActiveColor : PlayerIconColor , InactiveColor : PlayerIconColor ) ;
4759 AddSize ( InteractableKind . Barrel , 5 , 5 ) ;
48- AddSize ( InteractableKind . Drone ) ;
60+ AddSize ( InteractableKind . Drone , 7 , 7 ) ;
4961 AddSize ( InteractableKind . Primary ) ;
50- AddSize ( InteractableKind . Special ) ;
62+ AddSize ( InteractableKind . Special , 7 , 7 ) ;
63+ AddSize ( InteractableKind . Enemy , 3 , 3 , ActiveColor : Color . red ) ;
5164 AddSize ( InteractableKind . Utility ) ;
5265 }
5366
67+ public static InteractibleSetting GetSetting ( InteractableKind type )
68+ {
69+ if ( InteractibleSettings . ContainsKey ( type ) )
70+ {
71+ return InteractibleSettings [ type ] ;
72+ }
73+
74+ return new InteractibleSetting ( )
75+ {
76+ Dimensions = DefaultUIElementSize ,
77+ ActiveColor = DefaultActiveColor ,
78+ InactiveColor = DefaultInactiveColor
79+ } ;
80+ }
81+
82+ public static Color GetColor ( InteractableKind type , bool active )
83+ {
84+ if ( InteractibleSettings . ContainsKey ( type ) )
85+ {
86+ var setting = InteractibleSettings [ type ] ;
87+
88+ return active ? setting . ActiveColor : setting . InactiveColor ;
89+ }
90+
91+ return active ? DefaultActiveColor : DefaultInactiveColor ;
92+ }
93+
5494 public static Dimension2D GetInteractableSize ( InteractableKind type )
5595 {
56- if ( InteractableSizes . ContainsKey ( type ) )
96+ if ( InteractibleSettings . ContainsKey ( type ) )
5797 {
58- return InteractableSizes [ type ] ;
98+ return InteractibleSettings [ type ] . Dimensions ?? DefaultUIElementSize ;
5999 }
60100
61101 return DefaultUIElementSize ;
0 commit comments