summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-10-01 06:01:48 -0230
committerThatGravyBoat <thatgravyboat@gmail.com>2021-10-01 06:01:48 -0230
commitdb67c301c7dda69dda9665ed1194ba9d04fb487d (patch)
tree128b1110f508b1db3dbd4743bcf911600439161c
parent68366924a0d27f938a95accda5618eef970cbcc1 (diff)
downloadRewardClaim-db67c301c7dda69dda9665ed1194ba9d04fb487d.tar.gz
RewardClaim-db67c301c7dda69dda9665ed1194ba9d04fb487d.tar.bz2
RewardClaim-db67c301c7dda69dda9665ed1194ba9d04fb487d.zip
Fixed a bug where if the data wasn't loaded the store link would cause an error.v1.0.3
-rw-r--r--build.gradle2
-rw-r--r--src/main/kotlin/tech/thatgravyboat/rewardclaim/ui/RewardClaimGui.kt8
2 files changed, 7 insertions, 3 deletions
diff --git a/build.gradle b/build.gradle
index 0b88a5d..b23f830 100644
--- a/build.gradle
+++ b/build.gradle
@@ -5,7 +5,7 @@ plugins {
id "org.jetbrains.kotlin.jvm" version "1.5.31"
}
-version = "1.0.2"
+version = "1.0.3"
group = "tech.thatgravyboat"
archivesBaseName = "RewardClaim"
diff --git a/src/main/kotlin/tech/thatgravyboat/rewardclaim/ui/RewardClaimGui.kt b/src/main/kotlin/tech/thatgravyboat/rewardclaim/ui/RewardClaimGui.kt
index ad22f8c..ce47c4c 100644
--- a/src/main/kotlin/tech/thatgravyboat/rewardclaim/ui/RewardClaimGui.kt
+++ b/src/main/kotlin/tech/thatgravyboat/rewardclaim/ui/RewardClaimGui.kt
@@ -292,7 +292,7 @@ class RewardClaimGui(private val id: String) : WindowScreen() {
"Reward Claim AD",
"Hypixel is a great server and as such we don't want to remove their ad for their store. You can click the skip button when it appears to remove this message and claim your reward.",
UIImage.ofResourceCached("/rewardclaim/external_link.png"),
- { UDesktop.browse(URI(data.adLink)) },
+ { UDesktop.browse(getAd()) },
"${ChatColor.BOLD}Store",
null,
{ removePopup() },
@@ -303,13 +303,17 @@ class RewardClaimGui(private val id: String) : WindowScreen() {
"Reward Claim AD",
"Hypixel is a great server and as such we don't want to remove their ad for their store. You can click the skip button when it appears to remove this message and claim your reward.",
UIImage.ofResourceCached("/rewardclaim/external_link.png"),
- { UDesktop.browse(URI(data.adLink)) },
+ { UDesktop.browse(getAd()) },
"${ChatColor.BOLD}Store"
) childOf this.window
}
}
}
+ private fun getAd() : URI {
+ return if (this::data.isInitialized) URI(data.adLink) else URI("https://store.hypixel.net/?utm_source=rewards-video&utm_medium=website&utm_content=TRsCiBNYY7M&utm_campaign=Rewardss")
+ }
+
override fun onDrawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) {
this.window.draw()
}