Skip to content

Commit 240f31d

Browse files
committed
## Ship Panel
* Added toggle switches (currently read only) for Ship Lights, Night Vision, Hardpoints and Landing Gear. * Added warning lights for Overheating, Interdictions, Low Fuel and Danger ship states. * Added information / state lights for Mass Lock, FSD Cooldown, FSD Charging and FSD Jumping, Docked/Landed, Supercruise, Fuel Scooping and Flight Assist states. * Added total count for consumables and total counts with usage bar for each type of item in storage. * Updated copy on Ship Locker/Item Storage and used the name "Assets" where appropriate (consistent with the in-game UI). ## Engineering Panel * Improved rendering of information about engineers in Blueprints view. * Improved logic on Blueprint page to fix issues with sometimes not displaying distance to an engineer's system from your current location. ## Navigation Panel * Improved Navigation Route handling when in a system that is not in the currently plotted route. * Copy/text improvements in Navigation Route view. * Minor copy changes to faction state text.
1 parent 8677474 commit 240f31d

File tree

13 files changed

+385
-92
lines changed

13 files changed

+385
-92
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "icarus",
3-
"version": "0.10.0",
3+
"version": "0.11.0",
44
"description": "ICARUS Terminal for Elite Dangerous",
55
"scripts": {
66
"build": "npm run build:web && npm run build:app && npm run build:service && npm run build:package",

src/service/lib/event-handlers/inventory.js

+24-11
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ class Inventory {
1010
const shipLocker = (await this.eliteJson.json()).ShipLocker
1111
if (!shipLocker) return []
1212

13-
const inventory = []
13+
const inventoryItems = []
1414

1515
shipLocker.Consumables.forEach(item => {
16-
let itemInInventory = inventory.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
16+
let itemInInventory = inventoryItems.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
1717
if (!itemInInventory) {
1818
itemInInventory = {
1919
name: item?.Name_Localised ?? item.Name,
@@ -22,7 +22,7 @@ class Inventory {
2222
stolen: 0,
2323
count: 0
2424
}
25-
inventory.push(itemInInventory)
25+
inventoryItems.push(itemInInventory)
2626
}
2727

2828
itemInInventory.count += item.Count
@@ -31,7 +31,7 @@ class Inventory {
3131
})
3232

3333
shipLocker.Items.forEach(item => {
34-
let itemInInventory = inventory.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
34+
let itemInInventory = inventoryItems.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
3535
if (!itemInInventory) {
3636
itemInInventory = {
3737
name: item?.Name_Localised ?? item.Name,
@@ -40,7 +40,7 @@ class Inventory {
4040
stolen: 0,
4141
count: 0
4242
}
43-
inventory.push(itemInInventory)
43+
inventoryItems.push(itemInInventory)
4444
}
4545

4646
itemInInventory.count += item.Count
@@ -49,7 +49,7 @@ class Inventory {
4949
})
5050

5151
shipLocker.Components.forEach(item => {
52-
let itemInInventory = inventory.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
52+
let itemInInventory = inventoryItems.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
5353
if (!itemInInventory) {
5454
itemInInventory = {
5555
name: item?.Name_Localised ?? item.Name,
@@ -58,7 +58,7 @@ class Inventory {
5858
stolen: 0,
5959
count: 0
6060
}
61-
inventory.push(itemInInventory)
61+
inventoryItems.push(itemInInventory)
6262
}
6363

6464
itemInInventory.count += item.Count
@@ -67,7 +67,7 @@ class Inventory {
6767
})
6868

6969
shipLocker.Data.forEach(item => {
70-
let itemInInventory = inventory.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
70+
let itemInInventory = inventoryItems.filter(i => i.name === (item?.Name_Localised ?? item.Name))[0]
7171
if (!itemInInventory) {
7272
itemInInventory = {
7373
name: item?.Name_Localised ?? item.Name,
@@ -76,17 +76,30 @@ class Inventory {
7676
stolen: 0,
7777
count: 0
7878
}
79-
inventory.push(itemInInventory)
79+
inventoryItems.push(itemInInventory)
8080
}
8181

8282
itemInInventory.count += item.Count
8383
if (item.MissionID) itemInInventory.mission += item.Count
8484
if (item.OwnerID > 0) itemInInventory.stolen += item.Count
8585
})
8686

87-
inventory.sort((a, b) => a.name.localeCompare(b.name))
87+
inventoryItems.sort((a, b) => a.name.localeCompare(b.name))
8888

89-
return inventory
89+
const counts = {
90+
goods: 0,
91+
components: 0,
92+
data: 0,
93+
}
94+
95+
inventoryItems.filter(i => i.type === 'Goods').forEach(item => counts.goods += item.count)
96+
inventoryItems.filter(i => i.type === 'Component').forEach(item => counts.components += item.count)
97+
inventoryItems.filter(i => i.type === 'Data').forEach(item => counts.data += item.count)
98+
99+
return {
100+
counts,
101+
items: inventoryItems
102+
}
90103
}
91104
}
92105

src/service/lib/event-handlers/nav-route.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class NavRoute {
1111

1212
async getNavRoute () {
1313
const currentSystem = await this.system.getSystem()
14+
15+
let inSystemOnRoute = false
1416
let jumpsToDestination = null
1517

1618
const route = ((await this.eliteJson.json())?.NavRoute?.Route ?? []).map(system => {
@@ -22,6 +24,9 @@ class NavRoute {
2224
//const isCurrentSystem = (distanceToHop === 0)
2325
const isCurrentSystem = (system?.StarSystem?.toLowerCase() === currentSystem?.name?.toLowerCase())
2426

27+
if (isCurrentSystem)
28+
inSystemOnRoute = true
29+
2530
if (isCurrentSystem) {
2631
jumpsToDestination = 0
2732
} else {
@@ -42,7 +47,8 @@ class NavRoute {
4247
currentSystem,
4348
destination: route?.[route.length - 1] ?? [],
4449
jumpsToDestination,
45-
route
50+
route,
51+
inSystemOnRoute
4652
}
4753

4854
return navRoute

src/web/components/panels/nav/system-map.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import CopyOnClick from 'components/copy-on-click'
33

44
const factionStates = {
55
expansion: {
6-
description: 'Controlling faction expanding influence'
6+
description: 'Faction expanding influence'
77
},
88
investment: {
99
description: 'Ongoing investment, expansion anticipated'
@@ -24,7 +24,7 @@ const factionStates = {
2424
description: 'Economy bust'
2525
},
2626
civilUnrest: {
27-
description: 'Civil Unrest ,support & bounty missions'
27+
description: 'Civil Unrest, support & bounty missions'
2828
},
2929
famine: {
3030
description: 'Famine, demand for food, support missions'
@@ -36,7 +36,7 @@ const factionStates = {
3636
description: 'Lockdown, services restricted, support missions'
3737
},
3838
retreat: {
39-
description: 'Controlling faction retreating from system'
39+
description: 'Faction retreating from system'
4040
},
4141
naturalDisaster: {
4242
description: 'Natural disaster, support missions available'
@@ -65,9 +65,9 @@ export default function SystemMap ({ system, setSystemObject }) {
6565
<div className='system-map'>
6666
<div className='system-map__title'>
6767
<h1>
68-
<span className='fx-animated-text' data-fx-order='1'>
68+
<span className='fx-animated-text' data-fx-order='1' style={{paddingRight: '1rem'}}>
6969
<i className='icon icarus-terminal-system-orbits' />
70-
<CopyOnClick>{system.name}</CopyOnClick>&nbsp;
70+
<CopyOnClick>{system.name}</CopyOnClick>
7171
</span>
7272
</h1>
7373
{system.detail && system.detail.bodies && system.detail.bodies.length > 0 &&

src/web/components/panels/ship/ship-modules-panel.js

+142-33
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { UNKNOWN_VALUE } from '../../../../shared/consts'
22
import ShipModules from './ship-modules'
33

4-
export default function ShipModulesPanel ({ ship, selectedModule, setSelectedModule }) {
4+
export default function ShipModulesPanel ({ ship, selectedModule, setSelectedModule, cmdrStatus }) {
55
if (!ship) return null
66

77
if (ship.type === UNKNOWN_VALUE && ship.name === UNKNOWN_VALUE && ship.ident === UNKNOWN_VALUE) {
@@ -39,38 +39,147 @@ export default function ShipModulesPanel ({ ship, selectedModule, setSelectedMod
3939
<label className={(ship.onBoard && ship?.pips?.weapons > 0) ? 'text-primary' : 'text-primary text-muted'}>Weapons</label>
4040
</div>
4141
</div>
42-
<table className='ship-panel__ship-stats'>
43-
<tbody className='text-info'>
44-
<tr>
45-
<td>
46-
<span className='text-muted'>Max jump range</span>
47-
<span className='value'>{ship.maxJumpRange || '-'} Ly</span>
48-
</td>
49-
<td>
50-
<span className='text-muted'>Fuel (curr/max)</span>
51-
<span className='value'>{typeof ship?.fuelLevel === 'number' ? ship.fuelLevel : '-'}/{ship.fuelCapacity} T</span>
52-
</td>
53-
<td>
54-
<span className='text-muted'>Cargo (curr/max)</span>
55-
<span className='value'>{typeof ship?.cargo?.count === 'number' ? ship.cargo.count : '-'}/{ship.cargo.capacity} T</span>
56-
</td>
57-
</tr>
58-
<tr>
59-
<td>
60-
<span className='text-muted'>Insurance Rebuy</span>
61-
<span className='value'>{ship.rebuy ? ship.rebuy.toLocaleString() : '-'} CR</span>
62-
</td>
63-
<td>
64-
<span className='text-muted'>Fuel Reservoir</span>
65-
<span className='value'>{typeof ship?.fuelReservoir === 'number' ? ship.fuelReservoir : '-'}</span>
66-
</td>
67-
<td>
68-
<span className='text-muted'>Total mass</span>
69-
<span className='value'>{ship.mass} T</span>
70-
</td>
71-
</tr>
72-
</tbody>
73-
</table>
42+
43+
<div className='ship-panel--status'>
44+
<table className='ship-panel__ship-stats'>
45+
<tbody className='text-info'>
46+
<tr>
47+
<td>
48+
<span className='text-muted'>Max jump range</span>
49+
<span className='value'>{ship.maxJumpRange || '-'} Ly</span>
50+
</td>
51+
<td>
52+
<span className='text-muted'>Fuel (curr/max)</span>
53+
<span className='value'>{typeof ship?.fuelLevel === 'number' ? ship.fuelLevel : '-'}/{ship.fuelCapacity} T</span>
54+
</td>
55+
<td>
56+
<span className='text-muted'>Cargo (curr/max)</span>
57+
<span className='value'>{typeof ship?.cargo?.count === 'number' ? ship.cargo.count : '-'}/{ship.cargo.capacity} T</span>
58+
</td>
59+
</tr>
60+
<tr>
61+
<td>
62+
<span className='text-muted'>Insurance Rebuy</span>
63+
<span className='value'>{ship.rebuy ? ship.rebuy.toLocaleString() : '-'} CR</span>
64+
</td>
65+
<td>
66+
<span className='text-muted'>Fuel Reservoir</span>
67+
<span className='value'>{typeof ship?.fuelReservoir === 'number' ? ship.fuelReservoir : '-'}</span>
68+
</td>
69+
<td>
70+
<span className='text-muted'>Total mass</span>
71+
<span className='value'>{ship.mass} T</span>
72+
</td>
73+
</tr>
74+
</tbody>
75+
</table>
76+
77+
<table className='table--layout'>
78+
<tbody>
79+
<tr>
80+
<td>
81+
<label className='checkbox'>
82+
<span className='checkbox__text'>Ship Lights</span>
83+
<input type='checkbox' checked={ship.onBoard && cmdrStatus?.flags?.lightsOn} />
84+
<span class='checkbox__control'/>
85+
</label>
86+
</td>
87+
<td>
88+
<label className='checkbox'>
89+
<span className='checkbox__text'>Night Vision</span>
90+
<input type='checkbox' checked={ship.onBoard && cmdrStatus?.flags?.nightVision} />
91+
<span class='checkbox__control'/>
92+
</label>
93+
</td>
94+
<td>
95+
<label className='checkbox'>
96+
<span className='checkbox__text'>Hardpoints</span>
97+
<input type='checkbox' checked={ship.onBoard && cmdrStatus?.flags?.hardpointsDeployed} />
98+
<span class='checkbox__control'/>
99+
</label>
100+
</td>
101+
<td>
102+
<label className='checkbox'>
103+
<span className='checkbox__text'>Landing Gear</span>
104+
<input type='checkbox' checked={ship.onBoard && cmdrStatus?.flags?.landingGearDown} />
105+
<span class='checkbox__control'/>
106+
</label>
107+
</td>
108+
</tr>
109+
</tbody>
110+
</table>
111+
<table className='table--layout'>
112+
<tbody>
113+
<tr>
114+
<td>
115+
<span className={ship.onBoard && cmdrStatus?.flags?.overHeating ? 'ship-panel__light--danger' : 'ship-panel__light--off'}>
116+
<span className='ship-panel__light-text'>Overheating</span>
117+
</span>
118+
</td>
119+
<td>
120+
<span className={ship.onBoard && cmdrStatus?.flags?.beingInterdicted ? 'ship-panel__light--danger' : 'ship-panel__light--off'}>
121+
<span className='ship-panel__light-text'>Interdiction Detected</span>
122+
</span>
123+
</td>
124+
<td>
125+
<span className={ship.onBoard && cmdrStatus?.flags?.lowFuel ? 'ship-panel__light--secondary' : 'ship-panel__light--off'}>
126+
<span className='ship-panel__light-text'>Fuel Low</span>
127+
</span>
128+
</td>
129+
<td>
130+
<span className={ship.onBoard && cmdrStatus?.flags?.inDanger ? 'ship-panel__light--danger' : 'ship-panel__light--off'}>
131+
<span className='ship-panel__light-text'>Danger</span>
132+
</span>
133+
</td>
134+
</tr>
135+
<tr>
136+
<td>
137+
<span className={ship.onBoard && cmdrStatus?.flags?.fsdMassLocked ? 'ship-panel__light--secondary' : 'ship-panel__light--off'}>
138+
<span className='ship-panel__light-text'>Mass Locked</span>
139+
</span>
140+
</td>
141+
<td>
142+
<span className={ship.onBoard && cmdrStatus?.flags?.fsdCooldown ? 'ship-panel__light--secondary' : 'ship-panel__light--off'}>
143+
<span className='ship-panel__light-text'>Frame Shift Cooldown</span>
144+
</span>
145+
</td>
146+
<td>
147+
<span className={ship.onBoard && cmdrStatus?.flags?.fsdCharging ? 'ship-panel__light--secondary' : 'ship-panel__light--off'}>
148+
<span className='ship-panel__light-text'>Frame Shift Charging</span>
149+
</span>
150+
</td>
151+
<td>
152+
<span className={ship.onBoard && cmdrStatus?.flags?.fsdJump ? 'ship-panel__light--danger' : 'ship-panel__light--off'}>
153+
<span className='ship-panel__light-text'>Frame Shift Jumping</span>
154+
</span>
155+
</td>
156+
</tr>
157+
<tr>
158+
<td>
159+
<span className={ship.onBoard && (cmdrStatus?.flags?.docked || cmdrStatus?.flags?.landed) ? 'ship-panel__light--info' : 'ship-panel__light--off'}>
160+
<span className='ship-panel__light-text'>Docked</span>
161+
</span>
162+
</td>
163+
<td>
164+
<span className={ship.onBoard && cmdrStatus?.flags?.supercruise ? 'ship-panel__light--info' : 'ship-panel__light--off'}>
165+
<span className='ship-panel__light-text'>Supercruise</span>
166+
</span>
167+
</td>
168+
<td>
169+
<span className={ship.onBoard && cmdrStatus?.flags?.scoopingFuel ? 'ship-panel__light--secondary' : 'ship-panel__light--off'}>
170+
<span className='ship-panel__light-text'>Fuel Scooping</span>
171+
</span>
172+
</td>
173+
<td>
174+
<span className={ship.onBoard && cmdrStatus?.flags?.flightAssistOff ? 'ship-panel__light--secondary' : 'ship-panel__light--off'}>
175+
<span className='ship-panel__light-text'>Flight Assist Off</span>
176+
</span>
177+
</td>
178+
</tr>
179+
</tbody>
180+
</table>
181+
</div>
182+
74183
<ShipModules
75184
name='Hardpoints'
76185
modules={

0 commit comments

Comments
 (0)