Lobby
This commit is contained in:
1 parent
73a2db8bb8
commit
44cf31ce6b
231 files changed
+3396887
-1109081
No files matched your search
@@ -43,13 +43,18 @@ local gui = new("ScreenGui", {
|
||||
Name = "LoadingScreen", ResetOnSpawn = false, IgnoreGuiInset = true, DisplayOrder = 200,
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
|
||||
})
|
||||
-- фон: арт лобби (временная заглушка); пока картинка грузится, виден тёплый закатный градиент
|
||||
local BG_IMAGE = "rbxassetid://118616665961176"
|
||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.fromRGB(255, 190, 120), BorderSizePixel = 0, Parent = gui })
|
||||
-- фон: заставка «Рыболовная лихорадка»; пока картинка грузится, виден голубой градиент.
|
||||
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
||||
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
||||
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
||||
-- обычный Frame, а не CanvasGroup: CanvasGroup рендерит содержимое в текстуру пониженного разрешения — картинка мылится.
|
||||
-- Плавное появление/исчезновение делаем сами (setFade ниже).
|
||||
local root = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, BorderSizePixel = 0, Parent = gui })
|
||||
local backdrop = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Parent = root })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(120, 200, 255), Color3.fromRGB(255, 170, 110)),
|
||||
Parent = root,
|
||||
Color = ColorSequence.new(Color3.fromRGB(70, 140, 230), Color3.fromRGB(40, 70, 150)),
|
||||
Parent = backdrop,
|
||||
})
|
||||
local bg = new("ImageLabel", {
|
||||
Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Image = BG_IMAGE,
|
||||
@@ -62,13 +67,14 @@ end)
|
||||
-- плашка снизу: куда идём, полоска загрузки, совет
|
||||
local panel = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -28), Size = UDim2.fromOffset(560, 118),
|
||||
BackgroundColor3 = Color3.fromRGB(70, 40, 22), BackgroundTransparency = 0.18, BorderSizePixel = 0, Parent = root,
|
||||
BackgroundColor3 = Color3.new(1, 1, 1), BackgroundTransparency = 0.12, BorderSizePixel = 0, Parent = root,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 18), Parent = panel })
|
||||
new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.1, Parent = panel })
|
||||
-- тёмно-синяя плашка под ночное небо заставки, золотая обводка — как у заголовка
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
Color = ColorSequence.new(Color3.fromRGB(150, 95, 50), Color3.fromRGB(95, 55, 28)),
|
||||
Color = ColorSequence.new(Color3.fromRGB(40, 66, 140), Color3.fromRGB(20, 32, 78)),
|
||||
Parent = panel,
|
||||
})
|
||||
local float = new("TextLabel", {
|
||||
@@ -80,10 +86,10 @@ local title = new("TextLabel", {
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 240, 200), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Left,
|
||||
Font = Enum.Font.FredokaOne, Parent = panel,
|
||||
})
|
||||
new("UIStroke", { Color = Color3.fromRGB(60, 30, 10), Thickness = 2, Parent = title })
|
||||
new("UIStroke", { Color = Color3.fromRGB(15, 22, 55), Thickness = 2, Parent = title })
|
||||
local barBack = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 62), Size = UDim2.new(1, -36, 0, 16),
|
||||
BackgroundColor3 = Color3.fromRGB(40, 22, 10), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
|
||||
BackgroundColor3 = Color3.fromRGB(10, 16, 40), BackgroundTransparency = 0.15, BorderSizePixel = 0, Parent = panel,
|
||||
})
|
||||
new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = barBack })
|
||||
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = GOLD, BorderSizePixel = 0, Parent = barBack })
|
||||
@@ -91,7 +97,7 @@ new("UICorner", { CornerRadius = UDim.new(1, 0), Parent = bar })
|
||||
new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 230, 120), Color3.fromRGB(255, 160, 60)), Parent = bar })
|
||||
local tip = new("TextLabel", {
|
||||
Position = UDim2.fromOffset(18, 86), Size = UDim2.new(1, -36, 0, 22), BackgroundTransparency = 1,
|
||||
Text = "", TextColor3 = Color3.fromRGB(255, 228, 185), TextScaled = true,
|
||||
Text = "", TextColor3 = Color3.fromRGB(205, 222, 255), TextScaled = true,
|
||||
Font = Enum.Font.GothamMedium, Parent = panel,
|
||||
})
|
||||
|
||||
@@ -100,6 +106,78 @@ local function showTip()
|
||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||
end
|
||||
|
||||
-- плавность без CanvasGroup: запоминаем исходную прозрачность каждого элемента и смешиваем её с 1
|
||||
local fadeProps = { "BackgroundTransparency", "ImageTransparency", "TextTransparency", "TextStrokeTransparency" }
|
||||
local fadeItems = {}
|
||||
for _, o in ipairs(root:GetDescendants()) do
|
||||
local orig = {}
|
||||
for _, prop in ipairs(o:IsA("UIStroke") and { "Transparency" } or fadeProps) do
|
||||
local ok, v = pcall(function() return o[prop] end)
|
||||
if ok and type(v) == "number" then
|
||||
orig[prop] = v
|
||||
end
|
||||
end
|
||||
if next(orig) then
|
||||
fadeItems[o] = orig
|
||||
end
|
||||
end
|
||||
local fadeValue = Instance.new("NumberValue") -- 0 — экран виден, 1 — прозрачен
|
||||
local function setFade(a)
|
||||
for o, orig in pairs(fadeItems) do
|
||||
for prop, v in pairs(orig) do
|
||||
o[prop] = v + (1 - v) * a
|
||||
end
|
||||
end
|
||||
end
|
||||
fadeValue.Changed:Connect(setFade)
|
||||
local function fadeTo(a, time)
|
||||
local tw = TweenService:Create(fadeValue, TweenInfo.new(time), { Value = a })
|
||||
tw:Play()
|
||||
return tw
|
||||
end
|
||||
|
||||
-- HUD Roblox (хотбар, чат, список игроков, верхняя панель) рисуется поверх любых ScreenGui — прячем на время загрузки
|
||||
-- и возвращаем как было (FishingClient сам выключает его у таблички, поэтому сохраняем состояние каждого типа)
|
||||
local StarterGui = game:GetService("StarterGui")
|
||||
local savedCore = nil -- [CoreGuiType] = было ли включено до загрузки; nil — HUD сейчас не спрятан
|
||||
local coreGen = 0
|
||||
local function setCoreHidden(hidden)
|
||||
if hidden == (savedCore ~= nil) then
|
||||
return
|
||||
end
|
||||
local snapshot
|
||||
if hidden then
|
||||
savedCore = {}
|
||||
for _, t in ipairs(Enum.CoreGuiType:GetEnumItems()) do
|
||||
local ok, on = pcall(function() return StarterGui:GetCoreGuiEnabled(t) end)
|
||||
if t ~= Enum.CoreGuiType.All and ok then
|
||||
savedCore[t] = on
|
||||
end
|
||||
end
|
||||
snapshot = savedCore
|
||||
else
|
||||
snapshot, savedCore = savedCore, nil
|
||||
end
|
||||
coreGen += 1
|
||||
local gen = coreGen
|
||||
-- верхняя панель (меню Roblox); в новых версиях может не поддерживаться — тогда просто пропускаем
|
||||
task.spawn(function()
|
||||
for _ = 1, 20 do
|
||||
if gen ~= coreGen or pcall(function() StarterGui:SetCore("TopbarEnabled", not hidden) end) then
|
||||
return
|
||||
end
|
||||
task.wait(0.25) -- в первые кадры CoreScripts ещё не готовы и SetCore падает
|
||||
end
|
||||
end)
|
||||
for t, on in pairs(snapshot) do
|
||||
-- рюкзак и список игроков Roblox в игре заменены своими (HudBar.client.lua) — их не возвращаем
|
||||
if t == Enum.CoreGuiType.Backpack or t == Enum.CoreGuiType.PlayerList then
|
||||
on = false
|
||||
end
|
||||
pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
|
||||
end
|
||||
end
|
||||
|
||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||
local now = os.clock()
|
||||
gui:SetAttribute("Visible", true)
|
||||
@@ -108,6 +186,7 @@ gui:SetAttribute("StartAt", now)
|
||||
gui:SetAttribute("MinUntil", now + 3)
|
||||
gui:SetAttribute("Title", "Загрузка…")
|
||||
showTip()
|
||||
setCoreHidden(true)
|
||||
|
||||
task.spawn(function()
|
||||
if not game:IsLoaded() then
|
||||
@@ -122,11 +201,12 @@ end)
|
||||
local hiding = false
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
||||
-- новый телепорт мог прийти, пока экран ещё уходил: тогда возвращаем его
|
||||
if gui:GetAttribute("Visible") and (hiding or not gui.Enabled) then
|
||||
if gui:GetAttribute("Visible") then
|
||||
hiding = false
|
||||
showTip()
|
||||
gui.Enabled = true
|
||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
||||
setCoreHidden(true)
|
||||
fadeTo(0, 0.25)
|
||||
end
|
||||
end)
|
||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||
@@ -151,14 +231,13 @@ RunService.RenderStepped:Connect(function()
|
||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
if ready and hrp and t >= minUntil and not hiding then
|
||||
hiding = true
|
||||
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
|
||||
tw.Completed:Connect(function()
|
||||
if hiding then
|
||||
fadeTo(1, 0.6).Completed:Connect(function(state)
|
||||
if hiding and state == Enum.PlaybackState.Completed then
|
||||
gui.Enabled = false
|
||||
gui:SetAttribute("Visible", false)
|
||||
setCoreHidden(false)
|
||||
end
|
||||
end)
|
||||
tw:Play()
|
||||
end
|
||||
end)
|
||||
]]></ProtectedString></Properties></Item>
|
||||
|
||||
Reference in new issue
Block a user