From aa3ad851cf60086f3e225ee408edfafa8ed1254c Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Fri, 25 Feb 2022 21:44:09 +0800 Subject: [PATCH] add a cross in the middle & adjust timebar height --- internal/game/imgui.go | 4 ++++ internal/game/render_debuginfo.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/game/imgui.go b/internal/game/imgui.go index 4324817..c46ec63 100644 --- a/internal/game/imgui.go +++ b/internal/game/imgui.go @@ -1,6 +1,7 @@ package game import ( + "image/color" "log" "math" "os" @@ -144,6 +145,9 @@ func (g *Game) imgui() { } imgui.End() + imgui.BackgroundDrawList().AddRectFilledV(imgui.Vec2{X: float32(io.DisplaySize[0]/2 - 12), Y: float32(io.DisplaySize[1]/2 - 1)}, imgui.Vec2{X: float32(io.DisplaySize[0]/2 + 12), Y: float32(io.DisplaySize[1]/2 + 1)}, imgui.Packed(color.White), 0, 0) + imgui.BackgroundDrawList().AddRectFilledV(imgui.Vec2{X: float32(io.DisplaySize[0]/2 - 1), Y: float32(io.DisplaySize[1]/2 - 12)}, imgui.Vec2{X: float32(io.DisplaySize[0]/2 + 1), Y: float32(io.DisplaySize[1]/2 + 12)}, imgui.Packed(color.White), 0, 0) + imgui.SetNextWindowPosV(imgui.Vec2{float32(io.DisplaySize[0] / 2), float32(io.DisplaySize[1]) + 1}, imgui.ConditionAlways, imgui.Vec2{0.5, 1}) if igwrap.Begin("InventoryBar", nil, imgui.WindowFlagsAlwaysAutoResize|imgui.WindowFlagsNoNavFocus|imgui.WindowFlagsNoNavInputs|imgui.WindowFlagsNoDecoration|imgui.WindowFlagsNoBringToFrontOnFocus|imgui.WindowFlagsNoSavedSettings|imgui.WindowFlagsNoFocusOnAppearing) { diff --git a/internal/game/render_debuginfo.go b/internal/game/render_debuginfo.go index fcabaa1..91efbbb 100644 --- a/internal/game/render_debuginfo.go +++ b/internal/game/render_debuginfo.go @@ -14,7 +14,7 @@ import ( const ( timebarN = 700 - timebarScale = 256 + timebarScale = 128 ) var (