From d575d97837bac72dc86c90937134183275206a82 Mon Sep 17 00:00:00 2001 From: Alex Williams Date: Sat, 23 Nov 2024 21:40:19 +0000 Subject: [PATCH] Fixes the issue where Guardian Modules can be re-prioritised in the power section, but cannot in game. --- src/app/components/PowerManagement.jsx | 27 +++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/app/components/PowerManagement.jsx b/src/app/components/PowerManagement.jsx index ad574289..97402408 100644 --- a/src/app/components/PowerManagement.jsx +++ b/src/app/components/PowerManagement.jsx @@ -125,15 +125,32 @@ export default class PowerManagement extends TranslatedComponent { retractedElem = {translate('disabled')}; } + // If this is a Guardian Shield Reinforcement Package or Guardian Hull Reinforcement Package, or Guardian Module Reinforcement Package, it cannot change priority + console.log(slot); + let priorityField; + if (m.symbol) { + if (m.symbol.match(/GuardianShield/i) || m.symbol.match(/GuardianHull/i) || m.symbol.match(/GuardianModule/i)) { + priorityField = 1; + } else { + priorityField = + + {' ' + (slot.priority + 1) + ' '} + + ; + } + } + else { + priorityField = + + {' ' + (slot.priority + 1) + ' '} + + ; + } powerRows.push( {m.class + m.rating} {slotName(translate, slot)} {translate(slot.type)} - - - {' ' + (slot.priority + 1) + ' '} - - + {priorityField} {pwr(m.getPowerUsage())} {pct(m.getPowerUsage() / ship.powerAvailable)} {retractedElem}