Correctly handle cards that do not have a slot
This commit is contained in:
parent
b91b6a69ad
commit
5e25b42e2a
@ -26,11 +26,6 @@ function renameSlot(slot) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var slot = renameSlot(Component.settings.get('Slot'));
|
|
||||||
if (Component.settings.get('Slot2') != 'None') {
|
|
||||||
slot += '. ' + renameSlot(Component.settings.get('Slot2'));
|
|
||||||
}
|
|
||||||
|
|
||||||
const tag_replacements = {
|
const tag_replacements = {
|
||||||
"<fullname>": String(Component.getName()),
|
"<fullname>": String(Component.getName()),
|
||||||
"<gua>": "[guardian]",
|
"<gua>": "[guardian]",
|
||||||
@ -111,7 +106,6 @@ var card_data = {
|
|||||||
skill_intellect: skills["Intellect"],
|
skill_intellect: skills["Intellect"],
|
||||||
skill_wild: skills["Wild"],
|
skill_wild: skills["Wild"],
|
||||||
skill_willpower: skills["Willpower"],
|
skill_willpower: skills["Willpower"],
|
||||||
slot: String(slot),
|
|
||||||
// TODO: should also handle "Victory" field
|
// TODO: should also handle "Victory" field
|
||||||
text: substitute_tags(String(
|
text: substitute_tags(String(
|
||||||
Component.settings.get('Keywords') + '\n' + Component.settings.get('Rules'))),
|
Component.settings.get('Keywords') + '\n' + Component.settings.get('Rules'))),
|
||||||
@ -120,6 +114,15 @@ var card_data = {
|
|||||||
xp: parseInt(Component.settings.get('Level')) || null,
|
xp: parseInt(Component.settings.get('Level')) || null,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var raw_slot = Component.settings.get('Slot');
|
||||||
|
if (raw_slot) {
|
||||||
|
card_data.slot = renameSlot(String(raw_slot));
|
||||||
|
var raw_slot2 = Component.settings.get('Slot2');
|
||||||
|
if (raw_slot2 && raw_slot2 != 'None') {
|
||||||
|
card_data.slot += '. ' + renameSlot(raw_slot2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var subtitle = Component.settings.get('Subtitle');
|
var subtitle = Component.settings.get('Subtitle');
|
||||||
if (subtitle && subtitle != '') {
|
if (subtitle && subtitle != '') {
|
||||||
card_data.subname = subtitle;
|
card_data.subname = subtitle;
|
||||||
|
Loading…
Reference in New Issue
Block a user