Поправки багов, иконки и переделка второго острова
This commit is contained in:
1 parent
dcf89d037a
commit
c9795cc50e
6 files changed
+8315
-8415
No files matched your search
+7692
-8215
File diff suppressed because it is too large.
Load diff
@@ -1293,7 +1293,7 @@ end
|
|||||||
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
||||||
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
||||||
|
|
||||||
local REST_ANGLE, BACK_ANGLE = 30, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
local REST_ANGLE, BACK_ANGLE = 42, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||||
local function gripCF(angle)
|
local function gripCF(angle)
|
||||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||||
end
|
end
|
||||||
@@ -1599,6 +1599,24 @@ local function onActivate()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- клик пришёлся на видимый элемент интерфейса (кнопка, панель, картинка), а не в мир
|
||||||
|
local GuiService = game:GetService("GuiService")
|
||||||
|
local function pointerOverGui()
|
||||||
|
local pos = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()
|
||||||
|
for _, g in ipairs(player.PlayerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)) do
|
||||||
|
if g.Visible and (g:IsA("GuiButton") or g:IsA("TextBox") or g.BackgroundTransparency < 0.95
|
||||||
|
or (g:IsA("ImageLabel") and g.ImageTransparency < 0.95)) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- пока открыто любое окно (сумка, магазин, настройки, гильдия...), клики по удочке не работают
|
||||||
|
local function menuOpen()
|
||||||
|
return openWindow ~= nil and openWindow.isOpen()
|
||||||
|
end
|
||||||
|
|
||||||
local hooked = setmetatable({}, { __mode = "k" })
|
local hooked = setmetatable({}, { __mode = "k" })
|
||||||
local function hookTool(tool)
|
local function hookTool(tool)
|
||||||
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
|
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
|
||||||
@@ -1606,7 +1624,13 @@ local function hookTool(tool)
|
|||||||
end
|
end
|
||||||
hooked[tool] = true
|
hooked[tool] = true
|
||||||
tool.Activated:Connect(function()
|
tool.Activated:Connect(function()
|
||||||
|
if menuOpen() then
|
||||||
|
return
|
||||||
|
end
|
||||||
if state == "idle" then
|
if state == "idle" then
|
||||||
|
if pointerOverGui() then
|
||||||
|
return -- нажали кнопку или панель интерфейса — это не заброс
|
||||||
|
end
|
||||||
startCharge(tool)
|
startCharge(tool)
|
||||||
else
|
else
|
||||||
onActivate()
|
onActivate()
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ local gui = new("ScreenGui", {
|
|||||||
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
||||||
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
||||||
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
||||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, BorderSizePixel = 0, Parent = gui })
|
-- обычный 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 })
|
local backdrop = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Parent = root })
|
||||||
new("UIGradient", {
|
new("UIGradient", {
|
||||||
Rotation = 90,
|
Rotation = 90,
|
||||||
@@ -104,6 +106,74 @@ local function showTip()
|
|||||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||||
end
|
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
|
||||||
|
pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||||
local now = os.clock()
|
local now = os.clock()
|
||||||
gui:SetAttribute("Visible", true)
|
gui:SetAttribute("Visible", true)
|
||||||
@@ -112,6 +182,7 @@ gui:SetAttribute("StartAt", now)
|
|||||||
gui:SetAttribute("MinUntil", now + 3)
|
gui:SetAttribute("MinUntil", now + 3)
|
||||||
gui:SetAttribute("Title", "Загрузка…")
|
gui:SetAttribute("Title", "Загрузка…")
|
||||||
showTip()
|
showTip()
|
||||||
|
setCoreHidden(true)
|
||||||
|
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
if not game:IsLoaded() then
|
if not game:IsLoaded() then
|
||||||
@@ -130,7 +201,8 @@ gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
|||||||
hiding = false
|
hiding = false
|
||||||
showTip()
|
showTip()
|
||||||
gui.Enabled = true
|
gui.Enabled = true
|
||||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
setCoreHidden(true)
|
||||||
|
fadeTo(0, 0.25)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||||
@@ -155,14 +227,13 @@ RunService.RenderStepped:Connect(function()
|
|||||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
if ready and hrp and t >= minUntil and not hiding then
|
if ready and hrp and t >= minUntil and not hiding then
|
||||||
hiding = true
|
hiding = true
|
||||||
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
|
fadeTo(1, 0.6).Completed:Connect(function(state)
|
||||||
tw.Completed:Connect(function()
|
if hiding and state == Enum.PlaybackState.Completed then
|
||||||
if hiding then
|
|
||||||
gui.Enabled = false
|
gui.Enabled = false
|
||||||
gui:SetAttribute("Visible", false)
|
gui:SetAttribute("Visible", false)
|
||||||
|
setCoreHidden(false)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
tw:Play()
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
]]></ProtectedString></Properties></Item>
|
]]></ProtectedString></Properties></Item>
|
||||||
|
|||||||
+102
-7
@@ -7559,7 +7559,7 @@ end
|
|||||||
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
---------------------------------------------------------------- заброс: зарядка, шкала силы, наклон удочки
|
||||||
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
-- держишь ЛКМ — сила растёт, удочка уходит назад; отпустил — бросок на дальность по силе
|
||||||
|
|
||||||
local REST_ANGLE, BACK_ANGLE = 30, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
local REST_ANGLE, BACK_ANGLE = 42, 110 -- удочка в покое (как в GameServer) и в полном замахе
|
||||||
local function gripCF(angle)
|
local function gripCF(angle)
|
||||||
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
|
||||||
end
|
end
|
||||||
@@ -7865,6 +7865,24 @@ local function onActivate()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- клик пришёлся на видимый элемент интерфейса (кнопка, панель, картинка), а не в мир
|
||||||
|
local GuiService = game:GetService("GuiService")
|
||||||
|
local function pointerOverGui()
|
||||||
|
local pos = UserInputService:GetMouseLocation() - GuiService:GetGuiInset()
|
||||||
|
for _, g in ipairs(player.PlayerGui:GetGuiObjectsAtPosition(pos.X, pos.Y)) do
|
||||||
|
if g.Visible and (g:IsA("GuiButton") or g:IsA("TextBox") or g.BackgroundTransparency < 0.95
|
||||||
|
or (g:IsA("ImageLabel") and g.ImageTransparency < 0.95)) then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- пока открыто любое окно (сумка, магазин, настройки, гильдия...), клики по удочке не работают
|
||||||
|
local function menuOpen()
|
||||||
|
return openWindow ~= nil and openWindow.isOpen()
|
||||||
|
end
|
||||||
|
|
||||||
local hooked = setmetatable({}, { __mode = "k" })
|
local hooked = setmetatable({}, { __mode = "k" })
|
||||||
local function hookTool(tool)
|
local function hookTool(tool)
|
||||||
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
|
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
|
||||||
@@ -7872,7 +7890,13 @@ local function hookTool(tool)
|
|||||||
end
|
end
|
||||||
hooked[tool] = true
|
hooked[tool] = true
|
||||||
tool.Activated:Connect(function()
|
tool.Activated:Connect(function()
|
||||||
|
if menuOpen() then
|
||||||
|
return
|
||||||
|
end
|
||||||
if state == "idle" then
|
if state == "idle" then
|
||||||
|
if pointerOverGui() then
|
||||||
|
return -- нажали кнопку или панель интерфейса — это не заброс
|
||||||
|
end
|
||||||
startCharge(tool)
|
startCharge(tool)
|
||||||
else
|
else
|
||||||
onActivate()
|
onActivate()
|
||||||
@@ -9138,7 +9162,9 @@ local gui = new("ScreenGui", {
|
|||||||
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
||||||
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
||||||
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
||||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, BorderSizePixel = 0, Parent = gui })
|
-- обычный 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 })
|
local backdrop = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Parent = root })
|
||||||
new("UIGradient", {
|
new("UIGradient", {
|
||||||
Rotation = 90,
|
Rotation = 90,
|
||||||
@@ -9195,6 +9221,74 @@ local function showTip()
|
|||||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||||
end
|
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
|
||||||
|
pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||||
local now = os.clock()
|
local now = os.clock()
|
||||||
gui:SetAttribute("Visible", true)
|
gui:SetAttribute("Visible", true)
|
||||||
@@ -9203,6 +9297,7 @@ gui:SetAttribute("StartAt", now)
|
|||||||
gui:SetAttribute("MinUntil", now + 3)
|
gui:SetAttribute("MinUntil", now + 3)
|
||||||
gui:SetAttribute("Title", "Загрузка…")
|
gui:SetAttribute("Title", "Загрузка…")
|
||||||
showTip()
|
showTip()
|
||||||
|
setCoreHidden(true)
|
||||||
|
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
if not game:IsLoaded() then
|
if not game:IsLoaded() then
|
||||||
@@ -9221,7 +9316,8 @@ gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
|||||||
hiding = false
|
hiding = false
|
||||||
showTip()
|
showTip()
|
||||||
gui.Enabled = true
|
gui.Enabled = true
|
||||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
setCoreHidden(true)
|
||||||
|
fadeTo(0, 0.25)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||||
@@ -9246,14 +9342,13 @@ RunService.RenderStepped:Connect(function()
|
|||||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
if ready and hrp and t >= minUntil and not hiding then
|
if ready and hrp and t >= minUntil and not hiding then
|
||||||
hiding = true
|
hiding = true
|
||||||
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
|
fadeTo(1, 0.6).Completed:Connect(function(state)
|
||||||
tw.Completed:Connect(function()
|
if hiding and state == Enum.PlaybackState.Completed then
|
||||||
if hiding then
|
|
||||||
gui.Enabled = false
|
gui.Enabled = false
|
||||||
gui:SetAttribute("Visible", false)
|
gui:SetAttribute("Visible", false)
|
||||||
|
setCoreHidden(false)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
tw:Play()
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
]=====])
|
]=====])
|
||||||
|
|||||||
+342
-180
File diff suppressed because it is too large.
Load diff
@@ -46,7 +46,9 @@ local gui = new("ScreenGui", {
|
|||||||
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
-- Градиент — на отдельной подложке: UIGradient на самой CanvasGroup тонирует всё содержимое и затемнял картинку.
|
||||||
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
-- Свет и цветокоррекция сцены на экранный интерфейс не действуют, их не трогаем.
|
||||||
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
local BG_IMAGE = "rbxassetid://82266337853896" -- осветлённая и более насыщенная версия заставки
|
||||||
local root = new("CanvasGroup", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, BorderSizePixel = 0, Parent = gui })
|
-- обычный 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 })
|
local backdrop = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(1, 1, 1), BorderSizePixel = 0, Parent = root })
|
||||||
new("UIGradient", {
|
new("UIGradient", {
|
||||||
Rotation = 90,
|
Rotation = 90,
|
||||||
@@ -103,6 +105,74 @@ local function showTip()
|
|||||||
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
tip.Text = "💡 " .. TIPS[rng:NextInteger(1, #TIPS)]
|
||||||
end
|
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
|
||||||
|
pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
-- при входе: экран виден сразу, минимум — из FishConfig, когда он загрузится
|
||||||
local now = os.clock()
|
local now = os.clock()
|
||||||
gui:SetAttribute("Visible", true)
|
gui:SetAttribute("Visible", true)
|
||||||
@@ -111,6 +181,7 @@ gui:SetAttribute("StartAt", now)
|
|||||||
gui:SetAttribute("MinUntil", now + 3)
|
gui:SetAttribute("MinUntil", now + 3)
|
||||||
gui:SetAttribute("Title", "Загрузка…")
|
gui:SetAttribute("Title", "Загрузка…")
|
||||||
showTip()
|
showTip()
|
||||||
|
setCoreHidden(true)
|
||||||
|
|
||||||
task.spawn(function()
|
task.spawn(function()
|
||||||
if not game:IsLoaded() then
|
if not game:IsLoaded() then
|
||||||
@@ -129,7 +200,8 @@ gui:GetAttributeChangedSignal("Visible"):Connect(function()
|
|||||||
hiding = false
|
hiding = false
|
||||||
showTip()
|
showTip()
|
||||||
gui.Enabled = true
|
gui.Enabled = true
|
||||||
TweenService:Create(root, TweenInfo.new(0.25), { GroupTransparency = 0 }):Play()
|
setCoreHidden(true)
|
||||||
|
fadeTo(0, 0.25)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
gui:GetAttributeChangedSignal("Title"):Connect(function()
|
||||||
@@ -154,13 +226,12 @@ RunService.RenderStepped:Connect(function()
|
|||||||
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
local hrp = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||||
if ready and hrp and t >= minUntil and not hiding then
|
if ready and hrp and t >= minUntil and not hiding then
|
||||||
hiding = true
|
hiding = true
|
||||||
local tw = TweenService:Create(root, TweenInfo.new(0.6), { GroupTransparency = 1 })
|
fadeTo(1, 0.6).Completed:Connect(function(state)
|
||||||
tw.Completed:Connect(function()
|
if hiding and state == Enum.PlaybackState.Completed then
|
||||||
if hiding then
|
|
||||||
gui.Enabled = false
|
gui.Enabled = false
|
||||||
gui:SetAttribute("Visible", false)
|
gui:SetAttribute("Visible", false)
|
||||||
|
setCoreHidden(false)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
tw:Play()
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
Reference in new issue
Block a user