Skip to content

Commit 8880204

Browse files
committed
refactor(YHV1): Rebrand to Mastermind
1 parent e9775aa commit 8880204

4 files changed

Lines changed: 42 additions & 42 deletions

File tree

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,16 @@ local secondary_targets = { "CASH", "WEED", "COKE", "GOLD" }
3434

3535
---@alias HEIST_TYPES table<integer, HeistInfo>
3636

37-
---@class YimHeists
37+
---@class Mastermind
3838
---@field private m_raw_data RawBusinessData
3939
---@field private m_properties { agency: AgencyProperty, hangar: FieldHangarProperty, facility: FacilityProperty, submarine: SubmarineProperty }
4040
---@field m_tab Tab
41-
local YimHeists = { m_raw_data = require("includes.data.yrv3_data") }
42-
YimHeists.__index = YimHeists
43-
YimHeists.__label = "YimHeists"
41+
local Mastermind = { m_raw_data = require("includes.data.yrv3_data") }
42+
Mastermind.__index = Mastermind
43+
Mastermind.__label = "Mastermind"
4444

45-
---@return YimHeists
46-
function YimHeists:init()
45+
---@return Mastermind
46+
function Mastermind:init()
4747
local instance = setmetatable({
4848
m_properties = {}
4949
}, self)
@@ -62,38 +62,38 @@ end
6262
---@param statName string
6363
---@param statVal integer
6464
---@param notifTitle string
65-
function YimHeists:SkipPrep(statName, statVal, notifTitle)
65+
function Mastermind:SkipPrep(statName, statVal, notifTitle)
6666
stats.set_int(statName, statVal)
6767
Notifier:ShowSuccess(notifTitle, _T("YH_PREP_SKIP_NOTIF"))
6868
end
6969

7070
-- https://www.unknowncheats.me/forum/4489469-post16.html
7171
---@param type string
7272
---@param index integer
73-
function YimHeists:SetSecondaryTargets(type, index)
73+
function Mastermind:SetCayoSecTargets(type, index)
7474
local targets = { 0, 0, 0, 0 }
7575
targets[index] = -1
7676

7777
for st = 1, 4 do
7878
local stat_name = _F("MPX_H4LOOT_%s_%s", secondary_targets[st], type)
7979
stats.set_int(stat_name, targets[st])
80-
stats.set_int(stat_name .. "_SCOPED", targets[st])
80+
stats.set_int(_F("%s_SCOPED", stat_name), targets[st])
8181
end
8282

8383
stats.set_int("MPX_H4LOOT_PAINT", -1) -- Not really any reason to have an option for paintings
8484
stats.set_int("MPX_H4LOOT_PAINT_SCOPED", -1)
8585
end
8686

8787
---@return integer, integer
88-
function YimHeists:GetSecondaryTargets()
88+
function Mastermind:GetCayoSecTargets()
8989
local loot_i, loot_c
9090

9191
for st = 1, 4 do
9292
local stat_name = _F("MPX_H4LOOT_%s", secondary_targets[st])
93-
if (stats.get_int(stat_name .. "_I") == -1) then
93+
if (stats.get_int(_F("%s_I", stat_name)) == -1) then
9494
loot_i = st - 1 -- ImGui indexes by 0
9595
end
96-
if (stats.get_int(stat_name .. "_C") == -1) then
96+
if (stats.get_int(_F("%s_C", stat_name)) == -1) then
9797
loot_c = st - 1
9898
end
9999
end
@@ -114,7 +114,7 @@ local function GetSubCoordsGlobal()
114114
:At(vec_offset)
115115
end
116116

