@@ -45,6 +45,20 @@ public Mod(IModConfig _config, IReloadedHooks _hooks, IModLogger _logger) : base
4545
4646 }
4747
48+ public Colour colourRandomizer ( )
49+ {
50+ var newColour = new Colour ( ) ;
51+
52+
53+
54+ newColour . R = Random . Range ( 0.000f , 1.000f ) ;
55+ newColour . G = Random . Range ( 0.000f , 1.000f ) ;
56+ newColour . B = Random . Range ( 0.000f , 1.000f ) ;
57+ newColour . A = Random . Range ( 0.000f , 1.000f ) ;
58+
59+ return newColour ;
60+
61+ }
4862
4963
5064 /// <summary>
@@ -59,43 +73,58 @@ public override void Update()
5973 var planetData = planet . GetPlanetData ( ) ;
6074 Logger . WriteLine ( $ "Planet { planetData . Name . Value . ToString ( ) } has a seed { planetData . GenerationData . Seed . Seed . ToHex ( ) } ") ;
6175
62-
63- }
76+ var invBalance = Game . Player . DefaultInventoryBalance . GetValue ( ) ;
77+ invBalance . DefaultProductMaxAmount = 2147483647 ;
78+ invBalance . DefaultSubstanceMaxAmount = 2147483647 ;
6479
65- }
80+ var spaceColours = Game . SpaceColors . DefaulColorSettings . GetValue ( ) ;
81+ foreach ( var setting in spaceColours . Settings )
82+ {
83+
6684
67- var spaceColours = Game . SpaceColors . DefaulColorSettings . GetValue ( ) ;
68- foreach ( var setting in spaceColours . Settings )
69- {
70- var colourRandomizer = new Colour ( ) ;
71- colourRandomizer . R = 1.000f ;
72- colourRandomizer . G = 0.000f ;
73- colourRandomizer . B = 0.518f ;
74- colourRandomizer . A = 1.000f ;
7585
76- /*
77- colourRandomizer.R = Random.Range(0.000f, 1.000f);
78- colourRandomizer.G = Random.Range(0.000f, 1.000f);
79- colourRandomizer.B = Random.Range(0.000f, 1.000f);
80- colourRandomizer.A = Random.Range(0.000f, 1.000f);
81- */
82-
83- setting . BottomColour = colourRandomizer ;
84- setting . BottomColourPlanet = colourRandomizer ;
85- setting . CloudColour = colourRandomizer ;
86- setting . FogColour = colourRandomizer ;
87- setting . FogColour2 = colourRandomizer ;
88- setting . LightColour = colourRandomizer ;
89- setting . MidColour = colourRandomizer ;
90- setting . MidColourPlanet = colourRandomizer ;
91- setting . NebulaColour1 = colourRandomizer ;
92- setting . NebulaColour2 = colourRandomizer ;
93- setting . NebulaColour3 = colourRandomizer ;
94- setting . TopColour = colourRandomizer ;
95- setting . TopColourPlanet = colourRandomizer ;
96- Logger . WriteLine ( $ "Randomized Space Colours") ;
86+ setting . BottomColour = colourRandomizer ( ) ;
87+ setting . BottomColourPlanet = colourRandomizer ( ) ;
88+ setting . CloudColour = colourRandomizer ( ) ;
89+ setting . FogColour = colourRandomizer ( ) ;
90+ setting . FogColour2 = colourRandomizer ( ) ;
91+ setting . LightColour = colourRandomizer ( ) ;
92+ setting . MidColour = colourRandomizer ( ) ;
93+ setting . MidColourPlanet = colourRandomizer ( ) ;
94+ setting . NebulaColour1 = colourRandomizer ( ) ;
95+ setting . NebulaColour2 = colourRandomizer ( ) ;
96+ setting . NebulaColour3 = colourRandomizer ( ) ;
97+ setting . TopColour = colourRandomizer ( ) ;
98+ setting . TopColourPlanet = colourRandomizer ( ) ;
99+
100+ }
101+ Game . SpaceColors . DefaulColorSettings . SetValue ( spaceColours ) ;
102+
103+ var spaceColoursRare = Game . SpaceColors . RareColorSettings . GetValue ( ) ;
104+ foreach ( var setting in spaceColoursRare . Settings )
105+ {
106+ setting . BottomColour = colourRandomizer ( ) ;
107+ setting . BottomColourPlanet = colourRandomizer ( ) ;
108+ setting . CloudColour = colourRandomizer ( ) ;
109+ setting . FogColour = colourRandomizer ( ) ;
110+ setting . FogColour2 = colourRandomizer ( ) ;
111+ setting . LightColour = colourRandomizer ( ) ;
112+ setting . MidColour = colourRandomizer ( ) ;
113+ setting . MidColourPlanet = colourRandomizer ( ) ;
114+ setting . NebulaColour1 = colourRandomizer ( ) ;
115+ setting . NebulaColour2 = colourRandomizer ( ) ;
116+ setting . NebulaColour3 = colourRandomizer ( ) ;
117+ setting . TopColour = colourRandomizer ( ) ;
118+ setting . TopColourPlanet = colourRandomizer ( ) ;
119+
120+ }
121+
122+
123+ }
124+
97125 }
98- Game . SpaceColors . DefaulColorSettings . SetValue ( spaceColours ) ;
126+
127+
99128
100129
101130
@@ -240,12 +269,8 @@ private void planetLoaded(IPlanet planet)
240269 {
241270 for ( var i = 0 ; i < pallette . Colours . Length ; i ++ )
242271 {
243- var colourRandomizer = new Colour ( ) ;
244- colourRandomizer . R = Random . Range ( 0.000f , 1.000f ) ;
245- colourRandomizer . G = Random . Range ( 0.000f , 1.000f ) ;
246- colourRandomizer . B = Random . Range ( 0.000f , 1.000f ) ;
247- colourRandomizer . A = Random . Range ( 0.000f , 1.000f ) ;
248- pallette . Colours [ i ] = colourRandomizer ;
272+
273+ pallette . Colours [ i ] = colourRandomizer ( ) ;
249274
250275
251276 }
@@ -381,38 +406,26 @@ private void planetLoaded(IPlanet planet)
381406 //Randomize Water HeavyAir Colours
382407 foreach ( var heavyAirColour in planetData . Water . HeavyAir . Colours )
383408 {
384- var colourRandomizer = new Colour ( ) ;
385- colourRandomizer . R = Random . Range ( 0.000f , 1.000f ) ;
386- colourRandomizer . G = Random . Range ( 0.000f , 1.000f ) ;
387- colourRandomizer . B = Random . Range ( 0.000f , 1.000f ) ;
388- colourRandomizer . A = Random . Range ( 0.000f , 1.000f ) ;
389- heavyAirColour . Colour1 = colourRandomizer ;
390- heavyAirColour . Colour2 = colourRandomizer ;
409+
410+ heavyAirColour . Colour1 = colourRandomizer ( ) ;
411+ heavyAirColour . Colour2 = colourRandomizer ( ) ;
391412
392413 }
393414
394415 //Randomize Weather HeavyAir Colours
395416 foreach ( var weatherHeavyAir in planetData . Weather . HeavyAir . Colours )
396417 {
397- var colourRandomizer = new Colour ( ) ;
398- colourRandomizer . R = Random . Range ( 0.000f , 1.000f ) ;
399- colourRandomizer . G = Random . Range ( 0.000f , 1.000f ) ;
400- colourRandomizer . B = Random . Range ( 0.000f , 1.000f ) ;
401- colourRandomizer . A = Random . Range ( 0.000f , 1.000f ) ;
402- weatherHeavyAir . Colour1 = colourRandomizer ;
403- weatherHeavyAir . Colour2 = colourRandomizer ;
418+
419+ weatherHeavyAir . Colour1 = colourRandomizer ( ) ;
420+ weatherHeavyAir . Colour2 = colourRandomizer ( ) ;
404421
405422 }
406423
407424 //Randomize Tile Colours
408425 for ( var i = 0 ; i < planetData . TileColours . Length ; i ++ )
409426 {
410- var colourRandomizer = new Colour ( ) ;
411- colourRandomizer . R = Random . Range ( 0.000f , 1.000f ) ;
412- colourRandomizer . G = Random . Range ( 0.000f , 1.000f ) ;
413- colourRandomizer . B = Random . Range ( 0.000f , 1.000f ) ;
414- colourRandomizer . A = Random . Range ( 0.000f , 1.000f ) ;
415- planetData . TileColours [ i ] = colourRandomizer ;
427+
428+ planetData . TileColours [ i ] = colourRandomizer ( ) ;
416429 }
417430
418431 //Change Screen Filters
0 commit comments