Skip to content

Commit

Permalink
feat(radar): draw radar in UI colors
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mwerle committed Nov 8, 2024
1 parent 9b7df53 commit 62b0501
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions data/pigui/modules/radar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
2 changes: 1 addition & 1 deletion src/pigui/Radar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 62b0501

Please sign in to comment.