117-
function YimHeists:ReadPropertyData()
117+
function Mastermind:ReadPropertyData()
118118
ThreadManager:Run(function()
119119
while (Game.IsInTransition()) do
120120
yield()
@@ -165,7 +165,7 @@ function YimHeists:ReadPropertyData()
165165
end
166166

167167
---@return vec3
168-
function YimHeists:GetAviLocation()
168+
function Mastermind:GetAviLocation()
169169
local stat = stats.get_int("MPX_M25_AVI_MISSION_CURRENT")
170170
local blip = HUD.GET_FIRST_BLIP_INFO_ID(76)
171171
if (blip and stat ~= 4) then
@@ -179,12 +179,12 @@ function YimHeists:GetAviLocation()
179179
end
180180

181181
---@return AgencyProperty?
182-
function YimHeists:GetAgencyProperty()
182+
function Mastermind:GetAgencyProperty()
183183
return self.m_properties.agency
184184
end
185185

186186
---@return vec3?
187-
function YimHeists:GetAgencyLocation()
187+
function Mastermind:GetAgencyLocation()
188188
local agency = self:GetAgencyProperty()
189189
if (not agency) then
190190
return
@@ -194,12 +194,12 @@ function YimHeists:GetAgencyLocation()
194194
end
195195

196196
---@return FieldHangarProperty?
197-
function YimHeists:GetFieldHangarProperty()
197+
function Mastermind:GetFieldHangarProperty()
198198
return self.m_properties.hangar
199199
end
200200

201201
---@return vec3?
202-
function YimHeists:GetFieldHangarLocation()
202+
function Mastermind:GetFieldHangarLocation()
203203
local hangar = self:GetFieldHangarProperty()
204204
if (not hangar) then
205205
return
@@ -209,12 +209,12 @@ function YimHeists:GetFieldHangarLocation()
209209
end
210210

211211
---@return FacilityProperty?
212-
function YimHeists:GetFacilityProperty()
212+
function Mastermind:GetFacilityProperty()
213213
return self.m_properties.facility
214214
end
215215

216216
---@return vec3?
217-
function YimHeists:GetFacilityLocation()
217+
function Mastermind:GetFacilityLocation()
218218
local facility = self:GetFacilityProperty()
219219
if (not facility) then
220220
return
@@ -224,7 +224,7 @@ function YimHeists:GetFacilityLocation()
224224
end
225225

226226
---@return SubmarineProperty?
227-
function YimHeists:GetSubmarine()
227+
function Mastermind:GetSubmarine()
228228
local sub = self.m_properties.submarine
229229
if (not sub) then
230230
return
@@ -236,4 +236,4 @@ function YimHeists:GetSubmarine()
236236
return sub
237237
end
238238

239-
return YimHeists
239+
return Mastermind
Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-- * Provide a copy of or a link to the original license (GPL-3.0 or later); see LICENSE.md or <https://www.gnu.org/licenses/>.
88

99

10-
local YHV1 = require("includes.features.YimHeistsV1"):init()
10+
local Mastermind = require("SSV2.includes.features.Mastermind"):init()
1111
local SGSL = require("includes.services.SGSL")
1212
local secondary_targets = { "Cash", "Weed", "Coke", "Gold" }
1313
local cayo_secondary_target_i, cayo_secondary_target_c
@@ -26,10 +26,10 @@ local heistNames <const> = { -- https://github.com/root-cause/v-labels/blob/mast
2626
BogdanProblem = "HPSTRAND_SUBb",
2727
DoomsdayScenario = "HPSTRAND_MSILb",
2828
}
29-
local tabNames <const> = {
30-
"YH_BASIC_TAB", -- Basic
31-
"ISLAND_TRAVEL_T", -- Cayo Perico
32-
"FMMC_RSTAR_MHS2", -- The Doomsday Heist
29+
local tabNames <const> = { --
30+
"YH_BASIC_TAB", -- Basic
31+
"ISLAND_TRAVEL_T", -- Cayo Perico
32+
"FMMC_RSTAR_MHS2", -- The Doomsday Heist
3333
}
3434

3535
---@type HEIST_TYPES
@@ -53,7 +53,7 @@ local HEIST_TYPES = {
5353
return heistNames.KnoWayOut
5454
end,
5555
get_coords = function()
56-
return YHV1:GetAviLocation()
56+
return Mastermind:GetAviLocation()
5757
end,
5858
stat = {
5959
name = "MPX_M25_AVI_MISSION_CURRENT",
@@ -67,7 +67,7 @@ local HEIST_TYPES = {
6767
return heistNames.DontFuckWithDre
6868
end,
6969
get_coords = function()
70-
return YHV1:GetAgencyLocation()
70+
return Mastermind:GetAgencyLocation()
7171
end,
7272
stat = {
7373
name = "MPX_FIXER_STORY_BS",
@@ -81,7 +81,7 @@ local HEIST_TYPES = {
8181
return heistNames.OscarGuzmanFliesAgain
8282
end,
8383
get_coords = function()
84-
return YHV1:GetFieldHangarLocation()
84+
return Mastermind:GetFieldHangarLocation()
8585
end,
8686
stat = {
8787
name = "MPX_HACKER24_INST_BS",
@@ -119,7 +119,7 @@ local function drawBasicTab()
119119
ImGui.BeginDisabled(is_done or on_cooldown)
120120
ImGui.SameLine()
121121
if GUI:Button(_T("SY_COMPLETE_PREPARATIONS")) then
122-
YHV1:SkipPrep(heist.stat.name, heist.stat.val, heist_name)
122+
Mastermind:SkipPrep(heist.stat.name, heist.stat.val, heist_name)
123123
end
124124
if (heist.opt_info and not is_done) then
125125
GUI:Tooltip(heist.opt_info)
@@ -145,7 +145,7 @@ local function drawBasicTab()
145145
end
146146

147147
local function drawCayoTab()
148-
local sub = YHV1:GetSubmarine()
148+
local sub = Mastermind:GetSubmarine()
149149
if (not sub) then
150150
ImGui.Text(_T("YH_SUBMARINE_NOT_OWNED"))
151151
return
@@ -175,7 +175,7 @@ local function drawCayoTab()
175175
if (GUI:Button(btn_label)) then
176176
ThreadManager:Run(function()
177177
if (not LocalPlayer:IsOutside()) then
178-
Notifier:ShowError(YHV1.__label, _T("GENERIC_TP_INTERIOR_ERR"))
178+
Notifier:ShowError(Mastermind.__label, _T("GENERIC_TP_INTERIOR_ERR"))
179179
return
180180
end
181181

@@ -228,7 +228,7 @@ local function drawCayoTab()
228228
)
229229

230230
if (secondary_target_click) then
231-
YHV1:SetSecondaryTargets("I", cayo_secondary_target_i + 1)
231+
Mastermind:SetCayoSecTargets("I", cayo_secondary_target_i + 1)
232232
end
233233

234234
cayo_secondary_target_c, secondary_target_click = ImGui.Combo(
@@ -239,7 +239,7 @@ local function drawCayoTab()
239239
)
240240

241241
if (secondary_target_click) then
242-
YHV1:SetSecondaryTargets("C", cayo_secondary_target_c + 1)
242+
Mastermind:SetCayoSecTargets("C", cayo_secondary_target_c + 1)
243243
end
244244

245245
ImGui.Spacing()
@@ -306,14 +306,14 @@ local function drawCayoTab()
306306
stats.set_int("MPX_H4CNF_BS_ENTR", 0)
307307
stats.set_int("MPX_H4CNF_BS_GEN", 0)
308308
stats.set_int("MPX_H4CNF_BS_ABIL", 0)
309-
Notifier:ShowSuccess(YHV1.__label, "All Cayo progress has been reset!")
309+
Notifier:ShowSuccess(Mastermind.__label, "All Cayo progress has been reset!")
310310
end
311311
end
312312
end
313313

314314
-- Help text and values copied from: https://www.unknowncheats.me/forum/grand-theft-auto-v/431801-cayo-perico-heist-click.html
315315
local function drawDDayTab()
316-
local facility = YHV1:GetFacilityProperty()
316+
local facility = Mastermind:GetFacilityProperty()
317317
if (not facility) then
318318
ImGui.Text(_T("YH_FACILITY_NOT_OWNED"))
319319
return
@@ -406,7 +406,7 @@ local function HeistUI()
406406
return
407407
end
408408

409-
cayo_secondary_target_i, cayo_secondary_target_c = YHV1:GetSecondaryTargets()
409+
cayo_secondary_target_i, cayo_secondary_target_c = Mastermind:GetCayoSecTargets()
410410

411411
if (ImGui.BeginTabBar("##funkBar")) then
412412
ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, 10, 10)
@@ -424,7 +424,7 @@ local function HeistUI()
424424
end
425425
end
426426

427-
GUI:RegisterNewTab(Enums.eTabID.TAB_ONLINE, YHV1.__label, HeistUI)
427+
GUI:RegisterNewTab(Enums.eTabID.TAB_ONLINE, Mastermind.__label, HeistUI)
428428

429429
ThreadManager:Run(function()
430430
Translator:TranslateGXTList(tabNames)

SSV2/includes/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,12 +119,12 @@ local packages = {
119119
"frontend.entity_forge_ui",
120120
"frontend.bsv2_ui",
121121
"frontend.casino_ui",
122+
"frontend.mastermind_ui",
122123
"frontend.self.self_ui",
123124
"frontend.settings.settings_ui",
124125
"frontend.vehicle.vehicle_ui",
125126
"frontend.world_ui",
126127
"frontend.yav3_ui",
127-
"frontend.yhv1_ui",
128128
"frontend.yrv3.yrv3_ui",
129129
}
130130

docs/Features.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ SSV2 includes polished versions of your favorite features from previous versions
2626
<ul>
2727
<li><a href="#yimresupplierv3">YimResupplierV3</a></li>
2828
<li><a href="#casinopacino">CasinoPacino</a></li>
29-
<li><a href="#yimheistsv1">YimHeistsV1</a></li>
29+
<li><a href="#mastermind">Mastermind</a></li>
3030
</ul>
3131
</li>
3232
<li>
@@ -357,7 +357,7 @@ A business manager that supports auto-fill and auto-sell for several businesses,
357357

358358
An updated and slightly refactored version of [Casino Pacino](https://github.com/YimMenu-Lua/Casino-Pacino).
359359

360-
### YimHeistsV1
360+
### Mastermind
361361

362362
A heist editor added by [@How-Bout-No](https://github.com/How-Bout-No) [WIP].
363363

0 commit comments

Comments
 (0)