Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(AutoQueue/Custom): module control #5702

Merged
merged 1 commit into from
Feb 24, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,27 @@ object AutoQueueCustom : Choice("Custom") {
)
}

object Control : ToggleableConfigurable(this, "Control", true) {
private object AutoQueueControl : ToggleableConfigurable(this, "Control", true) {

val killAura by boolean("KillAura", true)
val speed by boolean("Speed", false)

fun changeGameState(isInGame: Boolean) {
if (!enabled) {
return
}
var wasInQueue = false
set(value) {
field = value

if (killAura) ModuleKillAura.enabled = isInGame
if (speed) ModuleSpeed.enabled = isInGame
}
if (!enabled) {
return
}

if (killAura) ModuleKillAura.enabled = !value
if (speed) ModuleSpeed.enabled = !value
}

}

init {
tree(Control)
tree(AutoQueueControl)
}

private val waitUntilWorldChange by boolean("WaitUntilWorldChange", true)
Expand All @@ -83,18 +86,17 @@ object AutoQueueCustom : Choice("Custom") {
val trigger = triggers.activeChoice

if (trigger.isTriggered) {
Control.changeGameState(false)
AutoQueueControl.wasInQueue = true

actions.activeChoice.execute(this)
onCancellation { Control.changeGameState(true) }

if (waitUntilWorldChange) {
waitUntil { worldChangeOccurred }
worldChangeOccurred = false
}

waitTicks(20)
Control.changeGameState(true)
} else if (AutoQueueControl.enabled && AutoQueueControl.wasInQueue) {
AutoQueueControl.wasInQueue = false
}
}

Expand Down
Loading