Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
trim_trailing_whitespace = true

[*.{kt,kts}]
ij_kotlin_code_style_defaults = KOTLIN_OFFICIAL
ktlint_code_style = intellij_idea
ktlint_standard_no-wildcard-imports = disabled
ktlint_standard_function-expression-body = disabled
ktlint_standard_filename = disabled
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
* fix(MiningPrediction): use server tick
* fix(RawInput): generate a separate dll for every Minecraft instance

## 0.11.2 ()
## 0.11.2 (UTC+8 2025/05/30 02:00)

* feat(Repository): request cooldown
* feat(Cursor): add Hide When Not Moving
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ object ContinuousTrail : Trail<CursorOptionsImpl.Continuous> {

private val renderedPoints = ArrayDeque<SamplePoint>()

private var lastMouse: Vec2D? = null

private var lastMouseMoveTime = 0L

private fun ArrayDeque<SamplePoint>.removeDead(
time: Long,
alive: Long,
Expand All @@ -62,6 +66,11 @@ object ContinuousTrail : Trail<CursorOptionsImpl.Continuous> {
lastTime: Long,
options: CursorOptionsImpl.Continuous,
) {
val lastMouse = lastMouse.also {
if (it != mouse) lastMouseMoveTime = time
lastMouse = mouse
}

if (!options.enabled) {
clear()
return
Expand Down Expand Up @@ -109,9 +118,11 @@ object ContinuousTrail : Trail<CursorOptionsImpl.Continuous> {
event.widgets +=
ContinuousTrailWidget(
if (renderedPoints[0] === samplePoints[0]) {
renderedPoints
ArrayDeque(renderedPoints)
} else if (options.hideWhenNotMoving && mouse == lastMouse) {
ArrayDeque(renderedPoints prepend samplePoints[0].copy(time = lastMouseMoveTime))
} else {
renderedPoints prepend samplePoints[0]
ArrayDeque(renderedPoints prepend samplePoints[0])
},
options.radius.double,
options.bloom.double,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,17 @@ data class ContinuousTrailWidget(
val trailT = ((duration + (timeSamples - t - 1) * fade / timeSamples) * 1e9).long
val trail =
iterator {
var firstRendered = false
samplePoints.firstOrNull {
if (time - it.time <= trailT) {
yield(it.position.x to it.position.y)
firstRendered = true
false
} else {
val position = mousePositionGetter(time, trailT)
yield(position.x to position.y)
if (firstRendered) {
val position = mousePositionGetter(time, trailT)
yield(position.x to position.y)
}
true
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ class CursorOptionsImpl :
size = 1,
)
val keepSamples = 0.1F

@Switch(
name = "Hide When Not Moving",
size = 1,
)
val hideWhenNotMoving = false
}

@Extract
Expand Down
Loading