diff --git a/src/main/kotlin/dartzee/screen/dartzee/DartzeeRuleVerificationPanel.kt b/src/main/kotlin/dartzee/screen/dartzee/DartzeeRuleVerificationPanel.kt index 8c3e2e1b8..4b60b1532 100644 --- a/src/main/kotlin/dartzee/screen/dartzee/DartzeeRuleVerificationPanel.kt +++ b/src/main/kotlin/dartzee/screen/dartzee/DartzeeRuleVerificationPanel.kt @@ -10,12 +10,12 @@ import dartzee.`object`.Dart import dartzee.screen.GameplayDartboard import dartzee.utils.DartsColour import dartzee.utils.InjectedThings.dartzeeCalculator +import dartzee.utils.ResourceCache import java.awt.BorderLayout import java.awt.Color import java.awt.Dimension import java.awt.event.ActionEvent import java.awt.event.ActionListener -import javax.swing.ImageIcon import javax.swing.JButton import javax.swing.JLabel import javax.swing.JPanel @@ -57,7 +57,7 @@ class DartzeeRuleVerificationPanel : JPanel(), DartboardListener, ActionListener tfResult.isEditable = false btnReset.preferredSize = Dimension(60, 60) - btnReset.icon = ImageIcon(javaClass.getResource("/buttons/Reset.png")) + btnReset.icon = ResourceCache.ICON_RESET btnReset.toolTipText = "Reset darts" btnReset.addActionListener(this) diff --git a/src/main/kotlin/dartzee/screen/game/DartsGamePanel.kt b/src/main/kotlin/dartzee/screen/game/DartsGamePanel.kt index 2953959f0..00e35495d 100644 --- a/src/main/kotlin/dartzee/screen/game/DartsGamePanel.kt +++ b/src/main/kotlin/dartzee/screen/game/DartsGamePanel.kt @@ -36,6 +36,7 @@ import dartzee.screen.game.x01.GamePanelX01 import dartzee.utils.InjectedThings import dartzee.utils.InjectedThings.mainDatabase import dartzee.utils.InjectedThings.preferenceService +import dartzee.utils.ResourceCache import dartzee.utils.ResourceCache.ICON_STATS_LARGE import dartzee.utils.getColourWrapperFromPrefs import dartzee.utils.getQuotedIdStr @@ -145,11 +146,11 @@ abstract class DartsGamePanel< panelSouth.add(panelAiSlider, BorderLayout.NORTH) panelSouth.add(panelButtons, BorderLayout.CENTER) btnConfirm.preferredSize = Dimension(80, 80) - btnConfirm.icon = ImageIcon(javaClass.getResource("/buttons/Confirm.png")) + btnConfirm.icon = ResourceCache.ICON_CONFIRM btnConfirm.toolTipText = "Confirm round" panelButtons.add(btnConfirm) btnReset.preferredSize = Dimension(80, 80) - btnReset.icon = ImageIcon(javaClass.getResource("/buttons/Reset.png")) + btnReset.icon = ResourceCache.ICON_RESET btnReset.toolTipText = "Reset round" panelButtons.add(btnReset) btnResign.preferredSize = Dimension(80, 80) diff --git a/src/main/kotlin/dartzee/screen/game/TutorialPanel.kt b/src/main/kotlin/dartzee/screen/game/TutorialPanel.kt index 121eacde2..4315d3b12 100644 --- a/src/main/kotlin/dartzee/screen/game/TutorialPanel.kt +++ b/src/main/kotlin/dartzee/screen/game/TutorialPanel.kt @@ -52,10 +52,11 @@ class TutorialPanel(private val parent: DartsGameScreen) : scrollPane.setViewportView(panelWest) panelWest.border = EtchedBorder(EtchedBorder.RAISED, null, null) panelWest.layout = MigLayout("al center top") - panelWest.preferredSize = Dimension(500, 950) + panelWest.preferredSize = Dimension(525, 950) add(scrollPane, BorderLayout.WEST) val lblRules = makeTitleLabel("The Rules") + lblRules.icon = ImageIcon(javaClass.getResource("/buttons/gameReport.png")) panelWest.add(lblRules, "cell 0 0, growx") panelWest.add(makeDivider(), "cell 0 1, alignx center") @@ -102,10 +103,10 @@ class TutorialPanel(private val parent: DartsGameScreen) : panelSouth.add(btnConfirm) panelSouth.add(btnReset) btnConfirm.preferredSize = Dimension(80, 80) - btnConfirm.icon = ImageIcon(javaClass.getResource("/buttons/Confirm.png")) + btnConfirm.icon = ResourceCache.ICON_CONFIRM btnConfirm.toolTipText = "Confirm round" btnReset.preferredSize = Dimension(80, 80) - btnReset.icon = ImageIcon(javaClass.getResource("/buttons/Reset.png")) + btnReset.icon = ResourceCache.ICON_RESET btnReset.toolTipText = "Reset round" btnConfirm.isEnabled = false btnReset.isEnabled = false @@ -140,14 +141,14 @@ class TutorialPanel(private val parent: DartsGameScreen) : private fun makeTextPane() = makeTransparentTextPane().apply { - font = ResourceCache.UNICODE_FONT + font = ResourceCache.BASE_FONT setFontSize(24) border = EmptyBorder(10, 5, 20, 5) } private fun makeTitleLabel(text: String) = JLabel(text).apply { - font = ResourceCache.UNICODE_FONT + font = ResourceCache.BASE_FONT border = EmptyBorder(10, 10, 10, 0) horizontalAlignment = SwingConstants.CENTER setFontSize(30) @@ -155,23 +156,29 @@ class TutorialPanel(private val parent: DartsGameScreen) : private fun makeRulesPane() = makeTextPane().apply { - append("\uD83D\uDCC9 Score down from 301. First to hit 0 wins.") + insertComponent(makeIconLabel(ResourceCache.ICON_GRAPH_DECREASING)) + append(" Score down from 301. First to hit 0 wins.") append("\n\n") - append("\uD83C\uDFAF You must finish") + insertComponent(makeIconLabel(ResourceCache.ICON_CALCULATOR)) + append(" You must finish") append(" exactly", bold = true) append(" - score too much and you'll lose your score for the round!") append("\n\n") - append( - "\uD83D\uDDB1\uFE0F Input your score by clicking on the Dartboard. Use the ✅ to confirm." - ) + insertComponent(makeIconLabel(ResourceCache.ICON_DARTBOARD)) + append(" Input your score by clicking on the Dartboard. Use the ") + insertComponent(makeIconLabel(ResourceCache.ICON_CONFIRM)) + append(" to confirm.") append("\n\n") - append("❎ Use the reset button if you mis-click.") + insertComponent(makeIconLabel(ResourceCache.ICON_RESET)) + append(" Use the reset button if you mis-click.") } + private fun makeIconLabel(icon: ImageIcon) = JLabel(icon).also { it.alignmentY = 0.65f } + private fun makeDivider() = JSeparator(SwingConstants.HORIZONTAL).apply { - border = EmptyBorder(10, 0, 10, 0) - preferredSize = Dimension(200, 2) + border = EmptyBorder(10, 0, 5, 0) + preferredSize = Dimension(240, 2) } override fun actionPerformed(e: ActionEvent?) { diff --git a/src/main/kotlin/dartzee/screen/sync/SyncManagementPanel.kt b/src/main/kotlin/dartzee/screen/sync/SyncManagementPanel.kt index 0a17f9242..159dd5956 100644 --- a/src/main/kotlin/dartzee/screen/sync/SyncManagementPanel.kt +++ b/src/main/kotlin/dartzee/screen/sync/SyncManagementPanel.kt @@ -46,7 +46,7 @@ class SyncManagementPanel : JPanel(), ActionListener { layout = BorderLayout(0, 0) add(panelMainOptions, BorderLayout.CENTER) btnPerformSync.icon = ImageIcon(javaClass.getResource("/buttons/sync.png")) - btnReset.icon = ImageIcon(javaClass.getResource("/buttons/Reset.png")) + btnReset.icon = ResourceCache.ICON_RESET btnPull.icon = ImageIcon(javaClass.getResource("/buttons/pull.png")) btnPush.icon = ImageIcon(javaClass.getResource("/buttons/push.png")) diff --git a/src/main/kotlin/dartzee/utils/ApplicationConstants.kt b/src/main/kotlin/dartzee/utils/ApplicationConstants.kt index ea376bcd4..250045145 100644 --- a/src/main/kotlin/dartzee/utils/ApplicationConstants.kt +++ b/src/main/kotlin/dartzee/utils/ApplicationConstants.kt @@ -1,5 +1,5 @@ package dartzee.utils -const val DARTS_VERSION_NUMBER = "v7.1.0" +const val DARTS_VERSION_NUMBER = "v7.1.1" const val DARTZEE_REPOSITORY_URL = "https://api.github.com/repos/alyssaruth/Dartzee" const val DARTZEE_MANUAL_DOWNLOAD_URL = "https://github.com/alyssaruth/Dartzee/releases" diff --git a/src/main/kotlin/dartzee/utils/ResourceCache.kt b/src/main/kotlin/dartzee/utils/ResourceCache.kt index a56692077..f20c64c48 100644 --- a/src/main/kotlin/dartzee/utils/ResourceCache.kt +++ b/src/main/kotlin/dartzee/utils/ResourceCache.kt @@ -31,6 +31,11 @@ object ResourceCache { val ICON_PAUSE = ImageIcon(javaClass.getResource("/buttons/pause.png")) val ICON_STATS_LARGE = ImageIcon(javaClass.getResource("/buttons/stats_large.png")) val ICON_TEAMS = ImageIcon(javaClass.getResource("/buttons/teams.png")) + val ICON_RESET = ImageIcon(javaClass.getResource("/buttons/Reset.png")) + val ICON_CONFIRM = ImageIcon(javaClass.getResource("/buttons/Confirm.png")) + val ICON_GRAPH_DECREASING = ImageIcon(javaClass.getResource("/icons/graph_decreasing.png")) + val ICON_DARTBOARD = ImageIcon(javaClass.getResource("/icons/dartboard.png")) + val ICON_CALCULATOR = ImageIcon(javaClass.getResource("/icons/calculator_large.png")) val AVATAR_UNSET = ImageIcon(PlayerAvatar::class.java.getResource("/avatars/Unset.png")) @@ -89,9 +94,6 @@ object ResourceCache { val BASE_FONT: Font = Font.createFont(Font.TRUETYPE_FONT, javaClass.getResourceAsStream("/trebuc.ttf")) - val UNICODE_FONT: Font = - Font.createFont(Font.TRUETYPE_FONT, javaClass.getResourceAsStream("/arialunicode.ttf")) - private val wavPoolLock = Any() private val hmWavToInputStreams = HashMapList() diff --git a/src/main/resources/ChangeLog b/src/main/resources/ChangeLog index e6d697842..4f5798dd0 100644 --- a/src/main/resources/ChangeLog +++ b/src/main/resources/ChangeLog @@ -1,3 +1,9 @@ +--------- v7.1.1 --------- + ++ Tutorial for party mode += Other party mode tweaks += 93.6% test coverage (14349 / 15330 lines covered by 2447 tests) + --------- v7.1.0 --------- + Option to not have to finish on a double in X01 diff --git a/src/main/resources/arialunicode.ttf b/src/main/resources/arialunicode.ttf deleted file mode 100644 index 51a18bca5..000000000 Binary files a/src/main/resources/arialunicode.ttf and /dev/null differ diff --git a/src/main/resources/icons/calculator_large.png b/src/main/resources/icons/calculator_large.png new file mode 100644 index 000000000..747e6892b Binary files /dev/null and b/src/main/resources/icons/calculator_large.png differ diff --git a/src/main/resources/icons/dartboard.png b/src/main/resources/icons/dartboard.png new file mode 100644 index 000000000..6b846cb9a Binary files /dev/null and b/src/main/resources/icons/dartboard.png differ diff --git a/src/main/resources/icons/graph_decreasing.png b/src/main/resources/icons/graph_decreasing.png new file mode 100644 index 000000000..35d9d6a6e Binary files /dev/null and b/src/main/resources/icons/graph_decreasing.png differ