mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2025-12-10 10:20:44 -07:00
Avoid magic numbers
This commit is contained in:
parent
be1aac7fe7
commit
d730ff65c4
1 changed files with 5 additions and 2 deletions
|
|
@ -16,6 +16,7 @@ import java.awt.image.BufferedImage
|
|||
version = 0.9
|
||||
)
|
||||
|
||||
|
||||
class plugin : Plugin() {
|
||||
private var xpGlobes = Array(Constants.SKILL_COUNT) { skillId -> XPGlobe(skillId, Constants.INVALID_XP, Constants.INVALID_XP, 0L, null) }
|
||||
private var lastGain = 0L
|
||||
|
|
@ -62,6 +63,7 @@ class plugin : Plugin() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
override fun OnXPUpdate(skillId: Int, xp: Int) {
|
||||
if (xpGlobes[skillId].xp == Constants.INVALID_XP) {
|
||||
xpGlobes[skillId].xp = xp
|
||||
|
|
@ -76,7 +78,7 @@ class plugin : Plugin() {
|
|||
val prevXp = xpGlobes[skillId].xp
|
||||
xpGlobes[skillId].xp = xp
|
||||
xpGlobes[skillId].prevXp = prevXp
|
||||
xpGlobes[skillId].timestamp = 0
|
||||
xpGlobes[skillId].timestamp = 0L
|
||||
val (prevLevel, _) = XPTable.getLevelForXp(prevXp)
|
||||
val (level, gainedXp) = XPTable.getLevelForXp(xp)
|
||||
|
||||
|
|
@ -112,7 +114,7 @@ class plugin : Plugin() {
|
|||
|
||||
override fun OnLogout() {
|
||||
lastGain = 0L
|
||||
xpGlobes = Array(24) { skillId -> XPGlobe(skillId, Constants.INVALID_XP, Constants.INVALID_XP, 0, null) }
|
||||
xpGlobes = Array(Constants.SKILL_COUNT) { skillId -> XPGlobe(skillId, Constants.INVALID_XP, Constants.INVALID_XP, 0L, null) }
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -156,6 +158,7 @@ class plugin : Plugin() {
|
|||
return SpritePNGLoader.getImageIndexedSprite(createArcImage(size, arcColor, weight))
|
||||
}
|
||||
|
||||
|
||||
private fun createArcImage(size: Int, arcColor: Color, weight: Double): BufferedImage {
|
||||
val image = BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB)
|
||||
val graphics = image.createGraphics()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue