123
This commit is contained in:
1 parent
b6f4ce020a
commit
bae57661a9
13 files changed
+2802
-516
No files matched your search
@@ -5784,10 +5784,39 @@ local LOOK = {
|
||||
local camera = workspace.CurrentCamera
|
||||
local weatherCC = new("ColorCorrectionEffect", { Name = "WeatherCC", Parent = camera })
|
||||
local nightCC = new("ColorCorrectionEffect", { Name = "NightCC", Parent = camera })
|
||||
local playerGui = player:WaitForChild("PlayerGui")
|
||||
local loadingGui = nil
|
||||
local function updateLoadingColorEffects()
|
||||
local loadingVisible = loadingGui ~= nil and loadingGui.Enabled and loadingGui:GetAttribute("Visible") ~= false
|
||||
weatherCC.Enabled = not loadingVisible
|
||||
nightCC.Enabled = not loadingVisible
|
||||
end
|
||||
local function bindLoadingGui(gui)
|
||||
loadingGui = gui
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(updateLoadingColorEffects)
|
||||
gui:GetPropertyChangedSignal("Enabled"):Connect(updateLoadingColorEffects)
|
||||
updateLoadingColorEffects()
|
||||
end
|
||||
local existingLoadingGui = playerGui:FindFirstChild("LoadingScreen")
|
||||
if existingLoadingGui then
|
||||
bindLoadingGui(existingLoadingGui)
|
||||
end
|
||||
playerGui.ChildAdded:Connect(function(child)
|
||||
if child.Name == "LoadingScreen" and child:IsA("ScreenGui") then
|
||||
bindLoadingGui(child)
|
||||
end
|
||||
end)
|
||||
playerGui.ChildRemoved:Connect(function(child)
|
||||
if child == loadingGui then
|
||||
loadingGui = nil
|
||||
updateLoadingColorEffects()
|
||||
end
|
||||
end)
|
||||
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
|
||||
camera = workspace.CurrentCamera
|
||||
weatherCC.Parent = camera
|
||||
nightCC.Parent = camera
|
||||
updateLoadingColorEffects()
|
||||
end)
|
||||
|
||||
local clouds = terrain:FindFirstChildOfClass("Clouds") or new("Clouds", { Parent = terrain })
|
||||
@@ -8959,7 +8988,7 @@ local gui = new("ScreenGui", {
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui"),
|
||||
})
|
||||
-- фон: арт лобби (временная заглушка); пока картинка грузится, виден тёплый закатный градиент
|
||||
local BG_IMAGE = "rbxassetid://118616665961176"
|
||||
local BG_IMAGE = "rbxassetid://113775888608724"
|
||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.fromRGB(255, 190, 120), BorderSizePixel = 0, Parent = gui })
|
||||
new("UIGradient", {
|
||||
Rotation = 90,
|
||||
@@ -8974,6 +9003,40 @@ task.spawn(function()
|
||||
pcall(function() game:GetService("ContentProvider"):PreloadAsync({ bg }) end)
|
||||
end)
|
||||
|
||||
-- Цветокоррекция локации/погоды затемняет и заставку. На время её показа отключаем только экранные цветовые эффекты.
|
||||
local disabledLoadingColorEffects = {}
|
||||
local function disableLoadingColorEffect(effect)
|
||||
if effect:IsA("ColorCorrectionEffect") or effect:IsA("ColorGradingEffect") then
|
||||
if disabledLoadingColorEffects[effect] == nil then
|
||||
disabledLoadingColorEffects[effect] = effect.Enabled
|
||||
end
|
||||
effect.Enabled = false
|
||||
end
|
||||
end
|
||||
local function syncLoadingColorEffects()
|
||||
local active = gui.Enabled and gui:GetAttribute("Visible") ~= false
|
||||
local camera = workspace.CurrentCamera
|
||||
local containers = { Lighting, camera }
|
||||
if active then
|
||||
for _, container in ipairs(containers) do
|
||||
if container then
|
||||
for _, effect in ipairs(container:GetChildren()) do
|
||||
disableLoadingColorEffect(effect)
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
for effect, wasEnabled in pairs(disabledLoadingColorEffects) do
|
||||
if effect.Parent then effect.Enabled = wasEnabled end
|
||||
disabledLoadingColorEffects[effect] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
Lighting.ChildAdded:Connect(function(effect)
|
||||
if gui.Enabled and gui:GetAttribute("Visible") ~= false then disableLoadingColorEffect(effect) end
|
||||
end)
|
||||
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(syncLoadingColorEffects)
|
||||
|
||||
-- плашка снизу: куда идём, полоска загрузки, совет
|
||||
local panel = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -28), Size = UDim2.fromOffset(560, 118),
|
||||
@@ -9035,9 +9098,12 @@ task.spawn(function()
|
||||
end)
|
||||
|
||||
local hiding = false
|
||||
gui:GetAttributeChangedSignal("Visible"):Connect(syncLoadingColorEffects)
|
||||
gui:GetPropertyChangedSignal("Enabled"):Connect(syncLoadingColorEffects)
|
||||
syncLoadingColorEffects()
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user