интерфейс

This commit is contained in:
listik committed 2026-11-04 22:37:21 +03:00
1 parent d7ccebb788
commit 838a118f98
10 files changed
+583 -86

No files matched your search

+10 -9
View File
@@ -331,16 +331,17 @@ Config.Zones = {
} }
---------------------------------------------------------------- удочки ---------------------------------------------------------------- удочки
-- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны -- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны,
-- icon = картинка удочки в хотбаре (Tool.TextureId)
Config.Rods = { Config.Rods = {
{ id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood" }, { id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood", icon = "rbxassetid://83350883185349" },
{ id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo" }, { id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo", icon = "rbxassetid://98615001898640" },
{ id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass" }, { id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass", icon = "rbxassetid://100031752289540" },
{ id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon" }, { id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon", icon = "rbxassetid://71788597596034" },
{ id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral" }, { id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral", icon = "rbxassetid://139114393074237" },
{ id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold" }, { id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold", icon = "rbxassetid://83212298735071" },
{ id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost" }, { id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost", icon = "rbxassetid://134579643216329" },
{ id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend" }, { id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend", icon = "rbxassetid://84863811378769" },
} }
Config.RodUpgrade = { maxLevel = 5, luckPerLevel = 0.08, zonePerLevel = 0.012, speedPerLevel = 0.96 } Config.RodUpgrade = { maxLevel = 5, luckPerLevel = 0.08, zonePerLevel = 0.012, speedPerLevel = 0.96 }
+3 -3
View File
@@ -116,7 +116,7 @@ local function sparkles(parent, color, rate)
end end
---------------------------------------------------------------- удочки ---------------------------------------------------------------- удочки
-- Рука в (0,0,0), удочка смотрит в -Z и изгибается вверх (+Y). -- Рука в (0,0,0), удочка смотрит в -Z почти прямо, кончик слегка провисает вниз (-Y).
local STYLES = { local STYLES = {
wood = { blank = C(125, 90, 60), mat = Enum.Material.Wood, grip = C(80, 55, 35), gripMat = Enum.Material.Fabric, wrap = C(175, 175, 175), reel = C(95, 95, 100) }, wood = { blank = C(125, 90, 60), mat = Enum.Material.Wood, grip = C(80, 55, 35), gripMat = Enum.Material.Fabric, wrap = C(175, 175, 175), reel = C(95, 95, 100) },
@@ -177,8 +177,8 @@ function M.buildRod(rodId, upgradeLevel, anchored)
cyl(model, V(0.24, -0.68, -0.58), V(0.5, -0.86, -0.58), 0.07, { Color = st.reel, Material = METAL }) cyl(model, V(0.24, -0.68, -0.58), V(0.5, -0.86, -0.58), 0.07, { Color = st.reel, Material = METAL })
ball(model, V(0.54, -0.9, -0.5), 0.19, { Color = st.grip, Material = SP }) ball(model, V(0.54, -0.9, -0.5), 0.19, { Color = st.grip, Material = SP })
-- бланк: 8 колен с плавным изгибом и шарами на стыках -- бланк: 8 колен, почти прямой, к кончику плавно провисает; шары на стыках
local angles = { 6, 9, 12, 16, 20, 25, 30, 36 } local angles = { 0, -1, -2, -3, -5, -7, -9, -12 }
local lengths = { 1.2, 1.15, 1.1, 1.0, 0.95, 0.9, 0.85, 0.8 } local lengths = { 1.2, 1.15, 1.1, 1.0, 0.95, 0.9, 0.85, 0.8 }
local p = V(0, 0, -1.55) local p = V(0, 0, -1.55)
local lastSeg local lastSeg
@@ -492,7 +492,7 @@ end
---------------------------------------------------------------- удочка, сумка, VIP на персонаже ---------------------------------------------------------------- удочка, сумка, VIP на персонаже
local REST_ANGLE = 30 local REST_ANGLE = 42 -- удочка в покое: рукоять под ~42° вверх-вперёд, кончик провисает до ~30°
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
@@ -546,6 +546,7 @@ local function giveRodTool(player)
local tool = Instance.new("Tool") local tool = Instance.new("Tool")
tool.Name = rod.name .. (lvl > 0 and (" +" .. lvl) or "") tool.Name = rod.name .. (lvl > 0 and (" +" .. lvl) or "")
tool.ToolTip = "Кликни у воды, чтобы закинуть" tool.ToolTip = "Кликни у воды, чтобы закинуть"
tool.TextureId = rod.icon or ""
tool.CanBeDropped = false tool.CanBeDropped = false
tool.Grip = gripCF(REST_ANGLE) tool.Grip = gripCF(REST_ANGLE)
tool:SetAttribute("IsRod", true) tool:SetAttribute("IsRod", true)
@@ -196,33 +196,50 @@ H.rod = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 128
-- баннер события (справа сверху) -- баннер события (справа сверху)
local eventBanner = new("Frame", { local eventBanner = new("Frame", {
Name = "EventBanner", -- по имени его ставит под таблицу игроков HudBar.client.lua
Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10), Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10),
BackgroundColor3 = WHITE, Visible = false, Parent = screen, BackgroundColor3 = WHITE, Visible = false, Parent = screen,
}, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) }) }, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) })
local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner }) local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner })
local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner }) local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner })
-- кнопки слева -- меню слева: деревянная панель в рамке с вкладкой «≡» сверху, внутри — широкие кнопки (значок и подпись в строку).
-- столбик на компьютере, сетка 2×N на телефоне (раскладка — в applyLayout ниже) -- side — сетка кнопок внутри панели H.sidePanel (раскладку для телефона и компьютера задаёт applyLayout ниже)
H.sidePanel = new("Frame", {
Name = "SideMenu", Size = UDim2.fromOffset(170, 0), AutomaticSize = Enum.AutomaticSize.Y, Position = UDim2.fromOffset(12, 228),
BackgroundColor3 = WHITE, Parent = screen,
}, { corner(10), stroke(C.goldDark, 2.5, 0), Theme.woodGradient(C.wood, C.woodDark) })
Theme.rivets(H.sidePanel, 7, 6)
do
local tab = new("Frame", {
Size = UDim2.fromOffset(48, 24), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0, 0),
BackgroundColor3 = WHITE, ZIndex = 3, Parent = H.sidePanel,
}, { corner(8), stroke(C.goldDark, 2, 0), Theme.woodGradient(C.woodLight, C.wood) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 18, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.goldBright, Text = "≡", ZIndex = 4, Parent = tab })
end
local side = new("Frame", { local side = new("Frame", {
Size = UDim2.fromOffset(70, 380), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 12, 0.5, 60), Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, Parent = H.sidePanel,
BackgroundTransparency = 1, Parent = screen, }, {
}, { new("UIGridLayout", { CellSize = UDim2.fromOffset(68, 68), CellPadding = UDim2.fromOffset(8, 8), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }) }) new("UIPadding", { PaddingTop = UDim.new(0, 18), PaddingBottom = UDim.new(0, 10), PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8) }),
new("UIGridLayout", { CellSize = UDim2.fromOffset(154, 40), CellPadding = UDim2.fromOffset(6, 6), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }),
})
local sideDots = {} local sideDots = {}
local function sideButton(order, icon, label, key, color, onClick) local function sideButton(order, icon, label, key, color, onClick)
-- деревянная плитка; цвет раздела — полоска-лента снизу -- широкая деревянная кнопка: цветной значок слева, подпись, справа — клавиша
local b = btn({ Size = UDim2.fromOffset(68, 68), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick) local b = btn({ Size = UDim2.fromOffset(154, 40), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick)
b:FindFirstChildOfClass("UIStroke").Color = C.goldDark b:FindFirstChildOfClass("UIStroke").Color = C.goldDark
b:FindFirstChildOfClass("UIStroke").Thickness = 2.5 b:FindFirstChildOfClass("UIStroke").Thickness = 2
new("Frame", { Size = UDim2.new(1, -10, 0, 4), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -4), BackgroundColor3 = color, BorderSizePixel = 0, Parent = b }, { corner(2) }) local badge = new("Frame", { Size = UDim2.new(0, 30, 1, -10), Position = UDim2.fromOffset(5, 5), BackgroundColor3 = color, Parent = b },
text({ Size = UDim2.fromScale(1, 0.5), Position = UDim2.fromScale(0, 0.06), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = b }) { corner(6), stroke(C.ink, 1.5, 0.3), gradient(WHITE, Color3.fromRGB(170, 170, 170), 90) })
text({ Size = UDim2.fromScale(1, 0.24), Position = UDim2.fromScale(0, 0.6), Font = TITLE, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b }) text({ Size = UDim2.fromScale(1, 1), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = badge })
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = text({ Size = UDim2.new(1, -66, 1, 0), Position = UDim2.fromOffset(42, 0), Font = TITLE,
TextScaled = true, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b }) })
if key and not UserInputService.TouchEnabled then if key and not UserInputService.TouchEnabled then
local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), Position = UDim2.new(1, -14, 0, -6), BackgroundColor3 = C.bg, Parent = b }, { corner(6), stroke(C.gold, 1.5) }) local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -6, 0.5, 0), BackgroundColor3 = C.bg, Parent = b }, { corner(5), stroke(C.gold, 1.2) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag }) text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag })
end end
local dot = new("Frame", { Size = UDim2.fromOffset(16, 16), Position = UDim2.new(0, -5, 0, -5), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(8), stroke(WHITE, 2) }) local dot = new("Frame", { Size = UDim2.fromOffset(14, 14), Position = UDim2.new(0, -4, 0, -4), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(7), stroke(WHITE, 2) })
sideDots[label] = dot sideDots[label] = dot
return b return b
end end
@@ -562,6 +579,7 @@ Theme.kit = {
makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar, makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar,
sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr, sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr,
screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2, screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2,
viewport = viewport, VIEW = VIEW, -- 3D-превью моделей (удочки на нижней панели — HudBar.client.lua)
} }
---------------------------------------------------------------- данные с сервера ---------------------------------------------------------------- данные с сервера
@@ -1140,6 +1158,7 @@ end)
sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function() sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function()
settingsWin.toggle() settingsWin.toggle()
end) end)
Theme.kit.bagWin = bagWin -- кнопка «Рюкзак» внизу справа (HudBar.client.lua)
-- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD -- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD
-- (левый низ свободен под джойстик, правый низ — под кнопку прыжка) -- (левый низ свободен под джойстик, правый низ — под кнопку прыжка)
@@ -1152,13 +1171,13 @@ do
Theme.onLayout(function(compact) Theme.onLayout(function(compact)
scaleOf(hud.Parent).Scale = compact and 0.82 or 1 scaleOf(hud.Parent).Scale = compact and 0.82 or 1
hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10) hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10)
grid.CellSize = compact and UDim2.fromOffset(52, 52) or UDim2.fromOffset(62, 62) -- меню: на компьютере — столбик широких кнопок, на телефоне — два столбика поуже
grid.CellPadding = compact and UDim2.fromOffset(6, 6) or UDim2.fromOffset(6, 6) grid.CellSize = compact and UDim2.fromOffset(112, 32) or UDim2.fromOffset(154, 40)
grid.FillDirectionMaxCells = compact and 3 or 1 grid.CellPadding = compact and UDim2.fromOffset(5, 5) or UDim2.fromOffset(6, 6)
side.AnchorPoint = Vector2.zero grid.FillDirectionMaxCells = compact and 2 or 1
-- под HUD (он выше на строку гильдии — её добавляет GuildClient) -- под HUD (он выше на строку гильдии — её добавляет GuildClient)
side.Position = compact and UDim2.fromOffset(8, 172) or UDim2.fromOffset(12, 216) H.sidePanel.Position = compact and UDim2.fromOffset(8, 176) or UDim2.fromOffset(12, 228)
side.Size = compact and UDim2.fromOffset(170, 240) or UDim2.fromOffset(70, 480) H.sidePanel.Size = compact and UDim2.fromOffset(2 * 112 + 5 + 16, 0) or UDim2.fromOffset(154 + 16, 0)
toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200) toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200)
H.toastBaseY = compact and 66 or 84 H.toastBaseY = compact and 66 or 84
toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY) toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY)
@@ -2124,6 +2143,11 @@ local function setInterfaceHidden(hidden)
boardGui.Enabled = hidden boardGui.Enabled = hidden
pcall(function() pcall(function()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden) StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden)
if not hidden then
-- рюкзак и список игроков Roblox заменены своими (HudBar.client.lua)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end
end) end)
-- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было -- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было
if hidden then if hidden then
+4
View File
@@ -170,6 +170,10 @@ local function setCoreHidden(hidden)
end end
end) end)
for t, on in pairs(snapshot) do 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) pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
end end
end end
+62 -32
View File
@@ -340,16 +340,17 @@ Config.Zones = {
} }
---------------------------------------------------------------- удочки ---------------------------------------------------------------- удочки
-- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны -- luck = бонус удачи, speed = множитель ожидания клёва (меньше = быстрее), zone = ширина зелёной зоны,
-- icon = картинка удочки в хотбаре (Tool.TextureId)
Config.Rods = { Config.Rods = {
{ id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood" }, { id = "Basic", name = "Старая удочка", price = 0, level = 1, luck = 0.00, speed = 1.00, zone = 0.22, upgradeCost = 40, style = "wood", icon = "rbxassetid://83350883185349" },
{ id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo" }, { id = "Bamboo", name = "Бамбуковая удочка", price = 150, level = 3, luck = 0.15, speed = 0.88, zone = 0.25, upgradeCost = 120, style = "bamboo", icon = "rbxassetid://98615001898640" },
{ id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass" }, { id = "Fiberglass", name = "Стеклопластиковая", price = 600, level = 5, luck = 0.30, speed = 0.78, zone = 0.27, upgradeCost = 300, style = "glass", icon = "rbxassetid://100031752289540" },
{ id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon" }, { id = "Carbon", name = "Карбоновая удочка", price = 1800, level = 8, luck = 0.55, speed = 0.68, zone = 0.29, upgradeCost = 700, style = "carbon", icon = "rbxassetid://71788597596034" },
{ id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral" }, { id = "Coral", name = "Коралловая удочка", price = 4500, level = 10, luck = 0.80, speed = 0.62, zone = 0.31, upgradeCost = 1300, style = "coral", icon = "rbxassetid://139114393074237" },
{ id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold" }, { id = "Golden", name = "Золотая удочка", price = 9000, level = 13, luck = 1.00, speed = 0.56, zone = 0.33, upgradeCost = 2200, style = "gold", icon = "rbxassetid://83212298735071" },
{ id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost" }, { id = "Frost", name = "Ледяная удочка", price = 25000, level = 18, luck = 1.40, speed = 0.50, zone = 0.35, upgradeCost = 5000, style = "frost", icon = "rbxassetid://134579643216329" },
{ id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend" }, { id = "Legend", name = "Удочка Легенды", price = 75000, level = 25, luck = 2.00, speed = 0.42, zone = 0.38, upgradeCost = 12000, style = "legend", icon = "rbxassetid://84863811378769" },
} }
Config.RodUpgrade = { maxLevel = 5, luckPerLevel = 0.08, zonePerLevel = 0.012, speedPerLevel = 0.96 } Config.RodUpgrade = { maxLevel = 5, luckPerLevel = 0.08, zonePerLevel = 0.012, speedPerLevel = 0.96 }
@@ -847,7 +848,7 @@ local function sparkles(parent, color, rate)
end end
---------------------------------------------------------------- удочки ---------------------------------------------------------------- удочки
-- Рука в (0,0,0), удочка смотрит в -Z и изгибается вверх (+Y). -- Рука в (0,0,0), удочка смотрит в -Z почти прямо, кончик слегка провисает вниз (-Y).
local STYLES = { local STYLES = {
wood = { blank = C(125, 90, 60), mat = Enum.Material.Wood, grip = C(80, 55, 35), gripMat = Enum.Material.Fabric, wrap = C(175, 175, 175), reel = C(95, 95, 100) }, wood = { blank = C(125, 90, 60), mat = Enum.Material.Wood, grip = C(80, 55, 35), gripMat = Enum.Material.Fabric, wrap = C(175, 175, 175), reel = C(95, 95, 100) },
@@ -908,8 +909,8 @@ function M.buildRod(rodId, upgradeLevel, anchored)
cyl(model, V(0.24, -0.68, -0.58), V(0.5, -0.86, -0.58), 0.07, { Color = st.reel, Material = METAL }) cyl(model, V(0.24, -0.68, -0.58), V(0.5, -0.86, -0.58), 0.07, { Color = st.reel, Material = METAL })
ball(model, V(0.54, -0.9, -0.5), 0.19, { Color = st.grip, Material = SP }) ball(model, V(0.54, -0.9, -0.5), 0.19, { Color = st.grip, Material = SP })
-- бланк: 8 колен с плавным изгибом и шарами на стыках -- бланк: 8 колен, почти прямой, к кончику плавно провисает; шары на стыках
local angles = { 6, 9, 12, 16, 20, 25, 30, 36 } local angles = { 0, -1, -2, -3, -5, -7, -9, -12 }
local lengths = { 1.2, 1.15, 1.1, 1.0, 0.95, 0.9, 0.85, 0.8 } local lengths = { 1.2, 1.15, 1.1, 1.0, 0.95, 0.9, 0.85, 0.8 }
local p = V(0, 0, -1.55) local p = V(0, 0, -1.55)
local lastSeg local lastSeg
@@ -1818,7 +1819,7 @@ end
---------------------------------------------------------------- удочка, сумка, VIP на персонаже ---------------------------------------------------------------- удочка, сумка, VIP на персонаже
local REST_ANGLE = 30 local REST_ANGLE = 42 -- удочка в покое: рукоять под ~42° вверх-вперёд, кончик провисает до ~30°
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
@@ -1872,6 +1873,7 @@ local function giveRodTool(player)
local tool = Instance.new("Tool") local tool = Instance.new("Tool")
tool.Name = rod.name .. (lvl > 0 and (" +" .. lvl) or "") tool.Name = rod.name .. (lvl > 0 and (" +" .. lvl) or "")
tool.ToolTip = "Кликни у воды, чтобы закинуть" tool.ToolTip = "Кликни у воды, чтобы закинуть"
tool.TextureId = rod.icon or ""
tool.CanBeDropped = false tool.CanBeDropped = false
tool.Grip = gripCF(REST_ANGLE) tool.Grip = gripCF(REST_ANGLE)
tool:SetAttribute("IsRod", true) tool:SetAttribute("IsRod", true)
@@ -6462,33 +6464,50 @@ H.rod = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 128
-- баннер события (справа сверху) -- баннер события (справа сверху)
local eventBanner = new("Frame", { local eventBanner = new("Frame", {
Name = "EventBanner", -- по имени его ставит под таблицу игроков HudBar.client.lua
Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10), Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10),
BackgroundColor3 = WHITE, Visible = false, Parent = screen, BackgroundColor3 = WHITE, Visible = false, Parent = screen,
}, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) }) }, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) })
local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner }) local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner })
local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner }) local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner })
-- кнопки слева -- меню слева: деревянная панель в рамке с вкладкой «≡» сверху, внутри — широкие кнопки (значок и подпись в строку).
-- столбик на компьютере, сетка 2×N на телефоне (раскладка — в applyLayout ниже) -- side — сетка кнопок внутри панели H.sidePanel (раскладку для телефона и компьютера задаёт applyLayout ниже)
H.sidePanel = new("Frame", {
Name = "SideMenu", Size = UDim2.fromOffset(170, 0), AutomaticSize = Enum.AutomaticSize.Y, Position = UDim2.fromOffset(12, 228),
BackgroundColor3 = WHITE, Parent = screen,
}, { corner(10), stroke(C.goldDark, 2.5, 0), Theme.woodGradient(C.wood, C.woodDark) })
Theme.rivets(H.sidePanel, 7, 6)
do
local tab = new("Frame", {
Size = UDim2.fromOffset(48, 24), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0, 0),
BackgroundColor3 = WHITE, ZIndex = 3, Parent = H.sidePanel,
}, { corner(8), stroke(C.goldDark, 2, 0), Theme.woodGradient(C.woodLight, C.wood) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 18, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.goldBright, Text = "≡", ZIndex = 4, Parent = tab })
end
local side = new("Frame", { local side = new("Frame", {
Size = UDim2.fromOffset(70, 380), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 12, 0.5, 60), Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, Parent = H.sidePanel,
BackgroundTransparency = 1, Parent = screen, }, {
}, { new("UIGridLayout", { CellSize = UDim2.fromOffset(68, 68), CellPadding = UDim2.fromOffset(8, 8), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }) }) new("UIPadding", { PaddingTop = UDim.new(0, 18), PaddingBottom = UDim.new(0, 10), PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8) }),
new("UIGridLayout", { CellSize = UDim2.fromOffset(154, 40), CellPadding = UDim2.fromOffset(6, 6), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }),
})
local sideDots = {} local sideDots = {}
local function sideButton(order, icon, label, key, color, onClick) local function sideButton(order, icon, label, key, color, onClick)
-- деревянная плитка; цвет раздела — полоска-лента снизу -- широкая деревянная кнопка: цветной значок слева, подпись, справа — клавиша
local b = btn({ Size = UDim2.fromOffset(68, 68), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick) local b = btn({ Size = UDim2.fromOffset(154, 40), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick)
b:FindFirstChildOfClass("UIStroke").Color = C.goldDark b:FindFirstChildOfClass("UIStroke").Color = C.goldDark
b:FindFirstChildOfClass("UIStroke").Thickness = 2.5 b:FindFirstChildOfClass("UIStroke").Thickness = 2
new("Frame", { Size = UDim2.new(1, -10, 0, 4), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -4), BackgroundColor3 = color, BorderSizePixel = 0, Parent = b }, { corner(2) }) local badge = new("Frame", { Size = UDim2.new(0, 30, 1, -10), Position = UDim2.fromOffset(5, 5), BackgroundColor3 = color, Parent = b },
text({ Size = UDim2.fromScale(1, 0.5), Position = UDim2.fromScale(0, 0.06), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = b }) { corner(6), stroke(C.ink, 1.5, 0.3), gradient(WHITE, Color3.fromRGB(170, 170, 170), 90) })
text({ Size = UDim2.fromScale(1, 0.24), Position = UDim2.fromScale(0, 0.6), Font = TITLE, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b }) text({ Size = UDim2.fromScale(1, 1), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = badge })
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = text({ Size = UDim2.new(1, -66, 1, 0), Position = UDim2.fromOffset(42, 0), Font = TITLE,
TextScaled = true, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b }) })
if key and not UserInputService.TouchEnabled then if key and not UserInputService.TouchEnabled then
local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), Position = UDim2.new(1, -14, 0, -6), BackgroundColor3 = C.bg, Parent = b }, { corner(6), stroke(C.gold, 1.5) }) local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -6, 0.5, 0), BackgroundColor3 = C.bg, Parent = b }, { corner(5), stroke(C.gold, 1.2) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag }) text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag })
end end
local dot = new("Frame", { Size = UDim2.fromOffset(16, 16), Position = UDim2.new(0, -5, 0, -5), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(8), stroke(WHITE, 2) }) local dot = new("Frame", { Size = UDim2.fromOffset(14, 14), Position = UDim2.new(0, -4, 0, -4), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(7), stroke(WHITE, 2) })
sideDots[label] = dot sideDots[label] = dot
return b return b
end end
@@ -6828,6 +6847,7 @@ Theme.kit = {
makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar, makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar,
sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr, sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr,
screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2, screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2,
viewport = viewport, VIEW = VIEW, -- 3D-превью моделей (удочки на нижней панели — HudBar.client.lua)
} }
---------------------------------------------------------------- данные с сервера ---------------------------------------------------------------- данные с сервера
@@ -7406,6 +7426,7 @@ end)
sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function() sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function()
settingsWin.toggle() settingsWin.toggle()
end) end)
Theme.kit.bagWin = bagWin -- кнопка «Рюкзак» внизу справа (HudBar.client.lua)
-- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD -- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD
-- (левый низ свободен под джойстик, правый низ — под кнопку прыжка) -- (левый низ свободен под джойстик, правый низ — под кнопку прыжка)
@@ -7418,13 +7439,13 @@ do
Theme.onLayout(function(compact) Theme.onLayout(function(compact)
scaleOf(hud.Parent).Scale = compact and 0.82 or 1 scaleOf(hud.Parent).Scale = compact and 0.82 or 1
hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10) hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10)
grid.CellSize = compact and UDim2.fromOffset(52, 52) or UDim2.fromOffset(62, 62) -- меню: на компьютере — столбик широких кнопок, на телефоне — два столбика поуже
grid.CellPadding = compact and UDim2.fromOffset(6, 6) or UDim2.fromOffset(6, 6) grid.CellSize = compact and UDim2.fromOffset(112, 32) or UDim2.fromOffset(154, 40)
grid.FillDirectionMaxCells = compact and 3 or 1 grid.CellPadding = compact and UDim2.fromOffset(5, 5) or UDim2.fromOffset(6, 6)
side.AnchorPoint = Vector2.zero grid.FillDirectionMaxCells = compact and 2 or 1
-- под HUD (он выше на строку гильдии — её добавляет GuildClient) -- под HUD (он выше на строку гильдии — её добавляет GuildClient)
side.Position = compact and UDim2.fromOffset(8, 172) or UDim2.fromOffset(12, 216) H.sidePanel.Position = compact and UDim2.fromOffset(8, 176) or UDim2.fromOffset(12, 228)
side.Size = compact and UDim2.fromOffset(170, 240) or UDim2.fromOffset(70, 480) H.sidePanel.Size = compact and UDim2.fromOffset(2 * 112 + 5 + 16, 0) or UDim2.fromOffset(154 + 16, 0)
toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200) toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200)
H.toastBaseY = compact and 66 or 84 H.toastBaseY = compact and 66 or 84
toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY) toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY)
@@ -8390,6 +8411,11 @@ local function setInterfaceHidden(hidden)
boardGui.Enabled = hidden boardGui.Enabled = hidden
pcall(function() pcall(function()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden) StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden)
if not hidden then
-- рюкзак и список игроков Roblox заменены своими (HudBar.client.lua)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end
end) end)
-- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было -- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было
if hidden then if hidden then
@@ -9285,6 +9311,10 @@ local function setCoreHidden(hidden)
end end
end) end)
for t, on in pairs(snapshot) do 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) pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
end end
end end
+4
View File
@@ -169,6 +169,10 @@ local function setCoreHidden(hidden)
end end
end) end)
for t, on in pairs(snapshot) do 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) pcall(function() StarterGui:SetCoreGuiEnabled(t, (not hidden) and on) end)
end end
end end
@@ -195,33 +195,50 @@ H.rod = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 128
-- баннер события (справа сверху) -- баннер события (справа сверху)
local eventBanner = new("Frame", { local eventBanner = new("Frame", {
Name = "EventBanner", -- по имени его ставит под таблицу игроков HudBar.client.lua
Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10), Size = UDim2.fromOffset(280, 58), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 10),
BackgroundColor3 = WHITE, Visible = false, Parent = screen, BackgroundColor3 = WHITE, Visible = false, Parent = screen,
}, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) }) }, { corner(14), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(90, 60, 20), C.bg, 90) })
local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner }) local eventTitle = text({ Size = UDim2.new(1, -20, 0, 26), Position = UDim2.fromOffset(12, 4), Font = TITLE, TextSize = 19, TextColor3 = C.gold, Text = "", Parent = eventBanner })
local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner }) local eventDesc = text({ Size = UDim2.new(1, -20, 0, 20), Position = UDim2.fromOffset(12, 30), Font = BODY2, TextSize = 13, TextColor3 = C.text, Text = "", Parent = eventBanner })
-- кнопки слева -- меню слева: деревянная панель в рамке с вкладкой «≡» сверху, внутри — широкие кнопки (значок и подпись в строку).
-- столбик на компьютере, сетка 2×N на телефоне (раскладка — в applyLayout ниже) -- side — сетка кнопок внутри панели H.sidePanel (раскладку для телефона и компьютера задаёт applyLayout ниже)
H.sidePanel = new("Frame", {
Name = "SideMenu", Size = UDim2.fromOffset(170, 0), AutomaticSize = Enum.AutomaticSize.Y, Position = UDim2.fromOffset(12, 228),
BackgroundColor3 = WHITE, Parent = screen,
}, { corner(10), stroke(C.goldDark, 2.5, 0), Theme.woodGradient(C.wood, C.woodDark) })
Theme.rivets(H.sidePanel, 7, 6)
do
local tab = new("Frame", {
Size = UDim2.fromOffset(48, 24), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 0, 0, 0),
BackgroundColor3 = WHITE, ZIndex = 3, Parent = H.sidePanel,
}, { corner(8), stroke(C.goldDark, 2, 0), Theme.woodGradient(C.woodLight, C.wood) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 18, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.goldBright, Text = "≡", ZIndex = 4, Parent = tab })
end
local side = new("Frame", { local side = new("Frame", {
Size = UDim2.fromOffset(70, 380), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 12, 0.5, 60), Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, Parent = H.sidePanel,
BackgroundTransparency = 1, Parent = screen, }, {
}, { new("UIGridLayout", { CellSize = UDim2.fromOffset(68, 68), CellPadding = UDim2.fromOffset(8, 8), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }) }) new("UIPadding", { PaddingTop = UDim.new(0, 18), PaddingBottom = UDim.new(0, 10), PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 8) }),
new("UIGridLayout", { CellSize = UDim2.fromOffset(154, 40), CellPadding = UDim2.fromOffset(6, 6), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }),
})
local sideDots = {} local sideDots = {}
local function sideButton(order, icon, label, key, color, onClick) local function sideButton(order, icon, label, key, color, onClick)
-- деревянная плитка; цвет раздела — полоска-лента снизу -- широкая деревянная кнопка: цветной значок слева, подпись, справа — клавиша
local b = btn({ Size = UDim2.fromOffset(68, 68), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick) local b = btn({ Size = UDim2.fromOffset(154, 40), BackgroundColor3 = C.woodLight, LayoutOrder = order, Parent = side }, onClick)
b:FindFirstChildOfClass("UIStroke").Color = C.goldDark b:FindFirstChildOfClass("UIStroke").Color = C.goldDark
b:FindFirstChildOfClass("UIStroke").Thickness = 2.5 b:FindFirstChildOfClass("UIStroke").Thickness = 2
new("Frame", { Size = UDim2.new(1, -10, 0, 4), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -4), BackgroundColor3 = color, BorderSizePixel = 0, Parent = b }, { corner(2) }) local badge = new("Frame", { Size = UDim2.new(0, 30, 1, -10), Position = UDim2.fromOffset(5, 5), BackgroundColor3 = color, Parent = b },
text({ Size = UDim2.fromScale(1, 0.5), Position = UDim2.fromScale(0, 0.06), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = b }) { corner(6), stroke(C.ink, 1.5, 0.3), gradient(WHITE, Color3.fromRGB(170, 170, 170), 90) })
text({ Size = UDim2.fromScale(1, 0.24), Position = UDim2.fromScale(0, 0.6), Font = TITLE, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b }) text({ Size = UDim2.fromScale(1, 1), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = badge })
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = text({ Size = UDim2.new(1, -66, 1, 0), Position = UDim2.fromOffset(42, 0), Font = TITLE,
TextScaled = true, Text = label, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = b }) })
if key and not UserInputService.TouchEnabled then if key and not UserInputService.TouchEnabled then
local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), Position = UDim2.new(1, -14, 0, -6), BackgroundColor3 = C.bg, Parent = b }, { corner(6), stroke(C.gold, 1.5) }) local tag = new("Frame", { Size = UDim2.fromOffset(20, 20), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -6, 0.5, 0), BackgroundColor3 = C.bg, Parent = b }, { corner(5), stroke(C.gold, 1.2) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag }) text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 12, TextXAlignment = Enum.TextXAlignment.Center, TextColor3 = C.gold, Text = key, Parent = tag })
end end
local dot = new("Frame", { Size = UDim2.fromOffset(16, 16), Position = UDim2.new(0, -5, 0, -5), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(8), stroke(WHITE, 2) }) local dot = new("Frame", { Size = UDim2.fromOffset(14, 14), Position = UDim2.new(0, -4, 0, -4), BackgroundColor3 = C.red, Visible = false, ZIndex = 3, Parent = b }, { corner(7), stroke(WHITE, 2) })
sideDots[label] = dot sideDots[label] = dot
return b return b
end end
@@ -561,6 +578,7 @@ Theme.kit = {
makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar, makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar,
sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr, sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr,
screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2, screen = screen, hud = hud, TITLE = TITLE, BODY = BODY, BODY2 = BODY2,
viewport = viewport, VIEW = VIEW, -- 3D-превью моделей (удочки на нижней панели — HudBar.client.lua)
} }
---------------------------------------------------------------- данные с сервера ---------------------------------------------------------------- данные с сервера
@@ -1139,6 +1157,7 @@ end)
sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function() sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function()
settingsWin.toggle() settingsWin.toggle()
end) end)
Theme.kit.bagWin = bagWin -- кнопка «Рюкзак» внизу справа (HudBar.client.lua)
-- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD -- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD
-- (левый низ свободен под джойстик, правый низ — под кнопку прыжка) -- (левый низ свободен под джойстик, правый низ — под кнопку прыжка)
@@ -1151,13 +1170,13 @@ do
Theme.onLayout(function(compact) Theme.onLayout(function(compact)
scaleOf(hud.Parent).Scale = compact and 0.82 or 1 scaleOf(hud.Parent).Scale = compact and 0.82 or 1
hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10) hud.Parent.Position = compact and UDim2.fromOffset(8, 6) or UDim2.fromOffset(12, 10)
grid.CellSize = compact and UDim2.fromOffset(52, 52) or UDim2.fromOffset(62, 62) -- меню: на компьютере — столбик широких кнопок, на телефоне — два столбика поуже
grid.CellPadding = compact and UDim2.fromOffset(6, 6) or UDim2.fromOffset(6, 6) grid.CellSize = compact and UDim2.fromOffset(112, 32) or UDim2.fromOffset(154, 40)
grid.FillDirectionMaxCells = compact and 3 or 1 grid.CellPadding = compact and UDim2.fromOffset(5, 5) or UDim2.fromOffset(6, 6)
side.AnchorPoint = Vector2.zero grid.FillDirectionMaxCells = compact and 2 or 1
-- под HUD (он выше на строку гильдии — её добавляет GuildClient) -- под HUD (он выше на строку гильдии — её добавляет GuildClient)
side.Position = compact and UDim2.fromOffset(8, 172) or UDim2.fromOffset(12, 216) H.sidePanel.Position = compact and UDim2.fromOffset(8, 176) or UDim2.fromOffset(12, 228)
side.Size = compact and UDim2.fromOffset(170, 240) or UDim2.fromOffset(70, 480) H.sidePanel.Size = compact and UDim2.fromOffset(2 * 112 + 5 + 16, 0) or UDim2.fromOffset(154 + 16, 0)
toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200) toasts.Size = compact and UDim2.fromOffset(640, 200) or UDim2.fromOffset(900, 200)
H.toastBaseY = compact and 66 or 84 H.toastBaseY = compact and 66 or 84
toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY) toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY)
@@ -2123,6 +2142,11 @@ local function setInterfaceHidden(hidden)
boardGui.Enabled = hidden boardGui.Enabled = hidden
pcall(function() pcall(function()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden) StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, not hidden)
if not hidden then
-- рюкзак и список игроков Roblox заменены своими (HudBar.client.lua)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end
end) end)
-- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было -- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было
if hidden then if hidden then
@@ -302,15 +302,19 @@ end
local bar = new("Frame", { local bar = new("Frame", {
Size = UDim2.fromOffset(250, 56), AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, Parent = K.screen, Size = UDim2.fromOffset(250, 56), AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, -12, 1, -12), BackgroundTransparency = 1, Parent = K.screen,
}, { new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, HorizontalAlignment = Enum.HorizontalAlignment.Right, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) }) }, { new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, HorizontalAlignment = Enum.HorizontalAlignment.Right, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
local baitBtn = btn({ Size = UDim2.fromOffset(110, 52), BackgroundColor3 = C.woodLight, Text = "", TextSize = 16, LayoutOrder = 1, Parent = bar }, function() -- наживка теперь — карточка на нижней панели (HudBar.client.lua); старая кнопка скрыта, вкладку открывает K.openBait
local baitBtn = btn({ Size = UDim2.fromOffset(110, 52), BackgroundColor3 = C.woodLight, Text = "", TextSize = 16, LayoutOrder = 1, Visible = false, Parent = bar }, function()
openGuild("bait") openGuild("bait")
end) end)
K.openBait = function()
openGuild("bait")
end
local autoBtn = btn({ Size = UDim2.fromOffset(130, 52), BackgroundColor3 = C.woodLight, Text = "", TextSize = 15, LayoutOrder = 2, Visible = false, Parent = bar }, function() local autoBtn = btn({ Size = UDim2.fromOffset(130, 52), BackgroundColor3 = C.woodLight, Text = "", TextSize = 15, LayoutOrder = 2, Visible = false, Parent = bar }, function()
remote:FireServer("AutoFish", not player:GetAttribute("AutoFish")) remote:FireServer("AutoFish", not player:GetAttribute("AutoFish"))
end) end)
Theme.onLayout(function(compact) Theme.onLayout(function(compact)
-- на телефоне — внизу, левее кнопки прыжка (над ней — панель целей) -- над кнопкой «Рюкзак» (правый низ): на телефоне — левее кнопки прыжка
bar.Position = compact and UDim2.new(1, -140, 1, -8) or UDim2.new(1, -12, 1, -12) bar.Position = compact and UDim2.new(1, -140, 1, -66) or UDim2.new(1, -12, 1, -92)
end) end)
local function refreshBar() local function refreshBar()
@@ -0,0 +1,405 @@
-- HudBar (LocalScript) -> StarterPlayer > StarterPlayerScripts
-- Нижняя панель и правый верх в стиле игры (вместо стандартных панелей Roblox):
-- слоты удочек со стрелками (клик / клавиши 1–3 — выбрать удочку и взять её в руки),
-- карточка удочки в руке (клик — взять или убрать), карточка наживки (⇄ — вкладка наживки гильдии),
-- кнопка «Рюкзак» с заполненностью сумки, таблица игроков (уровень, серебро, улов) справа сверху —
-- под ней встают плашка погоды и баннер события.
-- Стиль и помощники — из FishingClient (Theme.kit), всё лежит в его холсте и прячется вместе с ним.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")
local player = Players.LocalPlayer
local Config = require(ReplicatedStorage:WaitForChild("FishConfig"))
local Models = require(ReplicatedStorage:WaitForChild("GameModels"))
local Theme = require(script.Parent:WaitForChild("UiTheme"))
local remote = ReplicatedStorage:WaitForChild("GameEvent")
while not Theme.kit do
task.wait(0.1)
end
local K = Theme.kit
local C = Theme.C
local new, text, btn, corner, stroke, gradient, fmt = K.new, K.text, K.btn, K.corner, K.stroke, K.gradient, K.fmt
local TITLE, BODY2 = K.TITLE, K.BODY2
local CENTER = Enum.TextXAlignment.Center
local WHITE = Color3.new(1, 1, 1)
-- стандартные рюкзак и список игроков Roblox заменены своими
local function hideCore()
for _ = 1, 20 do
local ok = pcall(function()
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end)
if ok then
return
end
task.wait(0.5)
end
end
task.spawn(hideCore)
-- деревянная панель в стиле HUD
local function woodPanel(props)
local f = new("Frame", props, { corner(10), stroke(C.goldDark, 2.5, 0), Theme.woodGradient(C.wood, C.woodDark) })
Theme.innerBorder(f, 4, 7, C.gold, 0.55)
return f
end
---------------------------------------------------------------- удочки и наживка (низ по центру)
local SLOTS = 3
local bar = woodPanel({
Name = "HotBar", Size = UDim2.fromOffset(0, 74), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 1),
Position = UDim2.new(0.5, 0, 1, -10), BackgroundColor3 = WHITE, Parent = K.screen,
})
Theme.rivets(bar, 7, 6)
new("UIPadding", { PaddingLeft = UDim.new(0, 12), PaddingRight = UDim.new(0, 12), Parent = bar })
local row = new("Frame", { Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, BackgroundTransparency = 1, Parent = bar }, {
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, VerticalAlignment = Enum.VerticalAlignment.Center, Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder }),
})
-- ярлычок над слотами
do
local tag = new("Frame", {
Size = UDim2.fromOffset(0, 24), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0, 1), Position = UDim2.new(0, 34, 0, 6),
BackgroundColor3 = WHITE, ZIndex = 3, Parent = bar,
}, { corner(8), stroke(C.goldDark, 2, 0), Theme.woodGradient(C.woodLight, C.wood), new("UIPadding", { PaddingLeft = UDim.new(0, 10), PaddingRight = UDim.new(0, 10) }) })
text({ Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, Font = BODY2, TextSize = 13, TextColor3 = C.parchment, Text = "Выбрать удочку", ZIndex = 4, Parent = tag })
end
local page = 0 -- какие удочки видны в слотах: page*SLOTS + 1 …
local refresh -- обновление панели, объявлена ниже
local function ownedRods()
local set = {}
for id in string.gmatch(player:GetAttribute("OwnedRods") or "Basic", "[^,]+") do
set[id] = true
end
local list = {}
for _, r in ipairs(Config.Rods) do
if set[r.id] then
table.insert(list, r)
end
end
return list
end
local function rodLevel(id)
for pair in string.gmatch(player:GetAttribute("RodLevels") or "", "[^,]+") do
local k, v = pair:match("^(%w+):(%d+)$")
if k == id then
return tonumber(v)
end
end
return 0
end
local function rodTool()
for _, container in ipairs({ player.Character, player:FindFirstChild("Backpack") }) do
if container then
for _, t in ipairs(container:GetChildren()) do
if t:IsA("Tool") and t:GetAttribute("IsRod") then
return t
end
end
end
end
end
local function inHand()
local t = rodTool()
return t ~= nil and t.Parent == player.Character
end
local function equip(on)
local hum = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
if not hum then
return
end
if on then
local t = rodTool()
if t then
hum:EquipTool(t)
end
else
hum:UnequipTools()
end
end
-- 3D-модель удочки (как в магазине): картинки-иконки удочек могут быть недоступны (права на ассет),
-- модель строится из деталей и видна всегда. В квадрате удочка наклонена по диагонали, иначе она — тонкая черта
local function rodView(holder, rodId, lvl)
local key = rodId and (rodId .. ":" .. lvl) or ""
if holder:GetAttribute("Shown") == key then
return
end
holder:SetAttribute("Shown", key)
for _, c in ipairs(holder:GetChildren()) do
if c:IsA("ViewportFrame") then
c:Destroy()
end
end
if rodId and K.viewport then
local ok, model = pcall(Models.buildRod, rodId, lvl, true)
if ok and model then
local p = model:GetPivot()
model:PivotTo(CFrame.new(p.Position) * CFrame.Angles(math.rad(42), 0, 0) * (p - p.Position))
K.viewport(holder, model, K.VIEW.rod, 0.62)
end
end
end
local function arrow(order, label, dir)
local b = btn({ Size = UDim2.fromOffset(26, 56), BackgroundColor3 = C.woodLight, Text = label, TextSize = 18, LayoutOrder = order, Parent = row }, function()
local count = #ownedRods()
local pages = math.max(1, math.ceil(count / SLOTS))
page = (page + dir) % pages
refresh()
end)
return b
end
arrow(1, "‹", -1)
local slots = {}
for i = 1, SLOTS do
local s = btn({ Size = UDim2.fromOffset(56, 56), BackgroundColor3 = C.wood, Text = "", LayoutOrder = 1 + i, Parent = row }, function()
local rod = slots[i].rod
if rod then
if rod.id ~= player:GetAttribute("Rod") then
remote:FireServer("Buy", "Rod", rod.id) -- своя удочка — бесплатно, сервер выдаёт её в руки
task.delay(0.4, equip, true)
else
equip(not inHand())
end
end
end)
local icon = new("Frame", { Size = UDim2.new(1, -6, 1, -6), Position = UDim2.fromOffset(3, 3), BackgroundTransparency = 1, Parent = s })
local num = new("Frame", { Size = UDim2.fromOffset(18, 18), AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, 6), BackgroundColor3 = C.bg, ZIndex = 3, Parent = s },
{ corner(9), stroke(C.gold, 1.2) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 11, TextXAlignment = CENTER, TextColor3 = C.goldBright, Text = tostring(i), ZIndex = 4, Parent = num })
slots[i] = { button = s, icon = icon, stroke = s:FindFirstChildOfClass("UIStroke") }
end
arrow(10, "›", 1)
-- разделитель
new("Frame", { Size = UDim2.fromOffset(2, 52), BackgroundColor3 = C.goldDark, BorderSizePixel = 0, LayoutOrder = 11, Parent = row })
-- удочка в руке
local rodCard = btn({ Size = UDim2.fromOffset(196, 60), BackgroundColor3 = C.woodLight, Text = "", LayoutOrder = 12, Parent = row }, function()
equip(not inHand())
end)
local rodIcon = new("Frame", { Size = UDim2.fromOffset(52, 52), Position = UDim2.fromOffset(4, 4), BackgroundTransparency = 1, Parent = rodCard })
local rodName = text({ Size = UDim2.new(1, -66, 1, -8), Position = UDim2.fromOffset(58, 4), Font = TITLE, TextScaled = true, TextWrapped = true, Text = "", Parent = rodCard })
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = rodName })
local rodCheck = new("Frame", { Size = UDim2.fromOffset(22, 22), AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(1, -4, 0, 4), BackgroundColor3 = C.forest, ZIndex = 3, Parent = rodCard },
{ corner(11), stroke(WHITE, 2) })
text({ Size = UDim2.fromScale(1, 1), Font = TITLE, TextSize = 13, TextXAlignment = CENTER, Text = "✓", ZIndex = 4, Parent = rodCheck })
-- наживка
local baitCard = new("Frame", { Size = UDim2.fromOffset(190, 60), BackgroundColor3 = WHITE, LayoutOrder = 13, Parent = row },
{ corner(8), stroke(C.gold, 1.5, 0.15), Theme.woodGradient(C.woodLight, C.wood) })
local baitIcon = text({ Size = UDim2.fromOffset(44, 44), Position = UDim2.fromOffset(6, 8), TextScaled = true, TextXAlignment = CENTER, Text = "🐛", Parent = baitCard })
local baitName = text({ Size = UDim2.new(1, -104, 0, 24), Position = UDim2.fromOffset(54, 6), Font = TITLE, TextScaled = true, Text = "", Parent = baitCard })
new("UITextSizeConstraint", { MaxTextSize = 17, Parent = baitName })
local baitCount = text({ Size = UDim2.new(1, -104, 0, 20), Position = UDim2.fromOffset(54, 32), Font = BODY2, TextSize = 14, TextColor3 = C.muted, Text = "", Parent = baitCard })
btn({ Size = UDim2.fromOffset(40, 40), AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -8, 0.5, 0), BackgroundColor3 = C.wood, Text = "⇄", TextSize = 20, Parent = baitCard }, function()
if K.openBait then
K.openBait()
end
end)
---------------------------------------------------------------- рюкзак (правый низ)
local pack = btn({
Name = "BackpackButton", Size = UDim2.fromOffset(170, 70), AnchorPoint = Vector2.new(1, 1), Position = UDim2.new(1, -12, 1, -12),
BackgroundColor3 = C.woodLight, Text = "", Parent = K.screen,
}, function()
if K.bagWin then
K.bagWin.toggle("fish")
end
end)
pack:FindFirstChildOfClass("UIStroke").Color = C.goldDark
pack:FindFirstChildOfClass("UIStroke").Thickness = 2.5
text({ Size = UDim2.fromOffset(52, 52), Position = UDim2.fromOffset(8, 9), TextScaled = true, TextXAlignment = CENTER, Text = "🎒", Parent = pack })
text({ Size = UDim2.new(1, -70, 0, 30), Position = UDim2.fromOffset(64, 8), Font = TITLE, TextSize = 22, Text = "Рюкзак", TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = pack })
local packCount = text({ Size = UDim2.new(1, -70, 0, 22), Position = UDim2.fromOffset(64, 38), Font = BODY2, TextSize = 15, Text = "", Parent = pack })
---------------------------------------------------------------- таблица игроков (правый верх)
local ROW_H, MAX_ROWS = 26, 6
local board = woodPanel({
Name = "PlayersBoard", Size = UDim2.fromOffset(310, 34), AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -12, 0, 8),
BackgroundColor3 = WHITE, Parent = K.screen,
})
local function cols(parent, y, a, b, c, d, color, font)
local function cell(x, w, t, align)
text({ Size = UDim2.fromOffset(w, ROW_H), Position = UDim2.fromOffset(x, y), Font = font or BODY2, TextSize = 13, TextColor3 = color,
TextXAlignment = align or CENTER, TextTruncate = Enum.TextTruncate.AtEnd, Text = t, Parent = parent })
end
cell(12, 130, a, Enum.TextXAlignment.Left)
cell(142, 46, b)
cell(188, 62, c)
cell(250, 50, d)
end
local header = new("Frame", { Size = UDim2.new(1, 0, 0, 30), BackgroundTransparency = 1, Parent = board })
cols(header, 3, "👥 Игроки", "Уровень", "Серебро", "Улов", C.muted)
local rowsFrame = new("Frame", { Size = UDim2.new(1, 0, 1, -32), Position = UDim2.fromOffset(0, 30), BackgroundTransparency = 1, Parent = board })
local collapsed = false
local function stat(p, name)
local ls = p:FindFirstChild("leaderstats")
local v = ls and ls:FindFirstChild(name)
return v and v.Value or 0
end
local function placeBelowBoard()
-- плашку погоды (Ambience) и баннер события (FishingClient) ставим под таблицей
local y = 8 + board.Size.Y.Offset + 8
local weather = player.PlayerGui:FindFirstChild("WeatherHud")
local pill = weather and weather:FindFirstChild("Root") and weather.Root:FindFirstChildOfClass("Frame")
if pill then
pill.Position = UDim2.new(1, -12, 0, y)
y += pill.Size.Y.Offset + 8
end
local ev = K.screen:FindFirstChild("EventBanner")
if ev then
ev.Position = UDim2.new(1, -12, 0, y)
end
end
local function refreshBoard()
for _, c in ipairs(rowsFrame:GetChildren()) do
c:Destroy()
end
local list = Players:GetPlayers()
table.sort(list, function(a, b)
local la, lb = stat(a, "Уровень"), stat(b, "Уровень")
if la ~= lb then
return la > lb
end
return stat(a, "Серебро") > stat(b, "Серебро")
end)
local shown = collapsed and 0 or math.min(#list, MAX_ROWS)
for i = 1, shown do
local p = list[i]
local me = p == player
local r = new("Frame", { Size = UDim2.new(1, -12, 0, ROW_H - 2), Position = UDim2.fromOffset(6, (i - 1) * ROW_H), BackgroundColor3 = me and C.goldDark or C.woodDark,
BackgroundTransparency = me and 0.55 or 0.6, Parent = rowsFrame }, { corner(5) })
cols(r, -1, p.DisplayName, fmt(stat(p, "Уровень")), fmt(stat(p, "Серебро")), fmt(stat(p, "Улов")), me and C.goldBright or C.parchment, me and TITLE or BODY2)
end
board.Size = UDim2.fromOffset(310, 34 + shown * ROW_H + (shown > 0 and 6 or 0))
placeBelowBoard()
end
-- Tab — свернуть/развернуть, как стандартный список
UserInputService.InputBegan:Connect(function(input, processed)
if not processed and input.KeyCode == Enum.KeyCode.Tab then
collapsed = not collapsed
refreshBoard()
end
end)
---------------------------------------------------------------- обновление
refresh = function()
-- слоты удочек
local rods = ownedRods()
local pages = math.max(1, math.ceil(#rods / SLOTS))
page = math.clamp(page, 0, pages - 1)
local current = player:GetAttribute("Rod") or "Basic"
local hand = inHand()
for i, s in ipairs(slots) do
local rod = rods[page * SLOTS + i]
s.rod = rod
rodView(s.icon, rod and rod.id, rod and rodLevel(rod.id) or 0)
s.button.BackgroundColor3 = rod and C.woodLight or C.woodDark
s.button.AutoButtonColor = rod ~= nil
local on = rod and rod.id == current
s.stroke.Color = on and Color3.fromRGB(120, 230, 255) or C.goldDark
s.stroke.Thickness = on and 3 or 1.5
end
-- удочка в руке
local rod = Config.Find(Config.Rods, current) or Config.Rods[1]
local lvl = rodLevel(rod.id)
rodView(rodIcon, rod.id, lvl)
rodName.Text = rod.name .. (lvl > 0 and (" +" .. lvl) or "")
rodCheck.Visible = hand
rodCard:FindFirstChildOfClass("UIStroke").Color = hand and Color3.fromRGB(120, 230, 255) or C.gold
-- наживка
local id = player:GetAttribute("Bait")
local b = id and id ~= "" and Config.Find(Config.Baits, id)
baitIcon.Text = b and b.icon or "🐛"
baitName.Text = b and b.name or "Наживка"
baitCount.Text = b and ("×%d"):format(player:GetAttribute("BaitCount") or 0) or "не выбрана"
-- рюкзак
local count, cap = player:GetAttribute("BagCount") or 0, player:GetAttribute("BagCap") or 10
packCount.Text = ("📦 %d / %d"):format(count, cap)
packCount.TextColor3 = count >= cap and Color3.fromRGB(255, 130, 120) or C.parchment
end
-- клавиши 1–3: удочка из слота (взять в руки; повторно — убрать)
UserInputService.InputBegan:Connect(function(input, processed)
if processed then
return
end
local n = ({ [Enum.KeyCode.One] = 1, [Enum.KeyCode.Two] = 2, [Enum.KeyCode.Three] = 3 })[input.KeyCode]
local rod = n and slots[n].rod
if rod then
if rod.id ~= player:GetAttribute("Rod") then
remote:FireServer("Buy", "Rod", rod.id)
task.delay(0.4, equip, true)
else
equip(not inHand())
end
end
end)
Theme.onLayout(function(compact)
local function scale(obj, s)
local sc = obj:FindFirstChild("LayoutScale") or new("UIScale", { Name = "LayoutScale", Parent = obj })
sc.Scale = s
end
-- телефон: всё мельче; рюкзак левее кнопки прыжка, таблица игроков — компактнее
scale(bar, compact and 0.62 or 1)
bar.Position = compact and UDim2.new(0.5, 0, 1, -4) or UDim2.new(0.5, 0, 1, -10)
scale(pack, compact and 0.7 or 1)
pack.Position = compact and UDim2.new(1, -140, 1, -6) or UDim2.new(1, -12, 1, -12)
scale(board, compact and 0.75 or 1)
MAX_ROWS = compact and 4 or 6
refreshBoard()
end)
player.AttributeChanged:Connect(refresh)
local function watchChar(char)
char.ChildAdded:Connect(refresh)
char.ChildRemoved:Connect(refresh)
end
if player.Character then
watchChar(player.Character)
end
player.CharacterAdded:Connect(watchChar)
refresh()
-- таблица: игроки приходят и уходят, значения меняются
local function watchPlayer(p)
local ls = p:WaitForChild("leaderstats", 30)
if ls then
for _, v in ipairs(ls:GetChildren()) do
v.Changed:Connect(refreshBoard)
end
ls.ChildAdded:Connect(function(v)
v.Changed:Connect(refreshBoard)
end)
end
refreshBoard()
end
for _, p in ipairs(Players:GetPlayers()) do
task.spawn(watchPlayer, p)
end
Players.PlayerAdded:Connect(function(p)
task.spawn(watchPlayer, p)
end)
Players.PlayerRemoving:Connect(function()
task.defer(refreshBoard)
end)
refreshBoard()
-- плашка погоды создаётся другим скриптом — подождать её
task.delay(3, placeBelowBoard)