Handle different specials for dumbfire and seeker missiles

This commit is contained in:
Cmdr McDonald
2017-05-03 12:37:49 +01:00
parent 62e3b70581
commit 060cf75ec4
2 changed files with 5 additions and 2 deletions

View File

@@ -3,6 +3,8 @@
* Ensure comparisons with saved stock ships work correctly
* Add 'Racer' role
* Tidy up shipyard page; remove units from data columns and re-order for legibility
* Allow basic drag/drop functionality in Edge/Internet Explorer 11 browser
* Provide separate special effects for dumbfire and seeker missiles
#2.3.3
* Remove unused blueprint when hitting reset

View File

@@ -88,10 +88,11 @@ export default class ModificationsMenu extends TranslatedComponent {
const translate = language.translate;
const specials = [];
if (Modifications.modules[m.grp].specials && Modifications.modules[m.grp].specials.length > 0) {
const specialsId = m.missile ? 'specials_' + m.missile : 'specials';
if (Modifications.modules[m.grp][specialsId] && Modifications.modules[m.grp][specialsId].length > 0) {
const close = this._specialSelected.bind(this, null);
specials.push(<div style={{ cursor: 'pointer' }} key={ 'none' } onClick={ close }>{translate('PHRASE_NO_SPECIAL')}</div>);
for (const specialName of Modifications.modules[m.grp].specials) {
for (const specialName of Modifications.modules[m.grp][specialsId]) {
const close = this._specialSelected.bind(this, specialName);
specials.push(<div style={{ cursor: 'pointer' }} key={ specialName } onClick={ close }>{translate(Modifications.specials[specialName].name)}</div>);
}