Skip to content

Commit

Permalink
1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
syd711 committed Sep 22, 2022
1 parent 72dd0b1 commit e80cc93
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
6 changes: 3 additions & 3 deletions resources/card-generator.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue Sep 20 20:02:25 CEST 2022
#Thu Sep 22 18:15:11 CEST 2022
card.alphacomposite.black=28
card.alphacomposite.white=10
card.background=highscore-card-background-2.jpg
Expand All @@ -11,11 +11,11 @@ card.highscores.row.separator=7
card.sampleTable=7
card.score.font.font.style=0
card.score.font.name=Computerfont
card.score.font.size=80
card.score.font.size=100
card.score.font.style=0
card.table.font.font.style=0
card.table.font.name=Bernard MT Condensed
card.table.font.size=90
card.table.font.size=100
card.table.font.style=0
card.title.font.file=MediaCore-Bold.ttf
card.title.font.font.style=0
Expand Down
Binary file modified resources/highscore-card-sample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions resources/overlay-generator.properties
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#Tue Sep 20 20:02:25 CEST 2022
#Thu Sep 22 18:12:11 CEST 2022
overlay.alphacomposite.black=36
overlay.alphacomposite.white=0
overlay.background=background4k.jpg
overlay.challengedTable=6
overlay.font.color=\#ffffff
overlay.highscores.row.padding.left=87
overlay.highscores.row.separator=32
overlay.highscores.row.separator=24
overlay.highscores.text=Latest Highscores
overlay.hotkey=2+F1
overlay.score.font.font.style=0
overlay.score.font.name=Digiface
overlay.score.font.size=120
overlay.score.font.size=100
overlay.score.font.style=0
overlay.skipWithMissingWheels=true
overlay.table.font.font.style=0
overlay.table.font.name=SF Comic Script
overlay.table.font.size=100
overlay.table.font.size=120
overlay.table.font.style=0
overlay.title.font.font.style=0
overlay.title.font.name=Star Jedi
overlay.title.font.size=110
overlay.title.font.size=130
overlay.title.font.style=0
overlay.title.text=Table of the Month
overlay.title.y.offset=70
overlay.title.y.offset=89
Binary file modified resources/overlay.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public CardSettingsTab(ConfigWindow configWindow, VPinService service) {
/******************************** Generator Fields ****************************************************************/
WidgetFactory.createFileChooser(settingsPanel, "Background Image:", "Select File", store, "card.background", "highscore-card-background.jpg");
WidgetFactory.createTextField(settingsPanel, "Card Title:", store, "card.title.text", "Highscore");
WidgetFactory.createFontSelector(settingsPanel, "Title Font:", store, "card.title.font");
WidgetFactory.createFontSelector(settingsPanel, "Table Name Font:", store, "card.table.font");
WidgetFactory.createFontSelector(settingsPanel, "Score Font:", store, "card.score.font");
WidgetFactory.createFontSelector(settingsPanel, "Title Font:", store, "card.title.font", 120);
WidgetFactory.createFontSelector(settingsPanel, "Table Name Font:", store, "card.table.font", 100);
WidgetFactory.createFontSelector(settingsPanel, "Score Font:", store, "card.score.font", 80);
WidgetFactory.createColorChooser(configWindow, settingsPanel, "Font Color:", store, "card.font.color");
WidgetFactory.createSpinner(settingsPanel, "Padding Top:", "px", store, "card.title.y.offset", 80);
WidgetFactory.createSpinner(settingsPanel, "Padding Left:", "px", store, "card.highscores.row.padding.left", 60);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ private static int renderTableChallenge(BufferedImage image, GameInfo challenged
g.setFont(new Font(TABLE_FONT_NAME, TABLE_FONT_STYLE, TABLE_FONT_SIZE));
String challengedTable = challengedGame.getGameDisplayName();
int width = g.getFontMetrics().stringWidth(challengedTable);
int tableNameY = titleY + ROW_SEPARATOR + TITLE_FONT_SIZE;


int tableNameY = titleY + (2* ROW_SEPARATOR) + TITLE_FONT_SIZE;
g.drawString(challengedTable, imageWidth / 2 - width / 2, tableNameY);

g.setFont(new Font(SCORE_FONT_NAME, SCORE_FONT_STYLE, SCORE_FONT_SIZE));
Expand All @@ -118,12 +120,12 @@ private static int renderTableChallenge(BufferedImage image, GameInfo challenged
}

int position = 0;
int wheelWidth = 3 * TITLE_FONT_SIZE + 3 * ROW_SEPARATOR;
int wheelWidth = (3 * SCORE_FONT_SIZE) + (3 * ROW_SEPARATOR);
int totalScoreAndWheelWidth = scoreWidth + wheelWidth;

for (String score : scores) {
position++;
int scoreY = tableNameY + (position * SCORE_FONT_SIZE) + ROW_SEPARATOR;
int scoreY = tableNameY + (position * SCORE_FONT_SIZE) + (position * ROW_SEPARATOR);
g.drawString(score, imageWidth / 2 - totalScoreAndWheelWidth / 2 + wheelWidth + ROW_SEPARATOR, scoreY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public OverlaySettingsTab(ConfigWindow configWindow, VPinService service) {
WidgetFactory.createFileChooser(settingsPanel, "Background Image:", "Select File", store, "overlay.background", "background4k.jpg");
WidgetFactory.createTextField(settingsPanel, "Challenge Title:", store, "overlay.title.text", "Table of the Month");
WidgetFactory.createTextField(settingsPanel, "Highscores Title:", store, "overlay.highscores.text", "Latest Highscores");
WidgetFactory.createFontSelector(settingsPanel, "Title Font:", store, "overlay.title.font");
WidgetFactory.createFontSelector(settingsPanel, "Table Name Font:", store, "overlay.table.font");
WidgetFactory.createFontSelector(settingsPanel, "Score Font:", store, "overlay.score.font");
WidgetFactory.createFontSelector(settingsPanel, "Title Font:", store, "overlay.title.font", 130);
WidgetFactory.createFontSelector(settingsPanel, "Table Name Font:", store, "overlay.table.font", 120);
WidgetFactory.createFontSelector(settingsPanel, "Score Font:", store, "overlay.score.font", 100);
WidgetFactory.createColorChooser(configWindow, settingsPanel, "Font Color:", store, "overlay.font.color");
WidgetFactory.createSpinner(settingsPanel, "Padding Top:", "px", store, "overlay.title.y.offset", 80);
WidgetFactory.createSpinner(settingsPanel, "Padding Left:", "px", store, "overlay.highscores.row.padding.left", 60);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,10 @@ public String getDescription() {
});
}

public static void createFontSelector(JPanel parent, String label, PropertiesStore store, String property) {
public static void createFontSelector(JPanel parent, String label, PropertiesStore store, String property, int defaultSize) {
parent.add(new JLabel(label));
String name = store.getString(property + ".name", "Arial");
int size = store.getInt(property + ".size", 48);
int size = store.getInt(property + ".size", defaultSize);
final JLabel titleFontLabel = new JLabel(name + " / " + size);
parent.add(titleFontLabel, "span 3");
JButton fontChooserButton = new JButton("Choose Font");
Expand Down

0 comments on commit e80cc93

Please sign in to comment.