Only render the overlay in game

main
Charlotte Som 2022-02-05 12:41:04 +00:00
parent fec2da3d7f
commit e28dd79cee
1 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import codes.som.hibiscus.HibiscusMod
import codes.som.hibiscus.api.feature.Feature import codes.som.hibiscus.api.feature.Feature
import codes.som.hibiscus.api.feature.FeatureCategory import codes.som.hibiscus.api.feature.FeatureCategory
import codes.som.hibiscus.events.PostRenderAllEvent import codes.som.hibiscus.events.PostRenderAllEvent
import codes.som.hibiscus.mc
import imgui.ImGui import imgui.ImGui
import imgui.flag.ImGuiCol import imgui.flag.ImGuiCol
import imgui.flag.ImGuiStyleVar import imgui.flag.ImGuiStyleVar
@ -14,6 +15,9 @@ class Overlay : Feature("Overlay", FeatureCategory.OVERLAY) {
val enabledFeatures by values.bool("Enabled Features", true) val enabledFeatures by values.bool("Enabled Features", true)
on { _: PostRenderAllEvent -> on { _: PostRenderAllEvent ->
if (mc.world == null || mc.options.debugEnabled)
return@on
val viewport = ImGui.getMainViewport() val viewport = ImGui.getMainViewport()
ImGui.setNextWindowPos(viewport.posX, viewport.posY) ImGui.setNextWindowPos(viewport.posX, viewport.posY)
ImGui.setNextWindowSize(viewport.sizeX, viewport.sizeY) ImGui.setNextWindowSize(viewport.sizeX, viewport.sizeY)