@@ -45,6 +45,20 @@ public Mod(IModConfig _config, IReloadedHooks _hooks, IModLogger _logger) : base
45
45
46
46
}
47
47
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
+ }
48
62
49
63
50
64
/// <summary>
@@ -59,43 +73,58 @@ public override void Update()
59
73
var planetData = planet . GetPlanetData ( ) ;
60
74
Logger . WriteLine ( $ "Planet { planetData . Name . Value . ToString ( ) } has a seed { planetData . GenerationData . Seed . Seed . ToHex ( ) } ") ;
61
75
62
-
63
- }
76
+ var invBalance = Game . Player . DefaultInventoryBalance . GetValue ( ) ;
77
+ invBalance . DefaultProductMaxAmount = 2147483647 ;
78
+ invBalance . DefaultSubstanceMaxAmount = 2147483647 ;
64
79
65
- }
80
+ var spaceColours = Game . SpaceColors . DefaulColorSettings . GetValue ( ) ;
81
+ foreach ( var setting in spaceColours . Settings )
82
+ {
83
+
66
84
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 ;
75
85
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
+
97
125
}
98
- Game . SpaceColors . DefaulColorSettings . SetValue ( spaceColours ) ;
126
+
127
+
99
128
100
129
101
130
@@ -240,12 +269,8 @@ private void planetLoaded(IPlanet planet)
240
269
{
241
270
for ( var i = 0 ; i < pallette . Colours . Length ; i ++ )
242
271
{
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 ( ) ;
249
274
250
275
251
276
}
@@ -381,38 +406,26 @@ private void planetLoaded(IPlanet planet)
381
406
//Randomize Water HeavyAir Colours
382
407
foreach ( var heavyAirColour in planetData . Water . HeavyAir . Colours )
383
408
{
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 ( ) ;
391
412
392
413
}
393
414
394
415
//Randomize Weather HeavyAir Colours
395
416
foreach ( var weatherHeavyAir in planetData . Weather . HeavyAir . Colours )
396
417
{
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 ( ) ;
404
421
405
422
}
406
423
407
424
//Randomize Tile Colours
408
425
for ( var i = 0 ; i < planetData . TileColours . Length ; i ++ )
409
426
{
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 ( ) ;
416
429
}
417
430
418
431
//Change Screen Filters
0 commit comments