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