Added translation

This commit is contained in:
Cmdr McDonald
2017-05-16 16:39:15 +01:00
parent 420ebe4cc7
commit 464cd4165f
4 changed files with 64 additions and 4 deletions

View File

@@ -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

View File

@@ -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();
}
}

View File

@@ -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: `
<h1>Introduction</h1>

View File

@@ -167,14 +167,15 @@ export default class ModuleSet {
/**
* Find the lightest Power Plant that provides sufficient power
* @param {number} powerNeeded Power requirements in MJ
* @param {string} rating The optional rating of the power plant
* @return {Object} Power Plant
*/
lightestPowerPlant(powerNeeded) {
lightestPowerPlant(powerNeeded, rating) {
let pp = this.standard[0][0];
for (let p of this.standard[0]) {
// Provides enough power, is lighter or the same mass as current power plant but better output/efficiency
if (p.pgen >= powerNeeded && (p.mass < pp.mass || (p.mass == pp.mass && p.pgen > pp.pgen))) {
if (p.pgen >= powerNeeded && (p.mass < pp.mass || (p.mass == pp.mass && p.pgen > pp.pgen)) && (!rating || rating == p.rating)) {
pp = p;
}
}