Skip to content

Commit 2154044

Browse files
committed
Quick hud tags
1 parent e51f562 commit 2154044

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

common/src/main/kotlin/com/lambda/module/HudModule.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ import com.lambda.util.math.Vec2d
1111
abstract class HudModule(
1212
name: String,
1313
description: String = "",
14+
defaultTags: Set<ModuleTag> = setOf(),
1415
alwaysListening: Boolean = false,
1516
enabledByDefault: Boolean = false,
1617
defaultKeybind: KeyCode = KeyCode.UNBOUND,
17-
) : Module(name, description, setOf(ModuleTag.HUD), alwaysListening, enabledByDefault, defaultKeybind) {
18+
) : Module(name, description, defaultTags, alwaysListening, enabledByDefault, defaultKeybind) {
1819
private val renderCallables = mutableListOf<RenderLayer.() -> Unit>()
1920

2021
protected abstract val width: Double

common/src/main/kotlin/com/lambda/module/hud/Watermark.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ import com.lambda.graphics.renderer.gui.TextureRenderer.drawTexture
44
import com.lambda.graphics.renderer.gui.TextureRenderer.drawTextureShaded
55
import com.lambda.graphics.texture.MipmapTexture
66
import com.lambda.module.HudModule
7+
import com.lambda.module.tag.ModuleTag
78

89
object Watermark : HudModule(
9-
"Watermark"
10+
name = "Watermark",
11+
defaultTags = setOf(ModuleTag.HUD_CLIENT),
1012
) {
1113
private val shade by setting("Shade", true)
1214

common/src/main/kotlin/com/lambda/module/tag/ModuleTag.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import com.lambda.util.Nameable
1616
* @param name The name of the tag.
1717
*/
1818
data class ModuleTag(override val name: String) : Nameable {
19+
// Totally needs to be reworked
1920
companion object {
2021
val COMBAT = ModuleTag("Combat")
2122
val MOVEMENT = ModuleTag("Movement")
@@ -26,8 +27,8 @@ data class ModuleTag(override val name: String) : Nameable {
2627
val DEBUG = ModuleTag("Debug")
2728
val defaults = setOf(COMBAT, MOVEMENT, RENDER, PLAYER, NETWORK, DEBUG, CLIENT)
2829

29-
val HUD = ModuleTag("Hud") // omg
30-
val hudDefaults = setOf(HUD)
30+
val HUD_CLIENT = ModuleTag("Client") // omg
31+
val hudDefaults = setOf(HUD_CLIENT)
3132

3233
// currently secondary tags
3334
val WORLD = ModuleTag("World")

0 commit comments

Comments
 (0)