Skip to content

Commit

Permalink
Merge pull request #66 from Carifio24/material-royalty-export-optional
Browse files Browse the repository at this point in the history
Don't include empty component descriptions in spell export
  • Loading branch information
Carifio24 authored Apr 25, 2024
2 parents 39efa2d + 8e25935 commit eba1cef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions app/src/main/java/dnd/jon/spellbook/BaseSpellListExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ void addTextForSpell(Spell spell) {
final String componentsPrompt = DisplayUtils.componentsPrompt(context);
addPromptText(componentsPrompt, spell.componentsString());
addLineBreak();
addPromptText(DisplayUtils.materialsPrompt(context), spell.getMaterial());
addLineBreak();
addPromptText(DisplayUtils.rangePrompt(context), spell.getRoyalty());
addLineBreak();
if (!spell.getMaterial().isEmpty()) {
addPromptText(DisplayUtils.materialsPrompt(context), spell.getMaterial());
addLineBreak();
}
if (!spell.getRoyalty().isEmpty()) {
addPromptText(DisplayUtils.royaltyPrompt(context), spell.getRoyalty());
addLineBreak();
}
final String durationPrompt = DisplayUtils.durationPrompt(context);
final String durationText = DisplayUtils.string(context, spell.getDuration());
addPromptText(durationPrompt, durationText);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/spellcasting_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
A spell\'s components are the physical requirements you
must meet in order to cast it. Each spell\'s description
indicates whether it requires verbal (V), somatic (S),
or material (M) components. If you can\'t provide one
material (M), or royalty (R) components. If you can\'t provide one
or more of a spell\'s components, you are unable to
cast the spell.
\n\n<b>VERBAL (V)</b>
Expand Down

0 comments on commit eba1cef

Please sign in to comment.