1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
diff --git a/data/modules/Equipment/Hyperdrive.lua b/data/modules/Equipment/Hyperdrive.lua
index e3c8cd5b5e..fec629107b 100644
--- a/data/modules/Equipment/Hyperdrive.lua
+++ b/data/modules/Equipment/Hyperdrive.lua
@@ -96,7 +96,7 @@ Equipment.Register("hyperspace.hyperdrive_mil3", HyperdriveType.New {
slot = { type="hyperdrive.military", size=3 },
mass=12.5, volume=15, capabilities={ hyperclass=3 },
fuel_resv_size = 10, factor_eff = 60,
- price=85000, purchasable=true, tech_level=11,
+ price=85000, purchasable=true, tech_level="MILITARY",
icon_name="equip_hyperdrive_mil"
})
Equipment.Register("hyperspace.hyperdrive_mil4", HyperdriveType.New {
@@ -104,7 +104,7 @@ Equipment.Register("hyperspace.hyperdrive_mil4", HyperdriveType.New {
slot = { type="hyperdrive.military", size=4 },
mass=32, volume=40, capabilities={ hyperclass=4 },
fuel_resv_size = 30, factor_eff = 48,
- price=214000, purchasable=true, tech_level=12,
+ price=214000, purchasable=true, tech_level="MILITARY",
icon_name="equip_hyperdrive_mil"
})
Equipment.Register("hyperspace.hyperdrive_mil5", HyperdriveType.New {
diff --git a/data/pigui/libs/equipment-outfitter.lua b/data/pigui/libs/equipment-outfitter.lua
index 21bbc21a7c..86a08e592f 100644
--- a/data/pigui/libs/equipment-outfitter.lua
+++ b/data/pigui/libs/equipment-outfitter.lua
@@ -196,8 +196,12 @@ end
--==================
function Outfitter:stationHasTech(level)
- level = level == "MILITARY" and 11 or level
- return self.station.techLevel >= level
+ if level ~= "MILITARY" then
+ return self.station.techLevel >= level
+ else
+ level = 11
+ return self.station.techLevel == level
+ end
end
-- Override to support e.g. custom equipment shops
@@ -490,8 +494,15 @@ function Outfitter:renderCompareRow(label, stat_a, stat_b)
ui.text(label)
local icon_size = Vector2(ui.getTextLineHeight())
+ local cmp_a, cmp_b = "", ""
+ if stat_a then
+ cmp_a = stat_a[3] == "MILITARY" and 11 or stat_a[3]
+ end
+ if stat_b then
+ cmp_b = stat_b[3] == "MILITARY" and 11 or stat_b[3]
+ end
local color = stat_a and stat_b
- and compare(stat_a[3], stat_b[3], stat_a[5])
+ and compare(cmp_a, cmp_b, stat_a[5])
or colors.font
ui.tableNextColumn()
@@ -500,7 +511,11 @@ function Outfitter:renderCompareRow(label, stat_a, stat_b)
ui.sameLine()
local val, format = stat_a[3], stat_a[4]
- ui.textColored(color, format(val))
+ if val ~= "MILITARY" then
+ ui.textColored(color, format(val))
+ else
+ ui.icon(icons.shield_other, icon_size, color)
+ end
end
ui.tableNextColumn()
@@ -509,7 +524,11 @@ function Outfitter:renderCompareRow(label, stat_a, stat_b)
ui.sameLine()
local val, format = stat_b[3], stat_b[4]
- ui.text(format(val))
+ if val ~= "MILITARY" then
+ ui.textColored(color, format(val))
+ else
+ ui.icon(icons.shield_other, icon_size, color)
+ end
end
end
|