mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-08 14:33:22 +00:00
Adding functionality to pull the 'description' field from specials and show a tooltip, describing what the special does.
This commit is contained in:
@@ -12,6 +12,7 @@ import { STATS_FORMATTING } from '../shipyard/StatsFormatting';
|
||||
* @returns {Object} The react components
|
||||
*/
|
||||
export function specialToolTip(translate, blueprint, grp, m, specialName) {
|
||||
const description = [];
|
||||
const effects = [];
|
||||
if (!blueprint || !blueprint.features) {
|
||||
return undefined;
|
||||
@@ -19,6 +20,15 @@ export function specialToolTip(translate, blueprint, grp, m, specialName) {
|
||||
if (m) {
|
||||
// We also add in any benefits from specials that aren't covered above
|
||||
if (m.blueprint) {
|
||||
if (specialName) {
|
||||
if (Modifications.specials[specialName].description) {
|
||||
description.push(
|
||||
<div className={'success'} style={{ maxWidth: 350, padding: 5, marginBottom: 10 }}>
|
||||
{Modifications.specials[specialName].description}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
for (const feature in Modifications.modifierActions[specialName]) {
|
||||
// if (!blueprint.features[feature] && !m.mods.feature) {
|
||||
const featureDef = Modifications.modifications[feature];
|
||||
@@ -53,6 +63,7 @@ export function specialToolTip(translate, blueprint, grp, m, specialName) {
|
||||
|
||||
return (
|
||||
<div>
|
||||
{description}
|
||||
<table width='100%'>
|
||||
<tbody>
|
||||
{effects}
|
||||
|
||||
Reference in New Issue
Block a user