234
This commit is contained in:
1 parent
838a118f98
commit
81c7c016c5
3 files changed
+84
No files matched your search
@@ -433,6 +433,13 @@ local timeBar = new("Frame", { Size = UDim2.new(1, -30, 0, 5), Position = UDim2.
|
|||||||
---------------------------------------------------------------- окна
|
---------------------------------------------------------------- окна
|
||||||
|
|
||||||
local openWindow = nil
|
local openWindow = nil
|
||||||
|
-- окно, открытое у ларька (сразу после нажатия на подсказку), закрывается, если отойти дальше WINDOW_CLOSE_DIST
|
||||||
|
-- (5 м ≈ 18 studs); окна, открытые клавишами и кнопками меню, так не закрываются
|
||||||
|
H.WINDOW_CLOSE_DIST = 18
|
||||||
|
H.promptAt = -math.huge
|
||||||
|
game:GetService("ProximityPromptService").PromptTriggered:Connect(function()
|
||||||
|
H.promptAt = os.clock()
|
||||||
|
end)
|
||||||
|
|
||||||
local function makeWindow(title, accent, tabs)
|
local function makeWindow(title, accent, tabs)
|
||||||
local w = { pages = {}, tabButtons = {}, current = nil }
|
local w = { pages = {}, tabButtons = {}, current = nil }
|
||||||
@@ -444,6 +451,8 @@ local function makeWindow(title, accent, tabs)
|
|||||||
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
||||||
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
||||||
Theme.rivets(frame, 12, 8)
|
Theme.rivets(frame, 12, 8)
|
||||||
|
-- Modal: пока окно открыто, Roblox отпускает курсор и в виде от первого лица (иначе он прибит к центру экрана)
|
||||||
|
new("TextButton", { Name = "FreeCursor", Size = UDim2.fromOffset(1, 1), BackgroundTransparency = 1, Text = "", Modal = true, Parent = frame })
|
||||||
local scale = new("UIScale", { Parent = frame })
|
local scale = new("UIScale", { Parent = frame })
|
||||||
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
||||||
-- багровая лента по центру, ширина — по тексту
|
-- багровая лента по центру, ширина — по тексту
|
||||||
@@ -502,6 +511,9 @@ local function makeWindow(title, accent, tabs)
|
|||||||
openWindow = w
|
openWindow = w
|
||||||
if not frame.Visible then
|
if not frame.Visible then
|
||||||
Audio.play("open")
|
Audio.play("open")
|
||||||
|
-- открыли у ларька — запоминаем, где стоим; отойдёт игрок — окно закроется само
|
||||||
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
w.anchor = (hrp and os.clock() - H.promptAt < 2) and hrp.Position or nil
|
||||||
end
|
end
|
||||||
frame.Visible = true
|
frame.Visible = true
|
||||||
scale.Scale = 0.85
|
scale.Scale = 0.85
|
||||||
@@ -510,6 +522,7 @@ local function makeWindow(title, accent, tabs)
|
|||||||
end
|
end
|
||||||
function w.close()
|
function w.close()
|
||||||
frame.Visible = false
|
frame.Visible = false
|
||||||
|
w.anchor = nil
|
||||||
if openWindow == w then
|
if openWindow == w then
|
||||||
openWindow = nil
|
openWindow = nil
|
||||||
end
|
end
|
||||||
@@ -532,6 +545,21 @@ local function makeWindow(title, accent, tabs)
|
|||||||
return w
|
return w
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- отошёл от ларька — его окно закрывается
|
||||||
|
RunService.Heartbeat:Connect(function()
|
||||||
|
local w = openWindow
|
||||||
|
if not (w and w.anchor) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if hrp then
|
||||||
|
local d = hrp.Position - w.anchor
|
||||||
|
if Vector3.new(d.X, 0, d.Z).Magnitude > H.WINDOW_CLOSE_DIST then
|
||||||
|
w.close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
local function scrollArea(parent, cell, topOffset)
|
local function scrollArea(parent, cell, topOffset)
|
||||||
local sf = new("ScrollingFrame", {
|
local sf = new("ScrollingFrame", {
|
||||||
Size = UDim2.new(1, 0, 1, -(topOffset or 0)), Position = UDim2.fromOffset(0, topOffset or 0),
|
Size = UDim2.new(1, 0, 1, -(topOffset or 0)), Position = UDim2.fromOffset(0, topOffset or 0),
|
||||||
|
|||||||
@@ -6701,6 +6701,13 @@ local timeBar = new("Frame", { Size = UDim2.new(1, -30, 0, 5), Position = UDim2.
|
|||||||
---------------------------------------------------------------- окна
|
---------------------------------------------------------------- окна
|
||||||
|
|
||||||
local openWindow = nil
|
local openWindow = nil
|
||||||
|
-- окно, открытое у ларька (сразу после нажатия на подсказку), закрывается, если отойти дальше WINDOW_CLOSE_DIST
|
||||||
|
-- (5 м ≈ 18 studs); окна, открытые клавишами и кнопками меню, так не закрываются
|
||||||
|
H.WINDOW_CLOSE_DIST = 18
|
||||||
|
H.promptAt = -math.huge
|
||||||
|
game:GetService("ProximityPromptService").PromptTriggered:Connect(function()
|
||||||
|
H.promptAt = os.clock()
|
||||||
|
end)
|
||||||
|
|
||||||
local function makeWindow(title, accent, tabs)
|
local function makeWindow(title, accent, tabs)
|
||||||
local w = { pages = {}, tabButtons = {}, current = nil }
|
local w = { pages = {}, tabButtons = {}, current = nil }
|
||||||
@@ -6712,6 +6719,8 @@ local function makeWindow(title, accent, tabs)
|
|||||||
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
||||||
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
||||||
Theme.rivets(frame, 12, 8)
|
Theme.rivets(frame, 12, 8)
|
||||||
|
-- Modal: пока окно открыто, Roblox отпускает курсор и в виде от первого лица (иначе он прибит к центру экрана)
|
||||||
|
new("TextButton", { Name = "FreeCursor", Size = UDim2.fromOffset(1, 1), BackgroundTransparency = 1, Text = "", Modal = true, Parent = frame })
|
||||||
local scale = new("UIScale", { Parent = frame })
|
local scale = new("UIScale", { Parent = frame })
|
||||||
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
||||||
-- багровая лента по центру, ширина — по тексту
|
-- багровая лента по центру, ширина — по тексту
|
||||||
@@ -6770,6 +6779,9 @@ local function makeWindow(title, accent, tabs)
|
|||||||
openWindow = w
|
openWindow = w
|
||||||
if not frame.Visible then
|
if not frame.Visible then
|
||||||
Audio.play("open")
|
Audio.play("open")
|
||||||
|
-- открыли у ларька — запоминаем, где стоим; отойдёт игрок — окно закроется само
|
||||||
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
w.anchor = (hrp and os.clock() - H.promptAt < 2) and hrp.Position or nil
|
||||||
end
|
end
|
||||||
frame.Visible = true
|
frame.Visible = true
|
||||||
scale.Scale = 0.85
|
scale.Scale = 0.85
|
||||||
@@ -6778,6 +6790,7 @@ local function makeWindow(title, accent, tabs)
|
|||||||
end
|
end
|
||||||
function w.close()
|
function w.close()
|
||||||
frame.Visible = false
|
frame.Visible = false
|
||||||
|
w.anchor = nil
|
||||||
if openWindow == w then
|
if openWindow == w then
|
||||||
openWindow = nil
|
openWindow = nil
|
||||||
end
|
end
|
||||||
@@ -6800,6 +6813,21 @@ local function makeWindow(title, accent, tabs)
|
|||||||
return w
|
return w
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- отошёл от ларька — его окно закрывается
|
||||||
|
RunService.Heartbeat:Connect(function()
|
||||||
|
local w = openWindow
|
||||||
|
if not (w and w.anchor) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if hrp then
|
||||||
|
local d = hrp.Position - w.anchor
|
||||||
|
if Vector3.new(d.X, 0, d.Z).Magnitude > H.WINDOW_CLOSE_DIST then
|
||||||
|
w.close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
local function scrollArea(parent, cell, topOffset)
|
local function scrollArea(parent, cell, topOffset)
|
||||||
local sf = new("ScrollingFrame", {
|
local sf = new("ScrollingFrame", {
|
||||||
Size = UDim2.new(1, 0, 1, -(topOffset or 0)), Position = UDim2.fromOffset(0, topOffset or 0),
|
Size = UDim2.new(1, 0, 1, -(topOffset or 0)), Position = UDim2.fromOffset(0, topOffset or 0),
|
||||||
|
|||||||
@@ -432,6 +432,13 @@ local timeBar = new("Frame", { Size = UDim2.new(1, -30, 0, 5), Position = UDim2.
|
|||||||
---------------------------------------------------------------- окна
|
---------------------------------------------------------------- окна
|
||||||
|
|
||||||
local openWindow = nil
|
local openWindow = nil
|
||||||
|
-- окно, открытое у ларька (сразу после нажатия на подсказку), закрывается, если отойти дальше WINDOW_CLOSE_DIST
|
||||||
|
-- (5 м ≈ 18 studs); окна, открытые клавишами и кнопками меню, так не закрываются
|
||||||
|
H.WINDOW_CLOSE_DIST = 18
|
||||||
|
H.promptAt = -math.huge
|
||||||
|
game:GetService("ProximityPromptService").PromptTriggered:Connect(function()
|
||||||
|
H.promptAt = os.clock()
|
||||||
|
end)
|
||||||
|
|
||||||
local function makeWindow(title, accent, tabs)
|
local function makeWindow(title, accent, tabs)
|
||||||
local w = { pages = {}, tabButtons = {}, current = nil }
|
local w = { pages = {}, tabButtons = {}, current = nil }
|
||||||
@@ -443,6 +450,8 @@ local function makeWindow(title, accent, tabs)
|
|||||||
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
}, { corner(12), stroke(C.goldDark, 4, 0), Theme.woodGradient(C.wood, C.woodDark), new("UISizeConstraint", { MaxSize = Vector2.new(760, 540) }) })
|
||||||
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
Theme.innerBorder(frame, 7, 8, C.gold, 0.2)
|
||||||
Theme.rivets(frame, 12, 8)
|
Theme.rivets(frame, 12, 8)
|
||||||
|
-- Modal: пока окно открыто, Roblox отпускает курсор и в виде от первого лица (иначе он прибит к центру экрана)
|
||||||
|
new("TextButton", { Name = "FreeCursor", Size = UDim2.fromOffset(1, 1), BackgroundTransparency = 1, Text = "", Modal = true, Parent = frame })
|
||||||
local scale = new("UIScale", { Parent = frame })
|
local scale = new("UIScale", { Parent = frame })
|
||||||
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 56), BackgroundTransparency = 1, Parent = frame })
|
||||||
-- багровая лента по центру, ширина — по тексту
|
-- багровая лента по центру, ширина — по тексту
|
||||||
@@ -501,6 +510,9 @@ local function makeWindow(title, accent, tabs)
|
|||||||
openWindow = w
|
openWindow = w
|
||||||
if not frame.Visible then
|
if not frame.Visible then
|
||||||
Audio.play("open")
|
Audio.play("open")
|
||||||
|
-- открыли у ларька — запоминаем, где стоим; отойдёт игрок — окно закроется само
|
||||||
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
w.anchor = (hrp and os.clock() - H.promptAt < 2) and hrp.Position or nil
|
||||||
end
|
end
|
||||||
frame.Visible = true
|
frame.Visible = true
|
||||||
scale.Scale = 0.85
|
scale.Scale = 0.85
|
||||||
@@ -509,6 +521,7 @@ local function makeWindow(title, accent, tabs)
|
|||||||
end
|
end
|
||||||
function w.close()
|
function w.close()
|
||||||
frame.Visible = false
|
frame.Visible = false
|
||||||
|
w.anchor = nil
|
||||||
if openWindow == w then
|
if openWindow == w then
|
||||||
openWindow = nil
|
openWindow = nil
|
||||||
end
|
end
|
||||||
@@ -531,6 +544,21 @@ local function makeWindow(title, accent, tabs)
|
|||||||
return w
|
return w
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- отошёл от ларька — его окно закрывается
|
||||||
|
RunService.Heartbeat:Connect(function()
|
||||||
|
local w = openWindow
|
||||||
|
if not (w and w.anchor) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
|
if hrp then
|
||||||
|
local d = hrp.Position - w.anchor
|
||||||
|
if Vector3.new(d.X, 0, d.Z).Magnitude > H.WINDOW_CLOSE_DIST then
|
||||||
|
w.close()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
local function scrollArea(parent, cell, topOffset)
|
local function scrollArea(parent, cell, topOffset)
|
||||||
local sf = new("ScrollingFrame", {
|
local sf = new("ScrollingFrame", {
|
||||||
Size = UDim2.new(1, 0, 1, -(topOffset or 0)), Position = UDim2.fromOffset(0, topOffset or 0),
|
Size = UDim2.new(1, 0, 1, -(topOffset or 0)), Position = UDim2.fromOffset(0, topOffset or 0),
|
||||||
|
|||||||
Reference in new issue
Block a user