|
| 1 | +/* |
| 2 | + * Copyright 2024 Lambda |
| 3 | + * |
| 4 | + * This program is free software: you can redistribute it and/or modify |
| 5 | + * it under the terms of the GNU General Public License as published by |
| 6 | + * the Free Software Foundation, either version 3 of the License, or |
| 7 | + * (at your option) any later version. |
| 8 | + * |
| 9 | + * This program is distributed in the hope that it will be useful, |
| 10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | + * GNU General Public License for more details. |
| 13 | + * |
| 14 | + * You should have received a copy of the GNU General Public License |
| 15 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 16 | + */ |
| 17 | + |
| 18 | +package com.lambda.module.hud |
| 19 | + |
| 20 | +import com.lambda.graphics.renderer.gui.font.FontRenderer.drawString |
| 21 | +import com.lambda.module.HudModule |
| 22 | +import com.lambda.module.ModuleRegistry |
| 23 | +import com.lambda.module.tag.ModuleTag |
| 24 | +import com.lambda.task.TaskFlow |
| 25 | +import com.lambda.util.math.Vec2d |
| 26 | + |
| 27 | +object ModuleList : HudModule( |
| 28 | + name = "ModuleList", |
| 29 | + defaultTags = setOf(ModuleTag.CLIENT), |
| 30 | +) { |
| 31 | + override val width = 200.0 |
| 32 | + override val height = 200.0 |
| 33 | + |
| 34 | + init { |
| 35 | + onRender { |
| 36 | + val enabled = ModuleRegistry.modules |
| 37 | + .filter { it.isEnabled } |
| 38 | + .filter { it.isVisible.value } |
| 39 | + drawString(enabled.joinToString("\n") { "${it.name} [${it.keybind.name}]" }, Vec2d.ZERO) |
| 40 | + } |
| 41 | + } |
| 42 | +} |
0 commit comments