Поправки багов, иконки и переделка второго острова

This commit is contained in:
Xkrules_Wood committed 2026-11-04 21:10:31 +05:00
1 parent dcf89d037a
commit c9795cc50e
6 files changed
+8315 -8415

No files matched your search

@@ -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)
return (CFrame.Angles(math.rad(angle), 0, 0) * CFrame.new(0, 0, -0.3)):Inverse()
end
@@ -1599,6 +1599,24 @@ local function onActivate()
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 function hookTool(tool)
if hooked[tool] or not tool:IsA("Tool") or not tool:GetAttribute("IsRod") then
@@ -1606,7 +1624,13 @@ local function hookTool(tool)
end
hooked[tool] = true
tool.Activated:Connect(function()
if menuOpen() then
return
end
if state == "idle" then
if pointerOverGui() then
return -- нажали кнопку или панель интерфейса — это не заброс
end
startCharge(tool)
else
onActivate()