Hints: disable card hints in m15 render mode;

This commit is contained in:
Oleg Agafonov 2019-02-09 12:00:24 +04:00
parent 3f510e97c9
commit f341d35ece
4 changed files with 13 additions and 1 deletions

View file

@ -5,6 +5,7 @@
*/
package org.mage.card.arcane;
import mage.abilities.hint.HintUtils;
import mage.cards.ArtRect;
import mage.client.dialog.PreferencesDialog;
import mage.constants.AbilityType;
@ -137,12 +138,18 @@ public abstract class CardRenderer {
}
protected void parseRules(List<String> stringRules, ArrayList<TextboxRule> keywords, ArrayList<TextboxRule> rules) {
// Translate the textbox text
// Translate the textbox text and remove card hints
for (String rule : stringRules) {
// remove all card hints
if (rule.equals(HintUtils.HINT_START_MARK)) {
break;
}
// Kill reminder text
if (PreferencesDialog.getCachedValue(PreferencesDialog.KEY_CARD_RENDERING_REMINDER_TEXT, "false").equals("false")) {
rule = CardRendererUtils.killReminderText(rule).trim();
}
if (!rule.isEmpty()) {
TextboxRule tbRule = TextboxRuleParser.parse(cardView, rule);
if (tbRule.type == TextboxRuleType.SIMPLE_KEYWORD) {

View file

@ -15,6 +15,9 @@ public class HintUtils {
public static final String HINT_ICON_BAD = "ICON_BAD";
public static final String HINT_ICON_RESTRICT = "ICON_RESTRICT";
//
public static final String HINT_START_MARK = "<br/><hintstart/>"; // workaround to find hint text in rules list and shows it in html
public static String prepareText(String text, Color color) {
return prepareText(text, color, null);
}

View file

@ -273,6 +273,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
// total hints
if (!abilityHints.isEmpty()) {
rules.add(HintUtils.HINT_START_MARK);
rules.addAll(abilityHints);
}
}

View file

@ -294,6 +294,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
// total hints
if (!abilityHints.isEmpty() || !restrictHints.isEmpty()) {
rules.add(HintUtils.HINT_START_MARK);
rules.addAll(abilityHints);
rules.addAll(restrictHints);
}