интерфейс
This commit is contained in:
1 parent
d7ccebb788
commit
838a118f98
10 files changed
+583
-86
No files matched your search
@@ -196,33 +196,50 @@ H.rod = text({ Size = UDim2.new(1, 0, 0, 20), Position = UDim2.fromOffset(0, 128
|
||||
|
||||
-- баннер события (справа сверху)
|
||||
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),
|
||||
BackgroundColor3 = WHITE, Visible = false, Parent = screen,
|
||||
}, { 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 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", {
|
||||
Size = UDim2.fromOffset(70, 380), AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 12, 0.5, 60),
|
||||
BackgroundTransparency = 1, Parent = screen,
|
||||
}, { new("UIGridLayout", { CellSize = UDim2.fromOffset(68, 68), CellPadding = UDim2.fromOffset(8, 8), FillDirectionMaxCells = 1, SortOrder = Enum.SortOrder.LayoutOrder }) })
|
||||
Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, Parent = H.sidePanel,
|
||||
}, {
|
||||
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 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").Thickness = 2.5
|
||||
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) })
|
||||
text({ Size = UDim2.fromScale(1, 0.5), Position = UDim2.fromScale(0, 0.06), TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, Text = icon, Parent = b })
|
||||
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 })
|
||||
b:FindFirstChildOfClass("UIStroke").Thickness = 2
|
||||
local badge = new("Frame", { Size = UDim2.new(0, 30, 1, -10), Position = UDim2.fromOffset(5, 5), BackgroundColor3 = color, Parent = b },
|
||||
{ corner(6), stroke(C.ink, 1.5, 0.3), gradient(WHITE, Color3.fromRGB(170, 170, 170), 90) })
|
||||
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
|
||||
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 })
|
||||
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
|
||||
return b
|
||||
end
|
||||
@@ -562,6 +579,7 @@ Theme.kit = {
|
||||
makeWindow = makeWindow, scrollArea = scrollArea, itemRow = itemRow, progressBar = progressBar,
|
||||
sideButton = sideButton, notify = notify, popIn = popIn, fmt = fmt, timeStr = timeStr,
|
||||
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()
|
||||
settingsWin.toggle()
|
||||
end)
|
||||
Theme.kit.bagWin = bagWin -- кнопка «Рюкзак» внизу справа (HudBar.client.lua)
|
||||
|
||||
-- раскладка: компьютер — как раньше; телефон — HUD и кнопки компактнее, кнопки сеткой 3×N под HUD
|
||||
-- (левый низ свободен под джойстик, правый низ — под кнопку прыжка)
|
||||
@@ -1152,13 +1171,13 @@ do
|
||||
Theme.onLayout(function(compact)
|
||||
scaleOf(hud.Parent).Scale = compact and 0.82 or 1
|
||||
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.FillDirectionMaxCells = compact and 3 or 1
|
||||
side.AnchorPoint = Vector2.zero
|
||||
-- меню: на компьютере — столбик широких кнопок, на телефоне — два столбика поуже
|
||||
grid.CellSize = compact and UDim2.fromOffset(112, 32) or UDim2.fromOffset(154, 40)
|
||||
grid.CellPadding = compact and UDim2.fromOffset(5, 5) or UDim2.fromOffset(6, 6)
|
||||
grid.FillDirectionMaxCells = compact and 2 or 1
|
||||
-- под HUD (он выше на строку гильдии — её добавляет GuildClient)
|
||||
side.Position = compact and UDim2.fromOffset(8, 172) or UDim2.fromOffset(12, 216)
|
||||
side.Size = compact and UDim2.fromOffset(170, 240) or UDim2.fromOffset(70, 480)
|
||||
H.sidePanel.Position = compact and UDim2.fromOffset(8, 176) or UDim2.fromOffset(12, 228)
|
||||
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)
|
||||
H.toastBaseY = compact and 66 or 84
|
||||
toasts.Position = UDim2.new(0.5, 0, 0, H.toastBaseY)
|
||||
@@ -2124,6 +2143,11 @@ local function setInterfaceHidden(hidden)
|
||||
boardGui.Enabled = hidden
|
||||
pcall(function()
|
||||
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)
|
||||
-- надписи над объектами (порталы, лавки) тоже прячем, потом возвращаем как было
|
||||
if hidden then
|
||||
|
||||
Reference in new issue
Block a user