Skip to content

Commit

Permalink
Compass bug fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
toxicity188 committed Nov 8, 2024
1 parent c64fe3b commit e3b7049
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ class CircleCompass(

selectedPointer.map[CompassData(ceil((length - abs(minus * length)) / 2).toInt())]?.let { pointComponent ->
val value = (minus * comp.width / 2 - comp.width / 2).roundToInt()
comp += (value - pointComponent.width / 2).toSpaceComponent() + pointComponent + (-value).toSpaceComponent()
val halfPoint = pointComponent.width.toDouble() / 2
comp += (value - floor(halfPoint).toInt()).toSpaceComponent() + pointComponent + (-value - ceil(halfPoint).toInt()).toSpaceComponent()
}
}
return (-comp.width / 2).toSpaceComponent() + comp
Expand Down
12 changes: 6 additions & 6 deletions dist/src/main/kotlin/kr/toxicity/hud/manager/CommandManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ object CommandManager : BetterHudManager {
"player" to Component.text(player.name()),
"hud" to Component.text(hud.name)
)
if (success) add_success.send(me, map)
else add_failure.send(me, map)
if (success) remove_success.send(me, map)
else remove_failure.send(me, map)
}
}
}
Expand Down Expand Up @@ -265,8 +265,8 @@ object CommandManager : BetterHudManager {
"player" to Component.text(player.name()),
"compass" to Component.text(compass.name)
)
if (success) add_success.send(me, map)
else add_failure.send(me, map)
if (success) remove_success.send(me, map)
else remove_failure.send(me, map)
}
}
}
Expand Down Expand Up @@ -320,8 +320,8 @@ object CommandManager : BetterHudManager {
"player" to Component.text(player.name()),
"popup" to Component.text(popup.name)
)
if (success) add_success.send(me, map)
else add_failure.send(me, map)
if (success) remove_success.send(me, map)
else remove_failure.send(me, map)
}
}
}
Expand Down

0 comments on commit e3b7049

Please sign in to comment.