Add ability to easily hide reminder text

This commit is contained in:
Josh birnholz
2023-07-23 16:10:38 -04:00
parent 01fc5b767d
commit d27352af94
2 changed files with 19 additions and 0 deletions

View File

@@ -2687,6 +2687,19 @@ function writeText(textObject, targetContext) {
//Preps the text string
var splitString = '6GJt7eL8';
var rawText = textObject.text
if (document.querySelector('#hide-reminder-text').checked && textObject.name && textObject.name != 'Title' && textObject.name != 'Type' && textObject.name != 'Mana Cost' && textObject.name != 'Power/Toughness') {
var rulesText = rawText;
var flavorText = '';
var flavorIndex = rawText.indexOf('{flavor}') || rawText.indexOf('///');
if (flavorIndex >= 0) {
flavorText = rawText.substring(flavorIndex);
rulesText = rawText.substring(0, flavorIndex);
}
rulesText = rulesText.replace(/\([^\)]+\)/, '');
rawText = rulesText + flavorText;
}
if (textAllCaps) {
rawText = rawText.toUpperCase();
}