Skip to content

Commit 1ab90fb

Browse files
committed
- First stab at colonization tracking work
1 parent 2d08f9e commit 1ab90fb

21 files changed

+5711
-4284
lines changed

SrvSurvey/Main.Designer.cs

+14-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SrvSurvey/Main.cs

+16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using BioCriterias;
2+
using SharpDX.DirectInput;
23
using SrvSurvey.canonn;
34
using SrvSurvey.forms;
45
using SrvSurvey.game;
@@ -86,6 +87,9 @@ public Main()
8687
menuJourney.Items.RemoveAt(1);
8788
}
8889

90+
if (!Game.settings.buildProjects_TEST)
91+
menuBuildProjects.Visible = false;
92+
8993
Util.applyTheme(this);
9094
}
9195

@@ -411,6 +415,11 @@ private void updateAllControls(GameMode? newMode = null)
411415
else
412416
Program.closePlotter<PlotStationInfo>();
413417

418+
if (gameIsActive && PlotBuildCommodities.allowPlotter)
419+
Program.showPlotter<PlotBuildCommodities>();
420+
else
421+
Program.closePlotter<PlotBuildCommodities>();
422+
414423
// show high gravity warning
415424
var isLandableAndHighGravity = game?.systemBody?.type == SystemBodyType.LandableBody && game.systemBody.surfaceGravity >= Game.settings.highGravityWarningLevel * 10;
416425
if (Game.settings.autoShowFlightWarnings && game?.systemBody != null && isLandableAndHighGravity && game.isMode(GameMode.Landed, GameMode.SuperCruising, GameMode.GlideMode, GameMode.Flying, GameMode.InFighter, GameMode.InSrv))
@@ -1831,6 +1840,11 @@ private void menuBoxel_Click(object sender, EventArgs e)
18311840
BaseForm.show<FormBoxelSearch>();
18321841
}
18331842

1843+
private void menuBuildProjects_Click(object sender, EventArgs e)
1844+
{
1845+
BaseForm.show<FormBuildNew>();
1846+
}
1847+
18341848
private void btnRamTah_Click(object sender, EventArgs e)
18351849
{
18361850
BaseForm.show<FormRamTah>();
@@ -1839,6 +1853,7 @@ private void btnRamTah_Click(object sender, EventArgs e)
18391853
private void btnCodexBingo_Click(object sender, EventArgs e)
18401854
{
18411855
BaseForm.show<FormCodexBingo>();
1856+
//Game.spansh.testColonizationRoute("Col 285 Sector MD-S d4-60");
18421857
}
18431858

18441859
private void btnLogs_Click(object sender, EventArgs e)
@@ -1867,6 +1882,7 @@ private void btnLogs_Click(object sender, EventArgs e)
18671882
// */
18681883
}
18691884
private MainView mv;
1885+
18701886
}
18711887
}
18721888

