Skip to content

Commit f8b2cd3

Browse files
committed
refactor(YRV3): refactor businesses into objects
- Refactored businesses into state-aware objects. - Moved Nightclub from the safes tab into its own tab - Added business hubs (nightclub cargo) with production triggers. - Simplified YRV3 UI to prevent crashes. closes YimMenu-Lua#85
1 parent 508c560 commit f8b2cd3

199 files changed

Lines changed: 3710 additions & 1334 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

SSV2/includes/backend.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
---@diagnostic disable: lowercase-global
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+
29

310
local PreviewService = require("includes.services.PreviewService")
411
local function ClearPreview()

SSV2/includes/classes/Mutex.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
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+
110
--------------------------------------
211
-- Class: Mutex
312
--------------------------------------

SSV2/includes/classes/Pair.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
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+
--------------------------------------
11+
-- Class: Pair
12+
--------------------------------------
113
---@class Pair<K, V> : { first: K, second: V }
214
Pair = {}
315
Pair.__index = Pair

SSV2/includes/classes/Range.lua

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
---@diagnostic disable: param-type-mismatch
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+
29

310
--------------------------------------
411
-- Class: Range
@@ -12,6 +19,7 @@
1219
---@overload fun(from: number, to: number, step?: number): Range
1320
Range = {}
1421
Range.__index = Range
22+
---@diagnostic disable-next-line
1523
setmetatable(Range, {
1624
__call = function(_, from, to, step)
1725
return Range.new(from, to, step)
@@ -31,17 +39,14 @@ function Range.new(from, to, step)
3139
m_min = from,
3240
m_max = to,
3341
m_step = step,
42+
---@diagnostic disable-next-line
3443
}, Range)
3544
end
3645

3746
---@param value number
3847
---@return boolean
3948
function Range:Contains(value)
40-
if (self.m_step > 0) then
41-
return value >= self.m_min and value <= self.m_max -- or math.inrange(value, self.m_min, self.m_max)
42-
else
43-
return value <= self.m_min and value >= self.m_max
44-
end
49+
return value >= self.m_min and value <= self.m_max -- or math.isinrange(value, self.m_min, self.m_max)
4550
end
4651

4752
---@return fun(): number Iterator

SSV2/includes/classes/Rect.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
---@diagnostic disable: param-type-mismatch
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/>.
28

9+
10+
--------------------------------------
11+
-- Class: Rect
12+
--------------------------------------
313
---@class Rect
414
---@field min vec2
515
---@field max vec2
616
---@overload fun(min: vec2, max: vec2) : Rect
717
Rect = {}
818
Rect.__index = Rect
19+
---@diagnostic disable-next-line
920
setmetatable(Rect, {
1021
__call = function(_, ...)
1122
return Rect.new(...)
@@ -16,6 +27,7 @@ setmetatable(Rect, {
1627
---@param max vec2
1728
---@return Rect
1829
function Rect.new(min, max)
30+
---@diagnostic disable-next-line
1931
return setmetatable({ min = min, max = max }, Rect)
2032
end
2133

SSV2/includes/classes/Set.lua

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
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+
--------------------------------------
11+
-- Class: Set
12+
--------------------------------------
113
---@generic T
214
---@class Set<T> : { [T]: true }
315
---@field protected m_data table<anyval, true>

SSV2/includes/classes/Vector2.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
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+
110
---@diagnostic disable: unknown-operator
211

312
--------------------------------------

SSV2/includes/classes/Vector3.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
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+
110
---@diagnostic disable: unknown-operator
211

312
--------------------------------------

SSV2/includes/classes/Vector4.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
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+
110
---@diagnostic disable: unknown-operator
211

312
--------------------------------------

SSV2/includes/classes/gta/CBaseSubHandlingData.lua

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
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+
110
---@class CBaseSubHandlingData
211
---@field protected m_ptr pointer
312
---@field protected m_handling_type pointer<int32_t> -- 0x00C8

0 commit comments

Comments
 (0)