-
Notifications
You must be signed in to change notification settings - Fork 19
feat(AutoSpiral): Add AutoSpiral module #234
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
base: 1.21.11
Are you sure you want to change the base?
Changes from all commits
5991d55
b0a759c
361314a
7391ee1
d71a475
97e37f6
fc3f97a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| * Copyright 2026 Lambda | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package com.lambda.config | ||
|
|
||
|
|
||
| interface LayoutBuildable { | ||
| fun buildLayout() | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* | ||
| * Copyright 2026 Lambda | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
|
|
||
| package com.lambda.config.settings | ||
|
|
||
| import com.lambda.config.LayoutBuildable | ||
| import com.lambda.gui.dsl.ImGuiBuilder.button | ||
| import com.lambda.util.Describable | ||
| import com.lambda.util.Nameable | ||
|
|
||
| class GuiButton( | ||
| override val name: String, | ||
| override val description: String, | ||
| val clickConsumer: () -> Unit? | ||
| ) : Nameable, Describable, LayoutBuildable { | ||
| override fun buildLayout() { | ||
| button(name) { | ||
| clickConsumer() | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -355,7 +355,8 @@ object BaritoneManager : Configurable(LambdaConfig), Automated by AutomationConf | |
| get() = isBaritoneLoaded && | ||
| (primary?.customGoalProcess?.isActive == true || | ||
| primary?.pathingBehavior?.isPathing == true || | ||
| primary?.pathingControlManager?.mostRecentInControl()?.orElse(null)?.isActive == true) | ||
| primary?.pathingControlManager?.mostRecentInControl()?.orElse(null)?.isActive == true || | ||
| primary?.elytraProcess?.isActive == true) | ||
|
|
||
| /** | ||
| * Sets the current Baritone goal and starts pathing | ||
|
|
@@ -365,11 +366,25 @@ object BaritoneManager : Configurable(LambdaConfig), Automated by AutomationConf | |
| primary?.customGoalProcess?.setGoalAndPath(goal) | ||
| } | ||
|
|
||
| /** | ||
| * Sets the current Baritone goal without starting pathing | ||
| */ | ||
| fun setGoal(goal: Goal) { | ||
| if (!isBaritoneLoaded || primary?.elytraProcess?.isLoaded == false) return | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it be better to do primary?.elytraProcess?.isLoaed != true? That way it would account for if its null too |
||
| primary?.customGoalProcess?.goal = goal | ||
| } | ||
|
|
||
| fun setGoalAndElytraPath(goal: Goal) { | ||
| if (!isBaritoneLoaded || primary?.elytraProcess?.isLoaded == false) return | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
| primary?.elytraProcess?.pathTo(goal) | ||
| } | ||
|
|
||
| /** | ||
| * Force cancel Baritone | ||
| */ | ||
| fun cancel() { | ||
| if (!isBaritoneLoaded) return | ||
| primary?.pathingBehavior?.cancelEverything() | ||
| primary?.elytraProcess?.resetState() | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -145,6 +145,9 @@ interface IRotationRequest : Automated { | |
| @RotationRequestDsl | ||
| fun yaw(yaw: Float) { yawBuilder = { yaw.toDouble() } } | ||
|
|
||
| @RotationRequestDsl | ||
| fun yaw(rotation: Rotation) { yawBuilder = { rotation.yaw } } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dont think theres any need for this and the other pitch function. Best just to call yaw() with rotation.yaw |
||
|
|
||
| @JvmName("pitchBuilder1") | ||
| @RotationRequestDsl | ||
| fun pitch(builder: SafeContext.() -> Double) { pitchBuilder = builder } | ||
|
|
@@ -159,6 +162,9 @@ interface IRotationRequest : Automated { | |
| @RotationRequestDsl | ||
| fun pitch(pitch: Float) { pitchBuilder = { pitch.toDouble() } } | ||
|
|
||
| @RotationRequestDsl | ||
| fun pitch(rotation: Rotation) { pitchBuilder = { rotation.pitch } } | ||
|
|
||
| @RotationRequestDsl | ||
| fun rotation(builder: SafeContext.() -> Rotation) { rotationBuilder = builder } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the best way to go about adding non-setting elements in the module gui. They seem to be hard coded to appear after non-grouped settings and before grouped settings and dont store any data in the config.
It would be nice to add arbitrary imgui elements in modules for more unique functionality, but this would likely rely on some sort of switch up in how configurables store data in the config jsons