SrvSurvey/Settings.cs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace SrvSurvey
99
{
1010
class Settings
1111
{
12+
public bool buildProjects_TEST = false;
1213
public Color defaultOrange = GameColors.Defaults.Orange;
1314
public Color defaultOrangeDim = GameColors.Defaults.OrangeDim;
1415
public Color defaultCyan = GameColors.Defaults.Cyan;

SrvSurvey/SrvSurvey.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
<None Remove="allRuins.json" />
4646
<None Remove="allStructures.json" />
4747
<None Remove="bio-criteria\*.json" />
48+
<None Remove="colonization-costs.json" />
4849
<None Remove="guardianSiteTemplates.json" />
4950
<None Remove="humanSiteTemplates.json" />
5051
<None Remove="images\*.png" />
@@ -67,6 +68,9 @@
6768
<Content Include="bio-criteria\*.json">
6869
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6970
</Content>
71+
<Content Include="colonization-costs.json">
72+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
73+
</Content>
7074
<Content Include="guardianSiteTemplates.json">
7175
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
7276
</Content>

SrvSurvey/Util.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ public static float maxWidth(Font font, params string[] texts)
11901190

11911191
/// <summary>
11921192
/// Center the inner size within the outer size.
1193-
/// </summary>
1193+
/// </summary>
11941194
public static int centerIn(int outer, int inner)
11951195
{
11961196
return (int)Math.Ceiling((outer / 2f) - (inner / 2f));
@@ -1405,12 +1405,12 @@ public static Task continueOnSuccess<T>(this Task<T> preTask, Action<T> func)
14051405
/// <summary>
14061406
/// Continues execution on the main thread only if the Task is successful and yields a non-null result, and the form has not been disposed
14071407
/// </summary>
1408-
public static Task continueOnMain<T>(this Task<T> preTask, Form? form, Action<T> func)
1408+
public static Task continueOnMain<T>(this Task<T> preTask, Form? form, Action<T> func, bool allowNull = false)
14091409
{
1410-
return continueOnSuccess(preTask, form, true, func);
1410+
return continueOnSuccess(preTask, form, true, func, allowNull);
14111411
}
14121412

1413-
private static Task continueOnSuccess<T>(this Task<T> preTask, Form? form, bool onMainThread, Action<T> func)
1413+
private static Task continueOnSuccess<T>(this Task<T> preTask, Form? form, bool onMainThread, Action<T> func, bool allowNull = false)
14141414
{
14151415
return preTask.ContinueWith(postTask =>
14161416
{
@@ -1419,7 +1419,7 @@ private static Task continueOnSuccess<T>(this Task<T> preTask, Form? form, bool
14191419
Util.isFirewallProblem(postTask.Exception);
14201420

14211421
// exit early if the call did not succeed or returns a null
1422-
if (postTask.Exception != null || postTask.Result == null) return;
1422+
if (postTask.Exception != null || (!allowNull && postTask.Result == null)) return;
14231423

14241424
// of if we have a form but it's disposed
14251425
if (form?.IsDisposed == true) return;

SrvSurvey/colonization-costs.json

+213
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
{
2+
"coriolis": {
3+
"liquidoxygen": 3781,
4+
"water": 1609,
5+
"ceramiccomposites": 1207,
6+
"cmmcomposites": 11261,
7+
"insulatingmembrane": 644,
8+
"polymers": 1046,
9+
"semicondunctors": 161,
10+
"superconductors": 282,
11+
"aluminium": 10055,
12+
"copper": 644,
13+
"steel": 14076,
14+
"titanium": 8205,
15+
"computercomponents": 145,
16+
"medicaldiagnosticequipment": 25,
17+
"foodcartridges": 242,
18+
"fruitandvegetables": 145,
19+
"nonlethalweapons": 25,
20+
"powergenerators": 65,
21+
"waterpurifiers": 105
22+
},
23+
"asteroid": {
24+
"liquidoxygen": 3781,
25+
"water": 1609,
26+
"ceramiccomposites": 1207,
27+
"cmmcomposites": 11261,
28+
"insulatingmembrane": 644,
29+
"polymers": 1046,
30+
"semicondunctors": 161,
31+
"superconductors": 282,
32+
"aluminium": 10055,
33+
"copper": 644,
34+
"steel": 14076,
35+
"titanium": 8205,
36+
"computercomponents": 8205,
37+
"medicaldiagnosticequipment": 145,
38+
"foodcartridges": 25,
39+
"fruitandvegetables": 145,
40+
"nonlethalweapons": 25,
41+
"powergenerators": 65,
42+
"waterpurifiers": 105
43+
},
44+
"ocellus": {
45+
"liquidoxygen": 15124,
46+
"water": 6436,
47+
"ceramiccomposites": 4828,
48+
"cmmcomposites": 45044,
49+
"insulatingmembrane": 1288,
50+
"polymers": 2092,
51+
"semicondunctors": 322,
52+
"superconductors": 564,
53+
"aluminium": 40220,
54+
"copper": 2576,
55+
"steel": 56304,
56+
"titanium": 32820,
57+
"computercomponents": 290,
58+
"medicaldiagnosticequipment": 50,
59+
"foodcartridges": 484,
60+
"fruitandvegetables": 290,
61+
"nonlethalweapons": 50,
62+
"powergenerators": 130,
63+
"waterpurifiers": 210
64+
},
65+
"orbis": {
66+
"liquidoxygen": 15124,
67+
"water": 6436,
68+
"ceramiccomposites": 4828,
69+
"cmmcomposites": 45044,
70+
"insulatingmembrane": 1288,
71+
"polymers": 2092,
72+
"semicondunctors": 322,
73+
"superconductors": 564,
74+
"aluminium": 40220,
75+
"copper": 2576,
76+
"steel": 56304,
77+
"titanium": 32820,
78+
"computercomponents": 290,
79+
"medicaldiagnosticequipment": 50,
80+
"foodcartridges": 484,
81+
"fruitandvegetables": 290,
82+
"nonlethalweapons": 50,
83+
"powergenerators": 130,
84+
"waterpurifiers": 210
85+
},
86+
"outpost-commercial": {
87+
"liquidoxygen": 1553,
88+
"water": 621,
89+
"ceramiccomposites": 497,
90+
"cmmcomposites": 3912,
91+
"insulatingmembrane": 311,
92+
"polymers": 497,
93+
"semicondunctors": 56,
94+
"superconductors": 100,
95+
"aluminium": 515,
96+
"copper": 218,
97+
"steel": 5588,
98+
"titanium": 4843,
99+
"computercomponents": 50,
100+
"medicaldiagnosticequipment": 13,
101+
"foodcartridges": 94,
102+
"fruitandvegetables": 50,
103+
"nonlethalweapons": 13,
104+
"powergenerators": 19,
105+
"waterpurifiers": 38
106+
},
107+
"outpost-science": {
108+
"liquidoxygen": 1553,
109+
"water": 621,
110+
"ceramiccomposites": 497,
111+
"cmmcomposites": 3912,
112+
"insulatingmembrane": 311,
113+
"polymers": 497,
114+
"semicondunctors": 56,
115+
"superconductors": 100,
116+
"aluminium": 515,
117+
"copper": 218,
118+
"steel": 5588,
119+
"titanium": 4843,
120+
"computercomponents": 50,
121+
"medicaldiagnosticequipment": 13,
122+
"foodcartridges": 94,
123+
"fruitandvegetables": 50,
124+
"nonlethalweapons": 13,
125+
"powergenerators": 19,
126+
"waterpurifiers": 38
127+
},
128+
"outpost-industrial": {
129+
"liquidoxygen": 1553,
130+
"water": 621,
131+
"ceramiccomposites": 497,
132+
"cmmcomposites": 3912,
133+
"insulatingmembrane": 311,
134+
"polymers": 497,
135+
"semicondunctors": 56,
136+
"superconductors": 100,
137+
"aluminium": 515,
138+
"copper": 217,
139+
"steel": 5588,
140+
"titanium": 4843,
141+
"computercomponents": 50,
142+
"medicaldiagnosticequipment": 13,
143+
"foodcartridges": 94,
144+
"fruitandvegetables": 50,
145+
"nonlethalweapons": 13,
146+
"powergenerators": 19,
147+
"waterpurifiers": 38
148+
},
149+
"outpost-criminal": {
150+
"liquidoxygen": 1553,
151+
"water": 621,
152+
"ceramiccomposites": 497,
153+
"cmmcomposites": 3912,
154+
"insulatingmembrane": 311,
155+
"polymers": 497,
156+
"semicondunctors": 56,
157+
"superconductors": 100,
158+
"aluminium": 515,
159+
"copper": 218,
160+
"steel": 5588,
161+
"titanium": 4843,
162+
"computercomponents": 50,
163+
"medicaldiagnosticequipment": 13,
164+
"foodcartridges": 94,
165+
"fruitandvegetables": 50,
166+
"nonlethalweapons": 13,
167+
"powergenerators": 19,
168+
"waterpurifiers": 38
169+
},
170+
"outpost-civilian": {
171+
"liquidoxygen": 1553,
172+
"water": 621,
173+
"ceramiccomposites": 497,
174+
"cmmcomposites": 3912,
175+
"insulatingmembrane": 311,
176+
"polymers": 497,
177+
"semicondunctors": 56,
178+
"superconductors": 100,
179+
"aluminium": 515,
180+
"copper": 218,
181+
"steel": 5588,
182+
"titanium": 4843,
183+
"computercomponents": 50,
184+
"medicaldiagnosticequipment": 13,
185+
"foodcartridges": 94,
186+
"fruitandvegetables": 50,
187+
"nonlethalweapons": 13,
188+
"powergenerators": 19,
189+
"waterpurifiers": 38
190+
},
191+
"outpost-military": {
192+
"liquidoxygen": 1553,
193+
"water": 621,
194+
"ceramiccomposites": 497,
195+
"cmmcomposites": 3912,
196+
"insulatingmembrane": 311,
197+
"polymers": 497,
198+
"semicondunctors": 56,
199+
"superconductors": 100,
200+
"aluminium": 515,
201+
"copper": 218,
202+
"steel": 5588,
203+
"titanium": 4843,
204+
"computercomponents": 50,
205+
"medicaldiagnosticequipment": 13,
206+
"foodcartridges": 94,
207+
"fruitandvegetables": 50,
208+
"nonlethalweapons": 13,
209+
"powergenerators": 19,
210+
"waterpurifiers": 38
211+
},
212+
213+
}

0 commit comments

Comments
 (0)