Skip to content

Commit a6b3bea

Browse files
committed
Merge remote-tracking branch 'origin/master'
# Conflicts: # src/main/kotlin/com/github/subat0m1c/hatecheaters/modules/render/ProfileViewer.kt
2 parents 0e4b04b + deeb0d1 commit a6b3bea

File tree

6 files changed

+15
-9
lines changed

6 files changed

+15
-9
lines changed

src/main/kotlin/com/github/subat0m1c/hatecheaters/modules/render/ProfileViewer.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import com.github.subat0m1c.hatecheaters.pvgui.v2.PVGui
55
import com.github.subat0m1c.hatecheaters.pvgui.v2.PVGui.loadPlayer
66
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.setHover
77
import com.github.subat0m1c.hatecheaters.utils.LogHandler.Logger
8+
import com.github.subat0m1c.hatecheaters.utils.odinwrappers.OdinGray
89
import me.odinmain.clickgui.settings.AlwaysActive
910
import me.odinmain.clickgui.settings.Setting.Companion.withDependency
1011
import me.odinmain.clickgui.settings.impl.*
@@ -148,14 +149,14 @@ object ProfileViewer : Module(
148149
val themeEntries = listOf(
149150
Theme(
150151
"Classic",
151-
Color("555555FF"),
152+
OdinGray,
152153
Colors.MINECRAFT_BLUE,
153154
Colors.WHITE,
154155
Colors.MINECRAFT_GRAY,
155156
Colors.WHITE,
156157
"f",
157158
Colors.MINECRAFT_DARK_AQUA.withAlpha(0.8f),
158-
Color("555555FF"),
159+
Color(75, 75, 75),
159160
10f,
160161
0f,
161162
),

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/PVGui.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,19 @@ object PVGui : GuiScreen() {
7979
fun loadPlayer(name: String?, profileName: String? = null) = launch {
8080
getProfile(name ?: mc.thePlayer.name).fold(
8181
onSuccess = {
82+
if (it.profileData.profiles.isEmpty()) {
83+
loadText = "No profiles found for ${name}."
84+
return@launch
85+
}
8286
playerData = it
8387
setPlayer(it)
8488
updateProfile(profileName)
8589
}, onFailure = {
8690
modMessage(it.message)
87-
failed()
91+
loadText = "Failed to grab profile data."
8892
}
8993
)
9094
}
9195

92-
private fun failed() { loadText = "Failed to grab profile data." }
93-
9496
override fun doesGuiPauseGame(): Boolean = false
9597
}

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/Pages.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,15 @@ object Pages {
9797
}
9898

9999
Shaders.rect(lineY, lastY, pageWidth, lastHeight, ct.roundness, ct.button.hc())
100-
val betaText = if (currentPage != PageEntries.Overview) player.name else "HCPV 0.0.1"
100+
val betaText = if (currentPage != PageEntries.Overview) player.name else "HCPV 0.0.2"
101101
centeredText(
102102
betaText,
103103
pageCenter,
104104
lastY + lastHeight / 2,
105105
color = ct.font.hc(),
106106
scale = if (betaText.length >= 8) 3f else 3.5f
107107
)
108-
if (playerData != null) draw() else centeredText(loadText, mainCenterX, totalHeight / 2, 7f)
108+
if (playerData != null) draw() else centeredText(loadText, mainCenterX, totalHeight / 2, 5f)
109109
Shaders.popMatrix()
110110
}
111111

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/pages/Pets.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ object Pets: Pages.PVPage("Pets") {
3030
}
3131

3232
private val pets by profileLazy {
33-
profile.pets.pets.map { pet -> "${pet.colorName}${pet.petItem?.let { " §7(§${ct.fontCode}${it}§7)" } ?: ""}" }
33+
profile.pets.pets.sortedByDescending { it.exp }
34+
.map { pet -> "${pet.colorName}${pet.petItem?.let { " §7(§${ct.fontCode}${it}§7)" } ?: ""}" }
3435
}
3536

3637
private val entryHeight by profileLazy {

src/main/kotlin/com/github/subat0m1c/hatecheaters/utils/odinwrappers/Colors.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ object Colors {
4242
val TRANSPARENT = Color(OdinColors.TRANSPARENT)
4343
}
4444

45+
inline val OdinGray get() = OdinColor(35, 35, 35)
46+
4547
/**
4648
* this is so we can use odin's ColorSetting with our own wrapped class.
4749
*/

src/main/kotlin/com/github/subat0m1c/hatecheaters/utils/odinwrappers/Text.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object Text {
3131
if (char == 'r') {
3232
bold = false
3333
}
34-
val colorCode = "0123456789abcdefr".indexOf(text.lowercase()[i + 1])
34+
val colorCode = "0123456789abcdefr".indexOf(text.lowercase()[i + 1]).takeUnless { it == -1 } ?: 16
3535
color = colorCodes[colorCode]
3636
i += 2
3737
continue

0 commit comments

Comments
 (0)