From 62b0501935ded359f7291d44601dab84699f2fd9 Mon Sep 17 00:00:00 2001 From: Michael Werle Date: Sat, 9 Nov 2024 08:39:09 +0900 Subject: [PATCH] feat(radar): draw radar in UI colors The radar ("azimuthal mode") is drawn using the reticule colours (white), which clashes with the rest of the dashboard icons/controls as well as the scanner ("3d mode"). This commit changes the radar colours to (mostly) match the scanner colours. It also tweaks the line-width of the scanner and radar backgrounds: - rader inner lines are made thinner - scanner border is made thicker --- data/pigui/modules/radar.lua | 24 +++++++++++++++++------- src/pigui/Radar.cpp | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/data/pigui/modules/radar.lua b/data/pigui/modules/radar.lua index 6f310eff6f..9ed7026597 100644 --- a/data/pigui/modules/radar.lua +++ b/data/pigui/modules/radar.lua @@ -52,21 +52,31 @@ local function display2DRadar(cntr, size) local halfsize = size * 0.5 local thirdsize = size * 0.3 local twothirdsize = size * 0.7 + local fgColor = colors.uiPrimary + local bgColor = colors.uiBackground:opacity(0.54) + local lineThickness = 1.5 local function line(x,y) - -- ui.addLine(cntr + Vector2(x, y) * halfsize, cntr + Vector2(x,y) * size, colors.reticuleCircle, ui.reticuleCircleThickness) - ui.addLine(cntr + Vector2(x, y) * thirdsize, cntr + Vector2(x,y) * twothirdsize, colors.reticuleCircle, ui.reticuleCircleThickness) + -- ui.addLine(cntr + Vector2(x, y) * halfsize, cntr + Vector2(x,y) * size, colors.uiPrimaryDark, lineThickness) + ui.addLine(cntr + Vector2(x, y) * thirdsize, cntr + Vector2(x,y) * twothirdsize, fgColor, lineThickness) end - ui.addCircleFilled(cntr, size, colors.lightBlueBackground, ui.circleSegments(size), 1) - ui.addCircle(cntr, size, colors.reticuleCircle, ui.circleSegments(size), ui.reticuleCircleThickness) - -- ui.addCircle(cntr, halfsize, colors.reticuleCircle, ui.circleSegments(halfsize), ui.reticuleCircleThickness) - ui.addCircle(cntr, thirdsize, colors.reticuleCircle, ui.circleSegments(thirdsize), ui.reticuleCircleThickness) - ui.addCircle(cntr, twothirdsize, colors.reticuleCircle, ui.circleSegments(twothirdsize), ui.reticuleCircleThickness) + + -- radar background and border + ui.addCircleFilled(cntr, size, bgColor, ui.circleSegments(size), 1) + ui.addCircle(cntr, size, fgColor, ui.circleSegments(size), lineThickness * 2) + + -- inner circles + -- ui.addCircle(cntr, halfsize, fgColor, ui.circleSegments(halfsize), lineThickness) + ui.addCircle(cntr, thirdsize, fgColor, ui.circleSegments(thirdsize), lineThickness) + ui.addCircle(cntr, twothirdsize, fgColor, ui.circleSegments(twothirdsize), lineThickness) local l = ui.oneOverSqrtTwo + -- cross-lines line(-l, l) line(-l, -l) line(l, -l) line(l, l) + + -- Draw target markers local combatTarget = player:GetCombatTarget() local navTarget = player:GetNavTarget() local tooltip = {} diff --git a/src/pigui/Radar.cpp b/src/pigui/Radar.cpp index a54cf01f18..3c55f0d9cc 100644 --- a/src/pigui/Radar.cpp +++ b/src/pigui/Radar.cpp @@ -66,7 +66,7 @@ void RadarWidget::DrawPiGui() for (float ang = 0; ang < circle; ang += step) { drawList->PathLineTo(circlePos(ang, m_center, m_radius)); } - drawList->PathStroke(ImGui::GetColorU32(ImGuiCol_FrameBgActive), true); + drawList->PathStroke(ImGui::GetColorU32(ImGuiCol_FrameBgActive), true, 2.0); // inner ring for (float ang = 0; ang < circle; ang += circle / 20.f) {