|
| 1 | +-- Copyright (C) 2026 SAMURAI (xesdoog) & Contributors. |
| 2 | +-- This file is part of Samurai's Scripts. |
| 3 | +-- |
| 4 | +-- Permission is hereby granted to copy, modify, and redistribute |
| 5 | +-- this code as long as you respect these conditions: |
| 6 | +-- * Credit the owner and contributors. |
| 7 | +-- * 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/>. |
| 8 | + |
| 9 | + |
| 10 | +local YHV1 = require("includes.features.YimHeistsV1"):init() |
| 11 | + |
| 12 | +---@type HEIST_TYPES |
| 13 | +local HEIST_TYPES = { |
| 14 | + { |
| 15 | + name = "Cluckin Bell", |
| 16 | + coords = vec3:new(-1093.15, -807.14, 19.28), |
| 17 | + blip = 871, |
| 18 | + stat = { |
| 19 | + name = "MPX_SALV23_INST_PROG", |
| 20 | + val = 31, |
| 21 | + } |
| 22 | + }, |
| 23 | + { |
| 24 | + name = "KnoWay", |
| 25 | + coords = vec3:new(42.82, -1599.19, 29.60), |
| 26 | + blip = 76, |
| 27 | + stat = { |
| 28 | + name = "MPX_M25_AVI_MISSION_CURRENT", |
| 29 | + val = 4, |
| 30 | + }, |
| 31 | + }, |
| 32 | + { |
| 33 | + name = "Dr. Dre", |
| 34 | + coords = YHV1:GetAgencyLocation(), |
| 35 | + blip = 826, |
| 36 | + stat = { |
| 37 | + name = "MPX_FIXER_STORY_BS", |
| 38 | + val = 4095, |
| 39 | + } |
| 40 | + }, |
| 41 | + { |
| 42 | + name = "Oscar Guzman", |
| 43 | + coords = vec3:new(2150.65, 4796.60, 41.17), |
| 44 | + blip = 903, |
| 45 | + stat = { |
| 46 | + name = "MPX_HACKER24_INST_BS", |
| 47 | + val = 31, |
| 48 | + }, |
| 49 | + optInfo = "Complete first mission on Hard first!" |
| 50 | + }, |
| 51 | +} |
| 52 | + |
| 53 | +-- This is all a pretty asinine way of handling this and has some UI/UX inconsistencies but it's quick and it works good enuff for now |
| 54 | +-- TODO: Make this better |
| 55 | +local function drawBasicTab() |
| 56 | + for i, heist in ipairs(HEIST_TYPES) do |
| 57 | + ImGui.BeginDisabled(not heist.coords or not Game.IsValidCoords(heist.blip)) |
| 58 | + ImGui.PushID(i) |
| 59 | + ImGui.BulletText(heist.name) |
| 60 | + |
| 61 | + if (GUI:Button(_T("GENERIC_TELEPORT"))) then |
| 62 | + YHV1:Teleport(heist.coords, false) |
| 63 | + end |
| 64 | + |
| 65 | + ImGui.SameLine() |
| 66 | + if (GUI:Button(_T("GENERIC_SET_WAYPOINT"))) then |
| 67 | + Game.SetWaypointCoords(heist.blip) |
| 68 | + end |
| 69 | + |
| 70 | + ImGui.SameLine() |
| 71 | + |
| 72 | + ImGui.BeginDisabled(stats.get_int(heist.stat.name) == heist.stat.val) |
| 73 | + if GUI:Button(_T("SY_COMPLETE_PREPARATIONS")) then |
| 74 | + YHV1:SkipPrep(heist.stat.name, heist.stat.val, heist.name) |
| 75 | + end |
| 76 | + if (heist.optInfo) then |
| 77 | + GUI:Tooltip(heist.optInfo) |
| 78 | + end |
| 79 | + ImGui.EndDisabled() |
| 80 | + ImGui.PopID() |
| 81 | + ImGui.EndDisabled() |
| 82 | + end |
| 83 | +end |
| 84 | + |
| 85 | +local cayo_secondary_target_i = 2 |
| 86 | +local cayo_secondary_target_c = 3 |
| 87 | + |
| 88 | +local function drawCayoTab() |
| 89 | + -- https://www.unknowncheats.me/forum/grand-theft-auto-v/695454-edit-cayo-perico-primary-target-stat-yimmenu-v2.html |
| 90 | + -- https://www.unknowncheats.me/forum/grand-theft-auto-v/431801-cayo-perico-heist-click.html |
| 91 | + local cayo_heist_primary = stats.get_int("MPX_H4CNF_TARGET") |
| 92 | + local cayo_heist_difficulty = stats.get_int("MPX_H4_PROGRESS") |
| 93 | + local cayo_heist_weapons = stats.get_int("MPX_H4CNF_WEAPONS") |
| 94 | + |
| 95 | + ImGui.SeparatorText("Targets") |
| 96 | + |
| 97 | + local new_primary_target, primary_target_clicked = ImGui.Combo( |
| 98 | + _T "YH_CAYO_TARGET_PRIMARY", |
| 99 | + cayo_heist_primary, |
| 100 | + { "Tequila", "Ruby", "Bearer Bonds", "Pink Diamond", "Madrazo Files", "Panther Statue" }, |
| 101 | + 6 |
| 102 | + ) |
| 103 | + |
| 104 | + if (primary_target_clicked) then |
| 105 | + stats.set_int("MPX_H4CNF_TARGET", new_primary_target) |
| 106 | + end |
| 107 | + |
| 108 | + ImGui.Spacing() |
| 109 | + |
| 110 | + local secondary_targets = { "Cash", "Weed", "Coke", "Gold" } |
| 111 | + local new_secondary_target_i, secondary_target_i_click = ImGui.Combo( |
| 112 | + _T "YH_CAYO_TARGET_SECONDARY_I", |
| 113 | + cayo_secondary_target_i, |
| 114 | + secondary_targets, |
| 115 | + 4 |
| 116 | + ) |
| 117 | + |
| 118 | + if (secondary_target_i_click) then |
| 119 | + cayo_secondary_target_i = new_secondary_target_i |
| 120 | + end |
| 121 | + |
| 122 | + local new_secondary_target_c, secondary_target_c_click = ImGui.Combo( |
| 123 | + _T "YH_CAYO_TARGET_SECONDARY_C", |
| 124 | + cayo_secondary_target_c, |
| 125 | + secondary_targets, |
| 126 | + 4 |
| 127 | + ) |
| 128 | + |
| 129 | + if (secondary_target_c_click) then |
| 130 | + cayo_secondary_target_c = new_secondary_target_c |
| 131 | + end |
| 132 | + |
| 133 | + -- https://www.unknowncheats.me/forum/4489469-post16.html |
| 134 | + if GUI:Button("Set All Secondary Targets") then |
| 135 | + local targets_i = { 0, 0, 0, 0 } |
| 136 | + local targets_c = { 0, 0, 0, 0 } |
| 137 | + targets_i[new_secondary_target_i + 1] = -1 |
| 138 | + targets_c[new_secondary_target_c + 1] = -1 |
| 139 | + |
| 140 | + stats.set_int("MPX_H4LOOT_CASH_I", targets_i[0]) |
| 141 | + stats.set_int("MPX_H4LOOT_CASH_I_SCOPED", targets_i[0]) |
| 142 | + stats.set_int("MPX_H4LOOT_WEED_I", targets_i[1]) |
| 143 | + stats.set_int("MPX_H4LOOT_WEED_I_SCOPED", targets_i[1]) |
| 144 | + stats.set_int("MPX_H4LOOT_COKE_I", targets_i[2]) |
| 145 | + stats.set_int("MPX_H4LOOT_COKE_I_SCOPED", targets_i[2]) |
| 146 | + stats.set_int("MPX_H4LOOT_GOLD_I", targets_i[3]) |
| 147 | + stats.set_int("MPX_H4LOOT_GOLD_I_SCOPED", targets_i[3]) |
| 148 | + stats.set_int("MPX_H4LOOT_CASH_C", targets_c[0]) |
| 149 | + stats.set_int("MPX_H4LOOT_WEED_C", targets_c[1]) |
| 150 | + stats.set_int("MPX_H4LOOT_COKE_C", targets_c[2]) |
| 151 | + stats.set_int("MPX_H4LOOT_GOLD_C", targets_c[3]) |
| 152 | + stats.set_int("MPX_H4LOOT_PAINT", -1) -- Not really any reason to have an option for paintings |
| 153 | + stats.set_int("MPX_H4LOOT_PAINT_SCOPED", -1) |
| 154 | + end |
| 155 | + |
| 156 | + ImGui.SeparatorText(_T "GENERIC_SETTINGS_LABEL") |
| 157 | + |
| 158 | + local new_difficulty, difficulty_toggled = GUI:CustomToggle(_T("YH_CAYO_DIFFICULTY"), |
| 159 | + cayo_heist_difficulty > 130000 |
| 160 | + ) |
| 161 | + |
| 162 | + if (difficulty_toggled) then |
| 163 | + if (new_difficulty) then |
| 164 | + stats.set_int("MPX_H4_PROGRESS", 131055) |
| 165 | + else |
| 166 | + stats.set_int("MPX_H4_PROGRESS", 126823) |
| 167 | + end |
| 168 | + end |
| 169 | + |
| 170 | + local new_weapons, weapons_clicked = ImGui.Combo( |
| 171 | + _T "YH_CAYO_WEAPONS", |
| 172 | + cayo_heist_weapons, |
| 173 | + { "Unselected", "Aggressor", "Conspirator", "Crackshot", "Saboteur", "Marksman" }, |
| 174 | + 6 |
| 175 | + ) |
| 176 | + |
| 177 | + if (weapons_clicked) then |
| 178 | + stats.set_int("MPX_H4CNF_WEAPONS", new_weapons) |
| 179 | + end |
| 180 | + |
| 181 | + -- https://www.unknowncheats.me/forum/3058973-post602.html |
| 182 | + if GUI:Button(_T "CP_HEIST_UNLOCK_ALL") then |
| 183 | + stats.set_int("MPX_H4CNF_BS_GEN", 131071) |
| 184 | + stats.set_int("MPX_H4CNF_BS_ENTR", 63) |
| 185 | + stats.set_int("MPX_H4CNF_BS_ABIL", 63) |
| 186 | + stats.set_int("MPX_H4CNF_WEP_DISRP", 3) |
| 187 | + stats.set_int("MPX_H4CNF_ARM_DISRP", 3) |
| 188 | + stats.set_int("MPX_H4CNF_HEL_DISRP", 3) |
| 189 | + stats.set_int("MPX_H4_MISSIONS", 65535) |
| 190 | + if (stats.get_int("MPX_H4_PLAYTHROUGH_STATUS") == 0) then |
| 191 | + stats.set_int("MPX_H4_PLAYTHROUGH_STATUS", 40000) |
| 192 | + end |
| 193 | + Notifier:ShowSuccess("YHV1", "Heist ready") |
| 194 | + end |
| 195 | + |
| 196 | + if GUI:Button(_T "YH_CAYO_RESET_ALL") then |
| 197 | + stats.set_int("MPX_H4_MISSIONS", 0) |
| 198 | + stats.set_int("MPX_H4_PROGRESS", 0) |
| 199 | + stats.set_int("MPX_H4_PLAYTHROUGH_STATUS", 0) |
| 200 | + stats.set_int("MPX_H4CNF_APPROACH", 0) |
| 201 | + stats.set_int("MPX_H4CNF_BS_ENTR", 0) |
| 202 | + stats.set_int("MPX_H4CNF_BS_GEN", 0) |
| 203 | + stats.set_int("MPX_H4CNF_BS_ABIL", 0) |
| 204 | + Notifier:ShowSuccess("YHV1", "All progress has been reset!") |
| 205 | + end |
| 206 | +end |
| 207 | + |
| 208 | +local function HeistUI() |
| 209 | + if (not Game.IsOnline() or not Backend:IsUpToDate()) then |
| 210 | + ImGui.Text(_T("GENERIC_UNAVAILABLE_SP")) |
| 211 | + return |
| 212 | + end |
| 213 | + |
| 214 | + if (ImGui.BeginTabBar("##dunkBar")) then |
| 215 | + ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, 10, 10) |
| 216 | + |
| 217 | + if ImGui.BeginTabItem(_T("GENERIC_GENERAL_LABEL")) then |
| 218 | + drawBasicTab() |
| 219 | + ImGui.EndTabItem() |
| 220 | + end |
| 221 | + |
| 222 | + if ImGui.BeginTabItem(_T("YH_CAYO_TAB")) then |
| 223 | + drawCayoTab() |
| 224 | + ImGui.EndTabItem() |
| 225 | + end |
| 226 | + |
| 227 | + -- if ImGui.BeginTabItem(_T("YH_DDAY_TAB")) then |
| 228 | + -- drawDDayTab() |
| 229 | + -- ImGui.EndTabItem() |
| 230 | + -- end |
| 231 | + |
| 232 | + ImGui.PopStyleVar() |
| 233 | + ImGui.EndTabBar() |
| 234 | + end |
| 235 | +end |
| 236 | + |
| 237 | +YHV1.m_tab:RegisterGUI(HeistUI) |
0 commit comments