From 40f413e7a7f9175d1bc7ecd7977b364ac26822a9 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Thu, 3 Feb 2022 23:20:27 +0000 Subject: [PATCH] More GUI tweaks --- .../kotlin/codes/som/hibiscus/features/FeatureList.kt | 4 ++-- .../overlay/{FeatureList.kt => FeatureListOverlay.kt} | 10 +++++++--- .../kotlin/codes/som/hibiscus/gui/ModuleControlsUI.kt | 6 ++---- 3 files changed, 11 insertions(+), 9 deletions(-) rename src/main/kotlin/codes/som/hibiscus/features/overlay/{FeatureList.kt => FeatureListOverlay.kt} (83%) diff --git a/src/main/kotlin/codes/som/hibiscus/features/FeatureList.kt b/src/main/kotlin/codes/som/hibiscus/features/FeatureList.kt index e744d09..57ec4a3 100644 --- a/src/main/kotlin/codes/som/hibiscus/features/FeatureList.kt +++ b/src/main/kotlin/codes/som/hibiscus/features/FeatureList.kt @@ -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, ) diff --git a/src/main/kotlin/codes/som/hibiscus/features/overlay/FeatureList.kt b/src/main/kotlin/codes/som/hibiscus/features/overlay/FeatureListOverlay.kt similarity index 83% rename from src/main/kotlin/codes/som/hibiscus/features/overlay/FeatureList.kt rename to src/main/kotlin/codes/som/hibiscus/features/overlay/FeatureListOverlay.kt index 792f9bc..8bbe9ad 100644 --- a/src/main/kotlin/codes/som/hibiscus/features/overlay/FeatureList.kt +++ b/src/main/kotlin/codes/som/hibiscus/features/overlay/FeatureListOverlay.kt @@ -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 diff --git a/src/main/kotlin/codes/som/hibiscus/gui/ModuleControlsUI.kt b/src/main/kotlin/codes/som/hibiscus/gui/ModuleControlsUI.kt index 98ba796..4c2009a 100644 --- a/src/main/kotlin/codes/som/hibiscus/gui/ModuleControlsUI.kt +++ b/src/main/kotlin/codes/som/hibiscus/gui/ModuleControlsUI.kt @@ -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 ) } }