Skip to content

Commit 9429698

Browse files
kaz2700KazutoXDAvanatiker
authored
Rename AutoLog module to AutoDisconnect (#450)
* Rename AutoLog module to AutoDisconnect In most clients this module is called AutoDisconnect so as to avoid confusion I think renaming it would be very good :) * Cleanup Co-authored-by: KazutoXD <[email protected]> Co-authored-by: Constructor <[email protected]>
1 parent 58020a4 commit 9429698

File tree

2 files changed

+23
-15
lines changed

2 files changed

+23
-15
lines changed

src/main/kotlin/com/lambda/client/gui/mc/LambdaGuiDisconnected.kt

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,61 @@
11
package com.lambda.client.gui.mc
22

3-
import com.lambda.client.module.modules.combat.AutoLog
3+
import com.lambda.client.module.modules.combat.AutoDisconnect
44
import com.lambda.client.util.threads.mainScope
55
import kotlinx.coroutines.delay
66
import kotlinx.coroutines.launch
77
import net.minecraft.client.gui.GuiButton
88
import net.minecraft.client.gui.GuiScreen
99
import java.time.LocalTime
1010

11-
class LambdaGuiDisconnected(private val reason: Array<String>, private val screen: GuiScreen, private val disable: Boolean, private val logoutTime: LocalTime) : GuiScreen() {
11+
class LambdaGuiDisconnected(
12+
private val reason: Array<String>,
13+
private val screen: GuiScreen,
14+
private val disable: Boolean,
15+
private val logoutTime: LocalTime
16+
) : GuiScreen() {
1217

1318
override fun initGui() {
1419
super.initGui()
1520

1621
buttonList.add(GuiButton(0, width / 2 - 100, 200, "Okay"))
1722
if (!disable) {
18-
buttonList.add(GuiButton(1, width / 2 - 100, 220, "Disable AutoLog"))
23+
buttonList.add(GuiButton(1, width / 2 - 100, 220, "Disable AutoDisconnect"))
1924
} else {
2025
disable()
2126
}
2227
}
2328

2429
override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) {
2530
drawBackground(0)
26-
drawCenteredString(fontRenderer, "[AutoLog] Logged because:", width / 2, 80, 0x9B90FF)
27-
for ((index, reason) in reason.withIndex()) {
31+
drawCenteredString(fontRenderer, "[AutoDisconnect] Disconnected because:", width / 2, 80, 0x9B90FF)
32+
33+
reason.forEachIndexed { index, reason ->
2834
drawCenteredString(fontRenderer, reason, width / 2, 94 + (14 * index), 0xFFFFFF)
2935
}
3036

3137
drawCenteredString(fontRenderer, "Logged out at: $logoutTime", width / 2, 140, 0xFFFFFFF)
3238

33-
if (!disable) drawCenteredString(fontRenderer, "Disabled AutoLog", width / 2, 224, 0xDE413C)
39+
if (!disable) drawCenteredString(fontRenderer, "Disabled AutoDisconnect", width / 2, 224, 0xDE413C)
3440
super.drawScreen(mouseX, mouseY, partialTicks)
3541
}
3642

3743
override fun keyTyped(typedChar: Char, keyCode: Int) {}
3844

3945
override fun actionPerformed(button: GuiButton) {
40-
if (button.id == 0) mc.displayGuiScreen(screen)
41-
if (button.id == 1) {
42-
disable()
43-
buttonList.remove(button)
46+
when (button.id) {
47+
0 -> mc.displayGuiScreen(screen)
48+
1 -> {
49+
disable()
50+
buttonList.remove(button)
51+
}
4452
}
4553
}
4654

4755
private fun disable() {
4856
mainScope.launch {
4957
delay(250L)
50-
AutoLog.disable()
58+
AutoDisconnect.disable()
5159
}
5260
}
5361

src/main/kotlin/com/lambda/client/module/modules/combat/AutoLog.kt renamed to src/main/kotlin/com/lambda/client/module/modules/combat/AutoDisconnect.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import com.lambda.client.manager.managers.CombatManager
77
import com.lambda.client.manager.managers.FriendManager
88
import com.lambda.client.module.Category
99
import com.lambda.client.module.Module
10-
import com.lambda.client.module.modules.combat.AutoLog.Reasons.*
10+
import com.lambda.client.module.modules.combat.AutoDisconnect.Reasons.*
1111
import com.lambda.client.util.EntityUtils.isFakeOrSelf
1212
import com.lambda.client.util.combat.CombatUtils.scaledHealth
1313
import com.lambda.client.util.items.allSlots
@@ -25,9 +25,9 @@ import net.minecraft.util.text.TextComponentString
2525
import net.minecraftforge.fml.common.gameevent.TickEvent
2626
import java.time.LocalTime
2727

28-
object AutoLog : Module(
29-
name = "AutoLog",
30-
description = "Automatically log when in danger or on low health",
28+
object AutoDisconnect : Module(
29+
name = "AutoDisconnect",
30+
description = "Automatically disconnects when in danger or on low health",
3131
category = Category.COMBAT,
3232
alwaysListening = true
3333
) {

0 commit comments

Comments
 (0)