diff --git a/ChangeLog.md b/ChangeLog.md index 6276e551..74664027 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,7 @@ * Ensure that hidden blueprint effects are applied when a blueprint is selected * Handle display when summary values show thrusters disabled but current mass keeps them enabled * Added updated German translations (thanks to @sweisgerber-dev) + * Power state (enabled and priority) now follows modules when they are swapped or copied #2.3.4 * Fix crash when removing the special effect from a module diff --git a/src/app/components/SlotSection.jsx b/src/app/components/SlotSection.jsx index f18350fc..6f300e8e 100644 --- a/src/app/components/SlotSection.jsx +++ b/src/app/components/SlotSection.jsx @@ -134,18 +134,38 @@ export default class SlotSection extends TranslatedComponent { if (targetSlot && canMount(this.props.ship, targetSlot, m.grp, m.class)) { const mCopy = m.clone(); this.props.ship.use(targetSlot, mCopy, false); + // Copy power info + targetSlot.enabled = originSlot.enabled; + targetSlot.priority = originSlot.priority; this.props.onChange(); } } else { + // Store power info + const originEnabled = targetSlot.enabled; + const originPriority = targetSlot.priority; + const targetEnabled = originSlot.enabled; + const targetPriority = originSlot.priority; // We want to move the module in to the target slot, and swap back any module that was originally in the target slot if (targetSlot && m && canMount(this.props.ship, targetSlot, m.grp, m.class)) { // Swap modules if possible if (targetSlot.m && canMount(this.props.ship, originSlot, targetSlot.m.grp, targetSlot.m.class)) { this.props.ship.use(originSlot, targetSlot.m, true); - } else { // Otherwise empty the origin slot + this.props.ship.use(targetSlot, m); + // Swap power + originSlot.enabled = originEnabled; + originSlot.priority = originPriority; + targetSlot.enabled = targetEnabled; + targetSlot.priority = targetPriority; + } else { // Otherwise empty the origin slot + // Store power + const targetEnabled = originSlot.enabled; this.props.ship.use(originSlot, null, true); // Empty but prevent summary update + this.props.ship.use(targetSlot, m); + originSlot.enabled = 0; + originSlot.priority = 0; + targetSlot.enabled = targetEnabled; + targetSlot.priority = targetPriority; } - this.props.ship.use(targetSlot, m); // update target slot this.props.onChange(); } } diff --git a/src/app/i18n/en.js b/src/app/i18n/en.js index d3fd4bea..50294f7b 100644 --- a/src/app/i18n/en.js +++ b/src/app/i18n/en.js @@ -286,6 +286,44 @@ export const terms = { bulkheads: 'Bulkheads', reinforcement: 'Reinforcement', + // Panel headings and subheadings + 'power and costs': 'power and costs', + 'costs': 'costs', + 'retrofit costs': 'retrofit costs', + 'reload costs': 'reload costs', + 'profiles': 'profiles', + 'engine profile': 'engine profile', + 'fsd profile': 'fsd profile', + 'movement profile': 'movement profile', + 'damage to opponent\'s shields': 'damage to opponent\'s shields', + 'damage to opponent\'s hull': 'damage to opponent\'s hull', + 'offence': 'offence', + 'defence': 'defence', + 'shield metrics': 'shield metrics', + 'raw shield strength': 'raw shield strength', + 'shield sources': 'shield sources', + 'damage taken': 'damage taken', + 'effective shield': 'effective shield', + 'armour metrics': 'armour metrics', + 'raw armour strength': 'raw armour strength', + 'armour sources': 'armour sources', + 'raw module armour': 'raw module armour', + 'effective armour': 'effective armour', + 'offence metrics': 'offence metrics', + 'defence metrics': 'defence metrics', + // Misc items + 'fuel carried': 'fuel carried', + 'cargo carried': 'cargo carried', + 'ship control': 'ship control', + 'opponent': 'opponent', + 'opponent\'s shields': 'opponent\'s shields', + 'opponent\'s armour': 'opponent\'s armour', + 'shield damage sources': 'shield damage sources', + 'armour damage sources': 'armour damage sources', + 'never': 'never', + 'stock': 'stock', + 'boost': 'boost', + // Help text HELP_TEXT: `