Skip to content

Commit 034f71d

Browse files
committed
UI(YRV3): make the colored nameplate optional
- Add an option to toggle the Nightclub nameplate color. - Keep the player's vehicle when teleporting to the salvage yard.
1 parent 7d17395 commit 034f71d

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

SSV2/includes/frontend/yrv3_ui.lua

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ local sCooldownButtonLabel, bCooldownParam
1111
local alwaysPopularClicked = false
1212
local bigTips = false
1313
local bigTipsClicked = false
14+
local coloredNameplate = false
1415
local maxSellMissionButtonSize = vec2:new(80, 30)
1516
local progressBarSize = vec2:new(300, 25)
1617
local moneyGreen = Color("#85BB65")
@@ -79,7 +80,8 @@ end
7980
---@param business BusinessFront
8081
---@param custom_name string
8182
---@param bg Color
82-
local function drawNamePlate(business, custom_name, bg)
83+
---@param tpKeepVeh? boolean
84+
local function drawNamePlate(business, custom_name, bg, tpKeepVeh)
8385
ImGui.BeginChild("##nightclub",
8486
0,
8587
130,
@@ -111,7 +113,7 @@ local function drawNamePlate(business, custom_name, bg)
111113
ImGui.SetCursorPosX((ImGui.GetContentRegionAvail() - tp_label_width) * 0.5)
112114
if (coords) then
113115
if (GUI:Button(_T("GENERIC_TELEPORT"))) then
114-
YRV3:Teleport(coords)
116+
YRV3:Teleport(coords, tpKeepVeh)
115117
end
116118
end
117119
ImGui.EndChild()
@@ -370,13 +372,9 @@ local function drawBikerBusinesses()
370372
ImGui.EndTabBar()
371373
end
372374

373-
local tempHubVal = 0
374-
local function drawNightclub()
375-
local businessHubTotalValue = 0
376-
local club = YRV3:GetNightclub()
377-
if (not club) then
378-
ImGui.Text(_T("YRV3_CLUB_NOT_OWNED"))
379-
return
375+
local function getClubNameColor()
376+
if (not coloredNameplate) then
377+
return Color(ImGui.GetStyleColorVec4(ImGuiCol.Text))
380378
end
381379

382380
-- synthwave and pain
@@ -388,11 +386,23 @@ local function drawNightclub()
388386
local glow = Color.FromHSV(hue, 0.7, 0.8, 1)
389387
local flash = Color.FromHSV((hue + 0.2) % 1.0, 0.9, 1.0, 1)
390388
local bg = base:Mix(glow, beat * 0.6)
391-
bg = bg:Mix(flash, accent * 0.8)
389+
return bg:Mix(flash, accent * 0.8)
390+
end
391+
392+
local tempHubVal = 0
393+
local function drawNightclub()
394+
local businessHubTotalValue = 0
395+
local club = YRV3:GetNightclub()
396+
if (not club) then
397+
ImGui.Text(_T("YRV3_CLUB_NOT_OWNED"))
398+
return
399+
end
392400

401+
local bg = getClubNameColor()
393402
ImGui.PushStyleColor(ImGuiCol.Border, bg:AsU32())
394403
drawNamePlate(club, club:GetCustomName(), bg)
395404
ImGui.PopStyleColor()
405+
coloredNameplate, _ = GUI:CustomToggle("Synthwave & Pain", coloredNameplate)
396406
ImGui.Spacing()
397407

398408
local popValue = club:GetPopularity()
@@ -726,7 +736,8 @@ local function drawSalvageYard()
726736
drawNamePlate(
727737
salvage_yard,
728738
salvage_yard:GetName(),
729-
Color(ImGui.GetStyleColorVec4(ImGuiCol.Text))
739+
Color(ImGui.GetStyleColorVec4(ImGuiCol.Text)),
740+
true
730741
)
731742

732743
ImGui.Spacing()

0 commit comments

Comments
 (0)