Add tooltips for icons; fix import of old-style modification strings

This commit is contained in:
Cmdr McDonald
2016-11-04 13:12:44 +00:00
parent c17c7125e3
commit c1f4a8d416
2 changed files with 7 additions and 8 deletions

View File

@@ -45,13 +45,12 @@ export default class HardpointSlot extends Slot {
return <div className='details' draggable='true' onDragStart={drag} onDragEnd={drop}> return <div className='details' draggable='true' onDragStart={drag} onDragEnd={drop}>
<div className={'cb'}> <div className={'cb'}>
<div className={'l'}> <div className={'l'}>
{m.mount && m.mount == 'F' ? <MountFixed /> : ''} {m.mount && m.mount == 'F' ? <span onMouseOver={termtip.bind(null, 'fixed')} onMouseOut={tooltip.bind(null, null)}><MountFixed /></span> : ''}
{m.mount && m.mount == 'G' ? <MountGimballed /> : ''} {m.mount && m.mount == 'G' ? <span onMouseOver={termtip.bind(null, 'gimballed')} onMouseOut={tooltip.bind(null, null)}><MountGimballed /></span> : ''}
{m.mount && m.mount == 'T' ? <MountTurret /> : ''} {m.mount && m.mount == 'T' ? <span onMouseOver={termtip.bind(null, 'turreted')} onMouseOut={tooltip.bind(null, null)}><MountTurret /></span> : ''}
{m.type && m.type == 'K' ? <DamageKinetic /> : ''} {m.type && m.type.match('K') ? <span onMouseOver={termtip.bind(null, 'kinetic')} onMouseOut={tooltip.bind(null, null)}><DamageKinetic /></span> : ''}
{m.type && m.type == 'T' ? <DamageThermal /> : ''} {m.type && m.type.match('T') ? <span onMouseOver={termtip.bind(null, 'thermal')} onMouseOut={tooltip.bind(null, null)}><DamageThermal /></span> : ''}
{m.type && m.type == 'KT' ? <span><DamageKinetic /><DamageThermal /></span> : ''} {m.type && m.type.match('E') ? <span onMouseOver={termtip.bind(null, 'explosive')} onMouseOut={tooltip.bind(null, null)}><DamageExplosive /></span> : ''}
{m.type && m.type == 'E' ? <DamageExplosive /> : ''}
{classRating} {translate(m.name || m.grp)}</div> {classRating} {translate(m.name || m.grp)}</div>
<div className={'r'}>{formats.round1(m.getMass())}{u.T}</div> <div className={'r'}>{formats.round1(m.getMass())}{u.T}</div>
</div> </div>

View File

@@ -573,7 +573,7 @@ export default class Ship {
if (parts[3]) { if (parts[3]) {
const modstr = parts[3].replace(/-/g, '/'); const modstr = parts[3].replace(/-/g, '/');
if (modstr.match(':')) { if (modstr.match(':')) {
this.decodeModificationsString(LZString.decompressFromBase64(modstr), mods); this.decodeModificationsString(modstr, mods);
} else { } else {
this.decodeModificationsStruct(Buffer.from(modstr, 'base64'), mods); this.decodeModificationsStruct(Buffer.from(modstr, 'base64'), mods);
} }