Skip to content

Commit e9775aa

Browse files
committed
fix(YHV1): Remove native calls in UI
1 parent c02b2fd commit e9775aa

2 files changed

Lines changed: 26 additions & 25 deletions

File tree

SSV2/includes/frontend/yhv1_ui.lua

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,19 @@ local SGSL = require("includes.services.SGSL")
1212
local secondary_targets = { "Cash", "Weed", "Coke", "Gold" }
1313
local cayo_secondary_target_i, cayo_secondary_target_c
1414

15-
-- https://github.com/root-cause/v-labels/blob/master/labels.json
16-
local heistNames <const> = {
17-
"AWT_1026", -- The Cluckin' Bell Farm Raid
18-
"DLCC_AVIM", -- KnoWay Out
19-
"AWT_973", -- Don't Fuck With Dre
20-
"HACK24_MFM_STR", -- Oscar Guzman Flies Again
21-
"HTITLE_TUT", -- The Fleeca Job
22-
"HTITLE_PRISON", -- The Prison Break
23-
"HTITLE_HUMANE", -- The Humane Labs Raid
24-
"HTITLE_NARC", -- Series A Funding
25-
"HTITLE_ORNATE", -- The Pacific Standard Job
15+
local heistNames <const> = { -- https://github.com/root-cause/v-labels/blob/master/labels.json
16+
CluckinBellFarmRaid = "AWT_1026",
17+
KnoWayOut = "DLCC_AVIM",
18+
DontFuckWithDre = "AWT_973",
19+
OscarGuzmanFliesAgain = "HACK24_MFM_STR",
20+
FleecaJob = "HTITLE_TUT",
21+
PrisonBreak = "HTITLE_PRISON",
22+
HumaneLabsRaid = "HTITLE_HUMANE",
23+
SeriesAFunding = "HTITLE_NARC",
24+
PacificStandardJob = "HTITLE_ORNATE",
25+
DataBreaches = "HPSTRAND_IAAb",
26+
BogdanProblem = "HPSTRAND_SUBb",
27+
DoomsdayScenario = "HPSTRAND_MSILb",
2628
}
2729
local tabNames <const> = {
2830
"YH_BASIC_TAB", -- Basic
@@ -32,9 +34,9 @@ local tabNames <const> = {
3234

3335
---@type HEIST_TYPES
3436
local HEIST_TYPES = {
35-
{ -- Cluckin Bell
37+
{
3638
get_name = function()
37-
return heistNames[1]
39+
return heistNames.CluckinBellFarmRaid
3840
end,
3941
get_coords = function()
4042
return vec3:new(-1093.15, -807.14, 19.28)
@@ -46,9 +48,9 @@ local HEIST_TYPES = {
4648
cooldown_gvar = "cfr_cd",
4749
},
4850
},
49-
{ -- KnoWay
51+
{
5052
get_name = function()
51-
return heistNames[2]
53+
return heistNames.KnoWayOut
5254
end,
5355
get_coords = function()
5456
return YHV1:GetAviLocation()
@@ -60,9 +62,9 @@ local HEIST_TYPES = {
6062
cooldown_gvar = "knoway_cd",
6163
},
6264
},
63-
{ -- Dr Dre
65+
{
6466
get_name = function()
65-
return heistNames[3]
67+
return heistNames.DontFuckWithDre
6668
end,
6769
get_coords = function()
6870
return YHV1:GetAgencyLocation()
@@ -74,9 +76,9 @@ local HEIST_TYPES = {
7476
cooldown_gvar = "dre_cd",
7577
}
7678
},
77-
{ -- Oscar Guzman
79+
{
7880
get_name = function()
79-
return heistNames[4]
81+
return heistNames.OscarGuzmanFliesAgain
8082
end,
8183
get_coords = function()
8284
return YHV1:GetFieldHangarLocation()
@@ -351,7 +353,7 @@ local function drawDDayTab()
351353
GUI:HeaderText(_T("CP_HEIST_SETUP"), { separator = true, spacing = true })
352354
-- Final ACT 1
353355
ImGui.BeginDisabled(dday_status == 229383)
354-
if (GUI:Button(Game.GetGXTLabel("HPSTRAND_IAAb"))) then -- The Data Breaches
356+
if (GUI:Button(heistNames.DataBreaches)) then
355357
stats.set_int("MPX_GANGOPS_FLOW_MISSION_PROG", 503)
356358
stats.set_int("MPX_GANGOPS_HEIST_STATUS", 229383)
357359
stats.set_int("MPX_GANGOPS_FLOW_NOTIFICATIONS", 1557)
@@ -360,15 +362,15 @@ local function drawDDayTab()
360362
-- Final ACT 2
361363
ImGui.SameLine()
362364
ImGui.BeginDisabled(dday_status == 229378)
363-
if (GUI:Button(Game.GetGXTLabel("HPSTRAND_SUBb"))) then -- The Bogdan Problem
365+
if (GUI:Button(heistNames.BogdanProblem)) then
364366
stats.set_int("MPX_GANGOPS_FLOW_MISSION_PROG", 240)
365367
stats.set_int("MPX_GANGOPS_HEIST_STATUS", 229378)
366368
stats.set_int("MPX_GANGOPS_FLOW_NOTIFICATIONS", 1557)
367369
end
368370
ImGui.EndDisabled()
369371
-- Final ACT 3
370372
ImGui.BeginDisabled(dday_status == 229380)
371-
if (GUI:Button(Game.GetGXTLabel("HPSTRAND_MSILb"))) then -- The Doomsday Scenario
373+
if (GUI:Button(heistNames.DoomsdayScenario)) then
372374
stats.set_int("MPX_GANGOPS_FLOW_MISSION_PROG", 16368)
373375
stats.set_int("MPX_GANGOPS_HEIST_STATUS", 229380)
374376
stats.set_int("MPX_GANGOPS_FLOW_NOTIFICATIONS", 1557)

SSV2/includes/services/Translator.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ end
139139

140140
---@param labels array<string>
141141
function Translator:TranslateGXTList(labels)
142-
for i = 1, #labels do
143-
local label = labels[i]
144-
labels[i] = self:TranslateGXT(label)
142+
for k, v in pairs(labels) do
143+
labels[k] = self:TranslateGXT(v)
145144
end
146145
end

0 commit comments

Comments
 (0)