More GUI tweaks
This commit is contained in:
parent
7d939c6fe9
commit
40f413e7a7
3 changed files with 11 additions and 9 deletions
|
@ -3,12 +3,12 @@ package codes.som.hibiscus.features
|
|||
import codes.som.hibiscus.api.feature.Feature
|
||||
import codes.som.hibiscus.features.movement.Flight
|
||||
import codes.som.hibiscus.features.movement.Speed
|
||||
import codes.som.hibiscus.features.overlay.FeatureList
|
||||
import codes.som.hibiscus.features.overlay.FeatureListOverlay
|
||||
import codes.som.hibiscus.features.player.NoFallDamage
|
||||
|
||||
val ALL_FEATURES: Array<() -> Feature> = arrayOf(
|
||||
::NoFallDamage,
|
||||
::Flight,
|
||||
::FeatureList,
|
||||
::FeatureListOverlay,
|
||||
::Speed,
|
||||
)
|
||||
|
|
|
@ -6,9 +6,10 @@ import codes.som.hibiscus.api.feature.FeatureCategory
|
|||
import codes.som.hibiscus.events.PostRenderAllEvent
|
||||
import imgui.ImGui
|
||||
import imgui.flag.ImGuiCol
|
||||
import imgui.flag.ImGuiStyleVar
|
||||
import imgui.flag.ImGuiWindowFlags
|
||||
|
||||
class FeatureList : Feature("Feature List", FeatureCategory.OVERLAY) {
|
||||
class FeatureListOverlay : Feature("Feature List", FeatureCategory.OVERLAY) {
|
||||
init {
|
||||
on { _: PostRenderAllEvent ->
|
||||
val viewport = ImGui.getMainViewport()
|
||||
|
@ -22,6 +23,8 @@ class FeatureList : Feature("Feature List", FeatureCategory.OVERLAY) {
|
|||
return@on
|
||||
|
||||
ImGui.pushStyleColor(ImGuiCol.WindowBg, 10, 10, 10, 104)
|
||||
ImGui.pushStyleVar(ImGuiStyleVar.WindowPadding, 4f, 4f)
|
||||
ImGui.pushStyleVar(ImGuiStyleVar.WindowMinSize, 0f, 0f)
|
||||
|
||||
if (ImGui.begin(
|
||||
"Feature List",
|
||||
|
@ -34,9 +37,10 @@ class FeatureList : Feature("Feature List", FeatureCategory.OVERLAY) {
|
|||
ImGui.text(feature.name)
|
||||
ImGui.popStyleColor()
|
||||
}
|
||||
|
||||
ImGui.popStyleColor()
|
||||
ImGui.end()
|
||||
|
||||
ImGui.popStyleVar(2)
|
||||
ImGui.popStyleColor()
|
||||
}
|
||||
|
||||
enabled = true
|
|
@ -47,9 +47,7 @@ object ModuleControlsUI {
|
|||
feature.enabled = !feature.enabled
|
||||
}
|
||||
|
||||
ImGui.popStyleColor()
|
||||
ImGui.popStyleColor()
|
||||
ImGui.popStyleColor()
|
||||
ImGui.popStyleColor(3)
|
||||
|
||||
if (feature.values.exist()) {
|
||||
val showValueWindow = moduleValueWindows.getOrPut(feature) { ImBoolean(false) }
|
||||
|
@ -76,7 +74,7 @@ object ModuleControlsUI {
|
|||
categoryPanel(
|
||||
category,
|
||||
ImGui.getMainViewport().posX + 10f,
|
||||
ImGui.getMainViewport().posY + 10f + index * 20f
|
||||
ImGui.getMainViewport().posY + 10f + index * 30f
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue