Skip to content

Commit

Permalink
added flavor text to JavaFX as a tooltip over the card name, addressing
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Jun 1, 2015
1 parent 8b81d31 commit 8d995b0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.paint.Color;
Expand Down Expand Up @@ -104,6 +105,8 @@ private void setCardLabels() {
case "SCRAP":
scrapValue.setText(String.format("Scrap = %s", stringValue));
break;
case "flavor":
nameText.setTooltip(new Tooltip(stringValue));
default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.paint.Color;
Expand Down Expand Up @@ -124,6 +125,8 @@ private void setCardLabels() {
abilityText.setText(value); // truncatedString);
} else if (key.equals("name")) {
nameText.setText(value);
} else if (key.equalsIgnoreCase("flavor")) {
nameText.setTooltip(new Tooltip(value));
}
}
abilityText.setText(abilityText.getText() + CardHelper.stringResources(this.card));
Expand Down

0 comments on commit 8d995b0

Please sign in to comment.