Update
No files matched your search
@@ -0,0 +1,303 @@
|
||||
-- AdminPanel (LocalScript, StarterPlayerScripts): admin panel, only for admins (attribute IsAdmin from
|
||||
-- OrnamentAdminServer; the server checks the admin list again on every action).
|
||||
-- left : players on this server (name, level, shards, toys, tutorial) — click to select (you are first)
|
||||
-- shards : give / take any amount, quick +100 / +1 000 / +10 000
|
||||
-- level : set any level (1..MAX_LEVEL); boosters: - / + per booster
|
||||
-- player : reset the tutorial (it starts right away) / reset all statistics (second click confirms)
|
||||
-- all : reset the tutorial of every player (online now + everyone who joins later, all servers)
|
||||
-- Open / close: the "Админ" button at the bottom left or F2.
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local UIS = game:GetService("UserInputService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local folder = ReplicatedStorage:WaitForChild("OrnamentMachine")
|
||||
local K = require(player:WaitForChild("PlayerScripts"):WaitForChild("OrnamentCraftUI"):WaitForChild("ShopKit"))
|
||||
local new, corner, label, maxText, pill = K.new, K.corner, K.label, K.maxText, K.pill
|
||||
local GOLD, SOFT, OK, WARN, WHITE, BODY, NAVY = K.GOLD, K.SOFT, K.OK, K.WARN, K.WHITE, K.BODY, K.NAVY
|
||||
|
||||
do
|
||||
local t = os.clock()
|
||||
while player:GetAttribute("IsAdmin") == nil and os.clock() - t < 60 do task.wait(0.5) end
|
||||
end
|
||||
if player:GetAttribute("IsAdmin") ~= true then return end
|
||||
local fn = folder:WaitForChild("Admin", 30)
|
||||
if not fn then return end
|
||||
|
||||
local W, H = 900, 830
|
||||
local PANEL = Color3.fromRGB(6, 20, 26)
|
||||
|
||||
local function fmt(n)
|
||||
local s = tostring(math.floor(math.abs(n)))
|
||||
local out = s:reverse():gsub("(%d%d%d)", "%1 "):reverse():gsub("^ ", "")
|
||||
return (n < 0 and "-" or "") .. out
|
||||
end
|
||||
|
||||
local gui = new("ScreenGui", { Name = "AdminGui", ResetOnSpawn = false, DisplayOrder = 60, IgnoreGuiInset = true,
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = player:WaitForChild("PlayerGui") })
|
||||
|
||||
-- toggle button (bottom left)
|
||||
local toggle = new("TextButton", { Name = "AdminToggle", AnchorPoint = Vector2.new(0, 1), Position = UDim2.new(0, 12, 1, -12), Size = UDim2.fromOffset(128, 44),
|
||||
BackgroundColor3 = NAVY, BackgroundTransparency = 0.1, AutoButtonColor = true, Text = "🛠 Admin", FontFace = K.FONT, TextSize = 22, TextColor3 = GOLD, Parent = gui }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 2, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }),
|
||||
})
|
||||
|
||||
-- dim layer + panel
|
||||
local overlay = new("TextButton", { Name = "AdminOverlay", Text = "", AutoButtonColor = false, Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 0.45, Visible = false, Parent = gui })
|
||||
overlay:SetAttribute("NoSound", true)
|
||||
local panel = new("Frame", { Name = "AdminPanel", AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromOffset(W, H),
|
||||
BackgroundColor3 = WHITE, Parent = overlay }, {
|
||||
corner(UDim.new(0, 30)),
|
||||
new("UIStroke", { Color = Color3.fromRGB(242, 196, 82), Thickness = 4 }),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(Color3.fromRGB(22, 84, 70), Color3.fromRGB(8, 36, 44)) }),
|
||||
})
|
||||
local scale = new("UIScale", { Parent = panel })
|
||||
local function fit()
|
||||
local vp = workspace.CurrentCamera.ViewportSize
|
||||
scale.Scale = math.min(1, (vp.X - 24) / W, (vp.Y - 24) / H)
|
||||
end
|
||||
fit()
|
||||
workspace.CurrentCamera:GetPropertyChangedSignal("ViewportSize"):Connect(fit)
|
||||
|
||||
local function box(pos, size)
|
||||
return new("Frame", { Position = pos, Size = size, BackgroundColor3 = PANEL, BackgroundTransparency = 0.35, Parent = panel }, {
|
||||
corner(UDim.new(0, 18)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.5 }),
|
||||
})
|
||||
end
|
||||
local function title(text, pos, size)
|
||||
return maxText(label({ Position = pos, Size = size or UDim2.fromOffset(300, 32), Text = text, TextScaled = true, Parent = panel }, 2), 28)
|
||||
end
|
||||
|
||||
maxText(label({ Position = UDim2.fromOffset(28, 18), Size = UDim2.fromOffset(560, 48), Text = "🛠 Admin Panel", TextScaled = true, Parent = panel }, 3), 42)
|
||||
local setOpen
|
||||
local closeBtn = pill(panel, { Position = UDim2.fromOffset(W - 88, 14), Size = UDim2.fromOffset(68, 58), TextMax = 30 }, function() setOpen(false) end)
|
||||
closeBtn.set("danger", "X")
|
||||
|
||||
---------------------------------------------------------------- players list
|
||||
title("Players on server", UDim2.fromOffset(24, 86), UDim2.fromOffset(220, 32))
|
||||
local refresh -- forward
|
||||
local refreshBtn = pill(panel, { Position = UDim2.fromOffset(236, 80), Size = UDim2.fromOffset(124, 44), TextMax = 22 }, function() refresh() end)
|
||||
refreshBtn.set("alt", "Refresh")
|
||||
local listBox = box(UDim2.fromOffset(20, 132), UDim2.fromOffset(340, 550))
|
||||
local list = K.scroll(listBox, UDim2.fromOffset(0, 0), UDim2.fromScale(1, 1), new("UIListLayout", { Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder }))
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 8), PaddingRight = UDim.new(0, 16), PaddingTop = UDim.new(0, 8), PaddingBottom = UDim.new(0, 8), Parent = list })
|
||||
|
||||
---------------------------------------------------------------- selected player
|
||||
local card = box(UDim2.fromOffset(380, 80), UDim2.fromOffset(500, 120))
|
||||
local selName = maxText(label({ Position = UDim2.fromOffset(18, 10), Size = UDim2.fromOffset(464, 44), Text = "", TextScaled = true, Parent = card }, 2.5), 34)
|
||||
local selInfo = maxText(label({ Position = UDim2.fromOffset(18, 58), Size = UDim2.fromOffset(464, 52), Text = "", TextScaled = true, TextWrapped = true,
|
||||
FontFace = BODY, TextColor3 = SOFT, TextYAlignment = Enum.TextYAlignment.Top, Parent = card }, 1.5), 22)
|
||||
|
||||
title("Shards", UDim2.fromOffset(384, 214))
|
||||
local amountWrap = new("Frame", { Position = UDim2.fromOffset(380, 252), Size = UDim2.fromOffset(180, 56), BackgroundColor3 = NAVY, Parent = panel }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = Color3.fromRGB(190, 225, 255), Thickness = 2 }),
|
||||
})
|
||||
K.art("crystal", { Position = UDim2.new(0, -8, 0.5, -28), Size = UDim2.fromOffset(56, 56), ZIndex = 2, Parent = amountWrap })
|
||||
local amountBox = new("TextBox", { Position = UDim2.fromOffset(46, 6), Size = UDim2.new(1, -60, 1, -12), BackgroundTransparency = 1, Text = "100", PlaceholderText = "amount",
|
||||
ClearTextOnFocus = false, FontFace = K.FONT, TextScaled = true, TextColor3 = WHITE, ZIndex = 2, Parent = amountWrap })
|
||||
maxText(amountBox, 32)
|
||||
amountBox:GetPropertyChangedSignal("Text"):Connect(function()
|
||||
local d = amountBox.Text:gsub("%D", ""):sub(1, 8)
|
||||
if d ~= amountBox.Text then amountBox.Text = d end
|
||||
end)
|
||||
|
||||
local selectedId = player.UserId
|
||||
local players = {}
|
||||
local busy = false
|
||||
local status = maxText(label({ Position = UDim2.fromOffset(24, 782), Size = UDim2.fromOffset(852, 40), Text = "", TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, Parent = panel }, 1.5), 24)
|
||||
local function setStatus(text, color)
|
||||
status.Text = text
|
||||
status.TextColor3 = color or SOFT
|
||||
end
|
||||
|
||||
local render
|
||||
local function act(action, silent, a, b, c)
|
||||
if busy then return nil end
|
||||
busy = true
|
||||
if not silent then setStatus("…", SOFT) end
|
||||
local ok, res = pcall(fn.InvokeServer, fn, action, a, b, c)
|
||||
busy = false
|
||||
if not ok or type(res) ~= "table" then
|
||||
if not silent then setStatus("No response from server", WARN) end
|
||||
return nil
|
||||
end
|
||||
if not silent then setStatus(res.msg or (res.ok and "Done" or "Failed"), res.ok and OK or WARN) end
|
||||
if res.players then
|
||||
players = res.players
|
||||
render()
|
||||
end
|
||||
return res
|
||||
end
|
||||
refresh = function() act("List", false) end
|
||||
|
||||
local function amount()
|
||||
local n = tonumber(amountBox.Text)
|
||||
if not n or n <= 0 then setStatus("Enter a shard amount", WARN) return nil end
|
||||
return n
|
||||
end
|
||||
local giveBtn = pill(panel, { Position = UDim2.fromOffset(570, 252), Size = UDim2.fromOffset(150, 56), TextMax = 26 }, function()
|
||||
local n = amount()
|
||||
if n then act("Give", false, selectedId, n) end
|
||||
end)
|
||||
giveBtn.set("ready", "Give")
|
||||
local takeBtn = pill(panel, { Position = UDim2.fromOffset(730, 252), Size = UDim2.fromOffset(150, 56), TextMax = 26 }, function()
|
||||
local n = amount()
|
||||
if n then act("Give", false, selectedId, -n) end
|
||||
end)
|
||||
takeBtn.set("alt", "Take")
|
||||
for i, n in { 100, 1000, 10000 } do
|
||||
local q = pill(panel, { Position = UDim2.fromOffset(380 + (i - 1) * 170, 318), Size = UDim2.fromOffset(160, 50), TextMax = 24 }, function()
|
||||
act("Give", false, selectedId, n)
|
||||
end)
|
||||
q.set("alt", "+" .. fmt(n))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- level + boosters
|
||||
local Config = require(folder:WaitForChild("Config"))
|
||||
title("Level", UDim2.fromOffset(384, 386), UDim2.fromOffset(200, 32))
|
||||
local levelWrap = new("Frame", { Position = UDim2.fromOffset(380, 424), Size = UDim2.fromOffset(110, 52), BackgroundColor3 = NAVY, Parent = panel }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = Color3.fromRGB(190, 225, 255), Thickness = 2 }),
|
||||
})
|
||||
local levelBox = new("TextBox", { Position = UDim2.fromOffset(12, 6), Size = UDim2.new(1, -24, 1, -12), BackgroundTransparency = 1, Text = "", PlaceholderText = "1-" .. Config.MAX_LEVEL,
|
||||
ClearTextOnFocus = false, FontFace = K.FONT, TextScaled = true, TextColor3 = WHITE, Parent = levelWrap })
|
||||
maxText(levelBox, 30)
|
||||
levelBox:GetPropertyChangedSignal("Text"):Connect(function()
|
||||
local d = levelBox.Text:gsub("%D", ""):sub(1, 3)
|
||||
if d ~= levelBox.Text then levelBox.Text = d end
|
||||
end)
|
||||
local levelBtn = pill(panel, { Position = UDim2.fromOffset(498, 424), Size = UDim2.fromOffset(112, 52), TextMax = 24 }, function()
|
||||
local n = tonumber(levelBox.Text)
|
||||
if not n or n < 1 then setStatus("Enter a level from 1 to " .. Config.MAX_LEVEL, WARN) return end
|
||||
act("SetLevel", false, selectedId, n)
|
||||
end)
|
||||
levelBtn.set("ready", "Set")
|
||||
|
||||
title("Boosters", UDim2.fromOffset(634, 386), UDim2.fromOffset(200, 32))
|
||||
local boosterIds = {}
|
||||
for id in Config.BOOSTERS do table.insert(boosterIds, id) end
|
||||
table.sort(boosterIds, function(x, y) return (Config.BOOSTERS[x].Order or 0) < (Config.BOOSTERS[y].Order or 0) end)
|
||||
local boosterLabels = {}
|
||||
for i, id in boosterIds do
|
||||
local b = Config.BOOSTERS[id]
|
||||
local y = 424 + (i - 1) * 58
|
||||
local row = box(UDim2.fromOffset(630, y), UDim2.fromOffset(250, 52))
|
||||
boosterLabels[id] = maxText(label({ Position = UDim2.fromOffset(12, 8), Size = UDim2.fromOffset(120, 36), Text = b.Name, TextScaled = true,
|
||||
TextColor3 = b.Color or WHITE, Parent = row }, 1.5), 22)
|
||||
local minus = pill(row, { Position = UDim2.fromOffset(136, 4), Size = UDim2.fromOffset(52, 44), TextMax = 30 }, function()
|
||||
act("Booster", false, selectedId, id, -1)
|
||||
end)
|
||||
minus.set("alt", "-")
|
||||
local plus = pill(row, { Position = UDim2.fromOffset(194, 4), Size = UDim2.fromOffset(52, 44), TextMax = 30 }, function()
|
||||
act("Booster", false, selectedId, id, 1)
|
||||
end)
|
||||
plus.set("ready", "+")
|
||||
end
|
||||
local Y0 = 424 + #boosterIds * 58 + 8 -- the next section starts under the boosters
|
||||
|
||||
-- a dangerous button: the first click arms it ("Точно? Ещё раз"), the second (within 4 s) runs it
|
||||
local function confirmButton(pos, size, caption, kind, run)
|
||||
local btn
|
||||
local armedAt = 0
|
||||
btn = pill(panel, { Position = pos, Size = size, TextMax = 24 }, function()
|
||||
if os.clock() - armedAt < 4 then
|
||||
armedAt = 0
|
||||
btn.set(kind, caption)
|
||||
run()
|
||||
else
|
||||
local my = os.clock()
|
||||
armedAt = my
|
||||
btn.set("confirm", "Sure? Click again")
|
||||
task.delay(4, function()
|
||||
if armedAt == my then armedAt = 0; btn.set(kind, caption) end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
btn.set(kind, caption)
|
||||
return btn
|
||||
end
|
||||
|
||||
title("Reset", UDim2.fromOffset(384, Y0))
|
||||
local function afterOwnReset(res)
|
||||
-- own tutorial / stats reset: close the panel so the tutorial is not hidden behind it
|
||||
if res and res.ok and selectedId == player.UserId then setOpen(false) end
|
||||
end
|
||||
confirmButton(UDim2.fromOffset(380, Y0 + 40), UDim2.fromOffset(245, 62), "Reset tutorial", "alt", function()
|
||||
afterOwnReset(act("ResetTutorial", false, selectedId))
|
||||
end)
|
||||
confirmButton(UDim2.fromOffset(635, Y0 + 40), UDim2.fromOffset(245, 62), "Reset stats", "danger", function()
|
||||
afterOwnReset(act("ResetStats", false, selectedId))
|
||||
end)
|
||||
maxText(label({ Position = UDim2.fromOffset(384, Y0 + 110), Size = UDim2.fromOffset(496, 44), Text = "Stats: level, shards, ornaments, upgrades, boosters, plot decorations, market listings. Robux purchases are kept.",
|
||||
TextScaled = true, TextWrapped = true, FontFace = BODY, TextColor3 = SOFT, TextYAlignment = Enum.TextYAlignment.Top, Parent = panel }, 1), 17)
|
||||
|
||||
---------------------------------------------------------------- everyone
|
||||
new("Frame", { Position = UDim2.fromOffset(20, 708), Size = UDim2.fromOffset(W - 40, 2), BackgroundColor3 = GOLD, BackgroundTransparency = 0.5, BorderSizePixel = 0, Parent = panel })
|
||||
title("For all players", UDim2.fromOffset(24, 728), UDim2.fromOffset(260, 34))
|
||||
confirmButton(UDim2.fromOffset(300, 718), UDim2.fromOffset(360, 56), "Reset tutorial for EVERYONE", "danger", function()
|
||||
act("ResetTutorialAll", false)
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- render
|
||||
local shownId = nil -- the player whose level is in the level box
|
||||
local function entryOf(id)
|
||||
for _, e in players do if e.id == id then return e end end
|
||||
return nil
|
||||
end
|
||||
render = function()
|
||||
if not entryOf(selectedId) then selectedId = player.UserId end
|
||||
for _, c in list:GetChildren() do if c:IsA("GuiObject") then c:Destroy() end end
|
||||
table.sort(players, function(x, y)
|
||||
if (x.id == player.UserId) ~= (y.id == player.UserId) then return x.id == player.UserId end
|
||||
return x.display:lower() < y.display:lower()
|
||||
end)
|
||||
for i, e in players do
|
||||
local sel = e.id == selectedId
|
||||
local row = new("TextButton", { Text = "", AutoButtonColor = true, Size = UDim2.new(1, 0, 0, 68), LayoutOrder = i, BackgroundColor3 = sel and Color3.fromRGB(70, 56, 20) or Color3.fromRGB(14, 40, 50),
|
||||
Parent = list }, { corner(UDim.new(0, 14)), new("UIStroke", { Color = sel and GOLD or Color3.fromRGB(90, 130, 140), Thickness = sel and 3 or 1.5, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }) })
|
||||
maxText(label({ Position = UDim2.fromOffset(12, 6), Size = UDim2.new(1, -24, 0, 30), Text = e.display .. (e.id == player.UserId and " (you)" or "") .. (e.admin and " 🛠" or ""),
|
||||
TextScaled = true, Parent = row }, 1.5), 24)
|
||||
maxText(label({ Position = UDim2.fromOffset(12, 38), Size = UDim2.new(1, -24, 0, 22),
|
||||
Text = e.loaded and ("Lvl " .. e.level .. " · " .. fmt(e.shards) .. " shards · tutorial: " .. (e.tutorial and "done" or "no")) or "loading data…",
|
||||
TextScaled = true, FontFace = BODY, TextColor3 = SOFT, Parent = row }, 1), 18)
|
||||
row.Activated:Connect(function()
|
||||
selectedId = e.id
|
||||
render()
|
||||
end)
|
||||
end
|
||||
local e = entryOf(selectedId)
|
||||
if e and e.id ~= shownId then
|
||||
shownId = e.id
|
||||
if not levelBox:IsFocused() then levelBox.Text = e.loaded and tostring(e.level) or "" end
|
||||
end
|
||||
for id, lbl in boosterLabels do
|
||||
lbl.Text = Config.BOOSTERS[id].Name .. ": " .. ((e and e.boosters and e.boosters[id]) or 0)
|
||||
end
|
||||
if e then
|
||||
selName.Text = e.display .. " @" .. e.name .. (e.id == player.UserId and " (you)" or "")
|
||||
selInfo.Text = e.loaded and ("Level " .. e.level .. " · shards " .. fmt(e.shards) .. " · ornaments " .. e.toys .. "\nTutorial: " .. (e.tutorial and "done" or "not done"))
|
||||
or "Player data is still loading"
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- open / close
|
||||
setOpen = function(v)
|
||||
overlay.Visible = v
|
||||
toggle.Text = v and "Close" or "🛠 Admin"
|
||||
if v then
|
||||
setStatus("", SOFT)
|
||||
act("List", true)
|
||||
end
|
||||
end
|
||||
toggle.Activated:Connect(function() setOpen(not overlay.Visible) end)
|
||||
UIS.InputBegan:Connect(function(input, gp)
|
||||
if not gp and input.KeyCode == Enum.KeyCode.F2 then setOpen(not overlay.Visible) end
|
||||
end)
|
||||
-- keep the list fresh while the panel is open
|
||||
task.spawn(function()
|
||||
while true do
|
||||
task.wait(5)
|
||||
if overlay.Visible and not busy then act("List", true) end
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,47 @@
|
||||
-- BackgroundMusic (LocalScript, StarterPlayerScripts): quiet background music.
|
||||
-- Track: SoundService.Music["Happy Adventure"] (~71 s). It plays flat (not 3D), quietly, fades in and out, and after
|
||||
-- every play there is a pause of PAUSE seconds of silence, so a short track does not loop non-stop and annoy.
|
||||
-- Starts after the intro shot (IntroDone) so the camera fly-over stays calm.
|
||||
local SoundService = game:GetService("SoundService")
|
||||
local TweenService = game:GetService("TweenService")
|
||||
local Players = game:GetService("Players")
|
||||
|
||||
local VOLUME = 0.12 -- the music volume (0..1). Raise / lower here
|
||||
local FADE = 4 -- seconds of fade in / fade out
|
||||
local PAUSE = NumberRange.new(25, 50) -- seconds of silence between plays
|
||||
|
||||
local folder = SoundService:WaitForChild("Music", 10)
|
||||
local template = folder and folder:FindFirstChild("Happy Adventure")
|
||||
if not template then return end
|
||||
|
||||
local music = template:Clone()
|
||||
music.Name = "BackgroundMusic"
|
||||
music.Looped = false
|
||||
music.Volume = 0
|
||||
music.Parent = SoundService -- outside any part = flat sound, heard the same everywhere
|
||||
|
||||
-- wait for the intro shot (max 30 s)
|
||||
local player = Players.LocalPlayer
|
||||
local t0 = os.clock()
|
||||
while player:GetAttribute("IntroDone") ~= true and os.clock() - t0 < 30 do task.wait(0.25) end
|
||||
task.wait(1.5)
|
||||
|
||||
local function fade(to)
|
||||
local tw = TweenService:Create(music, TweenInfo.new(FADE, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut), { Volume = to })
|
||||
tw:Play()
|
||||
return tw
|
||||
end
|
||||
|
||||
if not music.IsLoaded then music.Loaded:Wait() end
|
||||
while music.Parent do
|
||||
music.TimePosition = 0
|
||||
music.Volume = 0
|
||||
music:Play()
|
||||
fade(VOLUME)
|
||||
-- fade out shortly before the end of the track
|
||||
local length = music.TimeLength
|
||||
task.wait(math.max(0, length - FADE - 0.2))
|
||||
fade(0).Completed:Wait()
|
||||
music:Stop()
|
||||
task.wait(math.random(PAUSE.Min, PAUSE.Max))
|
||||
end
|
||||
@@ -0,0 +1,192 @@
|
||||
-- Footsteps (LocalScript, StarterPlayerScripts): character sounds + snow footsteps.
|
||||
--
|
||||
-- 1. Own character: its 3D sounds (RbxCharacterSounds: Running, Jumping, Landing, FreeFalling, ...) were almost
|
||||
-- not heard while the camera follows the player. So every one of them is mirrored into a flat (not 3D) copy in
|
||||
-- SoundService.OwnCharacterSounds that follows the original exactly (play / stop / restart / speed / volume);
|
||||
-- the 3D originals are silenced through a SoundGroup with volume 0. Timing and sound stay the default ones.
|
||||
-- 2. Snow: on Snow / Glacier the normal footsteps are silenced and "snow step 1" (SoundService.Footsteps) plays,
|
||||
-- one sound per step. Own character: flat sounds; other players: 3D sounds in their root part.
|
||||
-- The ground is found with a short raycast down from the root part, skipping invisible parts (the zones have an
|
||||
-- invisible Plastic "Plot" part lying on the snow that the character physically stands on).
|
||||
local Players = game:GetService("Players")
|
||||
local RunService = game:GetService("RunService")
|
||||
local SoundService = game:GetService("SoundService")
|
||||
|
||||
local folder = SoundService:WaitForChild("Footsteps", 10)
|
||||
local snowTemplate = folder and folder:FindFirstChild("snow step 1")
|
||||
|
||||
local SNOW = { [Enum.Material.Snow] = true, [Enum.Material.Glacier] = true }
|
||||
local STRIDE = 5.3 -- studs per step: at the default 16 walk speed one step every ~0.33 s (walk animation)
|
||||
local MIN_SPEED = 1.5 -- slower than this = standing
|
||||
local POOL = 3 -- snow step copies played in turn, so a long step sound is not cut by the next one
|
||||
local OWN_GAIN = 0.85 -- flat copies are a bit quieter than the 3D original next to the ear
|
||||
-- snow step loudness = the Volume of SoundService.Footsteps["snow step 1"] (change it there, in Properties);
|
||||
-- other players' steps are 3D and fade with distance, so they get a little more
|
||||
local OTHER_SNOW_GAIN = 1.15
|
||||
|
||||
local localPlayer = Players.LocalPlayer
|
||||
local rays = RaycastParams.new()
|
||||
rays.FilterType = Enum.RaycastFilterType.Exclude
|
||||
rays.IgnoreWater = true
|
||||
|
||||
-- the 3D originals of the own character go into this silent group
|
||||
local muted = SoundService:FindFirstChild("MutedCharacterSounds") or Instance.new("SoundGroup")
|
||||
muted.Name = "MutedCharacterSounds"
|
||||
muted.Volume = 0
|
||||
muted.Parent = SoundService
|
||||
|
||||
local chars = {} -- [character] = state
|
||||
|
||||
---------------------------------------------------------------- own character: flat mirrors
|
||||
local function mirror(st, src, home)
|
||||
if not src:IsA("Sound") or st.mirrors[src] then return end
|
||||
local copy = Instance.new("Sound")
|
||||
copy.Name = src.Name
|
||||
copy.SoundId = src.SoundId
|
||||
copy.Parent = home
|
||||
local entry = { copy = copy }
|
||||
st.mirrors[src] = entry
|
||||
local function gain()
|
||||
if src.Name == "Running" and st.onSnow then return 0 end -- snow steps play instead
|
||||
return OWN_GAIN
|
||||
end
|
||||
entry.sync = function()
|
||||
copy.Volume = src.Volume * gain()
|
||||
copy.PlaybackSpeed = src.PlaybackSpeed
|
||||
copy.Looped = src.Looped
|
||||
end
|
||||
entry.sync()
|
||||
src.SoundGroup = muted
|
||||
local cons = st.cons
|
||||
table.insert(cons, src:GetPropertyChangedSignal("Volume"):Connect(entry.sync))
|
||||
table.insert(cons, src:GetPropertyChangedSignal("PlaybackSpeed"):Connect(entry.sync))
|
||||
table.insert(cons, src:GetPropertyChangedSignal("Looped"):Connect(entry.sync))
|
||||
table.insert(cons, src:GetPropertyChangedSignal("SoundId"):Connect(function() copy.SoundId = src.SoundId end))
|
||||
table.insert(cons, src:GetPropertyChangedSignal("SoundGroup"):Connect(function()
|
||||
if src.SoundGroup ~= muted then src.SoundGroup = muted end
|
||||
end))
|
||||
table.insert(cons, src:GetPropertyChangedSignal("Playing"):Connect(function()
|
||||
if src.Playing then
|
||||
copy.TimePosition = src.TimePosition
|
||||
copy.Playing = true
|
||||
else
|
||||
copy.Playing = false
|
||||
end
|
||||
end))
|
||||
table.insert(cons, src.Played:Connect(function() -- :Play() on a playing sound = restart
|
||||
copy.TimePosition = 0
|
||||
if not copy.Playing then copy.Playing = true end
|
||||
end))
|
||||
if src.Playing then copy.TimePosition = src.TimePosition; copy.Playing = true end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- setup per character
|
||||
local function setup(character)
|
||||
local hrp = character:WaitForChild("HumanoidRootPart", 10)
|
||||
local hum = character:WaitForChild("Humanoid", 10)
|
||||
if not hrp or not hum or chars[character] then return end
|
||||
local own = Players:GetPlayerFromCharacter(character) == localPlayer
|
||||
local st = { hrp = hrp, hum = hum, own = own, mirrors = {}, cons = {}, snow = {}, next = 1, dist = STRIDE * 0.6, onSnow = false }
|
||||
chars[character] = st
|
||||
|
||||
local home = hrp
|
||||
if own then
|
||||
home = SoundService:FindFirstChild("OwnCharacterSounds") or Instance.new("Folder")
|
||||
home.Name = "OwnCharacterSounds"
|
||||
home:ClearAllChildren() -- sounds of the previous life
|
||||
home.Parent = SoundService
|
||||
st.home = home
|
||||
hrp:WaitForChild("Running", 5) -- RbxCharacterSounds creates them
|
||||
for _, s in hrp:GetChildren() do mirror(st, s, home) end
|
||||
table.insert(st.cons, hrp.ChildAdded:Connect(function(s) mirror(st, s, home) end))
|
||||
else
|
||||
st.running = hrp:WaitForChild("Running", 5)
|
||||
st.runVolume = st.running and st.running.Volume or 0.65
|
||||
end
|
||||
|
||||
if snowTemplate then
|
||||
for i = 1, POOL do
|
||||
local s = snowTemplate:Clone()
|
||||
s.Name = "StepSnow" .. i
|
||||
s.Looped = false
|
||||
s.Volume = snowTemplate.Volume * (own and 1 or OTHER_SNOW_GAIN)
|
||||
s.RollOffMode = Enum.RollOffMode.Inverse -- (3D for other players) like the default sounds
|
||||
s.RollOffMinDistance, s.RollOffMaxDistance = 5, 150
|
||||
s.Parent = home
|
||||
st.snow[i] = s
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function drop(character)
|
||||
local st = chars[character]
|
||||
chars[character] = nil
|
||||
if not st then return end
|
||||
for _, c in st.cons do c:Disconnect() end
|
||||
if st.own and st.home then
|
||||
for _, e in st.mirrors do e.copy:Destroy() end
|
||||
for _, s in st.snow do s:Destroy() end
|
||||
end
|
||||
end
|
||||
|
||||
local function watch(player)
|
||||
if player.Character then task.spawn(setup, player.Character) end
|
||||
player.CharacterAdded:Connect(function(c) task.spawn(setup, c) end)
|
||||
player.CharacterRemoving:Connect(drop)
|
||||
end
|
||||
for _, p in Players:GetPlayers() do watch(p) end
|
||||
Players.PlayerAdded:Connect(watch)
|
||||
|
||||
---------------------------------------------------------------- snow
|
||||
local function ground(st, character)
|
||||
if st.own and st.hum.FloorMaterial == Enum.Material.Air then return nil end
|
||||
local ignore = { character }
|
||||
local origin = st.hrp.Position
|
||||
local depth = st.hum.HipHeight + st.hrp.Size.Y / 2 + 2.5
|
||||
for _ = 1, 4 do
|
||||
rays.FilterDescendantsInstances = ignore
|
||||
local hit = workspace:Raycast(origin, Vector3.new(0, -depth, 0), rays)
|
||||
if not hit then return nil end
|
||||
local inst = hit.Instance
|
||||
if inst:IsA("Terrain") or inst.Transparency < 0.95 then return hit.Material end
|
||||
table.insert(ignore, inst)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
local function setSnow(st, onSnow)
|
||||
if st.onSnow == onSnow then return end
|
||||
st.onSnow = onSnow
|
||||
if st.own then
|
||||
for src, e in st.mirrors do if src.Name == "Running" then e.sync() end end
|
||||
elseif st.running and st.running.Parent then
|
||||
st.running.Volume = onSnow and 0 or st.runVolume
|
||||
end
|
||||
end
|
||||
|
||||
RunService.Heartbeat:Connect(function(dt)
|
||||
for character, st in chars do
|
||||
if not character.Parent or not st.hrp.Parent then
|
||||
drop(character)
|
||||
continue
|
||||
end
|
||||
local v = st.hrp.AssemblyLinearVelocity
|
||||
local speed = Vector3.new(v.X, 0, v.Z).Magnitude
|
||||
local mat = ground(st, character)
|
||||
if mat ~= nil then setSnow(st, SNOW[mat] == true) end -- in the air: keep the last ground
|
||||
|
||||
if st.onSnow and mat ~= nil and speed > MIN_SPEED and st.hum.Health > 0 and #st.snow > 0 then
|
||||
st.dist += speed * dt
|
||||
if st.dist >= STRIDE then
|
||||
st.dist = 0
|
||||
local s = st.snow[st.next]
|
||||
st.next = st.next % #st.snow + 1
|
||||
s.PlaybackSpeed = 0.92 + math.random() * 0.16 -- small variation, so the steps do not sound copy-pasted
|
||||
s.TimePosition = 0
|
||||
s:Play()
|
||||
end
|
||||
else
|
||||
st.dist = STRIDE * 0.6 -- the first step comes quickly
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,184 @@
|
||||
-- GarlandPlacer: "Обвить ёлку" mode. The player clicks points on their own tree one after another, the garland
|
||||
-- (ToyModels.BuildGarland) is previewed through them live; "Готово" (Enter) sends the points to the server
|
||||
-- (Shop remote: "Place", id, { {x, y, z}, ... } in tree space). "Назад" (Backspace) removes the last point,
|
||||
-- "Отмена" (Esc) leaves without changes. Limits: Config.GARLAND (points, wire length).
|
||||
-- Usage (from OrnamentCraftUI): require(GarlandPlacer).start(id, ctx)
|
||||
-- ctx = { player, Config, ToyModels, remote, myPlot(), toast(text, color), closeWindow(), gui,
|
||||
-- new, corner, stroke, text, button, colors = { NAVY, GOLD, WHITE, MUTED, WARN, OK, GREEN, RED, GREY } }
|
||||
local UIS = game:GetService("UserInputService")
|
||||
local RunService = game:GetService("RunService")
|
||||
|
||||
local M = {}
|
||||
local ui -- built once: { bar, label, ok, undo, cancel }
|
||||
local state -- active session or nil
|
||||
|
||||
local function stop(restore)
|
||||
if not state then return end
|
||||
local s = state
|
||||
state = nil
|
||||
for _, c in s.conns do c:Disconnect() end
|
||||
if s.preview then s.preview:Destroy() end
|
||||
s.dot:Destroy()
|
||||
s.line:Destroy()
|
||||
if restore and s.hidden and s.hiddenParent and s.hiddenParent.Parent then s.hidden.Parent = s.hiddenParent end
|
||||
ui.bar.Visible = false
|
||||
end
|
||||
|
||||
local function buildUI(ctx)
|
||||
local c = ctx.colors
|
||||
local bar = ctx.new("Frame", { Name = "GarlandBar", AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 0, 1, -24), Size = UDim2.fromOffset(700, 64),
|
||||
BackgroundColor3 = c.NAVY, BackgroundTransparency = 0.05, Visible = false, ZIndex = 30, Parent = ctx.gui }, { ctx.corner(14), ctx.stroke(c.GOLD, 2) })
|
||||
local label = ctx.text({ Position = UDim2.fromOffset(16, 0), Size = UDim2.new(1, -380, 1, 0), Text = "", TextSize = 14, TextWrapped = true, ZIndex = 31, Parent = bar })
|
||||
local ok = ctx.button({ Name = "GarlandDone", AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -244, 0.5, 0), Size = UDim2.fromOffset(116, 44), Text = "Done", TextSize = 15, ZIndex = 31, Parent = bar }, c.GREEN)
|
||||
local undo = ctx.button({ Name = "GarlandUndo", AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -128, 0.5, 0), Size = UDim2.fromOffset(108, 44), Text = "Back", TextSize = 15, ZIndex = 31, Parent = bar }, c.GREY)
|
||||
local cancel = ctx.button({ Name = "GarlandCancel", AnchorPoint = Vector2.new(1, 0.5), Position = UDim2.new(1, -12, 0.5, 0), Size = UDim2.fromOffset(108, 44), Text = "Cancel", TextSize = 15, ZIndex = 31, Parent = bar }, c.RED)
|
||||
ui = { bar = bar, label = label, ok = ok, undo = undo, cancel = cancel }
|
||||
ok.Activated:Connect(function() if state then state.finish() end end)
|
||||
undo.Activated:Connect(function() if state then state.undo() end end)
|
||||
cancel.Activated:Connect(function() stop(true) end)
|
||||
end
|
||||
|
||||
function M.active() return state ~= nil end
|
||||
function M.stop() stop(true) end
|
||||
|
||||
function M.start(id, ctx)
|
||||
local Config, ToyModels, c = ctx.Config, ctx.ToyModels, ctx.colors
|
||||
local G = Config.GARLAND
|
||||
local plot = ctx.myPlot()
|
||||
local tree = plot and plot:FindFirstChild("Decor") and plot.Decor:FindFirstChild("Tree")
|
||||
if not tree or not tree:FindFirstChild("Needles") then
|
||||
ctx.toast("Place a tree on your plot first (Inventory → Items)", c.WARN)
|
||||
return
|
||||
end
|
||||
if not ui then buildUI(ctx) end
|
||||
stop(true)
|
||||
ctx.closeWindow()
|
||||
local hum = ctx.player.Character and ctx.player.Character:FindFirstChildOfClass("Humanoid")
|
||||
if hum then hum:UnequipTools() end
|
||||
|
||||
local s = { points = {}, conns = {} }
|
||||
state = s
|
||||
-- the garland already on the tree is hidden while a new one is being strung
|
||||
local real = plot.Decor:FindFirstChild(id)
|
||||
if real then s.hidden, s.hiddenParent = real, real.Parent; real.Parent = nil end
|
||||
local function part(props)
|
||||
local p = Instance.new("Part")
|
||||
p.Anchored, p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = true, false, false, false, false
|
||||
for k, v in props do p[k] = v end
|
||||
return p
|
||||
end
|
||||
s.dot = part({ Name = "GarlandAimDot", Shape = Enum.PartType.Ball, Size = Vector3.one * 0.7, Material = Enum.Material.Neon, Color = Color3.fromRGB(255, 220, 120), Transparency = 0.25 })
|
||||
s.line = part({ Name = "GarlandAimLine", Material = Enum.Material.Neon, Color = Color3.fromRGB(255, 220, 120), Transparency = 0.45 })
|
||||
local params = RaycastParams.new()
|
||||
params.FilterType = Enum.RaycastFilterType.Include
|
||||
params.FilterDescendantsInstances = { tree.Needles, tree:FindFirstChild("Trunk") }
|
||||
|
||||
local aim -- tree-space point under the cursor (or nil)
|
||||
local function treeCF() return tree:GetPivot() end
|
||||
local function length() return ToyModels.GarlandLength(s.points) end
|
||||
local function aimAt(pos, isScreen) -- viewport coords (mouse) or screen coords (touch, without the top inset)
|
||||
local cam = workspace.CurrentCamera
|
||||
local ray = isScreen and cam:ScreenPointToRay(pos.X, pos.Y) or cam:ViewportPointToRay(pos.X, pos.Y)
|
||||
local hit = workspace:Raycast(ray.Origin, ray.Direction * 300, params)
|
||||
if not hit then return nil end
|
||||
-- a bit in front of the needles, so the wire lies on top of them
|
||||
return treeCF():PointToObjectSpace(hit.Position + hit.Normal * 0.25)
|
||||
end
|
||||
local function refreshLabel()
|
||||
local n, len = #s.points, length()
|
||||
local text
|
||||
if n == 0 then
|
||||
text = "Click the tree: the first point starts the garland"
|
||||
elseif n == 1 then
|
||||
text = "Keep clicking — the garland follows your cursor"
|
||||
else
|
||||
text = string.format("Points %d · length %d / %d. Done — Enter, undo — Backspace", n, math.floor(len + 0.5), G.MAX_LENGTH)
|
||||
end
|
||||
ui.label.Text = text
|
||||
ui.label.TextColor3 = c.WHITE
|
||||
ui.ok.BackgroundTransparency = n >= 2 and 0 or 0.5
|
||||
ui.undo.BackgroundTransparency = n >= 1 and 0 or 0.5
|
||||
end
|
||||
local function rebuild()
|
||||
if s.preview then s.preview:Destroy() s.preview = nil end
|
||||
if #s.points >= 2 then
|
||||
s.preview = ToyModels.BuildGarland(s.points)
|
||||
s.preview.Name = "GarlandPreview"
|
||||
s.preview:PivotTo(treeCF())
|
||||
s.preview.Parent = workspace
|
||||
end
|
||||
refreshLabel()
|
||||
end
|
||||
local function add(p)
|
||||
if #s.points >= G.MAX_POINTS then ctx.toast("No more points — press “Done”", c.WARN) return end
|
||||
local last = s.points[#s.points]
|
||||
if last and (p - last).Magnitude < 0.4 then return end
|
||||
if last and length() + (p - last).Magnitude > G.MAX_LENGTH then ctx.toast("Out of wire — press “Done” or remove a point", c.WARN) return end
|
||||
table.insert(s.points, p)
|
||||
rebuild()
|
||||
end
|
||||
s.undo = function()
|
||||
if #s.points == 0 then return end
|
||||
table.remove(s.points)
|
||||
rebuild()
|
||||
end
|
||||
s.finish = function()
|
||||
if #s.points < 2 then ctx.toast("Place at least 2 points on the tree", c.WARN) return end
|
||||
local pts = {}
|
||||
for k, p in s.points do pts[k] = { p.X, p.Y, p.Z } end
|
||||
ui.ok.Text = "…"
|
||||
task.spawn(function()
|
||||
local okCall, res = pcall(ctx.remote.InvokeServer, ctx.remote, "Place", id, pts)
|
||||
res = (okCall and type(res) == "table") and res or { ok = false, msg = "No connection" }
|
||||
ui.ok.Text = "Done"
|
||||
ctx.toast(res.msg or (res.ok and "Done" or "Failed"), res.ok and c.OK or c.WARN)
|
||||
if res.ok and state == s then
|
||||
if s.hidden then s.hidden:Destroy() s.hidden = nil end -- the server already replaced it
|
||||
stop(false)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
table.insert(s.conns, RunService.RenderStepped:Connect(function()
|
||||
if not tree.Parent then stop(true) return end
|
||||
if UIS.TouchEnabled and not UIS.MouseEnabled then return end
|
||||
aim = aimAt(UIS:GetMouseLocation())
|
||||
if aim then
|
||||
local cf = treeCF()
|
||||
local w = cf * aim
|
||||
s.dot.Position = w
|
||||
s.dot.Parent = workspace
|
||||
local last = s.points[#s.points]
|
||||
if last then
|
||||
local a = cf * last
|
||||
local d = (w - a).Magnitude
|
||||
s.line.Size = Vector3.new(0.1, 0.1, d)
|
||||
s.line.CFrame = CFrame.lookAt((a + w) / 2, w)
|
||||
s.line.Parent = workspace
|
||||
else
|
||||
s.line.Parent = nil
|
||||
end
|
||||
else
|
||||
s.dot.Parent = nil
|
||||
s.line.Parent = nil
|
||||
end
|
||||
end))
|
||||
table.insert(s.conns, UIS.InputBegan:Connect(function(input, processed)
|
||||
if input.KeyCode == Enum.KeyCode.Escape then stop(true) return end
|
||||
if processed then return end
|
||||
if input.KeyCode == Enum.KeyCode.Return or input.KeyCode == Enum.KeyCode.KeypadEnter then
|
||||
s.finish()
|
||||
elseif input.KeyCode == Enum.KeyCode.Backspace or input.KeyCode == Enum.KeyCode.Z then
|
||||
s.undo()
|
||||
elseif input.UserInputType == Enum.UserInputType.MouseButton1 then
|
||||
if aim then add(aim) else ctx.toast("Click on your tree", c.WARN) end
|
||||
elseif input.UserInputType == Enum.UserInputType.Touch then
|
||||
local p = aimAt(Vector2.new(input.Position.X, input.Position.Y), true)
|
||||
if p then add(p) end
|
||||
end
|
||||
end))
|
||||
ui.bar.Visible = true
|
||||
refreshLabel()
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,83 @@
|
||||
-- GarlandTwinkle (LocalScript, StarterPlayerScripts): makes every garland in the world blink like a real one.
|
||||
-- A garland = any parts named "Bulb" with an "Index" attribute (order along the wire): the big tree in the centre
|
||||
-- of the map (workspace.CenterTree.Garland) and the players' tree garlands (ToyModels.BuildGarland).
|
||||
-- Runs only on the client (no network traffic). The time comes from the server clock, so every player sees the
|
||||
-- same pattern at the same moment. Programs change every MODE_TIME seconds, like a garland controller:
|
||||
-- alternate - two groups of bulbs take turns (odd / even)
|
||||
-- chase - running lights (3 groups), direction flips each time
|
||||
-- breathe - the two groups slowly fade in and out in turn
|
||||
-- twinkle - random bulbs blink off for a moment
|
||||
-- wave - a soft wave of light runs along the wire
|
||||
-- Bulbs fade like incandescent lamps (not instant on/off). Far garlands (> FAR studs from the camera) are skipped.
|
||||
-- Only the bulbs themselves blink: their PointLights (the glow on the needles) stay steady, otherwise the whole
|
||||
-- tree would get lighter / darker with every pattern step (all lit bulbs are every 3rd = one chase group).
|
||||
local RunService = game:GetService("RunService")
|
||||
|
||||
local MODES = { "alternate", "chase", "breathe", "twinkle", "wave" }
|
||||
local MODE_TIME = 9
|
||||
local FAR = 320
|
||||
local DIM = 0.1 -- brightness of an "off" bulb (0..1)
|
||||
local DARK = Color3.fromRGB(22, 22, 28)
|
||||
|
||||
local bulbs = {} -- [part] = { orig, index, cur }
|
||||
local function add(p)
|
||||
if bulbs[p] or not p:IsA("BasePart") or p.Name ~= "Bulb" then return end
|
||||
local index = p:GetAttribute("Index")
|
||||
if not index then return end
|
||||
bulbs[p] = { orig = p.Color, index = index, cur = 1 }
|
||||
end
|
||||
for _, d in workspace:GetDescendants() do add(d) end
|
||||
workspace.DescendantAdded:Connect(function(d)
|
||||
if d.Name == "Bulb" then task.defer(add, d) end -- attributes are set right after creation
|
||||
end)
|
||||
workspace.DescendantRemoving:Connect(function(d) bulbs[d] = nil end)
|
||||
|
||||
local function hash(a, b) return (math.sin(a * 12.9898 + b * 78.233) * 43758.5453) % 1 end
|
||||
|
||||
-- target brightness 0..1 of bulb number i at time t for the given mode
|
||||
local function target(mode, i, t, cycle)
|
||||
if mode == "alternate" then
|
||||
local phase = math.floor(t / 0.6) % 2
|
||||
return (i % 2 == phase) and 1 or DIM
|
||||
elseif mode == "chase" then
|
||||
local step = math.floor(t / 0.2)
|
||||
if cycle % 2 == 1 then step = -step end
|
||||
return (i % 3 == step % 3) and 1 or DIM
|
||||
elseif mode == "breathe" then
|
||||
local s = 0.5 + 0.5 * math.sin(t * 1.8 + (i % 2) * math.pi)
|
||||
return DIM + (1 - DIM) * s * s
|
||||
elseif mode == "twinkle" then
|
||||
local slot = math.floor(t / 0.35)
|
||||
return hash(i, slot) < 0.22 and DIM or 1
|
||||
else -- wave
|
||||
local s = 0.5 + 0.5 * math.sin(t * 5 - i * 0.45)
|
||||
return DIM + (1 - DIM) * s ^ 3
|
||||
end
|
||||
end
|
||||
|
||||
local acc = 0
|
||||
RunService.Heartbeat:Connect(function(dt)
|
||||
acc += dt
|
||||
if acc < 1 / 30 then return end
|
||||
local step = acc
|
||||
acc = 0
|
||||
local cam = workspace.CurrentCamera
|
||||
local camPos = cam and cam.CFrame.Position or Vector3.zero
|
||||
local t = workspace:GetServerTimeNow()
|
||||
local cycle = math.floor(t / MODE_TIME)
|
||||
local mode = MODES[cycle % #MODES + 1]
|
||||
local intoMode = t - cycle * MODE_TIME
|
||||
local k = math.min(1, step * 16) -- incandescent-like fade speed
|
||||
for p, b in bulbs do
|
||||
if (p.Position - camPos).Magnitude <= FAR then
|
||||
local want = target(mode, b.index, t, cycle)
|
||||
if intoMode < 0.5 then want = math.max(want, 1 - intoMode * 2) end -- short all-on flash between programs
|
||||
local cur = b.cur + (want - b.cur) * k
|
||||
if math.abs(cur - b.cur) > 0.004 then
|
||||
b.cur = cur
|
||||
p.Color = DARK:Lerp(b.orig, 0.25 + 0.75 * cur)
|
||||
p.Material = cur > 0.3 and Enum.Material.Neon or Enum.Material.SmoothPlastic
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
@@ -0,0 +1,104 @@
|
||||
local TweenService = game:GetService("TweenService")
|
||||
local UX = {}
|
||||
local gold=Color3.fromRGB(255,211,116)
|
||||
local function tween(o, duration, props)
|
||||
local t=TweenService:Create(o,TweenInfo.new(duration,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),props);t:Play();return t
|
||||
end
|
||||
local function make(class,props,parent)
|
||||
local o=Instance.new(class);for k,v in props do o[k]=v end;o.Parent=parent;return o
|
||||
end
|
||||
function UX.install(c)
|
||||
local self={pendingUntil=0}
|
||||
local panel=c.panel
|
||||
-- Cover baked button art once; all live controls are rendered above this quiet footer.
|
||||
local cover=make("Frame",{Name="CraftActionSurface",Position=UDim2.fromOffset(44,785),Size=UDim2.fromOffset(499,182),BackgroundColor3=Color3.fromRGB(5,55,36),BorderSizePixel=0,ZIndex=3},panel)
|
||||
make("UICorner",{CornerRadius=UDim.new(0,18)},cover)
|
||||
local function action(b,primary)
|
||||
for _,n in b:GetChildren() do if n.Name=="Pill" then n.Visible=false end end
|
||||
b.BackgroundTransparency=0;b.TextTransparency=1;b.AutoButtonColor=false;b.ZIndex=5
|
||||
-- Existing skin listeners force transparency; a dedicated visual child avoids fighting them.
|
||||
local face=make("Frame",{Name="LiveFace",Size=UDim2.fromScale(1,1),BackgroundColor3=Color3.new(1,1,1),BorderSizePixel=0,ZIndex=5},b)
|
||||
make("UICorner",{CornerRadius=UDim.new(0,primary and 20 or 16)},face)
|
||||
local stroke=make("UIStroke",{Color=gold,Thickness=2,Transparency=.12},face)
|
||||
local grad=make("UIGradient",{Rotation=90},face)
|
||||
local caption=b:FindFirstChild("Caption");if caption then caption.ZIndex=7 end
|
||||
local p,z=b.Position,b.Size
|
||||
b.AnchorPoint=Vector2.new(.5,.5);b.Position=UDim2.new(p.X.Scale+z.X.Scale/2,p.X.Offset+z.X.Offset/2,p.Y.Scale+z.Y.Scale/2,p.Y.Offset+z.Y.Offset/2)
|
||||
local scale=make("UIScale",{Scale=1},b)
|
||||
local hover=false
|
||||
local function paint()
|
||||
local enabled=b.Active
|
||||
local top=not enabled and Color3.fromRGB(61,76,79) or primary and Color3.fromRGB(232,62,67) or Color3.fromRGB(31,151,100)
|
||||
grad.Color=ColorSequence.new(top,top:Lerp(Color3.new(0,0,0),.42))
|
||||
if caption then caption.TextColor3=enabled and Color3.fromRGB(255,247,222) or Color3.fromRGB(193,205,203) end
|
||||
tween(stroke,.12,{Transparency=enabled and (hover and 0 or .12) or .6})
|
||||
if not enabled then tween(scale,.12,{Scale=1}) end
|
||||
end
|
||||
b.MouseEnter:Connect(function() hover=true;if b.Active then tween(scale,.12,{Scale=1.025}) end;paint() end)
|
||||
b.MouseLeave:Connect(function() hover=false;tween(scale,.12,{Scale=1});paint() end)
|
||||
b.SelectionGained:Connect(function() hover=true;paint() end)
|
||||
b.SelectionLost:Connect(function() hover=false;paint() end)
|
||||
b.InputBegan:Connect(function(input) if b.Active and (input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch) then tween(scale,.07,{Scale=.965}) end end)
|
||||
b.InputEnded:Connect(function(input) if input.UserInputType==Enum.UserInputType.MouseButton1 or input.UserInputType==Enum.UserInputType.Touch then tween(scale,.14,{Scale=hover and b.Active and 1.025 or 1}) end end)
|
||||
b:GetPropertyChangedSignal("Active"):Connect(paint);paint()
|
||||
end
|
||||
action(c.fill,false);action(c.clear,false);action(c.generate,true)
|
||||
for i,slot in c.slots do
|
||||
slot.button.Name="ShardSlot"..i
|
||||
local hint=make("TextLabel",{Name="AddHint",Size=UDim2.fromScale(1,1),BackgroundTransparency=1,Text="+",TextColor3=Color3.fromRGB(166,236,230),TextTransparency=1,Font=Enum.Font.GothamBold,TextSize=35,ZIndex=5},slot.button)
|
||||
local original=slot.icon.Size
|
||||
slot.button.MouseEnter:Connect(function() if not slot.icon.Visible then tween(hint,.12,{TextTransparency=.2}) end end)
|
||||
slot.button.MouseLeave:Connect(function() tween(hint,.12,{TextTransparency=1}) end)
|
||||
slot.icon:GetPropertyChangedSignal("Visible"):Connect(function()
|
||||
if slot.icon.Visible then
|
||||
hint.TextTransparency=1;slot.icon.Size=UDim2.fromOffset(48,49);slot.icon.Rotation=-12
|
||||
TweenService:Create(slot.icon,TweenInfo.new(.23,Enum.EasingStyle.Back,Enum.EasingDirection.Out),{Size=original,Rotation=0}):Play()
|
||||
end
|
||||
end)
|
||||
end
|
||||
for _,row in c.boosters do
|
||||
local highlight=make("Frame",{Name="HoverTint",Size=UDim2.fromScale(1,1),BackgroundColor3=gold,BackgroundTransparency=1,BorderSizePixel=0,ZIndex=3},row.row)
|
||||
make("UICorner",{CornerRadius=UDim.new(0,20)},highlight)
|
||||
row.row.MouseEnter:Connect(function() tween(highlight,.12,{BackgroundTransparency=.9}) end)
|
||||
row.row.MouseLeave:Connect(function() tween(highlight,.15,{BackgroundTransparency=1}) end)
|
||||
end
|
||||
c.boosterText.TextScaled=true
|
||||
make("UITextSizeConstraint",{MinTextSize=20,MaxTextSize=44},c.boosterText)
|
||||
local orb=make("Frame",{Name="BoosterGlow",AnchorPoint=Vector2.new(.5,.5),Position=UDim2.fromScale(.5,.5),Size=UDim2.fromScale(.68,.68),BackgroundColor3=Color3.fromRGB(39,178,106),BackgroundTransparency=.65,BorderSizePixel=0,ZIndex=3,Visible=false},c.boosterSlot)
|
||||
make("UICorner",{CornerRadius=UDim.new(1,0)},orb)
|
||||
function self.update()
|
||||
local s=c.player:GetAttribute("CraftSlots") or string.rep("0",16)
|
||||
local _,placed=s:gsub("1","")
|
||||
local shards=c.player:GetAttribute("Shards") or 0
|
||||
c.counter.Text=string.format("Shards in: %d / 16",placed)
|
||||
c.counter.TextColor3=placed>=c.minimum and Color3.fromRGB(174,255,195) or Color3.fromRGB(220,235,228)
|
||||
local busy=os.clock()<self.pendingUntil or (c.machine() and c.machine():GetAttribute("GeneratorBusy"))
|
||||
local ready=placed>=c.minimum and placed<=shards and not busy
|
||||
c.generate.Active=ready;c.generate.AutoButtonColor=false
|
||||
if busy then c.generate.Text="Generator working…"
|
||||
elseif placed>shards then c.generate.Text="Not enough shards"
|
||||
elseif placed<c.minimum then c.generate.Text="Add "..(c.minimum-placed).." shards"
|
||||
else c.generate.Text="Create · "..placed.." shards" end
|
||||
c.clear.Active=placed>0 and not busy
|
||||
c.fill.Active=shards>=c.minimum and not busy
|
||||
local id=c.player:GetAttribute("CraftBooster")
|
||||
local b=id and c.boosterConfig[id]
|
||||
orb.Visible=b~=nil
|
||||
if b then orb.BackgroundColor3=b.Color;c.boosterText.Text="×"..b.Luck;c.boosterInfo.Text=b.Name.." selected\nClick the slot to remove it."
|
||||
else c.boosterText.Text="+";c.boosterInfo.Text="Pick a booster below.\nIt boosts one generation." end
|
||||
end
|
||||
c.generate.Activated:Connect(function()
|
||||
if not c.generate.Active or not c.machine() then return end
|
||||
self.pendingUntil=os.clock()+1.5;self.update();c.submit(c.machine())
|
||||
end)
|
||||
c.overlay:GetPropertyChangedSignal("Visible"):Connect(function()
|
||||
if c.overlay.Visible then
|
||||
local art=panel:FindFirstChild("Art");if art then art.ImageTransparency=.15;tween(art,.18,{ImageTransparency=0}) end
|
||||
self.update()
|
||||
end
|
||||
end)
|
||||
task.spawn(function() while panel.Parent do if c.overlay.Visible then self.update() end;task.wait(.15) end end)
|
||||
self.update()
|
||||
return self
|
||||
end
|
||||
return UX
|
||||
@@ -0,0 +1,362 @@
|
||||
-- GeneratorWindow: "Генератор" — shards in a 4x4 pattern + optional booster -> a random toy (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Создать / Шансы / Как это работает.
|
||||
-- Создать : 4x4 grid (click a cell = put / take a shard, hover shows "+"), booster slot + booster rows,
|
||||
-- luck, buttons Автоузор / Очистить (alt; off when useless) and Создать (ready "Создать · N";
|
||||
-- off "Добавь ещё N" / "Мало осколков"; busy while the machine works). Right: what can drop (toy chances,
|
||||
-- the toy that matches the pattern is highlighted, locked toys are dimmed).
|
||||
-- Шансы : rarity chances with bars for the current luck + pity progress.
|
||||
-- RemoteEvent CraftAction: Slot i / Fill / Clear / Booster id|nil. ctx.submit(machine) starts the generation.
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local G = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, WARN, BODY, NAVY = K.WHITE, K.GOLD, K.SOFT, K.OK, K.WARN, K.BODY, K.NAVY
|
||||
local new, corner, art, label, maxText, pill, tween = K.new, K.corner, K.art, K.label, K.maxText, K.pill, K.tween
|
||||
local MUTED = Color3.fromRGB(170, 190, 185)
|
||||
local ICE = Color3.fromRGB(190, 225, 255)
|
||||
|
||||
function G.install(ctx)
|
||||
local Config, player, remote = ctx.Config, ctx.player, ctx.remote
|
||||
local fmt, pct = ctx.fmtNum, ctx.fmtPct
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local refresh
|
||||
local pendingUntil = 0
|
||||
local TABS = {
|
||||
{ id = "Create", text = "Create", icon = "🎄", tip = "If your shard pattern looks like an ornament, you're more likely to get that one." },
|
||||
{ id = "Chances", text = "Odds", icon = "🎲", tip = "More shards and a booster mean more luck and better odds for rare ornaments." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "Pity: a rare ornament is guaranteed within the shown number of tries." },
|
||||
}
|
||||
local ch = K.chrome({ win = win, title = "GENERATOR", subtitle = "Make ornaments\nfrom shards", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = fmt, onTab = function() if win.overlay.Visible then refresh() end end })
|
||||
|
||||
local function darkPanel(parent, pos, size, z)
|
||||
return new("Frame", { Position = pos, Size = size, BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.5, ZIndex = z or 4, Parent = parent }, {
|
||||
corner(UDim.new(0, 22)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.4 }),
|
||||
})
|
||||
end
|
||||
local function getSlots()
|
||||
local s = player:GetAttribute("CraftSlots")
|
||||
if typeof(s) ~= "string" or #s ~= Config.SLOT_COUNT then s = string.rep("0", Config.SLOT_COUNT) end
|
||||
return s
|
||||
end
|
||||
local function busy()
|
||||
local m = ctx.machine()
|
||||
return os.clock() < pendingUntil or (m ~= nil and m:GetAttribute("GeneratorBusy") == true)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- create page
|
||||
local cg = ch.makePage("Create")
|
||||
-- left: the shard grid
|
||||
local gridPanel = darkPanel(cg, UDim2.fromOffset(0, 0), UDim2.fromOffset(520, 566))
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 10), Size = UDim2.fromOffset(260, 36), Text = "Shard pattern", TextScaled = true, ZIndex = 5, Parent = gridPanel }, 2), 30)
|
||||
local counter = maxText(label({ Position = UDim2.fromOffset(290, 14), Size = UDim2.fromOffset(210, 30), Text = "", TextScaled = true, FontFace = BODY,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 5, Parent = gridPanel }, 1.5), 24)
|
||||
local CELL, GAP = 108, 10
|
||||
local slots = {}
|
||||
for i = 1, Config.SLOT_COUNT do
|
||||
local cx, cy = 29 + ((i - 1) % 4) * (CELL + GAP), 56 + ((i - 1) // 4) * (CELL + GAP)
|
||||
local b = new("TextButton", { Name = "ShardSlot" .. i, Text = "", AutoButtonColor = false, AnchorPoint = Vector2.new(0.5, 0.5),
|
||||
Position = UDim2.fromOffset(cx + CELL / 2, cy + CELL / 2), Size = UDim2.fromOffset(CELL, CELL), BackgroundColor3 = Color3.fromRGB(12, 40, 52), ZIndex = 5, Parent = gridPanel }, {
|
||||
corner(UDim.new(0, 20)),
|
||||
})
|
||||
local st = new("UIStroke", { Color = Color3.fromRGB(120, 190, 200), Thickness = 2, Transparency = 0.5, ApplyStrokeMode = Enum.ApplyStrokeMode.Border, Parent = b })
|
||||
local sc = new("UIScale", { Parent = b })
|
||||
local icon = art("crystal", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.fromOffset(84, 86), Visible = false, ZIndex = 6, Parent = b })
|
||||
local plus = label({ Size = UDim2.fromScale(1, 1), Text = "+", TextSize = 44, TextColor3 = Color3.fromRGB(166, 236, 230), TextTransparency = 1, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = b }, 0)
|
||||
local s = { button = b, stroke = st, icon = icon, scale = sc, on = false, hover = false }
|
||||
b.MouseEnter:Connect(function() s.hover = true; tween(sc, 0.12, { Scale = 1.06 }, Enum.EasingStyle.Back); if not s.on then tween(plus, 0.12, { TextTransparency = 0.2 }) end end)
|
||||
b.MouseLeave:Connect(function() s.hover = false; tween(sc, 0.12, { Scale = 1 }); tween(plus, 0.12, { TextTransparency = 1 }) end)
|
||||
b.InputBegan:Connect(function(input) if K.isPress(input) then tween(sc, 0.06, { Scale = 0.92 }) end end)
|
||||
b.InputEnded:Connect(function(input) if K.isPress(input) then tween(sc, 0.12, { Scale = s.hover and 1.06 or 1 }, Enum.EasingStyle.Back) end end)
|
||||
b.Activated:Connect(function()
|
||||
if busy() then return end
|
||||
if not s.on and attr("Shards", 0) <= 0 then ctx.toast("No shards — they build up over time", WARN) return end
|
||||
remote:FireServer("Slot", i)
|
||||
end)
|
||||
s.plus = plus
|
||||
slots[i] = s
|
||||
end
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 528), Size = UDim2.fromOffset(480, 28), Text = "Click a cell to add or remove a shard", TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = gridPanel }, 1.5), 20)
|
||||
|
||||
-- middle: booster + luck + buttons
|
||||
local boPanel = darkPanel(cg, UDim2.fromOffset(540, 0), UDim2.fromOffset(350, 300))
|
||||
maxText(label({ Position = UDim2.fromOffset(16, 8), Size = UDim2.fromOffset(200, 34), Text = "Booster", TextScaled = true, ZIndex = 5, Parent = boPanel }, 2), 30)
|
||||
local boSlot = new("TextButton", { Name = "BoosterSlot", Text = "", AutoButtonColor = false, Position = UDim2.fromOffset(18, 48), Size = UDim2.fromOffset(120, 120),
|
||||
BackgroundColor3 = Color3.fromRGB(12, 40, 52), ZIndex = 5, Parent = boPanel }, { corner(UDim.new(0.5, 0)) })
|
||||
local boSlotStroke = new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.4, ApplyStrokeMode = Enum.ApplyStrokeMode.Border, Parent = boSlot })
|
||||
local boSlotScale = new("UIScale", { Parent = boSlot })
|
||||
local boSlotText = maxText(label({ Position = UDim2.fromScale(0.15, 0.2), Size = UDim2.fromScale(0.7, 0.6), Text = "+", TextScaled = true, TextColor3 = MUTED,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = boSlot }, 2.5), 56)
|
||||
local boInfo = maxText(label({ Position = UDim2.fromOffset(150, 52), Size = UDim2.fromOffset(188, 112), Text = "", TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextYAlignment = Enum.TextYAlignment.Center, ZIndex = 5, Parent = boPanel }, 1.5), 21)
|
||||
boSlot.MouseEnter:Connect(function() tween(boSlotScale, 0.12, { Scale = 1.05 }, Enum.EasingStyle.Back) end)
|
||||
boSlot.MouseLeave:Connect(function() tween(boSlotScale, 0.12, { Scale = 1 }) end)
|
||||
boSlot.Activated:Connect(function() if player:GetAttribute("CraftBooster") then remote:FireServer("Booster", nil) end end)
|
||||
local boRows = {}
|
||||
local order = {}
|
||||
for id, b in Config.BOOSTERS do table.insert(order, { id = id, b = b }) end
|
||||
table.sort(order, function(x, y) return (x.b.Order or 0) < (y.b.Order or 0) end)
|
||||
for k, e in order do
|
||||
local row = new("TextButton", { Name = "Booster" .. e.id, Text = "", AutoButtonColor = false, AnchorPoint = Vector2.new(0.5, 0.5),
|
||||
Position = UDim2.fromOffset(175, 205 + (k - 1) * 58), Size = UDim2.fromOffset(318, 50), BackgroundColor3 = Color3.fromRGB(12, 40, 52), ZIndex = 5, Parent = boPanel }, {
|
||||
corner(UDim.new(0.5, 0)),
|
||||
})
|
||||
local st = new("UIStroke", { Color = e.b.Color, Thickness = 2, Transparency = 0.3, ApplyStrokeMode = Enum.ApplyStrokeMode.Border, Parent = row })
|
||||
local sc = new("UIScale", { Parent = row })
|
||||
local orb = new("Frame", { AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 6, 0.5, 0), Size = UDim2.fromOffset(40, 40), BackgroundColor3 = e.b.Color, ZIndex = 6, Parent = row }, { corner(UDim.new(0.5, 0)) })
|
||||
maxText(label({ Position = UDim2.fromScale(0.1, 0.18), Size = UDim2.fromScale(0.8, 0.64), Text = "x" .. e.b.Luck, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 7, Parent = orb }, 1.5), 20)
|
||||
maxText(label({ Position = UDim2.fromOffset(56, 8), Size = UDim2.fromOffset(180, 34), Text = e.b.Name, TextScaled = true, ZIndex = 6, Parent = row }, 2), 24)
|
||||
local cnt = maxText(label({ Position = UDim2.fromOffset(236, 8), Size = UDim2.fromOffset(70, 34), Text = "", TextScaled = true, TextColor3 = GOLD,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 6, Parent = row }, 2), 26)
|
||||
local r = { row = row, stroke = st, count = cnt, scale = sc, hover = false, b = e.b }
|
||||
row.MouseEnter:Connect(function() r.hover = true; tween(sc, 0.12, { Scale = 1.04 }, Enum.EasingStyle.Back) end)
|
||||
row.MouseLeave:Connect(function() r.hover = false; tween(sc, 0.12, { Scale = 1 }) end)
|
||||
row.InputBegan:Connect(function(input) if K.isPress(input) then tween(sc, 0.06, { Scale = 0.95 }) end end)
|
||||
row.InputEnded:Connect(function(input) if K.isPress(input) then tween(sc, 0.12, { Scale = r.hover and 1.04 or 1 }, Enum.EasingStyle.Back) end end)
|
||||
row.Activated:Connect(function()
|
||||
if player:GetAttribute("CraftBooster") == e.id then remote:FireServer("Booster", nil) return end
|
||||
if attr("Booster_" .. e.id, 0) <= 0 then
|
||||
ctx.toast("No “" .. e.b.Name .. "” boosters — craft them in the Workshop", WARN)
|
||||
tween(row, 0.05, { Rotation = -3 }).Completed:Wait()
|
||||
tween(row, 0.07, { Rotation = 3 }).Completed:Wait()
|
||||
tween(row, 0.06, { Rotation = 0 })
|
||||
return
|
||||
end
|
||||
remote:FireServer("Booster", e.id)
|
||||
end)
|
||||
boRows[e.id] = r
|
||||
end
|
||||
local luckText = maxText(label({ Position = UDim2.fromOffset(540, 308), Size = UDim2.fromOffset(350, 44), Text = "", TextScaled = true, TextColor3 = GOLD,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = cg }, 2.5), 36)
|
||||
local luckSub = maxText(label({ Position = UDim2.fromOffset(540, 352), Size = UDim2.fromOffset(350, 28), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = SOFT,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = cg }, 1.5), 20)
|
||||
local fillBtn = pill(cg, { Name = "Autofill", Position = UDim2.fromOffset(540, 392), Size = UDim2.fromOffset(170, 66), ZIndex = 5, TextMax = 26 }, function() remote:FireServer("Fill") end)
|
||||
local clearBtn = pill(cg, { Name = "Clear", Position = UDim2.fromOffset(720, 392), Size = UDim2.fromOffset(170, 66), ZIndex = 5, TextMax = 26 }, function() remote:FireServer("Clear") end)
|
||||
local genBtn
|
||||
genBtn = pill(cg, { Name = "GenerateButton", Position = UDim2.fromOffset(540, 468), Size = UDim2.fromOffset(350, 96), ZIndex = 5, TextMax = 34 }, function()
|
||||
local m = ctx.machine()
|
||||
if not m then ctx.toast("Go to your generator", WARN) return end
|
||||
pendingUntil = os.clock() + 1.5
|
||||
genBtn.set("busy")
|
||||
ctx.submit(m)
|
||||
end)
|
||||
|
||||
-- right: what can drop
|
||||
local poolPanel = darkPanel(cg, UDim2.fromOffset(910, 0), UDim2.fromOffset(350, 566))
|
||||
maxText(label({ Position = UDim2.fromOffset(16, 8), Size = UDim2.fromOffset(320, 34), Text = "Possible drops", TextScaled = true, ZIndex = 5, Parent = poolPanel }, 2), 30)
|
||||
local pool = {}
|
||||
for i, toy in Config.TOYS do
|
||||
local row = new("Frame", { Position = UDim2.fromOffset(10, 48 + (i - 1) * 85), Size = UDim2.fromOffset(330, 78), BackgroundColor3 = Color3.fromRGB(12, 40, 52), ZIndex = 5, Parent = poolPanel }, {
|
||||
corner(UDim.new(0, 18)),
|
||||
})
|
||||
local st = new("UIStroke", { Color = GOLD, Thickness = 0, Parent = row })
|
||||
local mini = ctx.miniPattern(toy.Mask, ICE, 54, row)
|
||||
mini.Position = UDim2.fromOffset(12, 12)
|
||||
mini.ZIndex = 6
|
||||
for _, x in mini:GetDescendants() do if x:IsA("GuiObject") then x.ZIndex = 6 end end
|
||||
maxText(label({ Position = UDim2.fromOffset(78, 6), Size = UDim2.fromOffset(150, 34), Text = toy.Name, TextScaled = true, ZIndex = 6, Parent = row }, 2), 26)
|
||||
local sub = maxText(label({ Position = UDim2.fromOffset(79, 42), Size = UDim2.fromOffset(170, 26), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = MUTED, ZIndex = 6, Parent = row }, 1.5), 18)
|
||||
local p = maxText(label({ Position = UDim2.fromOffset(226, 8), Size = UDim2.fromOffset(92, 36), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 6, Parent = row }, 2), 28)
|
||||
maxText(label({ Position = UDim2.fromOffset(246, 44), Size = UDim2.fromOffset(72, 24), Text = "x" .. toy.Mult, TextScaled = true, FontFace = BODY, TextColor3 = Color3.fromRGB(255, 205, 90),
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 6, Parent = row }, 1.5), 18)
|
||||
local dim = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.45, Visible = false, ZIndex = 8, Parent = row }, { corner(UDim.new(0, 18)) })
|
||||
local lockT = maxText(label({ Position = UDim2.fromOffset(160, 20), Size = UDim2.fromOffset(160, 38), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 9, Parent = dim }, 2), 24)
|
||||
pool[i] = { row = row, stroke = st, sub = sub, pct = p, toy = toy, dim = dim, lockT = lockT }
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- chances page
|
||||
local chg = ch.makePage("Chances")
|
||||
local raPanel = darkPanel(chg, UDim2.fromOffset(0, 0), UDim2.fromOffset(620, 566))
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 10), Size = UDim2.fromOffset(300, 38), Text = "Rarity odds", TextScaled = true, ZIndex = 5, Parent = raPanel }, 2), 32)
|
||||
local chLuck = maxText(label({ Position = UDim2.fromOffset(320, 14), Size = UDim2.fromOffset(280, 32), Text = "", TextScaled = true, TextColor3 = GOLD,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 5, Parent = raPanel }, 2), 26)
|
||||
local raRows = {}
|
||||
for i, r in Config.RARITIES do
|
||||
local y = 62 + (i - 1) * 78
|
||||
maxText(label({ Position = UDim2.fromOffset(20, y), Size = UDim2.fromOffset(240, 32), Text = r.Name, TextScaled = true, TextColor3 = r.Color, ZIndex = 5, Parent = raPanel }, 2), 26)
|
||||
local val = maxText(label({ Position = UDim2.fromOffset(400, y), Size = UDim2.fromOffset(200, 32), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 5, Parent = raPanel }, 2), 26)
|
||||
local bg = new("Frame", { Position = UDim2.fromOffset(20, y + 38), Size = UDim2.fromOffset(580, 18), BackgroundColor3 = Color3.fromRGB(10, 20, 26), ZIndex = 5, Parent = raPanel }, { corner(UDim.new(0.5, 0)) })
|
||||
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = r.Color, ZIndex = 6, Parent = bg }, { corner(UDim.new(0.5, 0)) })
|
||||
raRows[i] = { val = val, bar = bar }
|
||||
end
|
||||
local piPanel = darkPanel(chg, UDim2.fromOffset(640, 0), UDim2.fromOffset(620, 566))
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 10), Size = UDim2.fromOffset(580, 38), Text = "Pity — protection from bad luck", TextScaled = true, ZIndex = 5, Parent = piPanel }, 2), 32)
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 54), Size = UDim2.fromOffset(580, 56), Text = "Every generation without the rarity fills the pity bar. When it's full, a rare ornament is guaranteed.",
|
||||
TextScaled = true, TextWrapped = true, FontFace = BODY, TextColor3 = SOFT, ZIndex = 5, Parent = piPanel }, 1.5), 20)
|
||||
local piRows = {}
|
||||
for i, pc in Config.PITY do
|
||||
local r = Config.RarityById[pc.Rarity]
|
||||
local y = 130 + (i - 1) * 104
|
||||
maxText(label({ Position = UDim2.fromOffset(20, y), Size = UDim2.fromOffset(380, 34), Text = r.Name .. " or better", TextScaled = true, TextColor3 = r.Color, ZIndex = 5, Parent = piPanel }, 2), 28)
|
||||
local val = maxText(label({ Position = UDim2.fromOffset(330, y + 2), Size = UDim2.fromOffset(270, 30), Text = "", TextScaled = true, FontFace = BODY,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 5, Parent = piPanel }, 1.5), 22)
|
||||
local bg = new("Frame", { Position = UDim2.fromOffset(20, y + 42), Size = UDim2.fromOffset(580, 26), BackgroundColor3 = Color3.fromRGB(10, 20, 26), ZIndex = 5, Parent = piPanel }, { corner(UDim.new(0.5, 0)) })
|
||||
local bar = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = r.Color, ZIndex = 6, Parent = bg }, { corner(UDim.new(0.5, 0)) })
|
||||
local num = maxText(label({ Size = UDim2.fromScale(1, 1), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 7, Parent = bg }, 1.5), 18)
|
||||
piRows[i] = { pc = pc, val = val, bar = bar, num = num }
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- help page
|
||||
local _, heScroll = ch.makePage("Help", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardCyan", icon = "💎", title = "1. Pattern", btn = "To Grid", go = function() ch.showTab("Create") end,
|
||||
text = "Put " .. Config.MIN_SHARDS .. " to " .. Config.SLOT_COUNT .. " shards in the grid. More shards mean more luck. A pattern that looks like an ornament raises the odds for that one." },
|
||||
{ card = "cardViolet", icon = "🍀", title = "2. Booster", btn = "Workshop", go = function() K.go("Workshop", "Boosters") end,
|
||||
text = "A booster in the slot multiplies the luck of one generation. Boosters are crafted in the Workshop or bought in Premium." },
|
||||
{ card = "cardOrange", icon = "🎁", title = "3. Create", btn = "Odds", go = function() ch.showTab("Chances") end,
|
||||
text = "Press “Create” — the shards go into the machine, and an ornament appears a couple of seconds later. Pity makes sure you won't go long without rares." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, h.go)
|
||||
go.set("alt", h.btn)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- refresh
|
||||
local lastOn = {}
|
||||
refresh = function()
|
||||
local shards, level = attr("Shards", 0), attr("Level", 1)
|
||||
ch.setBalance(shards)
|
||||
local s = getSlots()
|
||||
local placed = 0
|
||||
for i, sl in slots do
|
||||
local on = s:sub(i, i) == "1"
|
||||
if on then placed += 1 end
|
||||
sl.on = on
|
||||
sl.icon.Visible = on
|
||||
sl.stroke.Color = on and Color3.fromRGB(150, 230, 255) or Color3.fromRGB(120, 190, 200)
|
||||
sl.stroke.Thickness = on and 4 or 2
|
||||
sl.stroke.Transparency = on and 0 or 0.5
|
||||
sl.button.BackgroundColor3 = on and Color3.fromRGB(24, 74, 96) or Color3.fromRGB(12, 40, 52)
|
||||
if on then sl.plus.TextTransparency = 1 end
|
||||
if on and not lastOn[i] then
|
||||
sl.icon.Size = UDim2.fromOffset(44, 46)
|
||||
sl.icon.Rotation = -14
|
||||
tween(sl.icon, 0.23, { Size = UDim2.fromOffset(84, 86), Rotation = 0 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
lastOn[i] = on
|
||||
end
|
||||
counter.Text = "Shards in: " .. placed .. " / " .. Config.SLOT_COUNT
|
||||
counter.TextColor3 = placed >= Config.MIN_SHARDS and OK or SOFT
|
||||
|
||||
local booster = player:GetAttribute("CraftBooster")
|
||||
local b = booster and Config.BOOSTERS[booster]
|
||||
if b then
|
||||
boSlot.BackgroundColor3 = b.Color
|
||||
boSlotStroke.Color, boSlotStroke.Thickness, boSlotStroke.Transparency = WHITE, 4, 0
|
||||
boSlotText.Text, boSlotText.TextColor3 = "x" .. b.Luck, WHITE
|
||||
boInfo.Text = b.Name .. " in the slot.\nClick the circle to remove it."
|
||||
else
|
||||
boSlot.BackgroundColor3 = Color3.fromRGB(12, 40, 52)
|
||||
boSlotStroke.Color, boSlotStroke.Thickness, boSlotStroke.Transparency = GOLD, 3, 0.4
|
||||
boSlotText.Text, boSlotText.TextColor3 = "+", MUTED
|
||||
boInfo.Text = "Pick a booster below — it boosts one generation."
|
||||
end
|
||||
for id, r in boRows do
|
||||
local n = attr("Booster_" .. id, 0)
|
||||
r.count.Text = "x" .. n
|
||||
r.count.TextColor3 = n > 0 and GOLD or MUTED
|
||||
local sel = id == booster
|
||||
r.stroke.Color = sel and GOLD or r.b.Color
|
||||
r.stroke.Thickness = sel and 4 or 2
|
||||
r.row.BackgroundColor3 = sel and Color3.fromRGB(70, 56, 20) or Color3.fromRGB(12, 40, 52)
|
||||
end
|
||||
|
||||
local luck = Config.Luck(placed, booster, attr("Upg_Luck", 0))
|
||||
local chances = Config.Chances(luck > 0 and luck or 1)
|
||||
if placed == 0 then
|
||||
luckText.Text, luckText.TextColor3 = "Put shards in the grid", SOFT
|
||||
luckSub.Text = "min " .. Config.MIN_SHARDS .. ", max " .. Config.SLOT_COUNT
|
||||
elseif luck == 0 then
|
||||
luckText.Text, luckText.TextColor3 = "Need " .. (Config.MIN_SHARDS - placed), WARN
|
||||
luckSub.Text = "min " .. Config.MIN_SHARDS .. " shards"
|
||||
else
|
||||
luckText.Text, luckText.TextColor3 = string.format("Luck x%.2f", luck), GOLD
|
||||
local rare = 0
|
||||
for i, r in Config.RARITIES do if r.Index >= 5 then rare += chances[i] end end
|
||||
luckSub.Text = "legendary or better: " .. pct(rare)
|
||||
end
|
||||
|
||||
-- buttons
|
||||
local isBusy = busy()
|
||||
if isBusy then genBtn.set("busy")
|
||||
elseif placed > shards then genBtn.set("off", "Not enough shards")
|
||||
elseif placed < Config.MIN_SHARDS then genBtn.set("off", "Add " .. (Config.MIN_SHARDS - placed))
|
||||
else genBtn.set("ready", "Create · " .. placed) end
|
||||
if isBusy or shards < Config.MIN_SHARDS then fillBtn.set("off", "Auto Pattern") else fillBtn.set("alt", "Auto Pattern") end
|
||||
if isBusy or placed == 0 then clearBtn.set("off", "Clear") else clearBtn.set("alt", "Clear") end
|
||||
|
||||
-- drop pool
|
||||
local toyChances, best, sim, bonus = Config.ToyChances(s, level)
|
||||
for i, pr in pool do
|
||||
local locked = pr.toy.Unlock > level
|
||||
local isBest = (not locked) and i == best and bonus > 0
|
||||
pr.dim.Visible = locked
|
||||
pr.lockT.Text = "🔒 lvl " .. pr.toy.Unlock
|
||||
pr.pct.Text = locked and "" or pct(toyChances[i])
|
||||
pr.pct.TextColor3 = isBest and OK or WHITE
|
||||
if isBest then
|
||||
pr.sub.Text = (sim >= 0.999 and "exact pattern" or string.format("pattern %d%%", math.floor(sim * 100 + 0.5))) .. string.format(" +%.1f%%", bonus)
|
||||
pr.sub.TextColor3 = OK
|
||||
else
|
||||
pr.sub.Text = pr.toy.Count .. " shards"
|
||||
pr.sub.TextColor3 = MUTED
|
||||
end
|
||||
pr.stroke.Thickness = isBest and 4 or 0
|
||||
pr.row.BackgroundColor3 = isBest and Color3.fromRGB(24, 74, 50) or Color3.fromRGB(12, 40, 52)
|
||||
end
|
||||
|
||||
-- chances page
|
||||
chLuck.Text = luck > 0 and string.format("luck x%.2f", luck) or "luck x1 (no shards)"
|
||||
local maxC = 0
|
||||
for i in Config.RARITIES do maxC = math.max(maxC, chances[i]) end
|
||||
for i, rr in raRows do
|
||||
rr.val.Text = pct(chances[i])
|
||||
tween(rr.bar, 0.25, { Size = UDim2.fromScale(math.clamp(chances[i] / math.max(maxC, 1e-9), 0.01, 1), 1) })
|
||||
end
|
||||
for _, pr in piRows do
|
||||
local done = attr("Pity_" .. pr.pc.Rarity, 0)
|
||||
local left = math.max(1, pr.pc.Rolls - done)
|
||||
pr.val.Text = "at most in " .. left
|
||||
pr.num.Text = math.min(done, pr.pc.Rolls) .. " / " .. pr.pc.Rolls
|
||||
tween(pr.bar, 0.25, { Size = UDim2.fromScale(math.clamp(done / pr.pc.Rolls, 0, 1), 1) })
|
||||
end
|
||||
end
|
||||
|
||||
local watched = { "Shards", "Level", "CraftSlots", "CraftBooster", "Upg_Luck" }
|
||||
for id in Config.BOOSTERS do table.insert(watched, "Booster_" .. id) end
|
||||
for _, pc in Config.PITY do table.insert(watched, "Pity_" .. pc.Rarity) end
|
||||
for _, n in watched do player:GetAttributeChangedSignal(n):Connect(function() if win.overlay.Visible then refresh() end end) end
|
||||
-- the machine's busy flag and the short "pending" window after a click
|
||||
local wasBusy = false
|
||||
task.spawn(function()
|
||||
while win.panel.Parent do
|
||||
task.wait(0.2)
|
||||
if win.overlay.Visible then
|
||||
local b = busy()
|
||||
if b ~= wasBusy then wasBusy = b; refresh() end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
ch.showTab("Create")
|
||||
return {
|
||||
open = function(tab)
|
||||
ch.setBalance(attr("Shards", 0), true)
|
||||
if tab then ch.showTab(tab) end
|
||||
refresh()
|
||||
end,
|
||||
refresh = refresh,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return G
|
||||
|
After Width: | Height: | Size: 2.0 MiB |
|
After Width: | Height: | Size: 2.0 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
@@ -0,0 +1,564 @@
|
||||
-- HudView: the player's always-on screen in the New Year shop style (ShopKit art + font).
|
||||
-- * status: two picture panels (panels-v2) — level (number on the star + XP bar) and shards (crystal + balance +
|
||||
-- free-regeneration bar with a timer); tap a panel for a short explanation
|
||||
-- * menu: round icon buttons (hover grows, press shrinks, gold ring while its window is open, red badge with
|
||||
-- "something to do" counts), added by OrnamentCraftUI through hud.addButton(...)
|
||||
-- * layout: wide screens = column at the top-left (scaled to the screen height);
|
||||
-- phones = one compact strip along the top under the Roblox top bar, so the thumbstick (bottom-left)
|
||||
-- and the jump button (bottom-right) stay free; the toast stack (gui.Toasts) moves under the strip.
|
||||
-- install(ctx) ctx = { gui, Config, player, fmtNum, toast(text, color) } ->
|
||||
-- { root, addButton(id, opts) -> GuiButton, setBadge(id, n), floatDelta(amount) }
|
||||
-- opts = { text, icon, color, order, window = "<overlay name>" }
|
||||
local TweenService = game:GetService("TweenService")
|
||||
local UIS = game:GetService("UserInputService")
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local H = {}
|
||||
|
||||
local FONT, BODY, INK, WHITE, GOLD, SOFT, OK, NAVY = K.FONT, K.BODY, K.INK, K.WHITE, K.GOLD, K.SOFT, K.OK, K.NAVY
|
||||
local new, corner, art, label, maxText, tween = K.new, K.corner, K.art, K.label, K.maxText, K.tween
|
||||
local ICE = Color3.fromRGB(150, 210, 255)
|
||||
local WARN = Color3.fromRGB(255, 120, 110)
|
||||
|
||||
local BTN_W, BTN_H, GAP = 92, 92, 12
|
||||
|
||||
-- status panels (GUI/HUD/panels-v2): art 2172x724; green field ~ x 4..96 %, y 24..83 %; the level art has a star on the left
|
||||
local PANEL_LEVEL = "rbxassetid://118257080024564" -- level-panel.png
|
||||
local PANEL_SHARDS = "rbxassetid://112163222652816" -- shards-panel.png
|
||||
local PANEL_W, PANEL_H = 300, 100
|
||||
local INNER_X, INNER_R = 76, 278 -- text / bar column inside the green field (right of the star / crystal)
|
||||
local STACK = 90 -- wide layout: second panel this far below the first (the snow overlaps a bit)
|
||||
local CARD_W, CARD_H = PANEL_W, STACK + PANEL_H -- wide: stacked
|
||||
local PHONE_CARD_W, PHONE_CARD_H = PANEL_W * 2 + 6, PANEL_H -- phone: side by side
|
||||
local SPRITE_SIZE = 92
|
||||
|
||||
-- menu button pictures (GUI/HUD/button-states-v2/<name>-states.png): one image = 3 square frames in a row,
|
||||
-- normal | hover | pressed. "" = not uploaded yet -> the round emoji button is used instead.
|
||||
local SPRITES = {
|
||||
Workshop = "rbxassetid://81759885631212", -- workshop-states.png
|
||||
Inventory = "rbxassetid://110766324164374", -- inventory-states.png
|
||||
Shop = "rbxassetid://113249527829304", -- shop-states.png
|
||||
Market = "rbxassetid://139389044874341", -- market-states.png
|
||||
Trade = "rbxassetid://105223746048116", -- trade-states.png
|
||||
Premium = "rbxassetid://96790295599044", -- premium-states.png
|
||||
}
|
||||
|
||||
local function grad(c1, c2, rot) return new("UIGradient", { Color = ColorSequence.new(c1, c2), Rotation = rot or 90 }) end
|
||||
|
||||
---------------------------------------------------------------- notifications (toasts)
|
||||
-- GUI/HUD/panels-v2/notification-panel.png (2172x724, green field ~ x 5..95 %, y 26..82 %). "" = not uploaded yet ->
|
||||
-- a plain navy plate is drawn instead. makeToast(gui) creates gui.Toasts (HudView's layout moves it under the HUD)
|
||||
-- and returns toast(message, color, big): newest on top, at most TOAST_MAX on screen, fade + slide out.
|
||||
local NOTIFY_PANEL = "rbxassetid://123152751080177" -- notification-panel.png
|
||||
local TOAST_MAX = 3
|
||||
|
||||
-- one soft, quiet sound per kind of notification (free Creator Store sounds). Every sound also goes through an
|
||||
-- equalizer that cuts the highs (that is what makes UI sounds feel sharp) — TOAST_EQ.
|
||||
-- info - plain hint / message soft bells (UI_Notification_3x_Soft_Bells)
|
||||
-- ok - success, purchase, coins one marimba note
|
||||
-- warn - refused action, not enough shards the same marimba note, lower: a soft "bonk", no buzz
|
||||
-- result - big toast: new toy, fusion result Magic Glows, soft chiming cluster (Pro Sound Effects)
|
||||
-- level - big green toast: level up Teeny Tiny, short light-hearted sting (APM Music)
|
||||
-- action - clickable toast: fusion set collected Fairy Dust (Pro Sound Effects, cut to 1.6 s)
|
||||
local TOAST_SOUNDS = {
|
||||
info = { id = "rbxassetid://95469323096995", volume = 0.22 },
|
||||
ok = { id = "rbxassetid://104421055647409", volume = 0.25, speed = 1.12 },
|
||||
warn = { id = "rbxassetid://104421055647409", volume = 0.22, speed = 0.75 },
|
||||
result = { id = "rbxassetid://9116395089", volume = 0.25 },
|
||||
level = { id = "rbxassetid://9040173538", volume = 0.25 },
|
||||
action = { id = "rbxassetid://9114369623", volume = 0.25, maxTime = 1.6 },
|
||||
}
|
||||
local TOAST_EQ = { HighGain = -12, MidGain = -2, LowGain = 0 }
|
||||
-- colours the game's modules pass to toast() -> kind (anything else = info)
|
||||
local function near(a, r, g, b) return math.abs(a.R * 255 - r) + math.abs(a.G * 255 - g) + math.abs(a.B * 255 - b) < 12 end
|
||||
local function toastKind(color, big, onClick)
|
||||
if onClick then return "action" end
|
||||
local green = color and (near(color, 140, 255, 160) or near(color, 150, 255, 160))
|
||||
if big then return green and "level" or "result" end
|
||||
if not color then return "info" end
|
||||
if near(color, 255, 120, 110) or near(color, 255, 196, 120) then return "warn" end
|
||||
if green or near(color, 255, 205, 70) then return "ok" end
|
||||
return "info"
|
||||
end
|
||||
function H.makeToast(gui)
|
||||
local holder = new("Frame", { Name = "Toasts", AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 74), Size = UDim2.fromOffset(480, 420),
|
||||
BackgroundTransparency = 1, ZIndex = 20, Parent = gui }, {
|
||||
new("UIListLayout", { HorizontalAlignment = Enum.HorizontalAlignment.Center, Padding = UDim.new(0, -34), SortOrder = Enum.SortOrder.LayoutOrder }),
|
||||
})
|
||||
local order, live = 0, {}
|
||||
-- sounds (one Sound per kind, played locally; the same kind is not restarted within 0.15 s)
|
||||
local sounds, lastPlay = {}, {}
|
||||
for kind, d in TOAST_SOUNDS do
|
||||
sounds[kind] = new("Sound", { Name = "Toast_" .. kind, SoundId = d.id, Volume = d.volume, PlaybackSpeed = d.speed or 1, Parent = holder }, {
|
||||
new("EqualizerSoundEffect", TOAST_EQ),
|
||||
})
|
||||
end
|
||||
local function playKind(kind)
|
||||
local s, d = sounds[kind], TOAST_SOUNDS[kind]
|
||||
if not s or os.clock() - (lastPlay[kind] or 0) < 0.15 then return end
|
||||
lastPlay[kind] = os.clock()
|
||||
s.Volume = d.volume
|
||||
s.TimePosition = 0
|
||||
s:Play()
|
||||
if d.maxTime then
|
||||
local stamp = lastPlay[kind]
|
||||
task.delay(d.maxTime - 0.4, function()
|
||||
if lastPlay[kind] == stamp then tween(s, 0.4, { Volume = 0 }) end
|
||||
end)
|
||||
task.delay(d.maxTime, function() if lastPlay[kind] == stamp then s:Stop() end end)
|
||||
end
|
||||
end
|
||||
-- load the panel art and the sounds right away, so the very first notification is complete
|
||||
task.spawn(function()
|
||||
local list = {}
|
||||
for _, s in sounds do table.insert(list, s) end
|
||||
if NOTIFY_PANEL ~= "" then
|
||||
table.insert(list, new("ImageLabel", { Name = "Probe", Image = NOTIFY_PANEL, Size = UDim2.fromOffset(1, 1), BackgroundTransparency = 1, ImageTransparency = 1, Parent = holder }))
|
||||
end
|
||||
pcall(function() game:GetService("ContentProvider"):PreloadAsync(list) end)
|
||||
local probe = holder:FindFirstChild("Probe")
|
||||
if probe then probe:Destroy() end
|
||||
end)
|
||||
local function dismiss(t)
|
||||
if t.gone then return end
|
||||
t.gone = true
|
||||
local i = table.find(live, t)
|
||||
if i then table.remove(live, i) end
|
||||
tween(t.sc, 0.3, { Scale = 0.85 })
|
||||
tween(t.frame, 0.3, { ImageTransparency = 1, BackgroundTransparency = 1 })
|
||||
tween(t.text, 0.3, { TextTransparency = 1 })
|
||||
tween(t.text.UIStroke, 0.3, { Transparency = 1 })
|
||||
tween(t.accent, 0.3, { BackgroundTransparency = 1 })
|
||||
task.delay(0.32, function() t.frame:Destroy() end)
|
||||
end
|
||||
-- onClick (optional): the panel becomes a button (hover grows it); a click runs onClick and closes the toast
|
||||
return function(message, color, big, onClick)
|
||||
order -= 1
|
||||
local w = big and 470 or 410
|
||||
local h = math.floor(w / 3 + 0.5)
|
||||
local useArt = NOTIFY_PANEL ~= ""
|
||||
local frame = new(onClick and "ImageButton" or "ImageLabel", { Size = UDim2.fromOffset(w, h), BackgroundTransparency = useArt and 1 or 0.05, BackgroundColor3 = NAVY,
|
||||
Image = useArt and NOTIFY_PANEL or "", ScaleType = Enum.ScaleType.Stretch, LayoutOrder = order, ZIndex = 20, Parent = holder })
|
||||
if not useArt then corner(UDim.new(0, 14)).Parent = frame end
|
||||
-- small coloured stripe at the left end of the green field = the kind of message (gold / ok / warning ...)
|
||||
local accent = new("Frame", { AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0.075, 0, 0.54, 0), Size = UDim2.new(0, 6, 0.36, 0),
|
||||
BackgroundColor3 = color or GOLD, ZIndex = 21, Parent = frame }, { corner(UDim.new(0.5, 0)) })
|
||||
local text = maxText(label({ Position = UDim2.new(0.105, 0, 0.28, 0), Size = UDim2.new(0.82, 0, 0.52, 0), Text = message, TextScaled = true, TextWrapped = true,
|
||||
FontFace = big and FONT or BODY, TextColor3 = big and (color or WHITE) or WHITE, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 21, Parent = frame }, big and 2.5 or 2), big and 26 or 19)
|
||||
local sc = new("UIScale", { Scale = 0.6, Parent = frame })
|
||||
tween(sc, 0.3, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
playKind(toastKind(color, big, onClick))
|
||||
local t = { frame = frame, text = text, accent = accent, sc = sc }
|
||||
table.insert(live, 1, t)
|
||||
while #live > TOAST_MAX do dismiss(live[#live]) end
|
||||
if onClick then
|
||||
frame.AutoButtonColor = false
|
||||
frame.MouseEnter:Connect(function() if not t.gone then tween(sc, 0.12, { Scale = 1.05 }, Enum.EasingStyle.Back) end end)
|
||||
frame.MouseLeave:Connect(function() if not t.gone then tween(sc, 0.12, { Scale = 1 }) end end)
|
||||
frame.Activated:Connect(function() if t.gone then return end dismiss(t); onClick() end)
|
||||
end
|
||||
task.delay(onClick and 7 or big and 4.5 or 3.4, function() dismiss(t) end)
|
||||
end
|
||||
end
|
||||
|
||||
-- blur the 3D world behind open windows (BlurEffect does not touch the GUI): watchBlur(overlay) for every window
|
||||
-- overlay; while any of them is visible the local "WindowBlur" in Lighting fades in
|
||||
local blurSet = {}
|
||||
function H.watchBlur(frame)
|
||||
local Lighting = game:GetService("Lighting")
|
||||
local function update()
|
||||
local any = false
|
||||
for f in blurSet do
|
||||
if f.Parent and f.Visible then any = true; break end
|
||||
end
|
||||
local b = Lighting:FindFirstChild("WindowBlur") or new("BlurEffect", { Name = "WindowBlur", Size = 0, Parent = Lighting })
|
||||
tween(b, any and 0.25 or 0.2, { Size = any and 16 or 0 })
|
||||
end
|
||||
blurSet[frame] = true
|
||||
frame:GetPropertyChangedSignal("Visible"):Connect(update)
|
||||
frame.Destroying:Connect(function() blurSet[frame] = nil; update() end)
|
||||
update()
|
||||
end
|
||||
|
||||
function H.install(ctx)
|
||||
local Config, player, fmt = ctx.Config, ctx.player, ctx.fmtNum
|
||||
local gui = ctx.gui
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
|
||||
local root = new("Frame", { Name = "Hud", BackgroundTransparency = 1, Size = UDim2.fromOffset(CARD_W, CARD_H), Parent = gui })
|
||||
local scale = new("UIScale", { Parent = root })
|
||||
|
||||
---------------------------------------------------------------- status: two picture panels (level / shards)
|
||||
-- panels are PANEL_W x PANEL_H (art 2172x724 = 3:1); wide screens stack them, phones put them side by side
|
||||
local card = new("Frame", { Name = "Status", Size = UDim2.fromOffset(CARD_W, CARD_H), BackgroundTransparency = 1, Parent = root })
|
||||
local function panel(name, img)
|
||||
return new("ImageButton", { Name = name, Image = img, AutoButtonColor = false, BackgroundTransparency = 1, ScaleType = Enum.ScaleType.Stretch, AnchorPoint = Vector2.new(0.5, 0.5),
|
||||
Size = UDim2.fromOffset(PANEL_W, PANEL_H), ZIndex = 2, Parent = card })
|
||||
end
|
||||
local BAR_BG, BAR_EDGE = Color3.fromRGB(6, 30, 16), Color3.fromRGB(255, 220, 120)
|
||||
local function bar(parent, y, h)
|
||||
return new("Frame", { Position = UDim2.fromOffset(INNER_X, y), Size = UDim2.fromOffset(INNER_R - INNER_X, h), BackgroundColor3 = BAR_BG, ZIndex = 3, Parent = parent }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = BAR_EDGE, Thickness = 1.5, Transparency = 0.35 }),
|
||||
})
|
||||
end
|
||||
|
||||
-- level panel (tap = what levels are for): the number sits on the gold star
|
||||
local levelHit = panel("LevelRow", PANEL_LEVEL)
|
||||
local badge = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(37, 58), Size = UDim2.fromOffset(40, 34), BackgroundTransparency = 1, ZIndex = 4, Parent = levelHit })
|
||||
local badgeScale = new("UIScale", { Parent = badge })
|
||||
local levelNum = maxText(label({ Size = UDim2.fromScale(1, 1), Text = "1", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = badge }, 2.5), 30)
|
||||
local levelTitle = maxText(label({ Position = UDim2.fromOffset(INNER_X + 2, 26), Size = UDim2.fromOffset(INNER_R - INNER_X - 4, 26), Text = "Level 1", TextScaled = true, ZIndex = 3, Parent = levelHit }, 2.5), 26)
|
||||
local xpBar = bar(levelHit, 55, 20)
|
||||
local xpFill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = WHITE, ZIndex = 4, Parent = xpBar }, {
|
||||
corner(UDim.new(0.5, 0)), grad(Color3.fromRGB(255, 240, 150), Color3.fromRGB(240, 165, 30)),
|
||||
})
|
||||
local xpText = maxText(label({ Size = UDim2.fromScale(1, 1), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = xpBar }, 1.5), 15)
|
||||
new("UIPadding", { PaddingTop = UDim.new(0, 2), PaddingBottom = UDim.new(0, 2), Parent = xpText })
|
||||
|
||||
-- shards panel (tap = how regeneration works): crystal in the left end of the green field
|
||||
local shardHit = panel("ShardRow", PANEL_SHARDS)
|
||||
local crystal = art("crystal", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(44, 54), Size = UDim2.fromOffset(56, 56), ZIndex = 3, Parent = shardHit })
|
||||
local crystalScale = new("UIScale", { Parent = crystal })
|
||||
local shardCount = maxText(label({ Position = UDim2.fromOffset(INNER_X + 2, 24), Size = UDim2.fromOffset(INNER_R - INNER_X - 4, 30), Text = "0", TextScaled = true, ZIndex = 3, Parent = shardHit }, 2.5), 30)
|
||||
local regenBar = bar(shardHit, 56, 20)
|
||||
local regenFill = new("Frame", { Size = UDim2.fromScale(0, 1), BackgroundColor3 = WHITE, ZIndex = 4, Parent = regenBar }, { corner(UDim.new(0.5, 0)) })
|
||||
local regenGrad = grad(Color3.fromRGB(200, 240, 255), Color3.fromRGB(70, 150, 255))
|
||||
regenGrad.Parent = regenFill
|
||||
local regenText = maxText(label({ Size = UDim2.fromScale(1, 1), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = regenBar }, 1.5), 15)
|
||||
new("UIPadding", { PaddingTop = UDim.new(0, 2), PaddingBottom = UDim.new(0, 2), Parent = regenText })
|
||||
|
||||
-- white flash over the green field of a panel (level up)
|
||||
local function glow(p)
|
||||
local f = new("Frame", { Position = UDim2.fromOffset(12, 25), Size = UDim2.fromOffset(PANEL_W - 24, 57), BackgroundColor3 = WHITE, BackgroundTransparency = 0.4, ZIndex = 8, Parent = p }, { corner(UDim.new(0.5, 0)) })
|
||||
tween(f, 0.5, { BackgroundTransparency = 1 })
|
||||
task.delay(0.55, function() f:Destroy() end)
|
||||
end
|
||||
|
||||
-- hover / press feel for the two panels: grow a little and brighten, shrink on press
|
||||
for _, row in { levelHit, shardHit } do
|
||||
local sc = new("UIScale", { Parent = row })
|
||||
local st = { hover = false, down = false }
|
||||
local function paint()
|
||||
tween(sc, st.down and 0.06 or 0.14, { Scale = st.down and 0.97 or st.hover and 1.04 or 1 }, st.down and Enum.EasingStyle.Quad or Enum.EasingStyle.Back)
|
||||
tween(row, 0.12, { ImageColor3 = st.hover and Color3.fromRGB(255, 255, 255) or Color3.fromRGB(232, 232, 232) })
|
||||
end
|
||||
row.ImageColor3 = Color3.fromRGB(232, 232, 232)
|
||||
row.MouseEnter:Connect(function() st.hover = true; paint() end)
|
||||
row.MouseLeave:Connect(function() st.hover, st.down = false, false; paint() end)
|
||||
row.InputBegan:Connect(function(i) if K.isPress(i) then st.down = true; paint() end end)
|
||||
row.InputEnded:Connect(function(i) if K.isPress(i) then st.down = false; paint() end end)
|
||||
end
|
||||
levelHit.Activated:Connect(function()
|
||||
ctx.toast("You get XP from generating, fusing and workout gear. New levels unlock ornaments, the market and trading.", GOLD)
|
||||
end)
|
||||
shardHit.Activated:Connect(function()
|
||||
local lvl = attr("Upg_Regen", 0)
|
||||
ctx.toast(string.format("Shards build up on their own: +1 every %ds while you have fewer than %d. Get more by recycling ornaments in the shredder.",
|
||||
math.floor(Config.RegenSeconds(lvl) + 0.5), Config.RegenCap(lvl)), ICE)
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- floating +N / -N
|
||||
local function floatDelta(amount)
|
||||
local t = label({ AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(1, 4, 0.5, 0), Size = UDim2.fromOffset(160, 40),
|
||||
Text = (amount > 0 and "+" or "-") .. fmt(math.abs(amount)), TextSize = 32, TextColor3 = amount > 0 and OK or WARN, ZIndex = 10, Parent = shardHit }, 2.5)
|
||||
local sc = new("UIScale", { Scale = 0.5, Parent = t })
|
||||
tween(sc, 0.25, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
tween(t, 1.2, { Position = UDim2.new(1, 4, 0.5, -42), TextTransparency = 1 })
|
||||
tween(t.UIStroke, 1.2, { Transparency = 1 })
|
||||
task.delay(1.25, function() t:Destroy() end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- live values
|
||||
local shownShards = attr("Shards", 0)
|
||||
local lastShards, lastLevel, lastXP = shownShards, attr("Level", 1), attr("XP", 0)
|
||||
local rolling = 0
|
||||
local function rollShards(target)
|
||||
rolling += 1
|
||||
local my, from = rolling, shownShards
|
||||
task.spawn(function()
|
||||
local t0, dur = os.clock(), math.clamp(math.abs(target - from) / 60, 0.25, 0.8)
|
||||
while my == rolling do
|
||||
local a = math.clamp((os.clock() - t0) / dur, 0, 1)
|
||||
a = 1 - (1 - a) ^ 3
|
||||
shownShards = math.floor(from + (target - from) * a + 0.5)
|
||||
shardCount.Text = fmt(shownShards)
|
||||
if a >= 1 then break end
|
||||
task.wait()
|
||||
end
|
||||
end)
|
||||
end
|
||||
shardCount.Text = fmt(shownShards)
|
||||
local function updateLevel()
|
||||
local level, xp, need = attr("Level", 1), attr("XP", 0), attr("XPNeed", 0)
|
||||
levelNum.Text = tostring(level)
|
||||
levelTitle.Text = "Level " .. level
|
||||
xpText.Text = need > 0 and (fmt(xp) .. " / " .. fmt(need) .. " XP") or "max"
|
||||
tween(xpFill, 0.4, { Size = UDim2.fromScale(need > 0 and math.clamp(xp / need, 0.03, 1) or 1, 1) })
|
||||
if level > lastLevel then
|
||||
-- level up: the badge jumps and shines
|
||||
badgeScale.Scale = 1.5
|
||||
tween(badgeScale, 0.6, { Scale = 1 }, Enum.EasingStyle.Elastic)
|
||||
glow(levelHit)
|
||||
K.floatText(card, "Level up!", GOLD)
|
||||
elseif xp > lastXP and level == lastLevel then
|
||||
badgeScale.Scale = 1.12
|
||||
tween(badgeScale, 0.3, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
lastLevel, lastXP = level, xp
|
||||
end
|
||||
for _, n in { "Level", "XP", "XPNeed" } do player:GetAttributeChangedSignal(n):Connect(updateLevel) end
|
||||
updateLevel()
|
||||
player:GetAttributeChangedSignal("Shards"):Connect(function()
|
||||
local v = attr("Shards", 0)
|
||||
if v ~= lastShards then floatDelta(v - lastShards) end
|
||||
lastShards = v
|
||||
rollShards(v)
|
||||
crystalScale.Scale = 1.25
|
||||
tween(crystalScale, 0.35, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
end)
|
||||
task.spawn(function()
|
||||
while root.Parent do
|
||||
local at = attr("ShardRegenAt", 0)
|
||||
local lvl = attr("Upg_Regen", 0)
|
||||
local cap, every = Config.RegenCap(lvl), Config.RegenSeconds(lvl)
|
||||
if at == 0 then
|
||||
regenFill.Size = UDim2.fromScale(1, 1)
|
||||
regenGrad.Color = ColorSequence.new(Color3.fromRGB(255, 235, 150), Color3.fromRGB(235, 160, 40))
|
||||
regenText.Text = attr("Shards", 0) > cap and ("regen paused: more than " .. cap) or ("cap full · " .. cap)
|
||||
else
|
||||
local left = math.max(0, at - workspace:GetServerTimeNow())
|
||||
local s = math.ceil(left)
|
||||
regenFill.Size = UDim2.fromScale(math.clamp(1 - left / every, 0.04, 1), 1)
|
||||
regenGrad.Color = ColorSequence.new(Color3.fromRGB(200, 240, 255), Color3.fromRGB(70, 150, 255))
|
||||
regenText.Text = string.format("+1 in %d:%02d · up to %d", s // 60, s % 60, cap)
|
||||
end
|
||||
task.wait(0.1)
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- menu buttons
|
||||
-- ZIndex 3: above the status panels, so a badge "+N" floats over them
|
||||
local menu = new("Frame", { Name = "Menu", BackgroundTransparency = 1, ZIndex = 3, Size = UDim2.fromOffset(CARD_W, BTN_H * 2 + GAP), Parent = root })
|
||||
local grid = new("UIGridLayout", { CellSize = UDim2.fromOffset(BTN_W, BTN_H), CellPadding = UDim2.fromOffset(GAP, GAP), SortOrder = Enum.SortOrder.LayoutOrder,
|
||||
FillDirectionMaxCells = 3, Parent = menu })
|
||||
-- phones: the second half of the buttons moves into a column on the right edge
|
||||
local menuR = new("Frame", { Name = "MenuRight", BackgroundTransparency = 1, ZIndex = 3, Visible = false, Size = UDim2.fromOffset(BTN_W, BTN_H), Parent = root })
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(BTN_W, BTN_H), CellPadding = UDim2.fromOffset(GAP, GAP), SortOrder = Enum.SortOrder.LayoutOrder,
|
||||
FillDirectionMaxCells = 1, Parent = menuR })
|
||||
local menuScale = new("UIScale", { Parent = menu })
|
||||
local menuRScale = new("UIScale", { Parent = menuR })
|
||||
local buttons = {}
|
||||
local function addButton(id, o)
|
||||
local b = new("TextButton", { Name = id .. "Button", Text = "", AutoButtonColor = false, BackgroundTransparency = 1, LayoutOrder = o.order or 0, Parent = menu })
|
||||
local sheet = SPRITES[id]
|
||||
local disc, setFrame, ringRound
|
||||
if sheet and sheet ~= "" then
|
||||
-- sprite sheet: 3 square frames side by side (normal | hover | pressed); a clipping window shows one of them
|
||||
disc = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, -2), Size = UDim2.fromOffset(SPRITE_SIZE, SPRITE_SIZE), BackgroundTransparency = 1, Parent = b })
|
||||
local window = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, ClipsDescendants = true, Parent = disc })
|
||||
local strip = new("ImageLabel", { Size = UDim2.fromScale(3, 1), BackgroundTransparency = 1, Image = sheet, ScaleType = Enum.ScaleType.Stretch, Parent = window })
|
||||
setFrame = function(k) strip.Position = UDim2.fromScale(-k, 0) end
|
||||
ringRound = UDim.new(0.24, 0)
|
||||
else
|
||||
-- fallback (no picture yet): round gradient disc with an emoji
|
||||
disc = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 2), Size = UDim2.fromOffset(78, 78), BackgroundColor3 = WHITE, Parent = b }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = INK, Thickness = 3 }),
|
||||
grad(o.color:Lerp(WHITE, 0.35), o.color:Lerp(Color3.new(0, 0, 0), 0.25)),
|
||||
})
|
||||
new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.new(1, -8, 1, -8), BackgroundTransparency = 1, ZIndex = 2, Parent = disc }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 3, Transparency = 0.15 }),
|
||||
})
|
||||
new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 6), Size = UDim2.new(0.56, 0, 0.2, 0), BackgroundColor3 = WHITE, BackgroundTransparency = 0.82, ZIndex = 2, Parent = disc }, {
|
||||
corner(UDim.new(0.5, 0)),
|
||||
})
|
||||
label({ Size = UDim2.fromScale(1, 1), Text = o.icon, TextSize = 40, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 3, Parent = disc }, 0)
|
||||
ringRound = UDim.new(0.5, 0)
|
||||
end
|
||||
local sc = new("UIScale", { Parent = disc })
|
||||
-- glowing ring while the window is open
|
||||
local ring = new("UIStroke", { Color = Color3.fromRGB(255, 240, 170), Thickness = 0, Transparency = 0, Parent = new("Frame", {
|
||||
AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.new(1, setFrame and -2 or 10, 1, setFrame and -2 or 10), BackgroundTransparency = 1, Parent = disc }, { corner(ringRound) }) })
|
||||
-- big caption across the middle of the button; it lives inside `disc`, so it grows / shrinks with the button's UIScale
|
||||
local cap = maxText(label({ AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.56), Size = UDim2.new(1, 10, 0, 34), Text = o.text, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 4, Parent = disc }, 3.5), 30)
|
||||
local badge2 = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, 30, 0, 10), Size = UDim2.fromOffset(28, 28), BackgroundColor3 = Color3.fromRGB(225, 40, 50),
|
||||
Visible = false, ZIndex = 5, Parent = b }, { corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 2.5 }) })
|
||||
local badgeText = maxText(label({ Size = UDim2.fromScale(1, 1), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = badge2 }, 1.5), 18)
|
||||
new("UIPadding", { PaddingTop = UDim.new(0, 4), PaddingBottom = UDim.new(0, 4), PaddingLeft = UDim.new(0, 3), PaddingRight = UDim.new(0, 3), Parent = badgeText })
|
||||
local st = { hover = false, down = false, open = false }
|
||||
local function paint()
|
||||
if setFrame then setFrame(st.down and 2 or (st.hover or st.open) and 1 or 0) end
|
||||
local target = setFrame and (st.down and 0.96 or st.hover and 1.05 or 1) -- the art already shows hover / press
|
||||
or (st.down and 0.9 or st.hover and 1.1 or st.open and 1.06 or 1)
|
||||
tween(sc, st.down and 0.06 or 0.14, { Scale = target }, st.down and Enum.EasingStyle.Quad or Enum.EasingStyle.Back)
|
||||
cap.TextColor3 = (st.hover or st.open) and GOLD or WHITE
|
||||
tween(ring, 0.15, { Thickness = st.open and 4 or 0 })
|
||||
end
|
||||
b.MouseEnter:Connect(function() st.hover = true; paint() end)
|
||||
b.MouseLeave:Connect(function() st.hover, st.down = false, false; paint() end)
|
||||
b.InputBegan:Connect(function(i) if K.isPress(i) then st.down = true; paint() end end)
|
||||
b.InputEnded:Connect(function(i) if K.isPress(i) then st.down = false; paint() end end)
|
||||
if o.window then
|
||||
task.spawn(function()
|
||||
local w = gui:WaitForChild(o.window, 30)
|
||||
if not w then return end
|
||||
local function sync() st.open = w.Visible; paint() end
|
||||
w:GetPropertyChangedSignal("Visible"):Connect(sync)
|
||||
sync()
|
||||
end)
|
||||
end
|
||||
buttons[id] = { button = b, badge = badge2, badgeText = badgeText }
|
||||
return b
|
||||
end
|
||||
-- red count badge; when the count grows (not on the first value after joining) the badge pops and a gold
|
||||
-- "+N" floats up from it
|
||||
local function setBadge(id, n)
|
||||
local e = buttons[id]
|
||||
if not e then return end
|
||||
n = n or 0
|
||||
local old = e.n
|
||||
e.n = n
|
||||
e.badge.Visible = n > 0
|
||||
e.badgeText.Text = n > 99 and "99+" or tostring(n)
|
||||
if old == nil or n <= old then return end
|
||||
local s2 = e.badge:FindFirstChildOfClass("UIScale") or new("UIScale", { Parent = e.badge })
|
||||
s2.Scale = old == 0 and 0.3 or 1.6
|
||||
tween(s2, old == 0 and 0.35 or 0.5, { Scale = 1 }, old == 0 and Enum.EasingStyle.Back or Enum.EasingStyle.Elastic)
|
||||
local plus = label({ AnchorPoint = Vector2.new(0.5, 1), Position = UDim2.new(0.5, 30, 0, 0), Size = UDim2.fromOffset(70, 34),
|
||||
Text = "+" .. (n - old), TextSize = 30, TextColor3 = GOLD, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 8, Parent = e.button }, 2.5)
|
||||
local ps = new("UIScale", { Scale = 0.4, Parent = plus })
|
||||
tween(ps, 0.25, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
tween(plus, 1.3, { Position = UDim2.new(0.5, 30, 0, -30) })
|
||||
task.delay(0.6, function()
|
||||
tween(plus, 0.7, { TextTransparency = 1 })
|
||||
tween(plus.UIStroke, 0.7, { Transparency = 1 })
|
||||
end)
|
||||
task.delay(1.35, function() plus:Destroy() end)
|
||||
end
|
||||
|
||||
-- "something to do" counts (recomputed when the player's attributes change)
|
||||
local function recount()
|
||||
-- (the Workshop badge = upgrades + fusions + boosters comes from WorkshopWindow through setBadge)
|
||||
local shards = attr("Shards", 0)
|
||||
local buy, waiting = 0, 0
|
||||
for _, it in Config.SHOP do
|
||||
local owned = attr("Decor_" .. it.Id, false)
|
||||
if not owned and shards >= it.Price then buy += 1 end
|
||||
if owned and not attr("Placed_" .. it.Id, false) then waiting += 1 end
|
||||
end
|
||||
setBadge("Shop", buy)
|
||||
setBadge("Inventory", waiting)
|
||||
end
|
||||
local queued = false
|
||||
player.AttributeChanged:Connect(function()
|
||||
if queued then return end
|
||||
queued = true
|
||||
task.delay(0.3, function() queued = false; recount() end)
|
||||
end)
|
||||
task.defer(recount)
|
||||
|
||||
---------------------------------------------------------------- layout (wide column / phone strip)
|
||||
local function layout()
|
||||
local cam = workspace.CurrentCamera
|
||||
local v = cam and cam.ViewportSize or Vector2.new(1280, 720)
|
||||
local inset = game:GetService("GuiService"):GetGuiInset()
|
||||
local h = v.Y - inset.Y
|
||||
local force = gui:GetAttribute("ForceLayout") -- QA: "phone" / "wide"
|
||||
local phone = force == "phone" or (force ~= "wide" and UIS.TouchEnabled and math.min(v.X, h) < 560)
|
||||
local nBtn = 0
|
||||
for _ in buttons do nBtn += 1 end
|
||||
nBtn = math.max(nBtn, 6)
|
||||
local s, toastY
|
||||
if phone then
|
||||
-- panels side by side up in the Roblox top bar (right of the Roblox buttons); the menu buttons go into two
|
||||
-- columns along the left and right screen edges, so the middle of the screen stays free
|
||||
local list = {}
|
||||
for _, e in buttons do table.insert(list, e.button) end
|
||||
table.sort(list, function(a, b) return a.LayoutOrder < b.LayoutOrder end)
|
||||
local half = math.ceil(#list / 2)
|
||||
for i, b in list do b.Parent = i <= half and menu or menuR end
|
||||
local rows = math.max(half, 3)
|
||||
local colH = rows * BTN_H + (rows - 1) * GAP
|
||||
local GS = game:GetService("GuiService")
|
||||
local tb = GS.TopbarInset -- free part of the top bar, screen pixels
|
||||
-- gui (0,0) in screen pixels: AbsolutePosition is counted from under the top bar, TopbarInset from the
|
||||
-- real screen corner, so the inset is added back (otherwise the panels end up under the bar, not in it)
|
||||
local origin = gui.AbsolutePosition + (gui.IgnoreGuiInset and Vector2.zero or inset)
|
||||
local barTop, barH, barL, barR
|
||||
if tb.Height >= 20 then
|
||||
barTop, barH, barL, barR = tb.Min.Y, tb.Height, tb.Min.X, tb.Max.X
|
||||
else
|
||||
barTop, barH, barL, barR = 0, math.max(inset.Y, 44), v.X * 0.3, v.X - 8
|
||||
end
|
||||
local below = math.max(barTop + barH, origin.Y) - origin.Y -- first free gui pixel under the top bar
|
||||
s = math.clamp(math.min((barH - 4) / PANEL_H, (h - below - 16) * 0.68 / colH), 0.36, 0.7)
|
||||
root.Size = UDim2.fromOffset(v.X / s, (h + origin.Y) / s)
|
||||
root.Position = UDim2.fromOffset(0, 0)
|
||||
-- panels: centred in the free top-bar area (not left of it), vertically on the bar's middle
|
||||
local cardW = PHONE_CARD_W * s
|
||||
local cx = math.max((barL + barR) / 2, barL + cardW / 2 + 4) - origin.X
|
||||
cx = math.min(cx, v.X - cardW / 2 - 6)
|
||||
local cy = barTop + barH / 2 - origin.Y
|
||||
card.Size = UDim2.fromOffset(PHONE_CARD_W, PHONE_CARD_H)
|
||||
card.Position = UDim2.fromOffset(cx / s - PHONE_CARD_W / 2, cy / s - PHONE_CARD_H / 2)
|
||||
levelHit.Position = UDim2.fromOffset(PANEL_W / 2, PANEL_H / 2)
|
||||
shardHit.Position = UDim2.fromOffset(PANEL_W * 1.5 + 6, PANEL_H / 2)
|
||||
-- button columns: own scale (the panels are limited by the thin top bar, the buttons are not)
|
||||
local sb = math.clamp((h - below - 16) * 0.7 / colH, 0.36, 0.7)
|
||||
menuScale.Scale = sb / s
|
||||
menuRScale.Scale = sb / s
|
||||
grid.FillDirectionMaxCells = 1
|
||||
local colTop = (below + 12) / s
|
||||
menu.Size = UDim2.fromOffset(BTN_W, colH)
|
||||
menu.Position = UDim2.fromOffset(6 / s, colTop)
|
||||
menuR.Size = UDim2.fromOffset(BTN_W, colH)
|
||||
menuR.Position = UDim2.fromOffset((v.X - 6 - BTN_W * sb) / s, colTop)
|
||||
menuR.Visible = true
|
||||
toastY = cy + PANEL_H * s / 2 + 8
|
||||
else
|
||||
for _, e in buttons do e.button.Parent = menu end
|
||||
menuR.Visible = false
|
||||
menuScale.Scale = 1
|
||||
card.Size = UDim2.fromOffset(CARD_W, CARD_H)
|
||||
card.Position = UDim2.fromOffset(0, 0)
|
||||
levelHit.Position = UDim2.fromOffset(PANEL_W / 2, PANEL_H / 2)
|
||||
shardHit.Position = UDim2.fromOffset(PANEL_W / 2, STACK + PANEL_H / 2)
|
||||
-- column at the top-left: card, then a 3 x N grid
|
||||
local rows = math.ceil(nBtn / 3)
|
||||
local colH = CARD_H + GAP + 6 + rows * BTN_H + (rows - 1) * GAP
|
||||
s = math.clamp(math.min(h * 0.6 / colH, 1.05), 0.55, 1.05)
|
||||
grid.FillDirectionMaxCells = 3
|
||||
menu.Size = UDim2.fromOffset(CARD_W, rows * BTN_H + (rows - 1) * GAP)
|
||||
menu.Position = UDim2.fromOffset(0, CARD_H + GAP + 6)
|
||||
root.Size = UDim2.fromOffset(CARD_W, colH)
|
||||
root.Position = UDim2.fromOffset(14, 12)
|
||||
toastY = 14
|
||||
end
|
||||
scale.Scale = s
|
||||
local toasts = gui:FindFirstChild("Toasts")
|
||||
if toasts then
|
||||
toasts.Position = UDim2.new(0.5, 0, 0, toastY)
|
||||
local ts = toasts:FindFirstChildOfClass("UIScale") or new("UIScale", { Parent = toasts })
|
||||
ts.Scale = phone and math.clamp(s * 1.25, 0.55, 0.9) or math.clamp(h / 900, 0.75, 1)
|
||||
end
|
||||
end
|
||||
local function watchCam()
|
||||
local cam = workspace.CurrentCamera
|
||||
if cam then cam:GetPropertyChangedSignal("ViewportSize"):Connect(layout) end
|
||||
layout()
|
||||
end
|
||||
workspace:GetPropertyChangedSignal("CurrentCamera"):Connect(watchCam)
|
||||
watchCam()
|
||||
UIS.LastInputTypeChanged:Connect(layout)
|
||||
game:GetService("GuiService"):GetPropertyChangedSignal("TopbarInset"):Connect(layout)
|
||||
gui:GetAttributeChangedSignal("ForceLayout"):Connect(layout)
|
||||
|
||||
return {
|
||||
root = root,
|
||||
addButton = function(id, o) local b = addButton(id, o); task.defer(layout); task.defer(recount); return b end,
|
||||
setBadge = setBadge,
|
||||
floatDelta = floatDelta,
|
||||
}
|
||||
end
|
||||
|
||||
return H
|
||||
@@ -0,0 +1,181 @@
|
||||
-- IntroCamera (LocalScript, StarterPlayerScripts): the opening shot when the game starts (once per session).
|
||||
-- 1. fade in from black, the camera circles the big Christmas tree in the middle of the map (workspace.CenterTree),
|
||||
-- coming down and closer while it turns, always looking at the tree;
|
||||
-- 2. then it flies in an arc to the player's spawn (the path in front of the own zone) and ends exactly where the
|
||||
-- normal Roblox camera stands behind the character, so control is handed over without a jump.
|
||||
-- The character can not walk during the shot. Any click / tap / key after the first second shortens it: the camera
|
||||
-- leaves the tree right away and flies to the player faster.
|
||||
local Players = game:GetService("Players")
|
||||
local RunService = game:GetService("RunService")
|
||||
local UIS = game:GetService("UserInputService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local camera = workspace.CurrentCamera
|
||||
|
||||
local ORBIT_TIME = 4.5 -- seconds for the quarter turn around the tree
|
||||
local FLY_TIME = 3.2 -- seconds from the tree to the player
|
||||
local ZOOM = 12.5 -- Roblox default camera distance
|
||||
local PITCH = math.rad(-15) -- final camera tilt: the one the Roblox camera settles on (measured), no jump
|
||||
|
||||
-- local attribute IntroDone: other client scripts (TutorialGuide) wait for the end of the shot
|
||||
player:SetAttribute("IntroDone", false)
|
||||
local tree = workspace:WaitForChild("CenterTree", 10)
|
||||
local character = player.Character or player.CharacterAdded:Wait()
|
||||
local hrp = character:WaitForChild("HumanoidRootPart", 10)
|
||||
local humanoid = character:WaitForChild("Humanoid", 10)
|
||||
if not tree or not hrp or not humanoid then player:SetAttribute("IntroDone", true) return end
|
||||
|
||||
local treeCf, treeSize = tree:GetBoundingBox()
|
||||
-- the trunk goes into the ground, so the shot is measured from the ground next to the tree, not the model's bottom
|
||||
local top = treeCf.Position.Y + treeSize.Y / 2
|
||||
local params = RaycastParams.new()
|
||||
params.FilterType = Enum.RaycastFilterType.Exclude
|
||||
params.FilterDescendantsInstances = { tree, character }
|
||||
local hit = workspace:Raycast(treeCf.Position + Vector3.new(treeSize.X, 200, 0), Vector3.new(0, -400, 0), params)
|
||||
local groundY = hit and hit.Position.Y or (treeCf.Position.Y - treeSize.Y / 2)
|
||||
local base = Vector3.new(treeCf.Position.X, groundY, treeCf.Position.Z)
|
||||
local height = top - groundY -- visible tree height
|
||||
local lookAt = base + Vector3.new(0, height * 0.55, 0) -- middle / upper part of the tree (the garland)
|
||||
|
||||
-- the HUD is hidden during the shot
|
||||
local hidden = {}
|
||||
local playerGui = player:WaitForChild("PlayerGui")
|
||||
local function hide(g)
|
||||
if g:IsA("ScreenGui") and g.Enabled and g.Name ~= "IntroFade" then
|
||||
g.Enabled = false
|
||||
table.insert(hidden, g)
|
||||
end
|
||||
end
|
||||
for _, g in playerGui:GetChildren() do hide(g) end
|
||||
local hideConn = playerGui.ChildAdded:Connect(hide) -- the HUD scripts may create their guis a bit later
|
||||
|
||||
-- freeze the character while the shot runs (the client owns its character's movement, so this is enough; the
|
||||
-- PlayerModule is not always there to disable the controls)
|
||||
local walkSpeed, jumpPower, jumpHeight = humanoid.WalkSpeed, humanoid.JumpPower, humanoid.JumpHeight
|
||||
humanoid.WalkSpeed, humanoid.JumpPower, humanoid.JumpHeight = 0, 0, 0
|
||||
|
||||
camera.CameraType = Enum.CameraType.Scriptable
|
||||
|
||||
-- black screen that fades out at the start
|
||||
local fadeGui = Instance.new("ScreenGui")
|
||||
fadeGui.Name = "IntroFade"
|
||||
fadeGui.IgnoreGuiInset = true
|
||||
fadeGui.DisplayOrder = 100
|
||||
fadeGui.ResetOnSpawn = false
|
||||
local black = Instance.new("Frame")
|
||||
black.Size = UDim2.fromScale(1, 1)
|
||||
black.BackgroundColor3 = Color3.new(0, 0, 0)
|
||||
black.BorderSizePixel = 0
|
||||
black.Parent = fadeGui
|
||||
fadeGui.Parent = player:WaitForChild("PlayerGui")
|
||||
|
||||
local function smooth(a) return a * a * (3 - 2 * a) end
|
||||
local function easeInOut(a) return a < 0.5 and 4 * a * a * a or 1 - (-2 * a + 2) ^ 3 / 2 end
|
||||
|
||||
---------------------------------------------------------------- the route is planned once, before the camera moves
|
||||
-- 1. wait (on the black screen) until the server has given the player a zone and moved the character to its
|
||||
-- spawn point, so the end of the shot is known exactly
|
||||
do
|
||||
local t = os.clock()
|
||||
while not player:GetAttribute("PlotIndex") and os.clock() - t < 15 do task.wait(0.1) end
|
||||
local zone = player:GetAttribute("PlotIndex") and workspace:FindFirstChild("Zones")
|
||||
and workspace.Zones:FindFirstChild("Zone_" .. player:GetAttribute("PlotIndex"))
|
||||
local sp = zone and zone:FindFirstChild("SpawnPoint")
|
||||
t = os.clock()
|
||||
while sp and (hrp.Position - sp.Position).Magnitude > 6 and os.clock() - t < 3 do task.wait(0.1) end
|
||||
task.wait(0.2)
|
||||
end
|
||||
|
||||
-- 2. the end: where the normal camera will stand — behind the character, on its focus point, at the default zoom
|
||||
local endLookFlat do
|
||||
local look = hrp.CFrame.LookVector
|
||||
endLookFlat = Vector3.new(look.X, 0, look.Z)
|
||||
endLookFlat = endLookFlat.Magnitude > 0.01 and endLookFlat.Unit or Vector3.new(0, 0, -1)
|
||||
end
|
||||
local endFocus = hrp.Position + Vector3.new(0, 1.5, 0)
|
||||
local endDir = (endLookFlat * math.cos(PITCH) + Vector3.new(0, math.sin(PITCH), 0)).Unit
|
||||
local endCf = CFrame.lookAt(endFocus - endDir * ZOOM, endFocus)
|
||||
|
||||
-- 3. the orbit: a quarter turn that ends on the far side of the tree, looking over the tree towards the player's
|
||||
-- zone — that is (almost) the same direction the end shot looks, so the camera never has to spin round
|
||||
local playerAngle = math.atan2(endFocus.Z - base.Z, endFocus.X - base.X)
|
||||
local orbitEndAngle = playerAngle + math.pi
|
||||
local function orbitCFrame(a)
|
||||
local angle = orbitEndAngle - (1 - a) * math.pi / 2
|
||||
local radius = 58 - 22 * a
|
||||
local h = height * (1.3 - 0.75 * a) -- from above the top down to about the middle
|
||||
local pos = base + Vector3.new(math.cos(angle) * radius, h, math.sin(angle) * radius)
|
||||
return CFrame.lookAt(pos, lookAt)
|
||||
end
|
||||
|
||||
-- 4. the flight: a cubic Bezier from the end of the orbit up over the top of the tree and down onto the end
|
||||
-- position, arriving along the final viewing direction
|
||||
local P0 = orbitCFrame(1).Position
|
||||
-- control points high enough that the curve clears the top of the tree with room to spare
|
||||
local P1 = Vector3.new(base.X, top + 30, base.Z):Lerp(Vector3.new(P0.X, top + 30, P0.Z), 0.35)
|
||||
local P2 = Vector3.new(endCf.Position.X, top + 4, endCf.Position.Z) - endLookFlat * 24
|
||||
local P3 = endCf.Position
|
||||
local function bezier(t)
|
||||
local u = 1 - t
|
||||
return P0 * (u * u * u) + P1 * (3 * u * u * t) + P2 * (3 * u * t * t) + P3 * (t * t * t)
|
||||
end
|
||||
-- the view turns by yaw / pitch only (no roll, no flips): shortest way round for the yaw
|
||||
local function yawPitch(cf)
|
||||
local l = cf.LookVector
|
||||
return math.atan2(-l.X, -l.Z), math.asin(math.clamp(l.Y, -1, 1))
|
||||
end
|
||||
local yaw0, pitch0 = yawPitch(orbitCFrame(1))
|
||||
local yaw1, pitch1 = yawPitch(endCf)
|
||||
local dYaw = (yaw1 - yaw0 + math.pi) % (2 * math.pi) - math.pi
|
||||
local function flightCFrame(t)
|
||||
local e = easeInOut(t)
|
||||
local yaw = yaw0 + dYaw * smooth(t)
|
||||
local pitch = pitch0 + (pitch1 - pitch0) * smooth(t) - math.rad(22) * math.sin(math.pi * t) -- glance down at the tree while passing over it
|
||||
return CFrame.new(bezier(e)) * CFrame.fromEulerAnglesYXZ(pitch, yaw, 0)
|
||||
end
|
||||
|
||||
local skip = false
|
||||
local t0 = os.clock()
|
||||
local conn = UIS.InputBegan:Connect(function(input)
|
||||
if os.clock() - t0 < 1 then return end
|
||||
local t = input.UserInputType
|
||||
if t == Enum.UserInputType.MouseButton1 or t == Enum.UserInputType.Touch or t == Enum.UserInputType.Keyboard
|
||||
or t == Enum.UserInputType.Gamepad1 then
|
||||
skip = true
|
||||
end
|
||||
end)
|
||||
|
||||
-- 1. around the tree
|
||||
local fadeStart = os.clock()
|
||||
local start = os.clock()
|
||||
while true do
|
||||
local a = math.clamp((os.clock() - start) / ORBIT_TIME, 0, 1)
|
||||
black.BackgroundTransparency = math.clamp((os.clock() - fadeStart) / 1.2, 0, 1)
|
||||
camera.CFrame = orbitCFrame(smooth(a))
|
||||
if a >= 1 then break end
|
||||
if skip then -- skipped: finish the turn quickly instead of jumping
|
||||
start -= ORBIT_TIME * 0.06
|
||||
end
|
||||
RunService.RenderStepped:Wait()
|
||||
end
|
||||
black.BackgroundTransparency = 1
|
||||
|
||||
-- 2. fly to the player along the planned curve; the last frame is exactly the end position
|
||||
local flyTime = skip and FLY_TIME * 0.7 or FLY_TIME
|
||||
start = os.clock()
|
||||
while true do
|
||||
local a = math.clamp((os.clock() - start) / flyTime, 0, 1)
|
||||
camera.CFrame = a >= 1 and endCf or flightCFrame(a)
|
||||
if a >= 1 then break end
|
||||
RunService.RenderStepped:Wait()
|
||||
end
|
||||
|
||||
-- 3. hand over: the normal camera keeps this view, the character can move again
|
||||
conn:Disconnect()
|
||||
camera.CameraSubject = humanoid
|
||||
camera.CameraType = Enum.CameraType.Custom
|
||||
if humanoid.Parent then humanoid.WalkSpeed, humanoid.JumpPower, humanoid.JumpHeight = walkSpeed, jumpPower, jumpHeight end
|
||||
fadeGui:Destroy()
|
||||
hideConn:Disconnect()
|
||||
for _, g in hidden do if g.Parent then g.Enabled = true end end
|
||||
player:SetAttribute("IntroDone", true)
|
||||
@@ -0,0 +1,314 @@
|
||||
-- InventoryWindow: "Инвентарь" — toys, plot items and boosters (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Игрушки / Предметы / Бустеры / Как это работает. "Предметы" shows a badge with bought items that are not
|
||||
-- on the plot yet. Placing (ghost + R / Esc) and the toy-in-hand logic stay in OrnamentCraftUI; this module
|
||||
-- calls them through ctx.startPlacing / ctx.storeDecor / ctx.toyCall.
|
||||
local ContentProvider = game:GetService("ContentProvider")
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local I = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, BODY, NAVY = K.WHITE, K.GOLD, K.SOFT, K.OK, K.BODY, K.NAVY
|
||||
local new, corner, art, label, maxText, pill, chip, tween = K.new, K.corner, K.art, K.label, K.maxText, K.pill, K.chip, K.tween
|
||||
local TOY_LIMIT = 120
|
||||
|
||||
local function viewport(parent, props)
|
||||
props.BackgroundColor3 = Color3.fromRGB(8, 22, 30)
|
||||
props.BackgroundTransparency = 0.25
|
||||
props.Ambient = Color3.fromRGB(165, 165, 180)
|
||||
props.LightColor = Color3.fromRGB(255, 245, 230)
|
||||
props.LightDirection = Vector3.new(-1, -1.3, -1)
|
||||
props.Parent = parent
|
||||
return new("ViewportFrame", props, { corner(UDim.new(0, 18)) })
|
||||
end
|
||||
|
||||
function I.install(ctx)
|
||||
local Config, player = ctx.Config, ctx.player
|
||||
local fmt = ctx.fmtNum
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local TABS = {
|
||||
{ id = "Toys", text = "Ornaments", icon = "🎄", tip = "“Hold” it, then click a glowing dot on your tree to hang the ornament." },
|
||||
{ id = "Items", text = "Items", icon = "🏠", tip = "“Place”: click to place, R to rotate, Esc to cancel." },
|
||||
{ id = "Boosters", text = "Boosters", icon = "🍀", tip = "Put boosters in the generator slot before making an ornament." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "Everything in your inventory is saved with your progress." },
|
||||
}
|
||||
local refresh
|
||||
local ch = K.chrome({ win = win, title = "INVENTORY", subtitle = "Your ornaments, items\nand boosters", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = fmt, onTab = function() if win.overlay.Visible then refresh() end end })
|
||||
|
||||
---------------------------------------------------------------- toys
|
||||
local toysG = ch.makePage("Toys")
|
||||
local toyFilter = "all"
|
||||
local filterChips = {}
|
||||
local filterRow = new("Frame", { Position = UDim2.fromOffset(4, 0), Size = UDim2.fromOffset(700, 54), BackgroundTransparency = 1, ZIndex = 4, Parent = toysG }, {
|
||||
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Center }),
|
||||
})
|
||||
for k, f in { { "all", "All" }, { "bag", "In inventory" }, { "tree", "On the tree" } } do
|
||||
filterChips[k] = { id = f[1], o = chip(filterRow, { Size = UDim2.fromOffset(210, 50), LayoutOrder = k, ZIndex = 4 }, f[2], function() toyFilter = f[1]; refresh() end) }
|
||||
end
|
||||
local toyCount = maxText(label({ Position = UDim2.fromOffset(720, 8), Size = UDim2.fromOffset(530, 38), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = SOFT,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 4, Parent = toysG }, 1.5), 22)
|
||||
local toyGrid = K.scroll(toysG, UDim2.fromOffset(0, 64), UDim2.new(1, 0, 0, 502),
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(238, 310), CellPadding = UDim2.fromOffset(12, 14), SortOrder = Enum.SortOrder.LayoutOrder }))
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 6), PaddingBottom = UDim.new(0, 6), Parent = toyGrid })
|
||||
local toyEmpty
|
||||
local toyBusy = {}
|
||||
local function rebuildToys()
|
||||
for _, c in toyGrid:GetChildren() do if c:IsA("GuiObject") then c:Destroy() end end
|
||||
if toyEmpty then toyEmpty:Destroy(); toyEmpty = nil end
|
||||
for _, c in filterChips do c.o.setSelected(c.id == toyFilter) end
|
||||
local inv = player:FindFirstChild("OrnamentInventory")
|
||||
local all = inv and inv:GetChildren() or {}
|
||||
local onTree = 0
|
||||
for _, c in all do if c:GetAttribute("OnTree") then onTree += 1 end end
|
||||
toyCount.Text = #all .. " pcs · on the tree: " .. onTree .. " · storage: " .. Config.StorageCap(attr("Upg_Storage", 0))
|
||||
local list = {}
|
||||
for _, c in all do
|
||||
local hung = c:GetAttribute("OnTree") ~= nil
|
||||
if toyFilter == "all" or (toyFilter == "tree") == hung then table.insert(list, c) end
|
||||
end
|
||||
table.sort(list, function(x, y)
|
||||
local tx, ty = x:GetAttribute("OnTree") ~= nil, y:GetAttribute("OnTree") ~= nil
|
||||
if tx ~= ty then return tx end
|
||||
local rx, ry = Config.RarityById[x:GetAttribute("Rarity")], Config.RarityById[y:GetAttribute("Rarity")]
|
||||
if rx.Index ~= ry.Index then return rx.Index > ry.Index end
|
||||
return (x:GetAttribute("Order") or 0) > (y:GetAttribute("Order") or 0)
|
||||
end)
|
||||
if #list == 0 then
|
||||
toyEmpty = K.emptyState({ Position = UDim2.fromOffset(0, 80), Size = UDim2.new(1, 0, 0, 420), ZIndex = 4, Parent = toysG },
|
||||
toyFilter == "tree" and "The tree is empty" or "No ornaments yet",
|
||||
toyFilter == "tree" and "Hold an ornament and click a glowing dot on the tree." or "Make ornaments in the generator — they'll show up here.")
|
||||
return
|
||||
end
|
||||
for k = 1, math.min(#list, TOY_LIMIT) do
|
||||
local c = list[k]
|
||||
local item = { Toy = c:GetAttribute("Toy"), Rarity = c:GetAttribute("Rarity"), Variant = c:GetAttribute("Variant") }
|
||||
local r = Config.RarityById[item.Rarity]
|
||||
local v = item.Variant and Config.VariantById[item.Variant]
|
||||
local hung = c:GetAttribute("OnTree") ~= nil
|
||||
local card = new("Frame", { BackgroundColor3 = WHITE, LayoutOrder = k, ZIndex = 5, Parent = toyGrid }, {
|
||||
corner(UDim.new(0, 24)),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(r.Color:Lerp(Color3.new(0, 0, 0), 0.45), Color3.fromRGB(10, 22, 34)) }),
|
||||
new("UIStroke", { Color = v and v.Color or r.Color, Thickness = v and 4 or 3 }),
|
||||
})
|
||||
local vp = viewport(card, { Position = UDim2.fromOffset(12, 12), Size = UDim2.new(1, -24, 0, 140), ZIndex = 6 })
|
||||
local model = ctx.ToyModels.Build(item, 1)
|
||||
model:PivotTo(CFrame.Angles(0, math.rad(25), 0))
|
||||
model.Parent = vp
|
||||
local cam = Instance.new("Camera")
|
||||
cam.FieldOfView = 35
|
||||
cam.CFrame = CFrame.lookAt(Vector3.new(0, 0.5, 4.2), Vector3.new(0, 0.15, 0))
|
||||
cam.Parent = vp
|
||||
vp.CurrentCamera = cam
|
||||
if v then
|
||||
local tag = new("Frame", { Position = UDim2.fromOffset(8, 8), Size = UDim2.fromOffset(104, 30), BackgroundColor3 = v.Color, ZIndex = 8, Parent = card }, { corner(UDim.new(0.5, 0)) })
|
||||
maxText(label({ Position = UDim2.fromOffset(6, 3), Size = UDim2.new(1, -12, 1, -6), Text = v.Name, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 9, Parent = tag }, 1.5), 18)
|
||||
end
|
||||
maxText(label({ Position = UDim2.fromOffset(10, 158), Size = UDim2.new(1, -20, 0, 32), Text = Config.ToyById[item.Toy].Name, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = card }, 2.5), 30)
|
||||
maxText(label({ Position = UDim2.fromOffset(10, 192), Size = UDim2.new(1, -20, 0, 24), Text = r.Name, TextScaled = true, TextColor3 = r.Color,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = card }, 2), 22)
|
||||
maxText(label({ Position = UDim2.fromOffset(10, 218), Size = UDim2.new(1, -20, 0, 22), Text = hung and "on the tree" or ("in inventory · " .. Config.Value(item) .. " shards"), TextScaled = true,
|
||||
FontFace = BODY, TextColor3 = hung and OK or SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = card }, 1.5), 18)
|
||||
local btn
|
||||
btn = pill(card, { Position = UDim2.fromOffset(14, 248), Size = UDim2.fromOffset(210, 52), ZIndex = 6, TextMax = 26 }, function()
|
||||
toyBusy[c.Name] = true
|
||||
btn.set("busy")
|
||||
task.spawn(function()
|
||||
local res = ctx.toyCall(hung and "TakeOff" or "Equip", c.Name)
|
||||
toyBusy[c.Name] = nil
|
||||
if res.ok and not hung then ctx.closeWindow() return end
|
||||
if res.ok then K.floatText(card, "Taken down!") end
|
||||
task.delay(0.2, function() if win.overlay.Visible and ch.current() == "Toys" then rebuildToys() end end)
|
||||
end)
|
||||
end)
|
||||
if toyBusy[c.Name] then btn.set("busy")
|
||||
elseif hung then btn.set("alt", "Take down")
|
||||
else btn.set("ready", "Hold") end
|
||||
end
|
||||
if #list > TOY_LIMIT then
|
||||
maxText(label({ Size = UDim2.fromOffset(238, 60), Text = "…and " .. (#list - TOY_LIMIT), TextScaled = true, TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center,
|
||||
LayoutOrder = TOY_LIMIT + 1, ZIndex = 5, Parent = toyGrid }, 1.5), 26)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- plot items
|
||||
local _, itScroll = ch.makePage("Items", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(615, 272), CellPadding = UDim2.fromOffset(18, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = itScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 2), PaddingTop = UDim.new(0, 2), Parent = itScroll })
|
||||
local CARD_FOR = { Tree = "cardGreen", PullUpBar = "cardCyan", Bench = "cardViolet", Fireworks = "cardOrange", Garland = "cardViolet" }
|
||||
local itemCards = {}
|
||||
for _, it in Config.SHOP do
|
||||
local card = art(CARD_FOR[it.Id] or "cardGreen", { LayoutOrder = it.Order, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = itScroll })
|
||||
local vp = viewport(card, { Position = UDim2.fromOffset(30, 46), Size = UDim2.fromOffset(220, 198), ZIndex = 5 })
|
||||
task.spawn(function()
|
||||
local template = ctx.decorTemplates:FindFirstChild(it.Model)
|
||||
if not template then return end
|
||||
local tree = it.OnTree and ctx.decorTemplates:FindFirstChild("ChristmasTree")
|
||||
pcall(function() ContentProvider:PreloadAsync({ template, tree }) end) -- meshes must load before cloning
|
||||
local model = template:Clone()
|
||||
if tree then -- a tree item is shown on a tree
|
||||
local both = Instance.new("Model")
|
||||
local t = tree:Clone()
|
||||
t:PivotTo(CFrame.new())
|
||||
t.Parent = both
|
||||
model:PivotTo(CFrame.new())
|
||||
model.Parent = both
|
||||
both.WorldPivot = CFrame.new() -- pivot at the tree's foot, not the box centre
|
||||
model = both
|
||||
end
|
||||
model:PivotTo(CFrame.Angles(0, math.rad(-30), 0))
|
||||
model.Parent = vp
|
||||
local _, size = model:GetBoundingBox()
|
||||
local cam = Instance.new("Camera")
|
||||
cam.FieldOfView = 40
|
||||
cam.CFrame = CFrame.lookAt(Vector3.new(0, size.Y * 0.62, math.max(size.X, size.Y, size.Z) * 1.5), Vector3.new(0, size.Y * 0.47, 0))
|
||||
cam.Parent = vp
|
||||
vp.CurrentCamera = cam
|
||||
end)
|
||||
maxText(label({ Position = UDim2.fromOffset(270, 40), Size = UDim2.fromOffset(320, 46), Text = it.Name, TextScaled = true, ZIndex = 5, Parent = card }, 3), 38)
|
||||
local status = maxText(label({ Position = UDim2.fromOffset(272, 92), Size = UDim2.fromOffset(318, 30), Text = "", TextScaled = true, FontFace = BODY, ZIndex = 5, Parent = card }, 1.5), 22)
|
||||
local hint = maxText(label({ Position = UDim2.fromOffset(272, 124), Size = UDim2.fromOffset(318, 56), Text = "", TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 19)
|
||||
local c = { it = it, card = card, status = status, hint = hint }
|
||||
c.main = pill(card, { Position = UDim2.fromOffset(268, 188), Size = UDim2.fromOffset(196, 64), ZIndex = 5, TextMax = 26 }, function(state)
|
||||
if not attr("Decor_" .. it.Id, false) then K.go("Shop", "All") return end
|
||||
ctx.startPlacing(it.Id)
|
||||
end)
|
||||
c.second = pill(card, { Position = UDim2.fromOffset(472, 188), Size = UDim2.fromOffset(128, 64), ZIndex = 5, TextMax = 24 }, function()
|
||||
c.second.set("busy")
|
||||
task.spawn(function()
|
||||
local res = ctx.storeDecor(it.Id)
|
||||
if res.ok then K.floatText(card, "Removed") end
|
||||
refresh()
|
||||
end)
|
||||
end)
|
||||
itemCards[it.Id] = c
|
||||
end
|
||||
local function paintItems()
|
||||
local waiting = 0
|
||||
for id, c in itemCards do
|
||||
local owned, placed = attr("Decor_" .. id, false), attr("Placed_" .. id, false)
|
||||
c.card.ImageTransparency = owned and 0 or 0.35
|
||||
if not owned then
|
||||
c.status.Text, c.status.TextColor3 = "not bought yet", SOFT
|
||||
c.hint.Text = "Shop price: " .. fmt(c.it.Price) .. " shards."
|
||||
c.main.set("alt", "To Shop")
|
||||
c.second.button.Visible = false
|
||||
elseif placed and c.it.OnTree then
|
||||
c.status.Text, c.status.TextColor3 = "on the tree", OK
|
||||
c.hint.Text = "You can rewrap the tree or take the garland down."
|
||||
c.main.set("alt", "Rehang")
|
||||
c.second.button.Visible = true
|
||||
if c.second.state ~= "busy" then c.second.set("danger", "Take down") end
|
||||
elseif c.it.OnTree then
|
||||
waiting += 1
|
||||
c.status.Text, c.status.TextColor3 = "in inventory", GOLD
|
||||
c.hint.Text = "Click the tree point by point — the garland follows your path."
|
||||
c.main.set("ready", "Wrap the tree")
|
||||
c.second.button.Visible = false
|
||||
elseif placed then
|
||||
c.status.Text, c.status.TextColor3 = "on your plot", OK
|
||||
c.hint.Text = "You can move it or put it back in your inventory."
|
||||
c.main.set("alt", "Move")
|
||||
c.second.button.Visible = true
|
||||
if c.second.state ~= "busy" then c.second.set("danger", "Store") end
|
||||
else
|
||||
waiting += 1
|
||||
c.status.Text, c.status.TextColor3 = "in inventory", GOLD
|
||||
c.hint.Text = "Pick a spot on your plot."
|
||||
c.main.set("ready", "Place")
|
||||
c.second.button.Visible = false
|
||||
end
|
||||
end
|
||||
ch.tabs.Items.setBadge(waiting)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- boosters
|
||||
local _, boScroll = ch.makePage("Boosters", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(615, 470), CellPadding = UDim2.fromOffset(18, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = boScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 2), PaddingTop = UDim.new(0, 2), Parent = boScroll })
|
||||
local bOrder = {}
|
||||
for id, b in Config.BOOSTERS do table.insert(bOrder, { id = id, b = b }) end
|
||||
table.sort(bOrder, function(x, y) return x.b.Order < y.b.Order end)
|
||||
local boCount = {}
|
||||
for i, e in bOrder do
|
||||
local card = art(i == 1 and "cardGreen" or "cardOrange", { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = boScroll })
|
||||
local orb = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 52), Size = UDim2.fromOffset(170, 170), BackgroundColor3 = e.b.Color, ZIndex = 5, Parent = card }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 6 }),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(WHITE, Color3.fromRGB(170, 170, 170)) }),
|
||||
})
|
||||
label({ Size = UDim2.fromScale(1, 1), Text = "x" .. e.b.Luck, TextSize = 76, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = orb }, 4)
|
||||
local cnt = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(1, 4, 0, 26), Size = UDim2.fromOffset(78, 78), BackgroundColor3 = NAVY, ZIndex = 7, Parent = orb }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 4 }),
|
||||
})
|
||||
boCount[e.id] = maxText(label({ Position = UDim2.fromScale(0.12, 0.2), Size = UDim2.fromScale(0.76, 0.6), Text = "0", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 8, Parent = cnt }, 2), 38)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 236), Size = UDim2.new(1, -60, 0, 50), Text = e.b.Name, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 44)
|
||||
maxText(label({ Position = UDim2.fromOffset(40, 288), Size = UDim2.new(1, -80, 0, 30), Text = "put it in the generator slot — one generation gets luck x" .. e.b.Luck, TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 1.5), 22)
|
||||
local a = pill(card, { Position = UDim2.fromOffset(40, 344), Size = UDim2.fromOffset(260, 76), ZIndex = 5, TextMax = 30 }, function() K.go("Workshop", "Boosters") end)
|
||||
a.set("alt", "Craft more")
|
||||
local b = pill(card, { Position = UDim2.fromOffset(316, 344), Size = UDim2.fromOffset(260, 76), ZIndex = 5, TextMax = 30 }, function() K.go("Premium", "Boosters") end)
|
||||
b.set("ready", "For Robux")
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- help
|
||||
local _, heScroll = ch.makePage("Help", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardGreen", icon = "🎄", title = "Ornaments", tab = "Toys",
|
||||
text = "“Hold” puts the ornament in your hand. Walk up to your tree and click a glowing dot to hang it." },
|
||||
{ card = "cardViolet", icon = "🏠", title = "Items", tab = "Items",
|
||||
text = "Things you buy in the shop go on your plot. Click to place, R to rotate, Esc to cancel." },
|
||||
{ card = "cardOrange", icon = "🍀", title = "Boosters", tab = "Boosters",
|
||||
text = "Boosters are crafted in the Workshop or bought for Robux. Put a booster in the generator slot." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, function() ch.showTab(h.tab) end)
|
||||
go.set("alt", "Open")
|
||||
end
|
||||
|
||||
refresh = function()
|
||||
ch.setBalance(attr("Shards", 0))
|
||||
paintItems()
|
||||
for id, t in boCount do t.Text = tostring(attr("Booster_" .. id, 0)) end
|
||||
if ch.current() == "Toys" then rebuildToys() end
|
||||
end
|
||||
local function live() if win.overlay.Visible then refresh() end end
|
||||
player:GetAttributeChangedSignal("Shards"):Connect(function() if win.overlay.Visible then ch.setBalance(attr("Shards", 0)) end end)
|
||||
for _, it in Config.SHOP do
|
||||
player:GetAttributeChangedSignal("Decor_" .. it.Id):Connect(live)
|
||||
player:GetAttributeChangedSignal("Placed_" .. it.Id):Connect(live)
|
||||
end
|
||||
for id in Config.BOOSTERS do player:GetAttributeChangedSignal("Booster_" .. id):Connect(live) end
|
||||
task.spawn(function()
|
||||
local inv = player:WaitForChild("OrnamentInventory")
|
||||
local queued = false
|
||||
local function changed()
|
||||
if queued or not (win.overlay.Visible and ch.current() == "Toys") then return end
|
||||
queued = true
|
||||
task.delay(0.15, function() queued = false; rebuildToys() end)
|
||||
end
|
||||
inv.ChildAdded:Connect(changed)
|
||||
inv.ChildRemoved:Connect(changed)
|
||||
local function watchToy(c) c:GetAttributeChangedSignal("OnTree"):Connect(changed) end
|
||||
for _, c in inv:GetChildren() do watchToy(c) end
|
||||
inv.ChildAdded:Connect(watchToy)
|
||||
end)
|
||||
ch.showTab("Toys")
|
||||
return {
|
||||
open = function(tab)
|
||||
ch.setBalance(attr("Shards", 0), true)
|
||||
if tab and tab ~= ch.current() then ch.showTab(tab) else refresh() end
|
||||
end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return I
|
||||
@@ -0,0 +1,691 @@
|
||||
-- LangRU (ModuleScript, ReplicatedStorage.OrnamentMachine): English -> Russian pairs for the interface language
|
||||
-- switch (Settings -> Language -> Русский). Generated from GUI/translations_en.txt (+ Settings window strings).
|
||||
-- Keys are the exact English string pieces used in the scripts (whole texts and the pieces texts are glued from).
|
||||
return {
|
||||
{ "Common", "Обычная" },
|
||||
{ "Uncommon", "Необычная" },
|
||||
{ "Rare", "Редкая" },
|
||||
{ "Epic", "Эпическая" },
|
||||
{ "Legendary", "Легендарная" },
|
||||
{ "Mythic", "Мифическая" },
|
||||
{ "Golden", "Золотая" },
|
||||
{ "Shiny", "Сияющая" },
|
||||
{ "Fused", "Слитая" },
|
||||
{ "Luck x2", "Удача x2" },
|
||||
{ "Luck x3", "Удача x3" },
|
||||
{ "Ball", "Шар" },
|
||||
{ "Bell", "Колокольчик" },
|
||||
{ "Star", "Звезда" },
|
||||
{ "Snowflake", "Снежинка" },
|
||||
{ "Reindeer", "Олень" },
|
||||
{ "Cottage", "Домик" },
|
||||
{ "Generator Luck", "Удача генератора" },
|
||||
{ "+8% luck on every generation", "+8% к удаче каждой генерации" },
|
||||
{ "Shard Regen", "Реген осколков" },
|
||||
{ "+6 regen cap and 5% faster regen", "+6 к запасу регена и реген на 5% быстрее" },
|
||||
{ "Shredder Power", "Мощность шредера" },
|
||||
{ "+5% shards from recycling", "+5% осколков с переработки" },
|
||||
{ "Toy Storage", "Склад игрушек" },
|
||||
{ "+50 inventory slots", "+50 мест в инвентаре" },
|
||||
{ "Santa's Stall", "Лавка Санты" },
|
||||
{ "Elf Trader", "Эльф-торговец" },
|
||||
{ "Gingerbread Gnome", "Гном Пряник" },
|
||||
{ "Bob the Snowman", "Снеговик Боб" },
|
||||
{ "Snow Maiden's Stall", "Лавка Снегурочки" },
|
||||
{ "Christmas Tree", "Новогодняя ёлка" },
|
||||
{ "A tall fluffy tree. Decorate it with your ornaments.", "Высокая пушистая ёлка. Украшай её своими игрушками." },
|
||||
{ "Pull-up Bar", "Турник" },
|
||||
{ "XP for every pull-up, +1 shard per 10 in a row. Up to 60 per set, then a 10 min rest.", "Опыт за каждое подтягивание, +1 осколок за 10 подряд. До 60 за подход, потом отдых 10 мин." },
|
||||
{ "Bench Press", "Скамья со штангой" },
|
||||
{ "A press bench and a loaded barbell.", "Скамья для жима и штанга с блинами." },
|
||||
{ "Fireworks", "Салют" },
|
||||
{ "A fireworks launcher. Walk up and launch it — everyone will see the show.", "Установка салюта. Подойди и запусти — салют увидят все." },
|
||||
{ "Tree Garland", "Гирлянда на ёлку" },
|
||||
{ "Colorful lights. Wrap the tree yourself — click on it point by point.", "Разноцветные огоньки. Обвей ёлку сам — кликай по ней точка за точкой." },
|
||||
{ "Doesn't fit on the plot", "Не помещается на участке" },
|
||||
{ "Blocked by: ", "Мешает: " },
|
||||
{ "Handful of Shards", "Горсть осколков" },
|
||||
{ "Bag of Shards", "Мешок осколков" },
|
||||
{ "+25% value", "+25% выгоднее" },
|
||||
{ "Chest of Shards", "Сундук осколков" },
|
||||
{ "+50% value", "+50% выгоднее" },
|
||||
{ "Mountain of Shards", "Гора осколков" },
|
||||
{ "best value", "лучшая цена" },
|
||||
{ "3 × Luck x2", "3 × Удача x2" },
|
||||
{ "3 × Luck x3", "3 × Удача x3" },
|
||||
{ "FREE", "СВОБОДНО" },
|
||||
{ "Plot: ", "Участок: " },
|
||||
{ "The ornament was taken off the tree and is in your inventory", "Игрушка снята с ёлки и лежит в инвентаре" },
|
||||
{ "Do pull-ups", "Подтягиваться" },
|
||||
{ "Pull-ups: ", "Подтягиваний: " },
|
||||
{ " XP", " опыта" },
|
||||
{ " shard", " осколк" },
|
||||
{ "Rest after ", "Отдых после " },
|
||||
{ " pull-ups: ", " подтягиваний: ещё " },
|
||||
{ "Jump off", "Спрыгнуть" },
|
||||
{ "Pull-ups: 0 / ", "Подтягивания: 0 / " },
|
||||
{ " shard for ", " осколок за " },
|
||||
{ " pull-ups in a row!", " подтягиваний подряд!" },
|
||||
{ "Set complete: ", "Подход окончен: " },
|
||||
{ " pull-ups! The bar is available again in ", " подтягиваний! Турник снова доступен через " },
|
||||
{ " min", " мин" },
|
||||
{ "This pull-up bar belongs to ", "Это турник игрока " },
|
||||
{ "Launch fireworks", "Запустить салют" },
|
||||
{ "These fireworks belong to ", "Это салют игрока " },
|
||||
{ "Fireworks recharging: ", "Салют перезаряжается: " },
|
||||
{ "Too fast", "Слишком часто" },
|
||||
{ "Your data is still loading", "Данные ещё загружаются" },
|
||||
{ "Bought: ", "Куплено: " },
|
||||
{ "! Press “", "! Жми «" },
|
||||
{ "On Tree", "На ёлку" },
|
||||
{ "Place", "Поставить" },
|
||||
{ "Buy it in the shop first", "Сначала купи в магазине" },
|
||||
{ "You don't have a plot yet", "У тебя пока нет участка" },
|
||||
{ "Place a tree on your plot first", "Сначала поставь ёлку на участок" },
|
||||
{ "You need at least 2 points on the tree", "Нужно хотя бы 2 точки на ёлке" },
|
||||
{ "Points must be on the tree", "Точки должны быть на ёлке" },
|
||||
{ "The garland is too long", "Гирлянда слишком длинная" },
|
||||
{ " is on the tree", " висит на ёлке" },
|
||||
{ " is on your plot", " стоит на участке" },
|
||||
{ " was taken down and is in your inventory", " снята и лежит в инвентаре" },
|
||||
{ " was moved to your inventory", " убран в инвентарь" },
|
||||
{ "Ornament not found", "Игрушка не найдена" },
|
||||
{ "This ornament is already on the tree", "Эта игрушка уже на ёлке" },
|
||||
{ "Point at your tree and click to hang it", "Наведи на свою ёлку и кликни, чтобы повесить" },
|
||||
{ "Place a tree on your plot first (Inventory)", "Сначала поставь ёлку на участок (Инвентарь)" },
|
||||
{ "Get closer to the tree", "Подойди ближе к ёлке" },
|
||||
{ "Ornament is on the tree!", "Игрушка на ёлке!" },
|
||||
{ "your data is still loading", "данные ещё загружаются" },
|
||||
{ "data not loaded", "данные не загружены" },
|
||||
{ "the market unlocks at level ", "рынок открывается с " },
|
||||
{ "Market sales: +", "Продажи на рынке: +" },
|
||||
{ " shards", " осколков" },
|
||||
{ "Sold on the market: ", "Продано на рынке: " },
|
||||
{ " for ", " за " },
|
||||
{ "Listing expired, ornament returned: ", "Лот истёк, игрушка вернулась: " },
|
||||
{ "No more than ", "Не больше " },
|
||||
{ " listings at once", " лотов одновременно" },
|
||||
{ "New ornaments can be listed in ", "Новые игрушки можно выставить через " },
|
||||
{ "Price from ", "Цена от " },
|
||||
{ " to ", " до " },
|
||||
{ "The market is temporarily unavailable, try again later", "Рынок временно недоступен, попробуй позже" },
|
||||
{ "Listed: ", "Выставлено: " },
|
||||
{ "Listing not found", "Лот не найден" },
|
||||
{ "The market is temporarily unavailable", "Рынок временно недоступен" },
|
||||
{ "The listing was already sold or expired", "Лот уже продан или истёк" },
|
||||
{ "Listing removed, ornament returned", "Лот снят, игрушка вернулась" },
|
||||
{ "This is your listing", "Это твой лот" },
|
||||
{ "Not enough shards", "Не хватает осколков" },
|
||||
{ "Storage is full", "Склад полон" },
|
||||
{ "This listing was already bought, removed or changed", "Этот лот уже купили, сняли или изменили" },
|
||||
{ "The market is temporarily unavailable, shards refunded", "Рынок временно недоступен, осколки возвращены" },
|
||||
{ "Too fast, wait a second", "Слишком часто, подожди секунду" },
|
||||
{ "Market error, try again", "Ошибка рынка, попробуй ещё раз" },
|
||||
{ "Santa", "Санта" },
|
||||
{ "This machine belongs to ", "Это станок игрока " },
|
||||
{ "This machine has no owner yet", "У этого станка пока нет хозяина" },
|
||||
{ ", booster “", ", бустер «" },
|
||||
{ "Level ", "Уровень " },
|
||||
{ "New ornament in the generator pool: ", "Новая игрушка в пуле генератора: " },
|
||||
{ "The pattern needs at least ", "Для узора нужно хотя бы " },
|
||||
{ "You need at least ", "Нужно минимум " },
|
||||
{ " shards in the generator grid", " осколков в сетке генератора" },
|
||||
{ "Inventory is full: recycle extra ornaments in the shredder", "Инвентарь полон: переработай лишние игрушки в шредере" },
|
||||
{ "You got: ", "Выпала игрушка: " },
|
||||
{ " (pity)", " (гарант)" },
|
||||
{ " got: ", " выпала игрушка: " },
|
||||
{ "Open generator", "Открыть генератор" },
|
||||
{ "Generator", "Генератор" },
|
||||
{ "Open shredder", "Открыть шредер" },
|
||||
{ "Shredder", "Шредер" },
|
||||
{ "Get closer to the generator", "Подойди ближе к генератору" },
|
||||
{ "The generator is still working, wait a couple of seconds", "Генератор ещё работает, подожди пару секунд" },
|
||||
{ "New collection entry! +", "Новая запись в коллекции! +" },
|
||||
{ "The shredder is still working, wait a couple of seconds", "Шредер ещё работает, подожди пару секунд" },
|
||||
{ "Recycled: ", "Переработано: " },
|
||||
{ ": level ", ": уровень " },
|
||||
{ "You need ", "Нужно " },
|
||||
{ " identical ornaments (no special variants)", " одинаковых игрушек (без особых вариантов)" },
|
||||
{ "Not enough shards: you need ", "Не хватает осколков: нужно " },
|
||||
{ "Fusion: ", "Слияние: " },
|
||||
{ " · Fused!", " · Слитая!" },
|
||||
{ "Booster crafted: “", "Создан бустер «" },
|
||||
{ "Player not found on this server", "Игрок не найден на сервере" },
|
||||
{ "Enter a shard amount", "Укажи количество осколков" },
|
||||
{ "An admin gave you ", "Администратор выдал тебе " },
|
||||
{ "An admin took ", "Администратор забрал у тебя " },
|
||||
{ "Given ", "Выдано " },
|
||||
{ "Taken ", "Забрано " },
|
||||
{ " shards · ", " осколков · " },
|
||||
{ "Enter a level", "Укажи уровень" },
|
||||
{ "An admin set your level to ", "Администратор установил тебе уровень " },
|
||||
{ "Unknown booster", "Неизвестный бустер" },
|
||||
{ "The player has no “", "У игрока нет бустера «" },
|
||||
{ "An admin gave you a “", "Администратор выдал тебе бустер «" },
|
||||
{ "An admin took your “", "Администратор забрал бустер «" },
|
||||
{ "The tutorial will start over", "Обучение начнётся заново" },
|
||||
{ "Tutorial reset · ", "Туториал сброшен · " },
|
||||
{ " (starts now)", " (начнётся сразу)" },
|
||||
{ "Player data not loaded", "Данные игрока не загружены" },
|
||||
{ "Your progress was reset by an admin", "Твой прогресс сброшен администратором" },
|
||||
{ "Stats reset · ", "Статистика сброшена · " },
|
||||
{ "Tutorial reset for everyone: online players now, others on their next join", "Туториал сброшен всем: онлайн — сразу, остальным — при следующем входе" },
|
||||
{ "DataStore unavailable: tutorial reset only for players on this server", "DataStore недоступен: туториал сброшен только игрокам на этом сервере" },
|
||||
{ "Access denied", "Нет доступа" },
|
||||
{ "Error: ", "Ошибка: " },
|
||||
{ "trading unlocks at level ", "обмен открывается с " },
|
||||
{ "no more than ", "не больше " },
|
||||
{ " trades per hour", " обменов в час" },
|
||||
{ "wait a couple of seconds after your last trade", "подожди пару секунд после прошлого обмена" },
|
||||
{ "Trade failed: ", "Обмен не прошёл: " },
|
||||
{ " ornaments", " игрушек" },
|
||||
{ " and ", " и " },
|
||||
{ "nothing", "ничего" },
|
||||
{ "Trade complete! Received: ", "Обмен завершён! Получено: " },
|
||||
{ "You are already trading", "Ты уже в обмене" },
|
||||
{ "Trade unavailable: ", "Обмен недоступен: " },
|
||||
{ " is already trading", " уже в обмене" },
|
||||
{ " already has a pending request, wait", " уже есть запрос, подожди" },
|
||||
{ "Trade request sent: ", "Запрос на обмен отправлен: " },
|
||||
{ "The request has expired", "Запрос уже истёк" },
|
||||
{ " declined the trade", " отклонил обмен" },
|
||||
{ "The trade is no longer available", "Обмен уже недоступен" },
|
||||
{ "This ornament can't be traded yet (new ornaments need ", "Эту игрушку пока нельзя обменять (новым игрушкам нужно " },
|
||||
{ " min)", " мин)" },
|
||||
{ " cancelled the trade", " отменил обмен" },
|
||||
{ " left the game", " вышел из игры" },
|
||||
{ "Your data is still being saved on another server. Please rejoin in a minute.", "Твои данные ещё сохраняются на другом сервере. Зайди снова через минуту." },
|
||||
{ "Unknown upgrade", "Неизвестное улучшение" },
|
||||
{ "Already at max level", "Уже максимальный уровень" },
|
||||
{ "The offer is no longer valid", "Предложение больше не действительно" },
|
||||
{ ": storage would overflow", ": склад переполнится" },
|
||||
{ "No such item", "Нет такого товара" },
|
||||
{ "Already bought", "Уже куплено" },
|
||||
{ "This spot is already taken", "Это место уже занято" },
|
||||
{ "Thanks for your purchase! ", "Спасибо за покупку! " },
|
||||
{ " is yours", " уже у тебя" },
|
||||
{ "Ornament Generator", "Генератор игрушек" },
|
||||
{ "Workshop", "Мастерская" },
|
||||
{ "Trade", "Обмен" },
|
||||
{ "Finish or cancel the trade first", "Сначала заверши или отмени обмен" },
|
||||
{ "Ornament Market", "Рынок игрушек" },
|
||||
{ "Market", "Рынок" },
|
||||
{ "Shop", "Магазин" },
|
||||
{ "Premium Shop", "Премиум-магазин" },
|
||||
{ "Premium", "Премиум" },
|
||||
{ "Generator: E or click", "Генератор: E или клик" },
|
||||
{ "Inventory", "Инвентарь" },
|
||||
{ "Rotate", "Повернуть" },
|
||||
{ "Cancel", "Отмена" },
|
||||
{ "Placing: ", "Ставим: " },
|
||||
{ "No connection", "Нет связи" },
|
||||
{ "Done", "Готово" },
|
||||
{ "Failed", "Не получилось" },
|
||||
{ "Removed", "Убрано" },
|
||||
{ "Place a tree on your plot first (Inventory → Items)", "Сначала поставь ёлку на участок (Инвентарь → Предметы)" },
|
||||
{ "No free spots on the tree", "На ёлке нет свободных мест" },
|
||||
{ "Point at your tree — a glowing dot shows the spot", "Наведи на свою ёлку — светлая точка покажет место" },
|
||||
{ "Click to hang the ornament on the tree", "Кликни, чтобы повесить игрушку на ёлку" },
|
||||
{ "No connection to the market", "Нет связи с рынком" },
|
||||
{ "Buy", "Купить" },
|
||||
{ "Listings from players on all servers. The first click on “Buy” prepares the purchase, the second confirms it.", "Лоты игроков со всех серверов. Первый клик по «Купить» готовит покупку, второй — подтверждает." },
|
||||
{ "Sell", "Продать" },
|
||||
{ "Tax ", "Налог " },
|
||||
{ "% per sale. Shards arrive even if you're offline.", "% с продажи. Осколки придут, даже если тебя не будет в игре." },
|
||||
{ "My Listings", "Мои лоты" },
|
||||
{ "A listing lasts ", "Лот живёт " },
|
||||
{ " days. If it doesn't sell, the ornament comes back to you.", " дня. Не продался — игрушка вернётся к тебе сама." },
|
||||
{ "How It Works", "Как это работает" },
|
||||
{ "The market is shared by all servers — players set the prices.", "Рынок общий для всех серверов — цены назначают сами игроки." },
|
||||
{ "MARKET", "РЫНОК" },
|
||||
{ "Buy and sell ornaments\nacross all servers", "Покупай и продавай\nигрушки всех серверов" },
|
||||
{ "All ornaments", "Все игрушки" },
|
||||
{ "All rarities", "Все редкости" },
|
||||
{ "Cheapest", "Дешёвые" },
|
||||
{ "Priciest", "Дорогие" },
|
||||
{ "Newest", "Новые" },
|
||||
{ "Refresh", "Обновить" },
|
||||
{ "seller: ", "продаёт " },
|
||||
{ "Bought", "Куплено" },
|
||||
{ "Your listing", "Твой лот" },
|
||||
{ "Need ", "Нужно ещё " },
|
||||
{ "Sure? ", "Точно? " },
|
||||
{ "Bought!", "Куплено!" },
|
||||
{ "Loading…", "Загрузка…" },
|
||||
{ "showing ", "показано " },
|
||||
{ " of ", " из " },
|
||||
{ " · Studio market", " · рынок Studio" },
|
||||
{ "No matching listings", "Таких лотов нет" },
|
||||
{ "The market is empty", "Рынок пока пуст" },
|
||||
{ "Try another ornament or rarity.", "Попробуй другую игрушку или редкость." },
|
||||
{ "Nobody is selling yet — be the first to list an ornament!", "Никто ещё ничего не продаёт — выставь свою игрушку первым!" },
|
||||
{ "Reset filters", "Сбросить фильтры" },
|
||||
{ "Sell an ornament", "Продать игрушку" },
|
||||
{ "Your ornaments", "Твои игрушки" },
|
||||
{ "Pick an ornament", "Выбери игрушку" },
|
||||
{ "Click an ornament on the left, then set a price — players on all servers will see the listing.", "Нажми на игрушку слева, потом назначь цену — лот увидят игроки на всех серверах." },
|
||||
{ "Listing price", "Цена лота" },
|
||||
{ "price", "цена" },
|
||||
{ "Min", "Мин." },
|
||||
{ "You get ", "Получишь " },
|
||||
{ " after ", " после налога " },
|
||||
{ "Enter the price as a number", "Впиши цену числом" },
|
||||
{ "Listings: ", "Лотов: " },
|
||||
{ " · lasts ", " · лот живёт " },
|
||||
{ " days · visible on all servers", " дня · виден на всех серверах" },
|
||||
{ "All ", "Все " },
|
||||
{ " listing slots are used", " лотов заняты" },
|
||||
{ "Enter a price", "Укажи цену" },
|
||||
{ "Max price ", "Цена до " },
|
||||
{ "List for ", "Выставить за " },
|
||||
{ "Listed", "Выставлено" },
|
||||
{ "Listed!", "Выставлено!" },
|
||||
{ "Shredder value: ", "В шредере: " },
|
||||
{ "\nmin price: ", "\nмин. цена: " },
|
||||
{ " pcs", " шт." },
|
||||
{ " on the tree", " на ёлке" },
|
||||
{ "Nothing to sell", "Нечего продавать" },
|
||||
{ "Make ornaments in the generator. Ornaments on the tree can't be sold — take them down first.", "Создай игрушки в генераторе. Игрушки с ёлки не продаются — сначала сними их." },
|
||||
{ "Sold listings close on their own — shards arrive automatically", "Проданные лоты закрываются сами — осколки приходят автоматически" },
|
||||
{ "You haven't listed anything yet", "Ты ещё ничего не выставил" },
|
||||
{ "List an ornament and players on all servers will see it.", "Выставь игрушку — и её увидят игроки на всех серверах." },
|
||||
{ "left: ", "осталось " },
|
||||
{ "Ornament returned", "Игрушка вернулась" },
|
||||
{ "Remove listing", "Снять с продажи" },
|
||||
{ "Listings from players on all servers. Filter by ornament and rarity. The first click on “Buy” prepares the purchase, the second confirms it.", "Здесь лоты игроков со всех серверов. Фильтруй по игрушке и редкости. Первый клик по «Купить» готовит покупку, второй — подтверждает." },
|
||||
{ "Pick an ornament and set a price — no lower than its shredder value. New ornaments can be listed ", "Выбери игрушку и назначь цену — не ниже её ценности в шредере. Новые игрушки можно выставить через " },
|
||||
{ " min after they are made.", " мин после создания." },
|
||||
{ "% per sale. A listing lasts ", "% с продажи. Лот живёт " },
|
||||
{ " days, then the ornament comes back. Shards arrive even if you're offline. Up to ", " дня, потом игрушка вернётся. Осколки придут, даже если тебя нет в игре. До " },
|
||||
{ " listings at once.", " лотов сразу." },
|
||||
{ "Open", "Открыть" },
|
||||
{ "🔒 Buying and selling unlocks at level ", "🔒 Покупать и продавать можно с " },
|
||||
{ " — you can browse right now.", "-го уровня — смотреть можно уже сейчас." },
|
||||
{ "Players", "Игроки" },
|
||||
{ "Trading unlocks at level ", "Обмен открывается с " },
|
||||
{ " for both players.", "-го уровня у обоих игроков." },
|
||||
{ "Deal", "Сделка" },
|
||||
{ "Any change clears “Ready” for both players — so nobody can swap an ornament at the last moment.", "Любое изменение снимает «Готов» у обоих — так никто не подменит игрушку в последний момент." },
|
||||
{ "% applies only to shards sent; ornaments are tax-free.", "% берётся только с переданных осколков, игрушки идут без налога." },
|
||||
{ "TRADE", "ОБМЕН" },
|
||||
{ "Trade ornaments\nwith players on this server", "Меняйся игрушками\nс игроками сервера" },
|
||||
{ "confirmed", "подтвердил" },
|
||||
{ "ready", "готов" },
|
||||
{ "not ready", "не готов" },
|
||||
{ " · level ", " · уровень " },
|
||||
{ "Request sent: ", "Запрос отправлен: " },
|
||||
{ "Request sent", "Запрос отправлен" },
|
||||
{ "Player is level ", "У игрока ур. " },
|
||||
{ "Offer a trade", "Предложить обмен" },
|
||||
{ "Nobody else is on this server", "На сервере больше никого нет" },
|
||||
{ "Invite a friend — trading works between players on the same server.", "Позови друга — обмен работает между игроками на одном сервере." },
|
||||
{ "No active trade", "Сейчас нет обмена" },
|
||||
{ "Pick a player in the “Players” tab and offer a trade — or accept someone's request.", "Выбери игрока во вкладке «Игроки» и предложи обмен — или прими чужой запрос." },
|
||||
{ "Pick a player", "Выбрать игрока" },
|
||||
{ "You give", "Ты отдаёшь" },
|
||||
{ "Click one of your ornaments below to put it here", "Нажми на свою игрушку внизу, чтобы положить её сюда" },
|
||||
{ "Shards", "Осколки" },
|
||||
{ "Set", "Задать" },
|
||||
{ "Your ornaments — click to add", "Твои игрушки — нажми, чтобы добавить" },
|
||||
{ "Nothing added yet", "Пока ничего не положил" },
|
||||
{ "Confirm in ", "Подтверждение через " },
|
||||
{ "Waiting for ", "Ждём, пока " },
|
||||
{ " to confirm", " подтвердит" },
|
||||
{ "All set — confirm!", "Всё готово — подтверждай!" },
|
||||
{ " to press “Ready”", " нажмёт «Готов»" },
|
||||
{ "Check both offers and press “Ready”", "Проверь предложения и нажми «Готов»" },
|
||||
{ "value ", "ценность " },
|
||||
{ " gives", " отдаёт" },
|
||||
{ "NEW", "НОВОЕ" },
|
||||
{ "arrives: ", "дойдёт " },
|
||||
{ "% · you have ", "% · у тебя " },
|
||||
{ "you have ", "у тебя " },
|
||||
{ " shards to you (after tax)", " осколков тебе (после налога)" },
|
||||
{ "offers no shards", "осколков не предлагает" },
|
||||
{ "New ornaments can be traded in ", "Новые игрушки можно обменять через " },
|
||||
{ " ornaments per trade", " игрушек в обмене" },
|
||||
{ "Warning: you're giving much more than you get!", "Внимание: ты отдаёшь намного больше, чем получаешь!" },
|
||||
{ "You're getting much more — make sure it's fair.", "Ты получаешь намного больше — проверь, что всё честно." },
|
||||
{ "Ready", "Готов" },
|
||||
{ "Not ready", "Не готов" },
|
||||
{ "Confirmed", "Подтверждено" },
|
||||
{ "Confirm", "Подтвердить" },
|
||||
{ "In ", "Через " },
|
||||
{ "Press “Ready” first", "Сначала «Готов»" },
|
||||
{ "1. Invite", "1. Пригласи" },
|
||||
{ "Pick a player and offer a trade. Both need level ", "Выбери игрока и предложи обмен. Нужен " },
|
||||
{ ". New ornaments can be traded ", "-й уровень у обоих. Новые игрушки можно обменять через " },
|
||||
{ "2. Add", "2. Положи" },
|
||||
{ "Up to ", "До " },
|
||||
{ " ornaments and shards (tax ", " игрушек и осколки (налог " },
|
||||
{ "%). Click your ornament to add it, click an added one to remove it.", "%). Нажми на свою игрушку, чтобы добавить, и на добавленную — чтобы убрать." },
|
||||
{ "3. Confirm", "3. Подтверди" },
|
||||
{ "Both press “Ready”, then after ", "Оба жмут «Готов», через " },
|
||||
{ "s — “Confirm”. Any change clears “Ready” for both.", " с — «Подтвердить». Любое изменение снимает готовность у обоих." },
|
||||
{ "🔒 Trading unlocks at level ", "🔒 Обмен откроется с " },
|
||||
{ " — you are level ", "-го уровня — сейчас у тебя " },
|
||||
{ "Accept", "Принять" },
|
||||
{ "Decline", "Отклонить" },
|
||||
{ " (lvl ", " (ур. " },
|
||||
{ ") wants to trade", ") предлагает обмен" },
|
||||
{ "Ornaments", "Игрушки" },
|
||||
{ "“Hold” it, then click a glowing dot on your tree to hang the ornament.", "«В руку» — и кликни по светлой точке на своей ёлке, чтобы повесить игрушку." },
|
||||
{ "Items", "Предметы" },
|
||||
{ "“Place”: click to place, R to rotate, Esc to cancel.", "«Поставить»: клик — поставить, R — повернуть, Esc — отмена." },
|
||||
{ "Boosters", "Бустеры" },
|
||||
{ "Put boosters in the generator slot before making an ornament.", "Бустеры кладут в слот генератора перед созданием игрушки." },
|
||||
{ "Everything in your inventory is saved with your progress.", "Всё, что лежит в инвентаре, сохраняется вместе с прогрессом." },
|
||||
{ "INVENTORY", "ИНВЕНТАРЬ" },
|
||||
{ "Your ornaments, items\nand boosters", "Твои игрушки, предметы\nи бустеры" },
|
||||
{ "All", "Все" },
|
||||
{ "In inventory", "В инвентаре" },
|
||||
{ "On the tree", "На ёлке" },
|
||||
{ " pcs · on the tree: ", " шт. · на ёлке: " },
|
||||
{ " · storage: ", " · склад: " },
|
||||
{ "The tree is empty", "На ёлке пока пусто" },
|
||||
{ "No ornaments yet", "Игрушек пока нет" },
|
||||
{ "Hold an ornament and click a glowing dot on the tree.", "Возьми игрушку в руку и кликни по светлой точке на ёлке." },
|
||||
{ "Make ornaments in the generator — they'll show up here.", "Создай игрушки в генераторе — они появятся здесь." },
|
||||
{ "on the tree", "висит на ёлке" },
|
||||
{ "in inventory · ", "в инвентаре · " },
|
||||
{ "Taken down!", "Снята!" },
|
||||
{ "Take down", "Снять с ёлки" },
|
||||
{ "Hold", "В руку" },
|
||||
{ "…and ", "…и ещё " },
|
||||
{ "not bought yet", "ещё не куплено" },
|
||||
{ "Shop price: ", "Цена в магазине: " },
|
||||
{ " shards.", " осколков." },
|
||||
{ "To Shop", "В магазин" },
|
||||
{ "You can rewrap the tree or take the garland down.", "Можно обвить ёлку заново или снять гирлянду." },
|
||||
{ "Rehang", "Перевесить" },
|
||||
{ "in inventory", "лежит в инвентаре" },
|
||||
{ "Click the tree point by point — the garland follows your path.", "Кликай по ёлке точка за точкой — гирлянда пойдёт, как ты её проведёшь." },
|
||||
{ "Wrap the tree", "Обвить ёлку" },
|
||||
{ "on your plot", "стоит на участке" },
|
||||
{ "You can move it or put it back in your inventory.", "Можно передвинуть или убрать обратно в инвентарь." },
|
||||
{ "Move", "Переставить" },
|
||||
{ "Store", "Убрать" },
|
||||
{ "Pick a spot on your plot.", "Выбери место на своём участке." },
|
||||
{ "put it in the generator slot — one generation gets luck x", "положи в слот генератора — удача одной генерации x" },
|
||||
{ "Craft more", "Создать ещё" },
|
||||
{ "For Robux", "За Robux" },
|
||||
{ "“Hold” puts the ornament in your hand. Walk up to your tree and click a glowing dot to hang it.", "«В руку» — игрушка окажется у тебя в руке. Подойди к своей ёлке и кликни по светлой точке, чтобы повесить." },
|
||||
{ "Things you buy in the shop go on your plot. Click to place, R to rotate, Esc to cancel.", "Купленное в магазине ставится на твой участок. Клик — поставить, R — повернуть, Esc — отмена." },
|
||||
{ "Boosters are crafted in the Workshop or bought for Robux. Put a booster in the generator slot.", "Бустеры создаются в мастерской или покупаются за Robux. Положи бустер в слот генератора." },
|
||||
{ "Create", "Создать" },
|
||||
{ "If your shard pattern looks like an ornament, you're more likely to get that one.", "Узор из осколков похож на игрушку — шанс получить именно её выше." },
|
||||
{ "Odds", "Шансы" },
|
||||
{ "More shards and a booster mean more luck and better odds for rare ornaments.", "Больше осколков и бустер — выше удача и шанс редких игрушек." },
|
||||
{ "Pity: a rare ornament is guaranteed within the shown number of tries.", "Гарант: редкая игрушка выпадет не позже, чем через указанное число попыток." },
|
||||
{ "GENERATOR", "ГЕНЕРАТОР" },
|
||||
{ "Make ornaments\nfrom shards", "Создавай игрушки\nиз осколков" },
|
||||
{ "Shard pattern", "Узор из осколков" },
|
||||
{ "No shards — they build up over time", "Нет осколков — они копятся сами со временем" },
|
||||
{ "Click a cell to add or remove a shard", "Клик по клетке — положить или убрать осколок" },
|
||||
{ "Booster", "Бустер" },
|
||||
{ "No “", "Бустеров «" },
|
||||
{ "” boosters — craft them in the Workshop", "» нет — создай их в Мастерской" },
|
||||
{ "Go to your generator", "Подойди к своему генератору" },
|
||||
{ "Possible drops", "Что выпадет" },
|
||||
{ "Rarity odds", "Шанс редкости" },
|
||||
{ "Pity — protection from bad luck", "Гарант — защита от неудачи" },
|
||||
{ "Every generation without the rarity fills the pity bar. When it's full, a rare ornament is guaranteed.", "Каждая генерация без нужной редкости приближает гарант. Когда шкала заполнится — редкая игрушка выпадет точно." },
|
||||
{ " or better", " или лучше" },
|
||||
{ "1. Pattern", "1. Узор" },
|
||||
{ "To Grid", "К сетке" },
|
||||
{ "Put ", "Положи в сетку от " },
|
||||
{ " shards in the grid. More shards mean more luck. A pattern that looks like an ornament raises the odds for that one.", " осколков. Чем больше — тем выше удача. Узор, похожий на игрушку, повышает шанс именно её." },
|
||||
{ "2. Booster", "2. Бустер" },
|
||||
{ "A booster in the slot multiplies the luck of one generation. Boosters are crafted in the Workshop or bought in Premium.", "Бустер в слоте умножает удачу одной генерации. Бустеры создаются в Мастерской или покупаются в Премиуме." },
|
||||
{ "3. Create", "3. Создай" },
|
||||
{ "Press “Create” — the shards go into the machine, and an ornament appears a couple of seconds later. Pity makes sure you won't go long without rares.", "Нажми «Создать» — осколки уйдут в станок, а через пару секунд появится игрушка. Гарант не даст долго оставаться без редких." },
|
||||
{ "Shards in: ", "Вложено: " },
|
||||
{ " in the slot.\nClick the circle to remove it.", " в слоте.\nНажми на круг, чтобы снять." },
|
||||
{ "Pick a booster below — it boosts one generation.", "Выбери бустер ниже — он усилит одну генерацию." },
|
||||
{ "Put shards in the grid", "Положи осколки в сетку" },
|
||||
{ "min ", "минимум " },
|
||||
{ ", max ", ", максимум " },
|
||||
{ "Luck x%.2f", "Удача x%.2f" },
|
||||
{ "legendary or better: ", "легендарная или лучше: " },
|
||||
{ "Add ", "Добавь ещё " },
|
||||
{ "Create · ", "Создать · " },
|
||||
{ "Auto Pattern", "Автоузор" },
|
||||
{ "Clear", "Очистить" },
|
||||
{ "🔒 lvl ", "🔒 ур. " },
|
||||
{ "exact pattern", "узор точный" },
|
||||
{ "pattern %d%%", "узор %d%%" },
|
||||
{ "luck x%.2f", "удача x%.2f" },
|
||||
{ "luck x1 (no shards)", "удача x1 (без осколков)" },
|
||||
{ "at most in ", "максимум через " },
|
||||
{ "Upgrades", "Улучшения" },
|
||||
{ "Tip: “Generator Luck” pays off fastest — it works on every generation.", "Совет: «Удача генератора» окупается быстрее всего — она работает в каждой генерации." },
|
||||
{ "Fusion", "Слияние" },
|
||||
{ " identical ornaments + shards = 1 “Fused” ornament one rarity higher — worth more than you put in.", " одинаковых игрушек + осколки = 1 «Слитая» игрушка на редкость выше — она дороже вложенного." },
|
||||
{ "A booster goes in the generator slot and is used up when you make an ornament. Best with 16 shards.", "Бустер кладут в слот генератора: он тратится при создании игрушки. Лучше всего — на 16 осколков." },
|
||||
{ "The Workshop is always open — the “Workshop” button on the left of the screen.", "Мастерская открыта всегда — кнопка «Мастерская» слева на экране." },
|
||||
{ "WORKSHOP", "МАСТЕРСКАЯ" },
|
||||
{ "Upgrade the generator,\nfuse and craft", "Улучшай генератор,\nсливай и создавай" },
|
||||
{ "cap %d · +1 per %.1fs", "запас %d · +1 за %.1f с" },
|
||||
{ "recycling x%.2f", "переработка x%.2f" },
|
||||
{ " slots", " мест" },
|
||||
{ "one generation luck x", "удача одной генерации x" },
|
||||
{ "Nothing to fuse yet", "Пока нечего сливать" },
|
||||
{ "Collect ", "Собери " },
|
||||
{ " identical ornaments of one rarity in the generator — then fuse them into a rarer one.", " одинаковых игрушек одной редкости в генераторе — и сливай их в более редкую." },
|
||||
{ " · Fused", " · Слитая" },
|
||||
{ "have ", "есть " },
|
||||
{ " · ready to fuse!", " · можно слить!" },
|
||||
{ " · need ", " · нужно ещё " },
|
||||
{ " · costs ", " · стоит " },
|
||||
{ " (put in ", " (вложено " },
|
||||
{ "Fuse", "Слить" },
|
||||
{ "Always active, even away from the machine. Luck — rarer ornaments, regen — more free shards, shredder — more shards from recycling, storage — more slots.", "Работают всегда, даже вдали от станка. Удача — более редкие игрушки, реген — больше бесплатных осколков, шредер — больше осколков с переработки, склад — больше мест." },
|
||||
{ " identical ornaments of one rarity + some shards = 1 “Fused” ornament one rarity higher. It's worth more than you put in, but it can't be fused again.", " одинаковых игрушек одной редкости + немного осколков = 1 «Слитая» игрушка на редкость выше. Она стоит больше вложенного, но слить её ещё раз нельзя." },
|
||||
{ "Craft a booster with shards and put it in the generator slot. It multiplies the luck of one generation and is used up when you make an ornament.", "Создай бустер за осколки и положи его в слот генератора. Он умножит удачу одной генерации и потратится при создании игрушки." },
|
||||
{ "Lvl ", "ур. " },
|
||||
{ "Upgrade", "Улучшить" },
|
||||
{ " · max", " · предел" },
|
||||
{ "Maxed", "Максимум" },
|
||||
{ "you have: ", "у тебя: " },
|
||||
{ "+1 level!", "+1 уровень!" },
|
||||
{ "+1 booster!", "+1 бустер!" },
|
||||
{ "✨ Set complete: %d × %s · %s!\nClick to fuse into “%s · Fused”", "✨ Набор собран: %d × %s · %s!\nНажми — слить в «%s · Слитая»" },
|
||||
{ "Recycle", "Переработка" },
|
||||
{ "+ identical ornaments at once — bonus +", "+ одинаковых игрушек за раз — бонус +" },
|
||||
{ "% shards.", "% осколков." },
|
||||
{ "Value", "Ценность" },
|
||||
{ "Special ornaments (golden, shiny) are worth several times more.", "Особые игрушки (золотые, сияющие) стоят в несколько раз дороже." },
|
||||
{ "The shredder doesn't touch ornaments on the tree — take them down first.", "Игрушки на ёлке шредер не трогает — сначала сними их." },
|
||||
{ "SHREDDER", "ШРЕДЕР" },
|
||||
{ "Turn extra ornaments\ninto shards", "Лишние игрушки —\nв осколки" },
|
||||
{ "Make them in the generator and bring extras here.", "Создай их в генераторе, а лишние приноси сюда." },
|
||||
{ "Selected", "Выбрано" },
|
||||
{ "You get", "Получишь" },
|
||||
{ "Go to your shredder", "Подойди к своему шредеру" },
|
||||
{ "You can recycle up to ", "За раз можно до " },
|
||||
{ "Shards per ornament", "Осколков за игрушку" },
|
||||
{ "by rarity, before variant and ornament multipliers", "по редкости, до множителей вида и игрушки" },
|
||||
{ "Multipliers", "Множители" },
|
||||
{ " ornament", " игрушка" },
|
||||
{ "+ identical at once", "+ одинаковых за раз" },
|
||||
{ "Shredder upgrade", "Улучшение шредера" },
|
||||
{ "1. Select", "1. Выбери" },
|
||||
{ "To Ornaments", "К игрушкам" },
|
||||
{ "Click ornaments or use “Select all” / “Common”. Up to ", "Нажимай на игрушки или используй «Выбрать всё» / «Обычные». За раз — до " },
|
||||
{ " ornaments at once.", " игрушек." },
|
||||
{ "2. Recycle", "2. Переработай" },
|
||||
{ "Ornaments turn into shards. For rare and special ones the shredder asks to confirm — so you won't lose them by accident.", "Игрушки превращаются в осколки. Для редких и особых шредер спросит подтверждение — случайно не потеряешь." },
|
||||
{ "3. Upgrade", "3. Улучши" },
|
||||
{ "The shredder upgrade in the Workshop gives more shards from every ornament.", "Улучшение шредера в Мастерской даёт больше осколков с каждой игрушки." },
|
||||
{ "that's the max at once (", "это максимум за раз (" },
|
||||
{ "Bonus +", "Бонус +" },
|
||||
{ "% for a batch: ", "% за пачку: " },
|
||||
{ "Click ornaments on the left to select them", "Нажимай на игрушки слева, чтобы выбрать" },
|
||||
{ "Your selection has legendary, mythic or special ornaments!", "В выборе есть легендарные, мифические или особые игрушки!" },
|
||||
{ "Select all", "Выбрать всё" },
|
||||
{ "Deselect", "Снять выбор" },
|
||||
{ "Select ornaments", "Выбери игрушки" },
|
||||
{ "Shredder working", "Шредер работает" },
|
||||
{ "Sure? Click again", "Точно? Нажми ещё раз" },
|
||||
{ "Recycle · ", "Переработать · " },
|
||||
{ "Decorate it with your ornaments", "Украшай её своими игрушками" },
|
||||
{ "XP, +1 shard per 10 in a row, up to 60 per set", "Опыт, +1 осколок за 10 подряд, до 60 за подход" },
|
||||
{ "A workout corner", "Уголок для тренировок" },
|
||||
{ "The whole server sees the show", "Салют увидит весь сервер" },
|
||||
{ "Wrap your tree in lights", "Обвей ёлку огоньками" },
|
||||
{ "All items", "Все товары" },
|
||||
{ "Purchases appear on your plot and stay forever.", "Покупки появляются на твоём участке и остаются навсегда." },
|
||||
{ "Decorations", "Украшения" },
|
||||
{ "The tree is the main decoration: you hang generator ornaments on it.", "Ёлка — главное украшение: на неё вешаются игрушки из генератора." },
|
||||
{ "Activities", "Развлечения" },
|
||||
{ "Workout gear gives XP — that unlocks the market and trading faster.", "Тренажёры дают опыт — так быстрее открываются рынок и обмен." },
|
||||
{ "You can move bought items or store them in your inventory any time.", "Купленное можно переставлять и убирать в инвентарь сколько угодно." },
|
||||
{ "SHOP", "МАГАЗИН" },
|
||||
{ "Decorations and activities\nfor your plot", "Украшения и развлечения\nдля твоего участка" },
|
||||
{ "No connection to the shop", "Нет связи с магазином" },
|
||||
{ "To Items", "К товарам" },
|
||||
{ "Everything costs shards. You buy each item once — it's yours forever.", "Всё оплачивается осколками. Каждую вещь покупаешь один раз — она твоя навсегда." },
|
||||
{ "Place on your plot", "Ставь на участок" },
|
||||
{ "Bought items are in your inventory. “Place” — pick a spot: click places, R rotates, Esc cancels.", "Купленное лежит в инвентаре. «Поставить» — выбери место: клик ставит, R поворачивает, Esc отменяет." },
|
||||
{ "Decorate the tree", "Наряжай ёлку" },
|
||||
{ "My Ornaments", "Мои игрушки" },
|
||||
{ "Place a tree, hold an ornament from your inventory and click a glowing dot on the tree.", "Поставь ёлку, возьми игрушку в руку через инвентарь и кликни по светлой точке на ёлке." },
|
||||
{ "bought · in inventory", "куплено · лежит в инвентаре" },
|
||||
{ "available", "можно купить" },
|
||||
{ "not enough shards", "не хватает осколков" },
|
||||
{ "The bigger the pack, the better the value per shard.", "Чем больше набор, тем выгоднее каждый осколок." },
|
||||
{ "A booster goes in the generator slot — it multiplies the luck of one generation.", "Бустер кладут в слот генератора — он умножает удачу одной генерации." },
|
||||
{ "Robux purchase: Roblox shows its own confirmation window.", "Покупка за Robux: Roblox сам покажет окно подтверждения." },
|
||||
{ "PREMIUM", "ПРЕМИУМ" },
|
||||
{ "Shards and boosters\nfor Robux", "Осколки и бустеры\nза Robux" },
|
||||
{ "Soon", "Скоро" },
|
||||
{ "shards · ", "осколков · на " },
|
||||
{ "% more per R$", "% больше за R$" },
|
||||
{ "shards", "осколков" },
|
||||
{ " boosters · one generation luck x", " бустера · удача одной генерации x" },
|
||||
{ "Safe", "Безопасно" },
|
||||
{ "To Shards", "К осколкам" },
|
||||
{ "Payment goes through Roblox: it shows its own confirmation window before charging Robux.", "Оплата идёт через Roblox: перед списанием Robux он сам покажет окно подтверждения." },
|
||||
{ "Instant", "Сразу" },
|
||||
{ "Shards and boosters arrive instantly and are saved with your progress.", "Осколки и бустеры приходят мгновенно и сохраняются вместе с прогрессом." },
|
||||
{ "To Boosters", "К бустерам" },
|
||||
{ "A booster goes in the generator slot. It multiplies the luck of one generation and is used up when you make an ornament.", "Бустер кладут в слот генератора. Он умножает удачу одной генерации и тратится при создании игрушки." },
|
||||
{ " boosters", " бустера" },
|
||||
{ "Back", "Назад" },
|
||||
{ "Click the tree: the first point starts the garland", "Кликай по ёлке: первая точка — начало гирлянды" },
|
||||
{ "Keep clicking — the garland follows your cursor", "Кликай дальше — гирлянда пойдёт за курсором" },
|
||||
{ "Points %d · length %d / %d. Done — Enter, undo — Backspace", "Точек %d · длина %d / %d. Готово — Enter, назад — Backspace" },
|
||||
{ "No more points — press “Done”", "Больше точек нельзя — нажми «Готово»" },
|
||||
{ "Out of wire — press “Done” or remove a point", "Провод закончился — нажми «Готово» или убери точку" },
|
||||
{ "Place at least 2 points on the tree", "Поставь хотя бы 2 точки на ёлке" },
|
||||
{ "Click on your tree", "Кликай по своей ёлке" },
|
||||
{ "Level 1", "Уровень 1" },
|
||||
{ "You get XP from generating, fusing and workout gear. New levels unlock ornaments, the market and trading.", "Опыт дают генерация, слияние и тренажёры. Новые уровни открывают игрушки, рынок и обмен." },
|
||||
{ "Shards build up on their own: +1 every %ds while you have fewer than %d. Get more by recycling ornaments in the shredder.", "Осколки копятся сами: +1 каждые %d с, пока их меньше %d. Больше — переработкой игрушек в шредере." },
|
||||
{ "max", "максимум" },
|
||||
{ "Level up!", "Новый уровень!" },
|
||||
{ "regen paused: more than ", "реген на паузе: больше " },
|
||||
{ "cap full · ", "запас полон · " },
|
||||
{ "+1 in %d:%02d · up to %d", "+1 через %d:%02d · до %d" },
|
||||
{ "Shards in: %d / 16", "Вложено: %d / 16" },
|
||||
{ "Generator working…", "Генератор работает…" },
|
||||
{ " selected\nClick the slot to remove it.", " выбран\nНажми на слот, чтобы снять." },
|
||||
{ "Pick a booster below.\nIt boosts one generation.", "Выбери бустер ниже.\nОн усилит одну генерацию." },
|
||||
{ "press the “Open” button at the machine", "нажми на кнопку «Открыть» у станка" },
|
||||
{ "press E", "нажми E" },
|
||||
{ "Skip tutorial", "Пропустить обучение" },
|
||||
{ "TUTORIAL · step ", "ОБУЧЕНИЕ · шаг " },
|
||||
{ "TUTORIAL", "ОБУЧЕНИЕ" },
|
||||
{ "Next", "Дальше" },
|
||||
{ "<font size=\"32\" color=\"#FFCD46\"><b>Hi there! 🎄</b></font>\nHere you make Christmas ornaments from magic shards, collect rare ones and decorate your plot.\n\nLet me show you how it all works — it only takes a couple of minutes.", "<font size=\"32\" color=\"#FFCD46\"><b>Привет! 🎄</b></font>\nЗдесь ты создаёшь ёлочные игрушки из волшебных осколков, собираешь редкие и украшаешь свой участок.\n\nДавай я покажу, как всё устроено — это займёт пару минут." },
|
||||
{ "Let's go!", "Поехали!" },
|
||||
{ "Skip", "Пропустить" },
|
||||
{ "These are your <font color=\"#9FE0FF\"><b>shards 💎</b></font> — the main currency of the game.\nThe generator turns them into ornaments, and you spend them in the shop.\n\nWhile you're low on shards, they build up on their own — the bar under the number shows when the next one arrives.", "Это твои <font color=\"#9FE0FF\"><b>осколки 💎</b></font> — главная валюта игры.\nИз них генератор создаёт игрушки, за них покупаются вещи в магазине.\n\nПока осколков мало, они копятся сами — полоска под числом показывает, когда придёт следующий." },
|
||||
{ "And this is your <font color=\"#FFCD46\"><b>level</b></font>. You get XP from generating, fusing and workout gear.\nNew levels unlock new ornaments, the market and trading.", "А это твой <font color=\"#FFCD46\"><b>уровень</b></font>. Опыт дают генерация, слияние и тренажёры.\nНовые уровни открывают новые игрушки, рынок и обмен." },
|
||||
{ "Right now we need the generator — close this window.", "Сейчас нам нужен генератор — закрой это окно." },
|
||||
{ "You're at the generator! Now ", "Ты у генератора! Теперь " },
|
||||
{ "\n(or just click the generator itself)", "\n(или просто нажми на сам генератор)" },
|
||||
{ "Go to your <font color=\"#FFCD46\"><b>generator</b></font> — follow the glowing arrows on the ground", "Иди к своему <font color=\"#FFCD46\"><b>генератору</b></font> — по светящимся стрелкам на земле" },
|
||||
{ "Open the “Create” tab.", "Открой вкладку «Создать»." },
|
||||
{ "This is the <b>pattern grid</b>. Each cell is one shard.\nTo make an ornament, put in at least <font color=\"#FFCD46\"><b>", "Это <b>сетка узора</b>. Каждая клетка — один осколок.\nЧтобы создать игрушку, нужно положить минимум <font color=\"#FFCD46\"><b>" },
|
||||
{ "</b></font> shards. More shards mean more luck!", "</b></font> осколков. Больше осколков — выше удача!" },
|
||||
{ "Here you can see <b>which ornaments can drop</b> and their odds.\nIf the pattern looks like an ornament, the odds for that one go up.", "Здесь видно, <b>какие игрушки могут выпасть</b> и с каким шансом.\nЕсли узор похож на игрушку — шанс получить именно её растёт." },
|
||||
{ "<b>Boosters</b> multiply the luck of one generation. They're crafted in the Workshop — you can skip them for now.", "<b>Бустеры</b> умножают удачу одной генерации. Их создают в Мастерской — пока можно без них." },
|
||||
{ "The easiest way — press <font color=\"#9FE0FF\"><b>“Auto Pattern”</b></font>: the generator lays out the best pattern for you.", "Самый простой способ — нажми <font color=\"#9FE0FF\"><b>«Автоузор»</b></font>: генератор сам выложит лучший узор." },
|
||||
{ "Great, the pattern is ready! Now press <font color=\"#FFCD46\"><b>“Create”</b></font> ✨", "Отлично, узор готов! Теперь нажми <font color=\"#FFCD46\"><b>«Создать»</b></font> ✨" },
|
||||
{ "Look — the generator is making an ornament! ✨", "Смотри — генератор создаёт игрушку! ✨" },
|
||||
{ "<font size=\"32\" color=\"#FFCD46\"><b>Hooray, your first ornament! 🎉</b></font>\n<b>", "<font size=\"32\" color=\"#FFCD46\"><b>Ура, твоя первая игрушка! 🎉</b></font>\n<b>" },
|
||||
{ "Ornament", "Игрушка" },
|
||||
{ "</b></font>\n\nAll ornaments are kept in your <b>Inventory</b> — you can hang them on your tree, sell them on the market or trade them.\nExtras turn back into shards in the <b>shredder</b>. Come on, I'll show you!", "</b></font>\n\nВсе игрушки хранятся в <b>Инвентаре</b> — их можно повесить на ёлку, продать на рынке или обменять.\nА лишние превращаются обратно в осколки в <b>шредере</b>. Пойдём, покажу!" },
|
||||
{ "Let's go", "Пойдём" },
|
||||
{ "Now we need the shredder — close this window.", "Сейчас нам нужен шредер — закрой это окно." },
|
||||
{ "You're at the shredder! Now ", "Ты у шредера! Теперь " },
|
||||
{ "\n(or click the shredder itself)", "\n(или нажми на сам шредер)" },
|
||||
{ "Now go to the <font color=\"#7CF0A0\"><b>shredder</b></font> — it's the other half of the machine", "Теперь иди к <font color=\"#7CF0A0\"><b>шредеру</b></font> — это вторая половина станка" },
|
||||
{ "Open the “Recycle” tab.", "Открой вкладку «Переработка»." },
|
||||
{ "Here are all your ornaments. The shredder turns them back into <font color=\"#9FE0FF\"><b>shards</b></font>.\nRare ornaments give more shards.", "Здесь все твои игрушки. Шредер превращает их обратно в <font color=\"#9FE0FF\"><b>осколки</b></font>.\nРедкие игрушки дают больше осколков." },
|
||||
{ "Click an ornament to <b>select</b> it.", "Нажми на игрушку, чтобы <b>выбрать</b> её." },
|
||||
{ "On the right you can see how many shards you'll get.\n\nPress <font color=\"#FFCD46\"><b>“Recycle”</b></font>!", "Справа видно, сколько осколков ты получишь.\n\nНажми <font color=\"#FFCD46\"><b>«Переработать»</b></font>!" },
|
||||
{ "The shredder is recycling the ornament… ♻️", "Шредер перерабатывает игрушку… ♻️" },
|
||||
{ " shards</b></font> are back in your balance! 💎\n", " осколков</b></font> вернулись на баланс! 💎\n" },
|
||||
{ "That's the game loop: make ornaments, keep the best ones and recycle the extras into shards for new tries.", "Так и устроена игра: создаёшь игрушки, оставляешь лучшие, а лишние перерабатываешь в осколки для новых попыток." },
|
||||
{ "Close this window.", "Закрой это окно." },
|
||||
{ "One last thing — the <font color=\"#FF8A8A\"><b>Shop</b></font>. Press the shop button.", "Последнее — <font color=\"#FF8A8A\"><b>Магазин</b></font>. Нажми на кнопку магазина." },
|
||||
{ "Here you spend shards on <b>decorations for your plot</b>: a tree, garlands, workout gear and more.\nPlace what you buy with the “Place” button, and hang ornaments from your inventory on your tree 🎄", "За осколки здесь покупаются <b>украшения для участка</b>: ёлка, гирлянды, тренажёры и другое.\nКупленное ставится на участок кнопкой «Поставить», а игрушки из инвентаря можно повесить на свою ёлку 🎄" },
|
||||
{ "Close the shop and start playing!", "Закрой магазин — и можно играть!" },
|
||||
{ "<font size=\"32\" color=\"#FFCD46\"><b>Tutorial complete! ⭐</b></font>\nNow you know the basics. Generate ornaments, collect rare ones, upgrade your machine in the <b>Workshop</b> and decorate your tree.\n\nGood luck and Happy New Year! 🎄", "<font size=\"32\" color=\"#FFCD46\"><b>Обучение пройдено! ⭐</b></font>\nТеперь ты знаешь главное. Генерируй игрушки, собирай редкие, улучшай станок в <b>Мастерской</b> и украшай свою ёлку.\n\nУдачи и с Новым годом! 🎄" },
|
||||
{ "Play!", "Играть!" },
|
||||
{ "🛠 Admin", "🛠 Админ" },
|
||||
{ "🛠 Admin Panel", "🛠 Админ-панель" },
|
||||
{ "Players on server", "Игроки на сервере" },
|
||||
{ "amount", "сколько" },
|
||||
{ "No response from server", "Нет ответа сервера" },
|
||||
{ "Give", "Выдать" },
|
||||
{ "Take", "Забрать" },
|
||||
{ "Level", "Уровень" },
|
||||
{ "Enter a level from 1 to ", "Впиши уровень от 1 до " },
|
||||
{ "Reset", "Сброс" },
|
||||
{ "Reset tutorial", "Сбросить туториал" },
|
||||
{ "Reset stats", "Сбросить статистику" },
|
||||
{ "Stats: level, shards, ornaments, upgrades, boosters, plot decorations, market listings. Robux purchases are kept.", "Статистика: уровень, осколки, игрушки, улучшения, бустеры, украшения участка, лоты на рынке. Покупки за Robux остаются." },
|
||||
{ "For all players", "Для всех игроков" },
|
||||
{ "Reset tutorial for EVERYONE", "Сбросить туториал ВСЕМ" },
|
||||
{ " (you)", " (ты)" },
|
||||
{ " shards · tutorial: ", " оск. · туториал: " },
|
||||
{ "done", "пройден" },
|
||||
{ "no", "нет" },
|
||||
{ "loading data…", "данные загружаются…" },
|
||||
{ " · shards ", " · осколков " },
|
||||
{ " · ornaments ", " · игрушек " },
|
||||
{ "\nTutorial: ", "\nТуториал: " },
|
||||
{ "not done", "не пройден" },
|
||||
{ "Player data is still loading", "Данные игрока ещё загружаются" },
|
||||
{ "Close", "Закрыть" },
|
||||
{ "XP for pull-ups, +1 shard per 10 in a row. Up to 60 per set, then a 10 min rest", "Опыт за подтягивания, +1 осколок за 10 подряд. До 60 за подход, потом отдых 10 мин" },
|
||||
{ "Light up the party for the whole server", "Зажги праздник для всего сервера" },
|
||||
{ "In inventory ✓", "В инвентаре ✓" },
|
||||
{ "Settings", "Настройки" },
|
||||
{ "SETTINGS", "НАСТРОЙКИ" },
|
||||
{ "Sound and language", "Звук и язык" },
|
||||
{ "Sound", "Звук" },
|
||||
{ "Language", "Язык" },
|
||||
{ "Master volume", "Общая громкость" },
|
||||
{ "Music", "Музыка" },
|
||||
{ "Effects", "Эффекты" },
|
||||
{ "Interface", "Интерфейс" },
|
||||
{ "Background music", "Фоновая музыка" },
|
||||
{ "On", "Вкл" },
|
||||
{ "Off", "Выкл" },
|
||||
{ "Drag the sliders — settings are saved to your profile and come back on every server.", "Двигай ползунки — настройки сохраняются в профиле и действуют на любом сервере." },
|
||||
{ "Pick the interface language — it is saved to your profile.", "Выбери язык интерфейса — он сохраняется в профиле." },
|
||||
{ "Auto", "Авто" },
|
||||
{ "Roblox translates the game into your device language.", "Roblox переводит игру на язык твоего устройства." },
|
||||
{ "The original English text.", "Оригинальный английский текст." },
|
||||
{ "The whole interface in Russian.", "Весь интерфейс на русском." },
|
||||
{ "Select", "Выбрать" },
|
||||
{ "All game sounds", "Все звуки игры" },
|
||||
{ "Background tracks", "Фоновые треки" },
|
||||
{ "Machines, fireworks, steps", "Станки, салют, шаги" },
|
||||
{ "Clicks and notifications", "Клики и уведомления" },
|
||||
{ "Play the background tracks", "Играть фоновые треки" },
|
||||
}
|
||||
@@ -0,0 +1,549 @@
|
||||
-- MarketWindow: the cross-server "Рынок" window in the New Year shop style (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Купить / Продать / Мои лоты / Как это работает. "Мои лоты" shows a badge with the number of active lots.
|
||||
-- Купить : toy + rarity filter chips, sort chips, refresh; listing cards. Buy button: ready -> confirm
|
||||
-- ("Точно? N", red, 3 s) -> busy -> done; off when you are short of shards or below the market level;
|
||||
-- "Твой лот" (blue, inert) on your own lots. Loading skeletons, empty state with a way out.
|
||||
-- Продать : your toys (tree toys hidden, fresh toys locked with a timer) + a sell box with a price stepper,
|
||||
-- quick price chips, payout after tax and a list button that says what is wrong with the price.
|
||||
-- Мои лоты : rows with time left (bar), price and "Снять"; empty state leads to "Продать".
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local M = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, WARN, NAVY, BODY, FONT = K.WHITE, K.GOLD, K.SOFT, K.OK, K.WARN, K.NAVY, K.BODY, K.FONT
|
||||
local tween, new, corner, art, label, maxText = K.tween, K.new, K.corner, K.art, K.label, K.maxText
|
||||
local pill, chip, pricePlate = K.pill, K.chip, K.pricePlate
|
||||
local DARK = Color3.fromRGB(10, 26, 34)
|
||||
|
||||
local function fmtLeft(s)
|
||||
local d, h, m = s // 86400, (s % 86400) // 3600, (s % 3600) // 60
|
||||
if d > 0 then return d .. "d " .. h .. "h" end
|
||||
if h > 0 then return h .. "h " .. m .. " min" end
|
||||
return math.max(1, m) .. " min"
|
||||
end
|
||||
|
||||
function M.install(ctx)
|
||||
local Config, player, fn = ctx.Config, ctx.player, ctx.remote
|
||||
local MK = Config.MARKET
|
||||
local fmt = ctx.fmtNum
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local function call(action, ...)
|
||||
local ok, res = pcall(fn.InvokeServer, fn, action, ...)
|
||||
if not ok or type(res) ~= "table" then return { ok = false, msg = "No connection to the market" } end
|
||||
return res
|
||||
end
|
||||
local function gated() return attr("Level", 1) < MK.MIN_LEVEL end
|
||||
local GATE = "Level " .. MK.MIN_LEVEL .. "+"
|
||||
local TAX = math.floor(MK.TAX * 100 + 0.5)
|
||||
local DAYS = MK.DURATION // 86400
|
||||
local function variantOf(it) return it.Variant and Config.VariantById[it.Variant] end
|
||||
local function subLine(it)
|
||||
local r, v = Config.RarityById[it.Rarity], variantOf(it)
|
||||
return r.Name .. (v and (" · " .. v.Name) or ""), v and v.Color or r.Color
|
||||
end
|
||||
-- dark disc with the toy's pattern
|
||||
local function toyDisc(parent, it, size, pos, z)
|
||||
local r, v = Config.RarityById[it.Rarity], variantOf(it)
|
||||
local disc = new("Frame", { Position = pos, Size = UDim2.fromOffset(size, size), BackgroundColor3 = DARK, ZIndex = z, Parent = parent }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = v and v.Color or r.Color, Thickness = 3 }),
|
||||
})
|
||||
local mini = ctx.miniPattern(Config.ToyById[it.Toy].Mask, r.Color, math.floor(size * 0.72), disc)
|
||||
mini.AnchorPoint = Vector2.new(0.5, 0.5)
|
||||
mini.Position = UDim2.fromScale(0.5, 0.5)
|
||||
for _, d in mini:GetDescendants() do if d:IsA("GuiObject") then d.ZIndex = z + 1 end end
|
||||
mini.ZIndex = z + 1
|
||||
return disc
|
||||
end
|
||||
|
||||
local onTab
|
||||
local TABS = {
|
||||
{ id = "Buy", text = "Buy", icon = "🛒", tip = "Listings from players on all servers. The first click on “Buy” prepares the purchase, the second confirms it." },
|
||||
{ id = "Sell", text = "Sell", icon = "💰", tip = "Tax " .. TAX .. "% per sale. Shards arrive even if you're offline." },
|
||||
{ id = "Mine", text = "My Listings", icon = "📦", tip = "A listing lasts " .. DAYS .. " days. If it doesn't sell, the ornament comes back to you." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "The market is shared by all servers — players set the prices." },
|
||||
}
|
||||
local ch = K.chrome({ win = win, title = "MARKET", subtitle = "Buy and sell ornaments\nacross all servers", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = fmt, onTab = function(id) onTab(id) end })
|
||||
local tabs = ch.tabs
|
||||
local mineCount = 0
|
||||
|
||||
---------------------------------------------------------------- BUY
|
||||
local buyG = ch.makePage("Buy")
|
||||
local filter = { toy = nil, rarity = nil, sort = "cheap" }
|
||||
local refreshBuy
|
||||
local function chipRow(y, entries, onPick)
|
||||
local row = new("Frame", { Position = UDim2.fromOffset(4, y), Size = UDim2.new(1, -8, 0, 54), BackgroundTransparency = 1, ZIndex = 4, Parent = buyG }, {
|
||||
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Center }),
|
||||
})
|
||||
local w = math.floor((1252 - 8 * (#entries - 1)) / #entries)
|
||||
local chips = {}
|
||||
for k, e in entries do
|
||||
chips[k] = { o = chip(row, { Size = UDim2.fromOffset(w, 50), LayoutOrder = k, ZIndex = 4 }, e.label, function() onPick(e.value) end, e.dot), value = e.value }
|
||||
end
|
||||
return chips
|
||||
end
|
||||
local toyEntries = { { label = "All ornaments", value = false } }
|
||||
for _, t in Config.TOYS do table.insert(toyEntries, { label = t.Name, value = t.Id }) end
|
||||
local rarityEntries = { { label = "All rarities", value = false } }
|
||||
for _, r in Config.RARITIES do table.insert(rarityEntries, { label = r.Name, value = r.Id, dot = r.Color }) end
|
||||
local toyChips = chipRow(0, toyEntries, function(v) filter.toy = v or nil; refreshBuy() end)
|
||||
local rarityChips = chipRow(60, rarityEntries, function(v) filter.rarity = v or nil; refreshBuy() end)
|
||||
local sortRow = new("Frame", { Position = UDim2.fromOffset(4, 120), Size = UDim2.fromOffset(560, 54), BackgroundTransparency = 1, ZIndex = 4, Parent = buyG }, {
|
||||
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 8), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Center }),
|
||||
})
|
||||
local sortChips = {}
|
||||
for k, e in { { label = "Cheapest", value = "cheap" }, { label = "Priciest", value = "expensive" }, { label = "Newest", value = "new" } } do
|
||||
sortChips[k] = { o = chip(sortRow, { Size = UDim2.fromOffset(176, 50), LayoutOrder = k, ZIndex = 4 }, e.label, function() filter.sort = e.value; refreshBuy() end), value = e.value }
|
||||
end
|
||||
local buyCount = maxText(label({ Position = UDim2.fromOffset(580, 128), Size = UDim2.fromOffset(400, 38), Text = "", TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 4, Parent = buyG }, 1.5), 22)
|
||||
local refreshBtn = pill(buyG, { Position = UDim2.fromOffset(1004, 120), Size = UDim2.fromOffset(248, 56), ZIndex = 4, TextMax = 28 }, function() refreshBuy() end)
|
||||
refreshBtn.set("alt", "Refresh")
|
||||
local buyList = K.scroll(buyG, UDim2.fromOffset(0, 186), UDim2.new(1, 0, 0, 380),
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(238, 330), CellPadding = UDim2.fromOffset(12, 14), SortOrder = Enum.SortOrder.LayoutOrder }))
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 6), PaddingBottom = UDim.new(0, 6), Parent = buyList })
|
||||
local buyCards, buyEmpty, buyReq = {}, nil, 0
|
||||
|
||||
local function paintFilters()
|
||||
for _, c in toyChips do c.o.setSelected((c.value or nil) == filter.toy) end
|
||||
for _, c in rarityChips do c.o.setSelected((c.value or nil) == filter.rarity) end
|
||||
for _, c in sortChips do c.o.setSelected(c.value == filter.sort) end
|
||||
end
|
||||
local function clearBuy()
|
||||
for _, c in buyList:GetChildren() do if c:IsA("GuiObject") then c:Destroy() end end
|
||||
buyCards = {}
|
||||
if buyEmpty then buyEmpty:Destroy(); buyEmpty = nil end
|
||||
end
|
||||
local function skeletons()
|
||||
for k = 1, 5 do
|
||||
local s = new("Frame", { BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.6, LayoutOrder = k, ZIndex = 5, Parent = buyList }, { corner(UDim.new(0, 24)) })
|
||||
task.spawn(function()
|
||||
task.wait(k * 0.08)
|
||||
while s.Parent do
|
||||
tween(s, 0.6, { BackgroundTransparency = 0.8 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
tween(s, 0.6, { BackgroundTransparency = 0.55 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
local function listingCard(l, order)
|
||||
local it = l.item
|
||||
local r, v = Config.RarityById[it.Rarity], variantOf(it)
|
||||
local card = new("Frame", { BackgroundColor3 = WHITE, LayoutOrder = order, ZIndex = 5, Parent = buyList }, {
|
||||
corner(UDim.new(0, 24)),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(r.Color:Lerp(Color3.new(0, 0, 0), 0.45), Color3.fromRGB(10, 22, 34)) }),
|
||||
new("UIStroke", { Color = v and v.Color or r.Color, Thickness = v and 4 or 3 }),
|
||||
})
|
||||
toyDisc(card, it, 112, UDim2.new(0.5, -56, 0, 14), 6)
|
||||
if v then
|
||||
local tag = new("Frame", { Position = UDim2.fromOffset(8, 8), Size = UDim2.fromOffset(104, 30), BackgroundColor3 = v.Color, ZIndex = 8, Parent = card }, { corner(UDim.new(0.5, 0)) })
|
||||
maxText(label({ Position = UDim2.fromOffset(6, 3), Size = UDim2.new(1, -12, 1, -6), Text = v.Name, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 9, Parent = tag }, 1.5), 18)
|
||||
end
|
||||
maxText(label({ Position = UDim2.fromOffset(10, 132), Size = UDim2.new(1, -20, 0, 32), Text = Config.ToyById[it.Toy].Name, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = card }, 2.5), 30)
|
||||
maxText(label({ Position = UDim2.fromOffset(10, 166), Size = UDim2.new(1, -20, 0, 24), Text = r.Name, TextScaled = true, TextColor3 = r.Color,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = card }, 2), 22)
|
||||
local _, price = pricePlate(card, UDim2.fromOffset(34, 198), UDim2.fromOffset(176, 46), 6)
|
||||
price.Text = fmt(l.price)
|
||||
maxText(label({ Position = UDim2.fromOffset(10, 250), Size = UDim2.new(1, -20, 0, 22), Text = "seller: " .. tostring(l.seller), TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextTruncate = Enum.TextTruncate.AtEnd, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = card }, 1.5), 18)
|
||||
local c = { l = l, card = card, price = price, armed = false, busy = false, sold = false }
|
||||
local btn
|
||||
function c.paint()
|
||||
local shards = attr("Shards", 0)
|
||||
price.TextColor3 = (l.mine or shards >= l.price) and WHITE or WARN
|
||||
if c.sold then btn.set("done", "Bought")
|
||||
elseif c.busy then btn.set("busy")
|
||||
elseif l.mine then btn.set("info", "Your listing")
|
||||
elseif gated() then btn.set("off", GATE)
|
||||
elseif shards < l.price then btn.set("off", "Need " .. fmt(l.price - shards))
|
||||
elseif c.armed then btn.set("confirm", "Sure? " .. fmt(l.price))
|
||||
else btn.set("ready", "Buy") end
|
||||
end
|
||||
btn = pill(card, { Position = UDim2.fromOffset(14, 278), Size = UDim2.fromOffset(210, 46), ZIndex = 6, TextMax = 26 }, function(state)
|
||||
if state == "ready" then
|
||||
c.armed = true
|
||||
local token = {}
|
||||
c.token = token
|
||||
c.paint()
|
||||
task.delay(3, function() if c.token == token and c.armed then c.armed = false; c.paint() end end)
|
||||
elseif state == "confirm" then
|
||||
c.armed, c.busy = false, true
|
||||
c.paint()
|
||||
task.spawn(function()
|
||||
local res = call("Buy", l.id, l.price)
|
||||
c.busy = false
|
||||
ctx.toast(res.msg or (res.ok and "Bought" or "Failed"), res.ok and OK or WARN)
|
||||
if res.ok then
|
||||
c.sold = true
|
||||
c.paint()
|
||||
K.flash(card, 24)
|
||||
K.floatText(card, "Bought!")
|
||||
task.delay(1, refreshBuy)
|
||||
else
|
||||
c.paint()
|
||||
task.delay(0.4, refreshBuy)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end)
|
||||
c.btn = btn
|
||||
c.paint()
|
||||
return c
|
||||
end
|
||||
refreshBuy = function()
|
||||
paintFilters()
|
||||
buyReq += 1
|
||||
local my = buyReq
|
||||
if #buyCards == 0 then clearBuy(); skeletons() end
|
||||
buyCount.Text = "Loading…"
|
||||
refreshBtn.set("busy")
|
||||
task.spawn(function()
|
||||
local res = call("Browse", { toy = filter.toy, rarity = filter.rarity, sort = filter.sort })
|
||||
if my ~= buyReq then return end
|
||||
refreshBtn.set("alt", "Refresh")
|
||||
clearBuy()
|
||||
if not res.ok then buyCount.Text = res.msg or "" return end
|
||||
buyCount.Text = "showing " .. #res.items .. " of " .. res.total .. (res.remote and "" or " · Studio market")
|
||||
if #res.items == 0 then
|
||||
local filtered = filter.toy ~= nil or filter.rarity ~= nil
|
||||
buyEmpty = K.emptyState({ Position = UDim2.fromOffset(0, 186), Size = UDim2.new(1, 0, 0, 380), ZIndex = 4, Parent = buyG },
|
||||
filtered and "No matching listings" or "The market is empty",
|
||||
filtered and "Try another ornament or rarity." or "Nobody is selling yet — be the first to list an ornament!")
|
||||
local b = pill(buyEmpty, { Position = UDim2.new(0.5, -150, 0, 312), Size = UDim2.fromOffset(300, 62), ZIndex = 5, TextMax = 28 }, function()
|
||||
if filtered then filter.toy, filter.rarity = nil, nil; refreshBuy() else ch.showTab("Sell") end
|
||||
end)
|
||||
b.set("alt", filtered and "Reset filters" or "Sell an ornament")
|
||||
return
|
||||
end
|
||||
for k, l in res.items do table.insert(buyCards, listingCard(l, k)) end
|
||||
end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- SELL
|
||||
local sellG = ch.makePage("Sell")
|
||||
local left = new("Frame", { Size = UDim2.fromOffset(770, 566), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.55, ZIndex = 4, Parent = sellG }, {
|
||||
corner(UDim.new(0, 26)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.4 }),
|
||||
})
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 12), Size = UDim2.fromOffset(360, 42), Text = "Your ornaments", TextScaled = true, ZIndex = 5, Parent = left }, 2.5), 34)
|
||||
local sellCount = maxText(label({ Position = UDim2.fromOffset(380, 18), Size = UDim2.fromOffset(366, 32), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = SOFT,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 5, Parent = left }, 1.5), 20)
|
||||
local sellList = K.scroll(left, UDim2.fromOffset(12, 62), UDim2.fromOffset(750, 494),
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(136, 168), CellPadding = UDim2.fromOffset(10, 10), SortOrder = Enum.SortOrder.LayoutOrder }))
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 6), PaddingTop = UDim.new(0, 6), PaddingBottom = UDim.new(0, 6), Parent = sellList })
|
||||
local sellEmpty
|
||||
|
||||
local right = new("Frame", { Position = UDim2.fromOffset(790, 0), Size = UDim2.fromOffset(470, 566), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.55, ZIndex = 4, Parent = sellG }, {
|
||||
corner(UDim.new(0, 26)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.4 }),
|
||||
})
|
||||
local noSel = K.emptyState({ Position = UDim2.fromOffset(0, 70), Size = UDim2.new(1, 0, 0, 340), ZIndex = 5, Parent = right },
|
||||
"Pick an ornament", "Click an ornament on the left, then set a price — players on all servers will see the listing.")
|
||||
local selBox = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Visible = false, ZIndex = 5, Parent = right })
|
||||
local selDiscHolder = new("Frame", { Position = UDim2.fromOffset(20, 20), Size = UDim2.fromOffset(130, 130), BackgroundTransparency = 1, ZIndex = 5, Parent = selBox })
|
||||
local selName = maxText(label({ Position = UDim2.fromOffset(166, 24), Size = UDim2.fromOffset(284, 44), Text = "", TextScaled = true, ZIndex = 6, Parent = selBox }, 2.5), 36)
|
||||
local selSub = maxText(label({ Position = UDim2.fromOffset(166, 70), Size = UDim2.fromOffset(284, 28), Text = "", TextScaled = true, ZIndex = 6, Parent = selBox }, 2), 24)
|
||||
local selValue = maxText(label({ Position = UDim2.fromOffset(166, 104), Size = UDim2.fromOffset(284, 44), Text = "", TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, ZIndex = 6, Parent = selBox }, 1.5), 20)
|
||||
maxText(label({ Position = UDim2.fromOffset(22, 166), Size = UDim2.fromOffset(300, 32), Text = "Listing price", TextScaled = true, ZIndex = 6, Parent = selBox }, 2), 28)
|
||||
local priceWrap = new("Frame", { Position = UDim2.fromOffset(102, 206), Size = UDim2.fromOffset(266, 64), BackgroundColor3 = NAVY, ZIndex = 6, Parent = selBox }, {
|
||||
corner(UDim.new(0.5, 0)),
|
||||
})
|
||||
local priceStroke = new("UIStroke", { Color = Color3.fromRGB(190, 225, 255), Thickness = 3, Parent = priceWrap })
|
||||
art("crystal", { Position = UDim2.new(0, -8, 0.5, -32), Size = UDim2.fromOffset(64, 64), ZIndex = 7, Parent = priceWrap })
|
||||
local priceBox = new("TextBox", { Position = UDim2.fromOffset(56, 6), Size = UDim2.new(1, -72, 1, -12), BackgroundTransparency = 1, Text = "", PlaceholderText = "price",
|
||||
ClearTextOnFocus = false, FontFace = FONT, TextScaled = true, TextColor3 = WHITE, PlaceholderColor3 = Color3.fromRGB(150, 170, 190), ZIndex = 7, Parent = priceWrap })
|
||||
maxText(priceBox, 38)
|
||||
local sel
|
||||
local function priceNow() local p = tonumber(priceBox.Text); return p and math.floor(p) end
|
||||
local function setPrice(p) priceBox.Text = tostring(math.clamp(math.floor(p), 1, MK.MAX_PRICE)) end
|
||||
local function step() return sel and math.max(1, math.ceil(Config.MinPrice(sel.item) * 0.25)) or 1 end
|
||||
local minus = pill(selBox, { Position = UDim2.fromOffset(20, 206), Size = UDim2.fromOffset(74, 64), ZIndex = 6, TextMax = 40 }, function() setPrice((priceNow() or 0) - step()) end)
|
||||
local plus = pill(selBox, { Position = UDim2.fromOffset(376, 206), Size = UDim2.fromOffset(74, 64), ZIndex = 6, TextMax = 40 }, function() setPrice((priceNow() or 0) + step()) end)
|
||||
minus.set("alt", "-")
|
||||
plus.set("alt", "+")
|
||||
local quickRow = new("Frame", { Position = UDim2.fromOffset(20, 282), Size = UDim2.fromOffset(430, 48), BackgroundTransparency = 1, ZIndex = 6, Parent = selBox }, {
|
||||
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 10), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Center }),
|
||||
})
|
||||
local quick = {}
|
||||
for k, q in { { "Min", 1 }, { "x2", 2 }, { "x5", 5 }, { "x10", 10 } } do
|
||||
quick[k] = { o = chip(quickRow, { Size = UDim2.fromOffset(100, 46), LayoutOrder = k, ZIndex = 6 }, q[1], function() if sel then setPrice(Config.MinPrice(sel.item) * q[2]) end end), mult = q[2] }
|
||||
end
|
||||
local payout = maxText(label({ Position = UDim2.fromOffset(20, 340), Size = UDim2.fromOffset(430, 32), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = OK,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = selBox }, 1.5), 22)
|
||||
local listing = false
|
||||
local listBtn
|
||||
local selNote = maxText(label({ Position = UDim2.fromOffset(20, 480), Size = UDim2.fromOffset(430, 66), Text = "", TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = selBox }, 1.5), 19)
|
||||
local function paintSell()
|
||||
if not sel then return end
|
||||
local p, minP = priceNow(), Config.MinPrice(sel.item)
|
||||
local bad = (not p) or p < minP or p > MK.MAX_PRICE
|
||||
priceStroke.Color = bad and WARN or Color3.fromRGB(190, 225, 255)
|
||||
payout.Text = p and ("You get " .. fmt(math.floor(p * (1 - MK.TAX))) .. " after " .. TAX .. "%") or "Enter the price as a number"
|
||||
payout.TextColor3 = bad and WARN or OK
|
||||
for _, q in quick do q.o.setSelected(p == minP * q.mult) end
|
||||
selNote.Text = "Listings: " .. mineCount .. " / " .. MK.MAX_LISTINGS .. " · lasts " .. DAYS .. " days · visible on all servers"
|
||||
if listing then listBtn.set("busy")
|
||||
elseif gated() then listBtn.set("off", GATE)
|
||||
elseif mineCount >= MK.MAX_LISTINGS then listBtn.set("off", "All " .. MK.MAX_LISTINGS .. " listing slots are used")
|
||||
elseif not p then listBtn.set("off", "Enter a price")
|
||||
elseif p < minP then listBtn.set("off", "Price from " .. fmt(minP))
|
||||
elseif p > MK.MAX_PRICE then listBtn.set("off", "Max price " .. fmt(MK.MAX_PRICE))
|
||||
else listBtn.set("ready", "List for " .. fmt(p)) end
|
||||
end
|
||||
priceBox:GetPropertyChangedSignal("Text"):Connect(function()
|
||||
local digits = priceBox.Text:gsub("%D", "")
|
||||
if digits ~= priceBox.Text then priceBox.Text = digits return end
|
||||
paintSell()
|
||||
end)
|
||||
local refreshSell, refreshMine
|
||||
listBtn = pill(selBox, { Position = UDim2.fromOffset(20, 384), Size = UDim2.fromOffset(430, 84), ZIndex = 6, TextMax = 34 }, function()
|
||||
if not sel then return end
|
||||
listing = true
|
||||
paintSell()
|
||||
local uid, p = sel.uid, priceNow()
|
||||
task.spawn(function()
|
||||
local res = call("List", uid, p)
|
||||
listing = false
|
||||
ctx.toast(res.msg or (res.ok and "Listed" or "Failed"), res.ok and OK or WARN)
|
||||
if res.ok then
|
||||
K.flash(right, 26)
|
||||
K.floatText(right, "Listed!")
|
||||
sel = nil
|
||||
selBox.Visible, noSel.Visible = false, true
|
||||
mineCount += 1
|
||||
tabs.Mine.setBadge(mineCount)
|
||||
task.spawn(refreshMine)
|
||||
end
|
||||
paintSell()
|
||||
task.defer(refreshSell)
|
||||
end)
|
||||
end)
|
||||
local function select(c, it)
|
||||
sel = { uid = c.Name, item = it }
|
||||
for _, d in selDiscHolder:GetChildren() do d:Destroy() end
|
||||
toyDisc(selDiscHolder, it, 130, UDim2.new(), 6)
|
||||
selName.Text = Config.ToyById[it.Toy].Name
|
||||
local sub, col = subLine(it)
|
||||
selSub.Text, selSub.TextColor3 = sub, col
|
||||
selValue.Text = "Shredder value: " .. fmt(Config.Value(it)) .. "\nmin price: " .. fmt(Config.MinPrice(it))
|
||||
selBox.Visible, noSel.Visible = true, false
|
||||
setPrice(Config.MinPrice(it) * 2)
|
||||
paintSell()
|
||||
end
|
||||
local tiles = {}
|
||||
refreshSell = function()
|
||||
for _, t in tiles do t:Destroy() end
|
||||
tiles = {}
|
||||
if sellEmpty then sellEmpty:Destroy(); sellEmpty = nil end
|
||||
local inv = player:FindFirstChild("OrnamentInventory")
|
||||
local list, onTree = {}, 0
|
||||
for _, c in inv and inv:GetChildren() or {} do
|
||||
if c:GetAttribute("OnTree") then onTree += 1 else table.insert(list, c) end -- toys on the tree can not be sold
|
||||
end
|
||||
table.sort(list, function(x, y)
|
||||
local rx, ry = Config.RarityById[x:GetAttribute("Rarity")], Config.RarityById[y:GetAttribute("Rarity")]
|
||||
if rx.Index ~= ry.Index then return rx.Index > ry.Index end
|
||||
return (x:GetAttribute("Order") or 0) > (y:GetAttribute("Order") or 0)
|
||||
end)
|
||||
sellCount.Text = #list .. " pcs" .. (onTree > 0 and (" · " .. onTree .. " on the tree") or "")
|
||||
if sel and not (inv and inv:FindFirstChild(sel.uid)) then sel = nil; selBox.Visible, noSel.Visible = false, true end
|
||||
if #list == 0 then
|
||||
sellEmpty = K.emptyState({ Position = UDim2.fromOffset(0, 80), Size = UDim2.new(1, 0, 0, 340), ZIndex = 5, Parent = left },
|
||||
"Nothing to sell", "Make ornaments in the generator. Ornaments on the tree can't be sold — take them down first.")
|
||||
return
|
||||
end
|
||||
for k, c in list do
|
||||
local it = { Toy = c:GetAttribute("Toy"), Rarity = c:GetAttribute("Rarity"), Variant = c:GetAttribute("Variant") }
|
||||
local r, v = Config.RarityById[it.Rarity], variantOf(it)
|
||||
local chosen = sel and sel.uid == c.Name
|
||||
local tile = new("TextButton", { Text = "", AutoButtonColor = false, BackgroundColor3 = chosen and Color3.fromRGB(40, 70, 60) or DARK, LayoutOrder = k, ZIndex = 5, Parent = sellList }, {
|
||||
corner(UDim.new(0, 20)), new("UIStroke", { Color = chosen and GOLD or (v and v.Color or r.Color), Thickness = chosen and 5 or 2.5, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }),
|
||||
})
|
||||
local sc = new("UIScale", { Scale = chosen and 1.04 or 1, Parent = tile })
|
||||
toyDisc(tile, it, 92, UDim2.new(0.5, -46, 0, 10), 6)
|
||||
maxText(label({ Position = UDim2.fromOffset(6, 106), Size = UDim2.new(1, -12, 0, 26), Text = Config.ToyById[it.Toy].Name, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = tile }, 2), 22)
|
||||
local sub, col = subLine(it)
|
||||
maxText(label({ Position = UDim2.fromOffset(6, 134), Size = UDim2.new(1, -12, 0, 22), Text = sub, TextScaled = true, TextColor3 = col,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = tile }, 1.5), 18)
|
||||
local age = os.time() - (c:GetAttribute("Created") or 0)
|
||||
local locked = age < Config.TRADE.MIN_AGE
|
||||
if locked then
|
||||
local lockF = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.12, ZIndex = 8, Parent = tile }, { corner(UDim.new(0, 20)) })
|
||||
maxText(label({ Position = UDim2.fromOffset(8, 34), Size = UDim2.new(1, -16, 0, 100), Text = "🔒\n" .. math.ceil((Config.TRADE.MIN_AGE - age) / 60) .. " min",
|
||||
TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 9, Parent = lockF }, 2), 26)
|
||||
end
|
||||
tile.MouseEnter:Connect(function() if not locked then tween(sc, 0.12, { Scale = 1.06 }, Enum.EasingStyle.Back) end end)
|
||||
tile.MouseLeave:Connect(function() tween(sc, 0.12, { Scale = chosen and 1.04 or 1 }) end)
|
||||
tile.InputBegan:Connect(function(i) if K.isPress(i) and not locked then tween(sc, 0.06, { Scale = 0.95 }) end end)
|
||||
tile.Activated:Connect(function()
|
||||
if locked then
|
||||
tween(tile, 0.05, { Rotation = -4 }).Completed:Wait()
|
||||
tween(tile, 0.07, { Rotation = 4 }).Completed:Wait()
|
||||
tween(tile, 0.06, { Rotation = 0 })
|
||||
ctx.toast("New ornaments can be listed in " .. (Config.TRADE.MIN_AGE // 60) .. " min", WARN)
|
||||
return
|
||||
end
|
||||
select(c, it)
|
||||
refreshSell()
|
||||
end)
|
||||
table.insert(tiles, tile)
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- MY LISTINGS
|
||||
local mineG = ch.makePage("Mine")
|
||||
local slotPlate = new("Frame", { Position = UDim2.fromOffset(4, 2), Size = UDim2.fromOffset(250, 52), BackgroundColor3 = NAVY, ZIndex = 4, Parent = mineG }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 2 }),
|
||||
})
|
||||
local slotText = maxText(label({ Position = UDim2.fromOffset(14, 8), Size = UDim2.new(1, -28, 1, -16), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = slotPlate }, 2), 28)
|
||||
local pipRow = new("Frame", { Position = UDim2.fromOffset(270, 14), Size = UDim2.fromOffset(340, 28), BackgroundTransparency = 1, ZIndex = 4, Parent = mineG }, {
|
||||
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 6), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Center }),
|
||||
})
|
||||
local slotPips = {}
|
||||
for k = 1, MK.MAX_LISTINGS do
|
||||
slotPips[k] = new("Frame", { Size = UDim2.fromOffset(26, 22), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.5, LayoutOrder = k, ZIndex = 4, Parent = pipRow }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 1.5, Transparency = 0.5 }),
|
||||
})
|
||||
end
|
||||
maxText(label({ Position = UDim2.fromOffset(620, 10), Size = UDim2.fromOffset(632, 36), Text = "Sold listings close on their own — shards arrive automatically", TextScaled = true,
|
||||
FontFace = BODY, TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 4, Parent = mineG }, 1.5), 20)
|
||||
local mineList = K.scroll(mineG, UDim2.fromOffset(0, 66), UDim2.new(1, 0, 0, 500),
|
||||
new("UIListLayout", { Padding = UDim.new(0, 12), SortOrder = Enum.SortOrder.LayoutOrder }))
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 18), PaddingTop = UDim.new(0, 4), PaddingBottom = UDim.new(0, 4), Parent = mineList })
|
||||
local mineEmpty
|
||||
local function paintSlots()
|
||||
slotText.Text = "Listings: " .. mineCount .. " / " .. MK.MAX_LISTINGS
|
||||
for k, p in slotPips do
|
||||
local on = k <= mineCount
|
||||
p.BackgroundColor3 = on and GOLD or Color3.new(0, 0, 0)
|
||||
p.BackgroundTransparency = on and 0 or 0.5
|
||||
end
|
||||
tabs.Mine.setBadge(mineCount)
|
||||
end
|
||||
local mineReq = 0
|
||||
refreshMine = function()
|
||||
mineReq += 1
|
||||
local my = mineReq
|
||||
local res = call("Mine")
|
||||
if my ~= mineReq then return end
|
||||
for _, c in mineList:GetChildren() do if c:IsA("GuiObject") then c:Destroy() end end
|
||||
if mineEmpty then mineEmpty:Destroy(); mineEmpty = nil end
|
||||
if not res.ok then slotText.Text = res.msg or "" return end
|
||||
mineCount = #res.items
|
||||
paintSlots()
|
||||
paintSell()
|
||||
if #res.items == 0 then
|
||||
mineEmpty = K.emptyState({ Position = UDim2.fromOffset(0, 70), Size = UDim2.new(1, 0, 0, 420), ZIndex = 4, Parent = mineG },
|
||||
"You haven't listed anything yet", "List an ornament and players on all servers will see it.")
|
||||
local b = pill(mineEmpty, { Position = UDim2.new(0.5, -150, 0, 320), Size = UDim2.fromOffset(300, 64), ZIndex = 5, TextMax = 28 }, function() ch.showTab("Sell") end)
|
||||
b.set("alt", "Sell an ornament")
|
||||
return
|
||||
end
|
||||
for k, l in res.items do
|
||||
local it = l.item
|
||||
local r, v = Config.RarityById[it.Rarity], variantOf(it)
|
||||
local row = new("Frame", { Size = UDim2.new(1, 0, 0, 120), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.45, LayoutOrder = k, ZIndex = 5, Parent = mineList }, {
|
||||
corner(UDim.new(0, 26)), new("UIStroke", { Color = v and v.Color or r.Color, Thickness = 2.5 }),
|
||||
})
|
||||
toyDisc(row, it, 96, UDim2.fromOffset(14, 12), 6)
|
||||
maxText(label({ Position = UDim2.fromOffset(128, 12), Size = UDim2.fromOffset(560, 40), Text = Config.ToyById[it.Toy].Name, TextScaled = true, ZIndex = 6, Parent = row }, 2.5), 34)
|
||||
local sub, col = subLine(it)
|
||||
maxText(label({ Position = UDim2.fromOffset(130, 52), Size = UDim2.fromOffset(560, 26), Text = sub, TextScaled = true, TextColor3 = col, ZIndex = 6, Parent = row }, 1.5), 22)
|
||||
local leftS = math.max(0, l.expires - os.time())
|
||||
local frac = math.clamp(leftS / MK.DURATION, 0, 1)
|
||||
local bar = new("Frame", { Position = UDim2.fromOffset(130, 88), Size = UDim2.fromOffset(330, 16), BackgroundColor3 = Color3.fromRGB(10, 20, 26), ZIndex = 6, Parent = row }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 1.5, Transparency = 0.6 }),
|
||||
})
|
||||
new("Frame", { Size = UDim2.fromScale(math.max(frac, 0.03), 1), BackgroundColor3 = frac > 0.5 and OK or frac > 0.2 and GOLD or WARN, ZIndex = 7, Parent = bar }, { corner(UDim.new(0.5, 0)) })
|
||||
maxText(label({ Position = UDim2.fromOffset(474, 82), Size = UDim2.fromOffset(230, 28), Text = "left: " .. fmtLeft(leftS), TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, ZIndex = 6, Parent = row }, 1.5), 20)
|
||||
local _, price = pricePlate(row, UDim2.fromOffset(726, 34), UDim2.fromOffset(190, 52), 6)
|
||||
price.Text = fmt(l.price)
|
||||
local btn
|
||||
btn = pill(row, { Position = UDim2.fromOffset(940, 26), Size = UDim2.fromOffset(280, 68), ZIndex = 6, TextMax = 30 }, function()
|
||||
btn.set("busy")
|
||||
task.spawn(function()
|
||||
local r2 = call("Cancel", l.id)
|
||||
ctx.toast(r2.msg or "", r2.ok and OK or WARN)
|
||||
if r2.ok then K.floatText(row, "Ornament returned") end
|
||||
task.delay(r2.ok and 0.8 or 0.2, refreshMine)
|
||||
end)
|
||||
end)
|
||||
btn.set("danger", "Remove listing")
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- HELP
|
||||
local _, heScroll = ch.makePage("Help", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardCyan", icon = "🛒", title = "Buy", tab = "Buy",
|
||||
text = "Listings from players on all servers. Filter by ornament and rarity. The first click on “Buy” prepares the purchase, the second confirms it." },
|
||||
{ card = "cardViolet", icon = "💰", title = "Sell", tab = "Sell",
|
||||
text = "Pick an ornament and set a price — no lower than its shredder value. New ornaments can be listed " .. (Config.TRADE.MIN_AGE // 60) .. " min after they are made." },
|
||||
{ card = "cardOrange", icon = "📦", title = "My Listings", tab = "Mine",
|
||||
text = "Tax " .. TAX .. "% per sale. A listing lasts " .. DAYS .. " days, then the ornament comes back. Shards arrive even if you're offline. Up to " .. MK.MAX_LISTINGS .. " listings at once." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, function() ch.showTab(h.tab) end)
|
||||
go.set("alt", "Open")
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- tab switching + live updates
|
||||
local function gateTip(id)
|
||||
if gated() and id ~= "Help" then
|
||||
ch.tip.Text = "🔒 Buying and selling unlocks at level " .. MK.MIN_LEVEL .. " — you can browse right now."
|
||||
ch.tip.TextColor3 = WARN
|
||||
end
|
||||
end
|
||||
onTab = function(id)
|
||||
if not win.overlay.Visible then return end
|
||||
ch.setBalance(attr("Shards", 0))
|
||||
gateTip(id)
|
||||
if id == "Buy" then refreshBuy()
|
||||
elseif id == "Sell" then refreshSell(); paintSell()
|
||||
elseif id == "Mine" then task.spawn(refreshMine) end
|
||||
end
|
||||
local function repaint()
|
||||
if not win.overlay.Visible then return end
|
||||
ch.setBalance(attr("Shards", 0))
|
||||
for _, c in buyCards do c.paint() end
|
||||
paintSell()
|
||||
end
|
||||
player:GetAttributeChangedSignal("Shards"):Connect(repaint)
|
||||
player:GetAttributeChangedSignal("Level"):Connect(function() repaint(); if win.overlay.Visible then ch.showTab(ch.current(), true) end end)
|
||||
task.spawn(function()
|
||||
local inv = player:WaitForChild("OrnamentInventory")
|
||||
local queued = false
|
||||
local function changed()
|
||||
if queued or not (win.overlay.Visible and ch.current() == "Sell") then return end
|
||||
queued = true
|
||||
task.delay(0.15, function() queued = false; refreshSell(); paintSell() end)
|
||||
end
|
||||
inv.ChildAdded:Connect(changed)
|
||||
inv.ChildRemoved:Connect(changed)
|
||||
end)
|
||||
paintFilters()
|
||||
paintSlots()
|
||||
ch.showTab("Buy")
|
||||
|
||||
return {
|
||||
open = function()
|
||||
ch.setBalance(attr("Shards", 0), true)
|
||||
ch.showTab(ch.current(), true)
|
||||
if ch.current() ~= "Mine" then task.spawn(refreshMine) end -- slot count + badge
|
||||
end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -0,0 +1,253 @@
|
||||
-- OrnamentAdminServer (Script, ServerScriptService): server side of the admin panel (client: AdminPanel).
|
||||
-- RemoteFunction OrnamentMachine.Admin:
|
||||
-- List / Give(userId, amount) / SetLevel(userId, level) / Booster(userId, boosterId, delta) /
|
||||
-- ResetTutorial(userId) / ResetStats(userId) / ResetTutorialAll
|
||||
-- -> { ok, msg, players = { { id, name, display, level, shards, toys, boosters, tutorial, admin, loaded } } }
|
||||
-- Admins (checked on EVERY call): Config.ADMINS ({ [userId] = true }), the owner of a user-owned game, and for a
|
||||
-- group game every member of the owning group with rank >= Config.ADMIN_GROUP.MinRank (Config.ADMIN_GROUP.Id = another
|
||||
-- group instead); in Studio every test player is an admin.
|
||||
-- The player attribute IsAdmin only tells the client to show the panel.
|
||||
-- "Reset the tutorial for everyone" = a global counter (DataStore OrnamentAdmin_v1, key TutorialEpoch): every profile
|
||||
-- with an older counter gets TutorialDone = false once — players online right away (all servers, MessagingService),
|
||||
-- the others when they join.
|
||||
-- "Reset statistics" = the profile becomes a new player's (Robux receipts are kept so purchases are never granted
|
||||
-- twice), the player's market lots and market mailbox are dropped, the plot is cleared (OrnamentShopServer listens
|
||||
-- to ServerStorage.OrnamentProfileReset).
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local ServerStorage = game:GetService("ServerStorage")
|
||||
local DataStoreService = game:GetService("DataStoreService")
|
||||
local MessagingService = game:GetService("MessagingService")
|
||||
local RunService = game:GetService("RunService")
|
||||
|
||||
local folder = ReplicatedStorage:WaitForChild("OrnamentMachine")
|
||||
local Config = require(folder:WaitForChild("Config"))
|
||||
local PlayerData = require(script.Parent:WaitForChild("OrnamentPlayerData"))
|
||||
local MarketStore = require(script.Parent:WaitForChild("OrnamentMarketStore"))
|
||||
local notify = folder:WaitForChild("Notify")
|
||||
local resetEvent = ServerStorage:WaitForChild("OrnamentProfileReset", 15)
|
||||
|
||||
local adminFn = folder:FindFirstChild("Admin") or Instance.new("RemoteFunction")
|
||||
adminFn.Name = "Admin"
|
||||
adminFn.Parent = folder
|
||||
|
||||
local TOPIC = "OrnamentAdmin"
|
||||
local MAX_GIVE = 10000000
|
||||
local adminStore
|
||||
pcall(function() adminStore = DataStoreService:GetDataStore("OrnamentAdmin_v1") end)
|
||||
|
||||
local function fmt(n)
|
||||
local s = tostring(math.floor(math.abs(n)))
|
||||
local out = s:reverse():gsub("(%d%d%d)", "%1 "):reverse():gsub("^ ", "")
|
||||
return (n < 0 and "-" or "") .. out
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- who is an admin
|
||||
local rankCache = {}
|
||||
local function isAdmin(player)
|
||||
if RunService:IsStudio() then return true end
|
||||
if (Config.ADMINS or {})[player.UserId] then return true end
|
||||
if game.CreatorType == Enum.CreatorType.User and player.UserId == game.CreatorId then return true end
|
||||
local g = Config.ADMIN_GROUP or {}
|
||||
local groupId = g.Id or (game.CreatorType == Enum.CreatorType.Group and game.CreatorId or nil)
|
||||
if groupId and groupId ~= 0 then
|
||||
if rankCache[player] == nil then
|
||||
local ok, rank = pcall(player.GetRankInGroup, player, groupId)
|
||||
if not ok then return false end -- web error: try again on the next call
|
||||
rankCache[player] = rank
|
||||
end
|
||||
return rankCache[player] >= (g.MinRank or 254)
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- tutorial reset for everyone (global counter)
|
||||
local epoch = 0
|
||||
local function applyEpochAll()
|
||||
for _, p in Players:GetPlayers() do
|
||||
if p:GetAttribute("DataLoaded") then PlayerData.ApplyTutorialEpoch(p, epoch) end
|
||||
end
|
||||
end
|
||||
local function setEpoch(n)
|
||||
if type(n) == "number" and n > epoch then
|
||||
epoch = n
|
||||
applyEpochAll()
|
||||
end
|
||||
end
|
||||
task.spawn(function()
|
||||
while true do
|
||||
if adminStore then
|
||||
local ok, v = pcall(function() return adminStore:GetAsync("TutorialEpoch") end)
|
||||
if ok then setEpoch(v) end
|
||||
end
|
||||
task.wait(300)
|
||||
end
|
||||
end)
|
||||
task.spawn(function()
|
||||
pcall(function()
|
||||
MessagingService:SubscribeAsync(TOPIC, function(msg)
|
||||
local d = msg.Data
|
||||
if type(d) == "table" and d.kind == "TutorialEpoch" then setEpoch(d.epoch) end
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
local function onJoin(player)
|
||||
player:SetAttribute("IsAdmin", isAdmin(player))
|
||||
local t0 = os.clock()
|
||||
while player.Parent and not player:GetAttribute("DataLoaded") and os.clock() - t0 < 90 do task.wait(0.5) end
|
||||
if player.Parent then PlayerData.ApplyTutorialEpoch(player, epoch) end
|
||||
end
|
||||
Players.PlayerAdded:Connect(onJoin)
|
||||
for _, p in Players:GetPlayers() do task.spawn(onJoin, p) end
|
||||
Players.PlayerRemoving:Connect(function(p) rankCache[p] = nil end)
|
||||
|
||||
---------------------------------------------------------------- helpers
|
||||
local function snapshot()
|
||||
local out = {}
|
||||
for _, p in Players:GetPlayers() do
|
||||
local d = PlayerData.Get(p)
|
||||
table.insert(out, {
|
||||
id = p.UserId, name = p.Name, display = p.DisplayName, loaded = d ~= nil,
|
||||
level = d and d.Level or 0, shards = d and d.Shards or 0, toys = PlayerData.OrnamentCount(p),
|
||||
boosters = d and table.clone(d.Boosters) or {},
|
||||
tutorial = d ~= nil and d.TutorialDone == true, admin = p:GetAttribute("IsAdmin") == true,
|
||||
})
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
||||
local function target(id)
|
||||
local p = type(id) == "number" and Players:GetPlayerByUserId(id)
|
||||
if p and PlayerData.Get(p) then return p end
|
||||
return nil
|
||||
end
|
||||
|
||||
local function dropMarketLots(ids, userId)
|
||||
for _, id in ids do
|
||||
pcall(function()
|
||||
MarketStore.Update(id, function(old)
|
||||
if old and old.State == "active" then old.State = "cancelled" return old end
|
||||
return nil
|
||||
end, 60)
|
||||
MarketStore.Remove(id)
|
||||
end)
|
||||
end
|
||||
pcall(MarketStore.MailTake, userId) -- unpaid sales of the old profile
|
||||
pcall(MarketStore.Publish, { type = "removed" })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- actions
|
||||
local actions = {}
|
||||
|
||||
function actions.List()
|
||||
return { ok = true }
|
||||
end
|
||||
|
||||
function actions.Give(admin, id, amount)
|
||||
local p = target(id)
|
||||
if not p then return { ok = false, msg = "Player not found on this server" } end
|
||||
if type(amount) ~= "number" or amount ~= amount or amount == 0 then return { ok = false, msg = "Enter a shard amount" } end
|
||||
amount = math.clamp(math.floor(amount), -MAX_GIVE, MAX_GIVE)
|
||||
local before = PlayerData.Get(p).Shards
|
||||
PlayerData.AddShards(p, amount)
|
||||
local delta = PlayerData.Get(p).Shards - before
|
||||
task.spawn(PlayerData.Save, p)
|
||||
if p ~= admin then
|
||||
notify:FireClient(p, (delta >= 0 and "An admin gave you " or "An admin took ") .. fmt(math.abs(delta)) .. " shards",
|
||||
delta >= 0 and "level" or "warn")
|
||||
end
|
||||
return { ok = true, msg = (delta >= 0 and "Given " or "Taken ") .. fmt(math.abs(delta)) .. " shards · " .. p.DisplayName }
|
||||
end
|
||||
|
||||
function actions.SetLevel(admin, id, level)
|
||||
local p = target(id)
|
||||
if not p then return { ok = false, msg = "Player not found on this server" } end
|
||||
if type(level) ~= "number" or level ~= level then return { ok = false, msg = "Enter a level" } end
|
||||
level = math.clamp(math.floor(level), 1, Config.MAX_LEVEL)
|
||||
PlayerData.SetLevel(p, level)
|
||||
task.spawn(PlayerData.Save, p)
|
||||
if p ~= admin then notify:FireClient(p, "An admin set your level to " .. level, "level") end
|
||||
return { ok = true, msg = "Level " .. level .. " · " .. p.DisplayName }
|
||||
end
|
||||
|
||||
function actions.Booster(admin, id, boosterId, delta)
|
||||
local p = target(id)
|
||||
if not p then return { ok = false, msg = "Player not found on this server" } end
|
||||
local b = type(boosterId) == "string" and Config.BOOSTERS[boosterId]
|
||||
if not b or type(delta) ~= "number" or delta ~= delta or delta == 0 then return { ok = false, msg = "Unknown booster" } end
|
||||
delta = math.clamp(math.floor(delta), -1000, 1000)
|
||||
local before = PlayerData.Get(p).Boosters[boosterId] or 0
|
||||
PlayerData.AddBooster(p, boosterId, delta)
|
||||
local now = PlayerData.Get(p).Boosters[boosterId] or 0
|
||||
if now == before then return { ok = false, msg = "The player has no “" .. b.Name .. "”" } end
|
||||
task.spawn(PlayerData.Save, p)
|
||||
if p ~= admin then
|
||||
notify:FireClient(p, (now > before and "An admin gave you a “" or "An admin took your “") .. b.Name .. "”", now > before and "level" or "warn")
|
||||
end
|
||||
return { ok = true, msg = b.Name .. ": " .. before .. " → " .. now .. " · " .. p.DisplayName }
|
||||
end
|
||||
|
||||
function actions.ResetTutorial(admin, id)
|
||||
local p = target(id)
|
||||
if not p then return { ok = false, msg = "Player not found on this server" } end
|
||||
PlayerData.ResetTutorial(p)
|
||||
task.spawn(PlayerData.Save, p)
|
||||
if p ~= admin then notify:FireClient(p, "The tutorial will start over", "shards") end
|
||||
return { ok = true, msg = "Tutorial reset · " .. p.DisplayName .. " (starts now)" }
|
||||
end
|
||||
|
||||
function actions.ResetStats(admin, id)
|
||||
local p = target(id)
|
||||
if not p then return { ok = false, msg = "Player not found on this server" } end
|
||||
local lots = PlayerData.ResetProfile(p)
|
||||
if not lots then return { ok = false, msg = "Player data not loaded" } end
|
||||
p:SetAttribute("CraftSlots", string.rep("0", Config.SLOT_COUNT))
|
||||
p:SetAttribute("CraftBooster", nil)
|
||||
if resetEvent then resetEvent:Fire(p) end
|
||||
task.spawn(dropMarketLots, lots, p.UserId)
|
||||
task.spawn(PlayerData.Save, p)
|
||||
if p ~= admin then notify:FireClient(p, "Your progress was reset by an admin", "warn") end
|
||||
return { ok = true, msg = "Stats reset · " .. p.DisplayName }
|
||||
end
|
||||
|
||||
function actions.ResetTutorialAll()
|
||||
local newEpoch, global = epoch + 1, false
|
||||
if adminStore then
|
||||
local ok, v = pcall(function()
|
||||
return adminStore:UpdateAsync("TutorialEpoch", function(old) return math.max(tonumber(old) or 0, epoch) + 1 end)
|
||||
end)
|
||||
if ok and type(v) == "number" then newEpoch, global = v, true end
|
||||
end
|
||||
setEpoch(newEpoch)
|
||||
if global then
|
||||
pcall(function() MessagingService:PublishAsync(TOPIC, { kind = "TutorialEpoch", epoch = newEpoch }) end)
|
||||
return { ok = true, msg = "Tutorial reset for everyone: online players now, others on their next join" }
|
||||
end
|
||||
return { ok = true, msg = "DataStore unavailable: tutorial reset only for players on this server" }
|
||||
end
|
||||
|
||||
local last = {}
|
||||
adminFn.OnServerInvoke = function(player, action, a, b, c)
|
||||
if not isAdmin(player) then
|
||||
warn("[Admin] denied: " .. player.Name .. " (" .. player.UserId .. ") " .. tostring(action))
|
||||
return { ok = false, msg = "Access denied" }
|
||||
end
|
||||
if type(action) ~= "string" or not actions[action] then return { ok = false } end
|
||||
if action ~= "List" then
|
||||
local now = os.clock()
|
||||
if last[player] and now - last[player] < 0.3 then return { ok = false, msg = "Too fast", players = snapshot() } end
|
||||
last[player] = now
|
||||
end
|
||||
local ok, res = pcall(actions[action], player, a, b, c)
|
||||
if not ok then
|
||||
warn("[Admin] " .. action .. " failed: " .. tostring(res))
|
||||
res = { ok = false, msg = "Error: " .. tostring(res) }
|
||||
end
|
||||
if action ~= "List" then
|
||||
print(("[Admin] %s (%d): %s %s %s %s -> %s"):format(player.Name, player.UserId, action, tostring(a or ""), tostring(b or ""), tostring(c or ""), tostring(res.msg)))
|
||||
end
|
||||
res.players = snapshot()
|
||||
return res
|
||||
end
|
||||
Players.PlayerRemoving:Connect(function(p) last[p] = nil end)
|
||||
@@ -0,0 +1,213 @@
|
||||
-- PlayerSettings (LocalScript, StarterPlayerScripts): applies the Settings window choices on this client.
|
||||
-- The values live in the player profile on the server (OrnamentPlayerData.Settings) and arrive as player
|
||||
-- attributes Set_Master / Set_Music / Set_Effects / Set_UI (0..1), Set_MusicOn, Set_Lang ("auto" / "en" / "ru").
|
||||
-- The Settings window sets the same attributes locally while the player drags (instant feedback) and sends them
|
||||
-- to the server when the player stops.
|
||||
--
|
||||
-- SOUND: three local SoundGroups in SoundService; every Sound without a group is put into one of them:
|
||||
-- Settings_Music - the background music (SoundService.BackgroundMusic / the Music folder)
|
||||
-- Settings_UI - interface clicks (SoundService.UISounds) and sounds inside PlayerGui (notification sounds)
|
||||
-- Settings_Effects - everything else (machines, fireworks, footsteps, other players)
|
||||
-- group volume = Master x own level; music off = Settings_Music volume 0.
|
||||
--
|
||||
-- LANGUAGE:
|
||||
-- auto - texts are left alone, Roblox auto-translates them to the device language (AutoLocalize on)
|
||||
-- en - AutoLocalize off: the original English text
|
||||
-- ru - AutoLocalize off and every text is translated with ReplicatedStorage.OrnamentMachine.LangRU:
|
||||
-- whole text first, then "%d"-style templates, then the English pieces texts are glued from (longest
|
||||
-- first). Texts in PlayerGui and in world GUIs (signs, boards) and proximity prompts are watched, so texts
|
||||
-- the game sets later (timers, notifications) are translated too. The English original is remembered per
|
||||
-- object, switching back restores it. An object with the attribute NoTranslate is never touched.
|
||||
local Players = game:GetService("Players")
|
||||
local SoundService = game:GetService("SoundService")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local playerGui = player:WaitForChild("PlayerGui")
|
||||
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
|
||||
---------------------------------------------------------------- sound
|
||||
local function group(name)
|
||||
local g = SoundService:FindFirstChild(name)
|
||||
if not g then
|
||||
g = Instance.new("SoundGroup")
|
||||
g.Name = name
|
||||
g.Parent = SoundService
|
||||
end
|
||||
return g
|
||||
end
|
||||
local G_MUSIC, G_FX, G_UI = group("Settings_Music"), group("Settings_Effects"), group("Settings_UI")
|
||||
local OURS = { [G_MUSIC] = true, [G_FX] = true, [G_UI] = true }
|
||||
local musicFolder = SoundService:FindFirstChild("Music")
|
||||
local uiFolder = SoundService:FindFirstChild("UISounds")
|
||||
|
||||
local function classify(s)
|
||||
if not s:IsA("Sound") then return end
|
||||
if s.SoundGroup and not OURS[s.SoundGroup] then return end -- e.g. MutedCharacterSounds (Footsteps)
|
||||
local g
|
||||
if s.Name == "BackgroundMusic" or (musicFolder and s:IsDescendantOf(musicFolder)) then g = G_MUSIC
|
||||
elseif (uiFolder and s:IsDescendantOf(uiFolder)) or s:IsDescendantOf(playerGui) then g = G_UI
|
||||
else g = G_FX end
|
||||
if s.SoundGroup ~= g then s.SoundGroup = g end
|
||||
end
|
||||
for _, root in { workspace, SoundService, playerGui } do
|
||||
for _, d in root:GetDescendants() do classify(d) end
|
||||
root.DescendantAdded:Connect(function(d) if d:IsA("Sound") then task.defer(classify, d) end end)
|
||||
end
|
||||
|
||||
local function applySound()
|
||||
local master = attr("Set_Master", 1)
|
||||
G_MUSIC.Volume = attr("Set_MusicOn", true) and master * attr("Set_Music", 1) or 0
|
||||
G_FX.Volume = master * attr("Set_Effects", 1)
|
||||
G_UI.Volume = master * attr("Set_UI", 1)
|
||||
end
|
||||
for _, n in { "Set_Master", "Set_Music", "Set_Effects", "Set_UI", "Set_MusicOn" } do
|
||||
player:GetAttributeChangedSignal(n):Connect(applySound)
|
||||
end
|
||||
applySound()
|
||||
|
||||
---------------------------------------------------------------- language
|
||||
local PAIRS = require(ReplicatedStorage:WaitForChild("OrnamentMachine"):WaitForChild("LangRU"))
|
||||
local exact, pieces, templates = {}, {}, {}
|
||||
-- a string.format template -> Lua pattern (each %d / %02d / %.2f / %s = one capture) or -> a "%s"-only format
|
||||
local function scanFormat(s, onSpec, onPercent, onChar)
|
||||
local out, i = {}, 1
|
||||
while i <= #s do
|
||||
local c = s:sub(i, i)
|
||||
local spec = c == "%" and s:match("^%%[%d%.]*[dfs]", i)
|
||||
if s:sub(i, i + 1) == "%%" then table.insert(out, onPercent); i += 2
|
||||
elseif spec then table.insert(out, onSpec); i += #spec
|
||||
else table.insert(out, onChar(c)); i += 1 end
|
||||
end
|
||||
return table.concat(out)
|
||||
end
|
||||
local function esc(c) return c:find("[%^%$%(%)%.%[%]%*%+%-%?%%]") and ("%" .. c) or c end
|
||||
for _, p in PAIRS do
|
||||
local en, ru = p[1], p[2]
|
||||
if exact[en] == nil then
|
||||
exact[en] = ru
|
||||
if en:find("%%[%d%.]*[dfs]") then
|
||||
-- "+1 in %d:%02d · up to %d" -> "^%+1 in (.-):(.-) · up to (.-)$"; the Russian text gets the pieces in order
|
||||
table.insert(templates, {
|
||||
pat = "^" .. scanFormat(en, "(.-)", "%%", esc) .. "$",
|
||||
ru = scanFormat(ru, "%s", "%%", function(c) return c end),
|
||||
})
|
||||
elseif utf8.len(en) and utf8.len(en) >= 4 and en:find("%a%a") then
|
||||
table.insert(pieces, { en, ru })
|
||||
end
|
||||
end
|
||||
end
|
||||
table.sort(pieces, function(a, b) return #a[1] > #b[1] end)
|
||||
|
||||
local function replaceAll(s, a, b)
|
||||
local out, i = {}, 1
|
||||
while true do
|
||||
local x, y = s:find(a, i, true)
|
||||
if not x then break end
|
||||
table.insert(out, s:sub(i, x - 1))
|
||||
table.insert(out, b)
|
||||
i = y + 1
|
||||
end
|
||||
if i == 1 then return s end
|
||||
table.insert(out, s:sub(i))
|
||||
return table.concat(out)
|
||||
end
|
||||
|
||||
local memo, memoN = {}, 0
|
||||
local function translate(s)
|
||||
if type(s) ~= "string" or s == "" or not s:find("%a") then return s end
|
||||
local hit = exact[s] or memo[s]
|
||||
if hit then return hit end
|
||||
local r
|
||||
for _, t in templates do
|
||||
local caps = { s:match(t.pat) }
|
||||
if #caps > 0 then
|
||||
for i, c in caps do caps[i] = translate(c) end
|
||||
local ok, v = pcall(string.format, t.ru, table.unpack(caps))
|
||||
if ok then r = v break end
|
||||
end
|
||||
end
|
||||
if not r then
|
||||
r = s
|
||||
for _, p in pieces do
|
||||
if r:find(p[1], 1, true) then r = replaceAll(r, p[1], p[2]) end
|
||||
end
|
||||
end
|
||||
if memoN > 4000 then memo, memoN = {}, 0 end
|
||||
memo[s] = r
|
||||
memoN += 1
|
||||
return r
|
||||
end
|
||||
|
||||
local lang = "auto"
|
||||
local PROPS = { TextLabel = { "Text" }, TextButton = { "Text" }, TextBox = { "PlaceholderText" }, ProximityPrompt = { "ActionText", "ObjectText" } }
|
||||
local tracked = setmetatable({}, { __mode = "k" }) -- obj -> { [prop] = english, ["=" .. prop] = what we wrote }
|
||||
|
||||
local function render(obj, prop, rec)
|
||||
local en = rec[prop]
|
||||
local out = (lang == "ru" and not obj:GetAttribute("NoTranslate")) and translate(en) or en
|
||||
rec["=" .. prop] = out
|
||||
if obj[prop] ~= out then obj[prop] = out end
|
||||
end
|
||||
local function onChanged(obj, prop)
|
||||
local rec = tracked[obj]
|
||||
local cur = obj[prop]
|
||||
if rec["=" .. prop] == cur then return end -- our own write
|
||||
rec[prop] = cur -- the game set a new (English) text
|
||||
render(obj, prop, rec)
|
||||
end
|
||||
local function watch(obj)
|
||||
local props = PROPS[obj.ClassName]
|
||||
if not props or tracked[obj] then return end
|
||||
local rec = {}
|
||||
tracked[obj] = rec
|
||||
for _, prop in props do
|
||||
rec[prop] = obj[prop]
|
||||
rec["=" .. prop] = obj[prop]
|
||||
obj:GetPropertyChangedSignal(prop):Connect(function() onChanged(obj, prop) end)
|
||||
if lang == "ru" then render(obj, prop, rec) end
|
||||
end
|
||||
end
|
||||
local function setAuto(obj)
|
||||
if obj:IsA("GuiObject") or obj:IsA("LayerCollector") then obj.AutoLocalize = (lang == "auto") and not obj:GetAttribute("NoTranslate") end
|
||||
end
|
||||
|
||||
local started = false
|
||||
local function start()
|
||||
if started then return end
|
||||
started = true
|
||||
local function hook(root, worldOnly)
|
||||
local function add(d)
|
||||
if worldOnly and not (d:IsA("ProximityPrompt") or d:FindFirstAncestorWhichIsA("LayerCollector")) then return end
|
||||
setAuto(d)
|
||||
watch(d)
|
||||
end
|
||||
for _, d in root:GetDescendants() do add(d) end
|
||||
root.DescendantAdded:Connect(add)
|
||||
end
|
||||
hook(playerGui, false)
|
||||
hook(workspace, true)
|
||||
end
|
||||
|
||||
local function applyLang()
|
||||
local new = attr("Set_Lang", "auto")
|
||||
if new ~= "auto" and new ~= "en" and new ~= "ru" then new = "auto" end
|
||||
if new == lang and started then return end
|
||||
lang = new
|
||||
if lang ~= "auto" then start() end
|
||||
if not started then return end
|
||||
for obj, rec in tracked do
|
||||
setAuto(obj)
|
||||
for _, prop in PROPS[obj.ClassName] or {} do
|
||||
if rec[prop] ~= nil then render(obj, prop, rec) end
|
||||
end
|
||||
end
|
||||
for _, root in { playerGui, workspace } do
|
||||
for _, d in root:GetDescendants() do
|
||||
if d:IsA("LayerCollector") or (root == playerGui and d:IsA("GuiObject")) then setAuto(d) end
|
||||
end
|
||||
end
|
||||
end
|
||||
player:GetAttributeChangedSignal("Set_Lang"):Connect(applyLang)
|
||||
applyLang()
|
||||
@@ -0,0 +1,179 @@
|
||||
-- PremiumWindow: "Премиум" — shard packs and booster packs for Robux (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Осколки / Бустеры / Как это работает. Button: ready "R$ N" -> busy while Roblox shows its purchase
|
||||
-- dialog -> card flashes "+N" when bought; off "Скоро" while the Developer Product is not set up (ProductId 0).
|
||||
-- Everything is granted on the server (ProcessReceipt); the client only opens PromptProductPurchase.
|
||||
local MarketplaceService = game:GetService("MarketplaceService")
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local P = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, BODY, NAVY = K.WHITE, K.GOLD, K.SOFT, K.OK, K.BODY, K.NAVY
|
||||
local new, corner, art, label, maxText, pill, tween = K.new, K.corner, K.art, K.label, K.maxText, K.pill, K.tween
|
||||
|
||||
function P.install(ctx)
|
||||
local Config, player = ctx.Config, ctx.player
|
||||
local fmt = ctx.fmtNum
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local TABS = {
|
||||
{ id = "Shards", text = "Shards", icon = "💎", tip = "The bigger the pack, the better the value per shard." },
|
||||
{ id = "Boosters", text = "Boosters", icon = "🍀", tip = "A booster goes in the generator slot — it multiplies the luck of one generation." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "Robux purchase: Roblox shows its own confirmation window." },
|
||||
}
|
||||
local refresh
|
||||
local ch = K.chrome({ win = win, title = "PREMIUM", subtitle = "Shards and boosters\nfor Robux", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = fmt, onTab = function() refresh() end })
|
||||
|
||||
local buttons = {} -- productId -> { btn, card, item }
|
||||
local waiting = {} -- productId -> true while the Roblox dialog is open
|
||||
local function buyButton(card, item, props)
|
||||
local btn
|
||||
btn = pill(card, props, function()
|
||||
waiting[item.ProductId] = true
|
||||
btn.set("busy")
|
||||
MarketplaceService:PromptProductPurchase(player, item.ProductId)
|
||||
task.delay(30, function() if waiting[item.ProductId] then waiting[item.ProductId] = nil; refresh() end end)
|
||||
end)
|
||||
if item.ProductId ~= 0 then buttons[item.ProductId] = { btn = btn, card = card, item = item } end
|
||||
return btn
|
||||
end
|
||||
local function paintButton(btn, item)
|
||||
if item.ProductId == 0 then btn.set("off", "Soon")
|
||||
elseif waiting[item.ProductId] then btn.set("busy")
|
||||
else btn.set("ready", "R$ " .. item.Robux) end
|
||||
end
|
||||
local all = {}
|
||||
|
||||
-- shard packs: 4 tall cards
|
||||
local _, shScroll = ch.makePage("Shards", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(300, 548), CellPadding = UDim2.fromOffset(18, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = shScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 8), Parent = shScroll })
|
||||
local cheapest
|
||||
for _, item in Config.PREMIUM do
|
||||
if item.Kind == "Shards" then
|
||||
local per = item.Amount / item.Robux
|
||||
cheapest = cheapest and math.min(cheapest, per) or per
|
||||
end
|
||||
end
|
||||
local order = 0
|
||||
for _, item in Config.PREMIUM do
|
||||
if item.Kind == "Shards" then
|
||||
order += 1
|
||||
local card = art(order == 4 and "cardOrange" or order == 3 and "cardViolet" or "cardCyan", { LayoutOrder = order, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = shScroll })
|
||||
if item.Tag then
|
||||
local tag = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(220, 40), BackgroundColor3 = GOLD, ZIndex = 7, Parent = card }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = Color3.fromRGB(150, 90, 10), Thickness = 2 }),
|
||||
})
|
||||
maxText(label({ Position = UDim2.fromOffset(10, 5), Size = UDim2.new(1, -20, 1, -10), Text = item.Tag, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 8, Parent = tag }, 1.5), 24)
|
||||
end
|
||||
-- a pile of crystals: bigger pack, bigger pile
|
||||
local n = item.Amount >= 3000 and 4 or item.Amount >= 1200 and 3 or item.Amount >= 500 and 2 or 1
|
||||
local pile = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 96), Size = UDim2.fromOffset(240, 170), BackgroundTransparency = 1, ZIndex = 5, Parent = card })
|
||||
for k = 1, n do
|
||||
local off = k - (n + 1) / 2
|
||||
local ic = art("crystal", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(0.5, off * 52, 0.5, (k % 2) * 16 - 4), Size = UDim2.fromOffset(120, 120),
|
||||
Rotation = off * 12, ZIndex = 5 + (k % 2), Parent = pile })
|
||||
local s = new("UIScale", { Parent = ic })
|
||||
task.spawn(function()
|
||||
task.wait(k * 0.3)
|
||||
while ic.Parent do
|
||||
tween(s, 1.4, { Scale = 1.06 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
tween(s, 1.4, { Scale = 1 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
end
|
||||
end)
|
||||
end
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 280), Size = UDim2.new(1, -40, 0, 46), Text = item.Name, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 36)
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 330), Size = UDim2.new(1, -40, 0, 50), Text = "+" .. fmt(item.Amount), TextScaled = true, TextColor3 = Color3.fromRGB(190, 230, 255),
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 48)
|
||||
local bonus = math.floor((item.Amount / item.Robux / cheapest - 1) * 100 + 0.5)
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 384), Size = UDim2.new(1, -40, 0, 26), Text = bonus > 0 and ("shards · " .. bonus .. "% more per R$") or "shards", TextScaled = true,
|
||||
FontFace = BODY, TextColor3 = bonus > 0 and GOLD or SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 1.5), 20)
|
||||
local btn = buyButton(card, item, { Position = UDim2.fromOffset(30, 428), Size = UDim2.fromOffset(240, 74), ZIndex = 5, TextMax = 32 })
|
||||
table.insert(all, { btn = btn, item = item })
|
||||
end
|
||||
end
|
||||
|
||||
-- booster packs: 2 wide cards
|
||||
local _, boScroll = ch.makePage("Boosters", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(615, 470), CellPadding = UDim2.fromOffset(18, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = boScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 2), PaddingTop = UDim.new(0, 2), Parent = boScroll })
|
||||
local owned = {}
|
||||
order = 0
|
||||
for _, item in Config.PREMIUM do
|
||||
if item.Kind == "Booster" then
|
||||
order += 1
|
||||
local b = Config.BOOSTERS[item.Booster]
|
||||
local card = art(order == 1 and "cardGreen" or "cardOrange", { LayoutOrder = order, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = boScroll })
|
||||
local orb = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 52), Size = UDim2.fromOffset(170, 170), BackgroundColor3 = b.Color, ZIndex = 5, Parent = card }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 6 }),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(WHITE, Color3.fromRGB(170, 170, 170)) }),
|
||||
})
|
||||
label({ Size = UDim2.fromScale(1, 1), Text = "x" .. b.Luck, TextSize = 76, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = orb }, 4)
|
||||
local cnt = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(1, 4, 0, 26), Size = UDim2.fromOffset(70, 70), BackgroundColor3 = Color3.fromRGB(226, 40, 52), ZIndex = 7, Parent = orb }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 4 }),
|
||||
})
|
||||
maxText(label({ Position = UDim2.fromScale(0.15, 0.2), Size = UDim2.fromScale(0.7, 0.6), Text = "×" .. item.Amount, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 8, Parent = cnt }, 2), 34)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 236), Size = UDim2.new(1, -60, 0, 50), Text = item.Name, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 44)
|
||||
maxText(label({ Position = UDim2.fromOffset(40, 288), Size = UDim2.new(1, -80, 0, 30), Text = item.Amount .. " boosters · one generation luck x" .. b.Luck, TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 1.5), 22)
|
||||
local chip = new("Frame", { AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -30, 0, 44), Size = UDim2.fromOffset(140, 50), BackgroundColor3 = NAVY,
|
||||
BackgroundTransparency = 0.15, ZIndex = 6, Parent = card }, { corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 2 }) })
|
||||
owned[item.Booster] = maxText(label({ Position = UDim2.fromOffset(8, 6), Size = UDim2.new(1, -16, 1, -12), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 7, Parent = chip }, 2), 26)
|
||||
local btn = buyButton(card, item, { Position = UDim2.fromOffset(157, 344), Size = UDim2.fromOffset(300, 76), ZIndex = 5, TextMax = 34 })
|
||||
table.insert(all, { btn = btn, item = item })
|
||||
end
|
||||
end
|
||||
|
||||
-- help
|
||||
local _, heScroll = ch.makePage("Help", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardCyan", icon = "🛡", title = "Safe", btn = "To Shards", tab = "Shards",
|
||||
text = "Payment goes through Roblox: it shows its own confirmation window before charging Robux." },
|
||||
{ card = "cardViolet", icon = "⚡", title = "Instant", btn = "To Shards", tab = "Shards",
|
||||
text = "Shards and boosters arrive instantly and are saved with your progress." },
|
||||
{ card = "cardOrange", icon = "🍀", title = "Boosters", btn = "To Boosters", tab = "Boosters",
|
||||
text = "A booster goes in the generator slot. It multiplies the luck of one generation and is used up when you make an ornament." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, function() ch.showTab(h.tab) end)
|
||||
go.set("alt", h.btn)
|
||||
end
|
||||
|
||||
refresh = function()
|
||||
ch.setBalance(attr("Shards", 0))
|
||||
for _, e in all do paintButton(e.btn, e.item) end
|
||||
for id, t in owned do t.Text = "you have: " .. attr("Booster_" .. id, 0) end
|
||||
end
|
||||
MarketplaceService.PromptProductPurchaseFinished:Connect(function(userId, productId, bought)
|
||||
if userId ~= player.UserId or not waiting[productId] then return end
|
||||
waiting[productId] = nil
|
||||
local e = buttons[productId]
|
||||
if bought and e and win.overlay.Visible then
|
||||
K.flash(e.card)
|
||||
K.floatText(e.card, e.item.Kind == "Shards" and ("+" .. fmt(e.item.Amount)) or ("+" .. e.item.Amount .. " boosters"))
|
||||
end
|
||||
refresh()
|
||||
end)
|
||||
player:GetAttributeChangedSignal("Shards"):Connect(function() if win.overlay.Visible then refresh() end end)
|
||||
for id in Config.BOOSTERS do
|
||||
player:GetAttributeChangedSignal("Booster_" .. id):Connect(function() if win.overlay.Visible then refresh() end end)
|
||||
end
|
||||
ch.showTab("Shards")
|
||||
return {
|
||||
open = function(tab)
|
||||
ch.setBalance(attr("Shards", 0), true)
|
||||
if tab then ch.showTab(tab) end
|
||||
refresh()
|
||||
end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return P
|
||||
@@ -0,0 +1,199 @@
|
||||
-- SettingsWindow: "Settings" — sound volumes, background music on/off, interface language (frame, tabs: ShopKit).
|
||||
-- Tabs: Sound / Language.
|
||||
-- Sound: sliders Master / Music / Effects / Interface (drag or click the track, 0..100 %) + a Background music
|
||||
-- On/Off switch.
|
||||
-- Language: Auto (Roblox translates to the device language) / English / Русский.
|
||||
-- Values: player attributes Set_* (from the profile, see OrnamentPlayerData.Settings). A change is applied at once
|
||||
-- by setting the attribute locally (PlayerSettings listens to it) and is sent to the server
|
||||
-- (OrnamentMachine.Settings) 0.6 s after the player stops changing things, so it is saved in the profile.
|
||||
local UIS = game:GetService("UserInputService")
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local S = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, BODY, NAVY, INK = K.WHITE, K.GOLD, K.SOFT, K.BODY, K.NAVY, K.INK
|
||||
local new, corner, art, label, maxText, pill, tween = K.new, K.corner, K.art, K.label, K.maxText, K.pill, K.tween
|
||||
|
||||
local DEFAULTS = { Master = 1, Music = 1, Effects = 1, UI = 1, MusicOn = true, Lang = "auto" }
|
||||
|
||||
function S.install(ctx)
|
||||
local player, win, remote = ctx.player, ctx.win, ctx.remote
|
||||
local function get(k) local v = player:GetAttribute("Set_" .. k); if v == nil then return DEFAULTS[k] end return v end
|
||||
|
||||
-- local apply + debounced save
|
||||
local pending, stamp = {}, 0
|
||||
local function set(k, v)
|
||||
player:SetAttribute("Set_" .. k, v)
|
||||
pending[k] = v
|
||||
stamp += 1
|
||||
local my = stamp
|
||||
task.delay(0.6, function()
|
||||
if my ~= stamp or next(pending) == nil then return end
|
||||
local patch = pending
|
||||
pending = {}
|
||||
remote:FireServer(patch)
|
||||
end)
|
||||
end
|
||||
|
||||
local TABS = {
|
||||
{ id = "Sound", text = "Sound", icon = "🔊", tip = "Drag the sliders — settings are saved to your profile and come back on every server." },
|
||||
{ id = "Language", text = "Language", icon = "🌐", tip = "Pick the interface language — it is saved to your profile." },
|
||||
}
|
||||
local refresh
|
||||
local ch = K.chrome({ win = win, title = "SETTINGS", subtitle = "Sound and language", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = ctx.fmtNum, onTab = function() refresh() end })
|
||||
-- the "Language" tab always says "Language" (in every interface language and with Roblox auto-translation),
|
||||
-- so a player who switched to a language they can not read still finds the way back
|
||||
for _, d in ch.tabs.Language.button:GetDescendants() do
|
||||
if d:IsA("TextLabel") and d.Text == "Language" then
|
||||
d:SetAttribute("NoTranslate", true)
|
||||
d.AutoLocalize = false
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- sound page
|
||||
local page = ch.makePage("Sound")
|
||||
local ROW_W, ROW_H, GAP = 1180, 98, 10
|
||||
local function row(i)
|
||||
return new("Frame", { Position = UDim2.fromOffset(40, 6 + (i - 1) * (ROW_H + GAP)), Size = UDim2.fromOffset(ROW_W, ROW_H), BackgroundColor3 = NAVY,
|
||||
BackgroundTransparency = 0.25, ZIndex = 4, Parent = page }, { corner(UDim.new(0, 24)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.45 }) })
|
||||
end
|
||||
local function caption(r, icon, title, sub)
|
||||
label({ Position = UDim2.fromOffset(18, 14), Size = UDim2.fromOffset(70, 70), Text = icon, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = r }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(100, 12), Size = UDim2.fromOffset(330, 44), Text = title, TextScaled = true, ZIndex = 5, Parent = r }, 2.5), 36)
|
||||
maxText(label({ Position = UDim2.fromOffset(100, 58), Size = UDim2.fromOffset(330, 28), Text = sub, TextScaled = true, FontFace = BODY, TextColor3 = SOFT, ZIndex = 5, Parent = r }, 1.5), 22)
|
||||
end
|
||||
|
||||
local sliders = {}
|
||||
local dragging -- { s = slider, input = InputObject? }
|
||||
local function slider(i, key, icon, title, sub)
|
||||
local r = row(i)
|
||||
caption(r, icon, title, sub)
|
||||
local TRACK_X, TRACK_W = 470, 540
|
||||
local hit = new("TextButton", { Text = "", AutoButtonColor = false, BackgroundTransparency = 1, Position = UDim2.fromOffset(TRACK_X - 20, 14),
|
||||
Size = UDim2.fromOffset(TRACK_W + 40, 70), ZIndex = 5, Parent = r })
|
||||
hit:SetAttribute("NoSound", true)
|
||||
local track = new("Frame", { Position = UDim2.fromOffset(20, 24), Size = UDim2.fromOffset(TRACK_W, 22), BackgroundColor3 = Color3.fromRGB(6, 30, 16), ZIndex = 5, Parent = hit }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = Color3.fromRGB(255, 220, 120), Thickness = 2, Transparency = 0.3 }),
|
||||
})
|
||||
local fill = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = WHITE, ZIndex = 6, Parent = track }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIGradient", { Color = ColorSequence.new(Color3.fromRGB(255, 240, 150), Color3.fromRGB(240, 165, 30)) }),
|
||||
})
|
||||
local knob = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(1, 0.5), Size = UDim2.fromOffset(54, 54), BackgroundColor3 = WHITE, ZIndex = 8, Parent = track }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = INK, Thickness = 3 }),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(Color3.fromRGB(255, 244, 190), Color3.fromRGB(236, 170, 40)) }),
|
||||
})
|
||||
local knobScale = new("UIScale", { Parent = knob })
|
||||
local pct = maxText(label({ Position = UDim2.fromOffset(1050, 22), Size = UDim2.fromOffset(110, 54), Text = "100%", TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = r }, 2.5), 36)
|
||||
local s = { key = key, track = track, hover = false }
|
||||
function s.show(v)
|
||||
fill.Size = UDim2.fromScale(v, 1)
|
||||
fill.Visible = v > 0.001
|
||||
knob.Position = UDim2.fromScale(v, 0.5)
|
||||
pct.Text = math.floor(v * 100 + 0.5) .. "%"
|
||||
end
|
||||
function s.paint()
|
||||
local active = dragging and dragging.s == s
|
||||
tween(knobScale, 0.12, { Scale = active and 1.18 or s.hover and 1.1 or 1 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
function s.setFromX(x)
|
||||
local a, w = track.AbsolutePosition.X, track.AbsoluteSize.X
|
||||
if w <= 0 then return end
|
||||
local v = math.clamp((x - a) / w, 0, 1)
|
||||
v = math.floor(v * 100 + 0.5) / 100
|
||||
s.show(v)
|
||||
if v ~= get(key) then set(key, v) end
|
||||
end
|
||||
hit.MouseEnter:Connect(function() s.hover = true; s.paint() end)
|
||||
hit.MouseLeave:Connect(function() s.hover = false; s.paint() end)
|
||||
hit.InputBegan:Connect(function(input)
|
||||
if K.isPress(input) then
|
||||
dragging = { s = s, input = input.UserInputType == Enum.UserInputType.Touch and input or nil }
|
||||
s.setFromX(input.Position.X)
|
||||
s.paint()
|
||||
end
|
||||
end)
|
||||
sliders[key] = s
|
||||
return s
|
||||
end
|
||||
UIS.InputChanged:Connect(function(input)
|
||||
if not dragging then return end
|
||||
if input.UserInputType == Enum.UserInputType.MouseMovement or (dragging.input and input == dragging.input) or input.UserInputType == Enum.UserInputType.Touch then
|
||||
dragging.s.setFromX(input.Position.X)
|
||||
end
|
||||
end)
|
||||
UIS.InputEnded:Connect(function(input)
|
||||
if dragging and (input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch) then
|
||||
local s = dragging.s
|
||||
dragging = nil
|
||||
s.paint()
|
||||
end
|
||||
end)
|
||||
|
||||
slider(1, "Master", "🔊", "Master volume", "All game sounds")
|
||||
slider(2, "Music", "🎵", "Music", "Background tracks")
|
||||
slider(3, "Effects", "✨", "Effects", "Machines, fireworks, steps")
|
||||
slider(4, "UI", "🖱", "Interface", "Clicks and notifications")
|
||||
local musicRow = row(5)
|
||||
caption(musicRow, "🎶", "Background music", "Play the background tracks")
|
||||
local musicBtn = pill(musicRow, { Position = UDim2.fromOffset(880, 12), Size = UDim2.fromOffset(260, 74), ZIndex = 5, TextMax = 32 }, function()
|
||||
set("MusicOn", not get("MusicOn"))
|
||||
refresh()
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- language page
|
||||
local _, langScroll = ch.makePage("Language", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = langScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = langScroll })
|
||||
local LANGS = {
|
||||
{ id = "auto", card = "cardCyan", badge = "AUTO", title = "Auto", text = "Roblox translates the game into your device language." },
|
||||
{ id = "en", card = "cardViolet", badge = "EN", title = "English", text = "The original English text." },
|
||||
{ id = "ru", card = "cardOrange", badge = "RU", title = "Русский", text = "Весь интерфейс на русском.", native = true },
|
||||
}
|
||||
local langButtons = {}
|
||||
for i, l in LANGS do
|
||||
local card = art(l.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = langScroll })
|
||||
local disc = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 48), Size = UDim2.fromOffset(150, 150), BackgroundColor3 = NAVY, ZIndex = 5, Parent = card }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 5 }),
|
||||
})
|
||||
local b = maxText(label({ Position = UDim2.fromScale(0.12, 0.25), Size = UDim2.fromScale(0.76, 0.5), Text = l.badge, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = disc }, 3), 60)
|
||||
b:SetAttribute("NoTranslate", true)
|
||||
local t = maxText(label({ Position = UDim2.fromOffset(24, 214), Size = UDim2.new(1, -48, 0, 54), Text = l.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 46)
|
||||
local d = maxText(label({ Position = UDim2.fromOffset(34, 276), Size = UDim2.new(1, -68, 0, 120), Text = l.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 26)
|
||||
if l.id ~= "auto" then t:SetAttribute("NoTranslate", true) end -- language names stay in their own language
|
||||
if l.native then d:SetAttribute("NoTranslate", true) end
|
||||
langButtons[l.id] = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 74), ZIndex = 5, TextMax = 30 }, function()
|
||||
set("Lang", l.id)
|
||||
K.flash(card)
|
||||
refresh()
|
||||
end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- refresh
|
||||
refresh = function()
|
||||
ch.setBalance(player:GetAttribute("Shards") or 0)
|
||||
for key, s in sliders do if not (dragging and dragging.s == s) then s.show(get(key)) end end
|
||||
local on = get("MusicOn")
|
||||
musicBtn.set(on and "ready" or "alt", on and "On" or "Off")
|
||||
local lang = get("Lang")
|
||||
for id, btn in langButtons do
|
||||
if id == lang then btn.set("done", "Selected") else btn.set("ready", "Select") end
|
||||
end
|
||||
end
|
||||
for _, k in { "Master", "Music", "Effects", "UI", "MusicOn", "Lang" } do
|
||||
player:GetAttributeChangedSignal("Set_" .. k):Connect(function() if win.overlay.Visible then refresh() end end)
|
||||
end
|
||||
ch.showTab("Sound")
|
||||
return {
|
||||
open = function(tab)
|
||||
ch.setBalance(player:GetAttribute("Shards") or 0, true)
|
||||
if tab then ch.showTab(tab) end
|
||||
refresh()
|
||||
end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return S
|
||||
@@ -0,0 +1,494 @@
|
||||
-- ShopKit: shared pieces of the New Year shop-style windows (Мастерская, Рынок).
|
||||
-- Art from GUI/магазин: snowy green panel, red ribbon, pill buttons, ray cards, crystal, holly, gift.
|
||||
-- Design canvas 1400 x 1000 px; OrnamentCraftUI's openWindow() scales it to the screen.
|
||||
--
|
||||
-- K.pill : action button with states
|
||||
-- ready (gold) / alt (blue) / confirm, danger (red) — clickable
|
||||
-- done (green) / info (blue) — inert, off (grey, says what is missing) / busy (•••, waiting for the server)
|
||||
-- hover = grow + light ring, press = shrink + darken, a click on "off" wiggles it.
|
||||
-- K.chip : filter chip (green, gold when selected), same hover / press feel.
|
||||
-- K.chrome : the whole window frame — gradient body, stars, garlands, ribbon title, balance plate, close button,
|
||||
-- content panel, tip line and up to 4 tabs (normal / hover / pressed / selected + red badge).
|
||||
local TweenService = game:GetService("TweenService")
|
||||
|
||||
local K = {}
|
||||
|
||||
K.FONT = Font.new("rbxasset://fonts/families/FredokaOne.json", Enum.FontWeight.Bold)
|
||||
K.BODY = Font.new("rbxasset://fonts/families/GothamSSm.json", Enum.FontWeight.Bold)
|
||||
K.INK = Color3.fromRGB(12, 8, 10)
|
||||
K.WHITE = Color3.new(1, 1, 1)
|
||||
K.GOLD = Color3.fromRGB(255, 211, 116)
|
||||
K.SOFT = Color3.fromRGB(222, 238, 230)
|
||||
K.OK = Color3.fromRGB(150, 255, 160)
|
||||
K.WARN = Color3.fromRGB(255, 196, 120)
|
||||
K.NAVY = Color3.fromRGB(14, 26, 58)
|
||||
local FONT, BODY, INK, WHITE, GOLD, SOFT, OK, NAVY = K.FONT, K.BODY, K.INK, K.WHITE, K.GOLD, K.SOFT, K.OK, K.NAVY
|
||||
|
||||
-- art (id, opaque rect in the source png)
|
||||
K.ART = {
|
||||
panel = { "rbxassetid://138527541920438", { 18, 42, 278, 234 } },
|
||||
ribbon = { "rbxassetid://103499479509351", { 10, 74, 294, 166 } },
|
||||
green = { "rbxassetid://93987797017793", { 16, 110, 280, 102 } },
|
||||
red = { "rbxassetid://138508596098174", { 18, 108, 280, 102 } },
|
||||
blue = { "rbxassetid://111888989174975", { 18, 114, 278, 94 } },
|
||||
gold = { "rbxassetid://131564766133063", { 16, 108, 280, 102 } },
|
||||
grey = { "rbxassetid://89653402754634", { 16, 108, 280, 102 } },
|
||||
crystal = { "rbxassetid://105804941618750", { 54, 56, 206, 210 } },
|
||||
cardGreen = { "rbxassetid://105142745227171", { 16, 22, 280, 272 } },
|
||||
cardCyan = { "rbxassetid://116968687145512", { 18, 22, 280, 272 } },
|
||||
cardViolet = { "rbxassetid://103872013133887", { 16, 22, 282, 272 } },
|
||||
cardOrange = { "rbxassetid://125846279529125", { 18, 22, 280, 272 } },
|
||||
gift = { "rbxassetid://85573436333424" },
|
||||
holly = { "rbxassetid://96646166091621" },
|
||||
garland = { "rbxassetid://133428323657868" },
|
||||
}
|
||||
K.CARD_SLICE = Rect.new(34, 60, 246, 206)
|
||||
local ART = K.ART
|
||||
|
||||
function K.tween(o, t, props, style, dir)
|
||||
local tw = TweenService:Create(o, TweenInfo.new(t, style or Enum.EasingStyle.Quad, dir or Enum.EasingDirection.Out), props)
|
||||
tw:Play()
|
||||
return tw
|
||||
end
|
||||
local tween = K.tween
|
||||
function K.new(class, props, children)
|
||||
local o = Instance.new(class)
|
||||
for k, v in props do if k ~= "Parent" then o[k] = v end end
|
||||
for _, c in children or {} do c.Parent = o end
|
||||
if class == "TextButton" or class == "ImageButton" then o:SetAttribute("UXDone", true) end -- OrnamentUX: hands off
|
||||
if props.Parent then o.Parent = props.Parent end
|
||||
return o
|
||||
end
|
||||
local new = K.new
|
||||
function K.corner(r) return new("UICorner", { CornerRadius = r }) end
|
||||
local corner = K.corner
|
||||
function K.art(name, props, isButton)
|
||||
local d = ART[name]
|
||||
props.BackgroundTransparency = 1
|
||||
props.Image = d[1]
|
||||
if d[2] then
|
||||
props.ImageRectOffset = Vector2.new(d[2][1], d[2][2])
|
||||
props.ImageRectSize = Vector2.new(d[2][3], d[2][4])
|
||||
end
|
||||
return new(isButton and "ImageButton" or "ImageLabel", props)
|
||||
end
|
||||
local art = K.art
|
||||
function K.setArt(img, name)
|
||||
local d = ART[name]
|
||||
img.Image = d[1]
|
||||
img.ImageRectOffset = Vector2.new(d[2][1], d[2][2])
|
||||
img.ImageRectSize = Vector2.new(d[2][3], d[2][4])
|
||||
end
|
||||
local setArt = K.setArt
|
||||
-- rounded title text with a thin black outline
|
||||
function K.label(props, stroke)
|
||||
props.BackgroundTransparency = 1
|
||||
props.FontFace = props.FontFace or FONT
|
||||
props.TextColor3 = props.TextColor3 or WHITE
|
||||
if props.TextXAlignment == nil then props.TextXAlignment = Enum.TextXAlignment.Left end
|
||||
local t = new("TextLabel", props)
|
||||
new("UIStroke", { Color = INK, Thickness = stroke or 2, Parent = t })
|
||||
return t
|
||||
end
|
||||
local label = K.label
|
||||
function K.maxText(t, size) new("UITextSizeConstraint", { MaxTextSize = size, Parent = t }) return t end
|
||||
local maxText = K.maxText
|
||||
function K.isPress(input)
|
||||
return input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch
|
||||
end
|
||||
local isPress = K.isPress
|
||||
-- floating "+1" over a card
|
||||
function K.floatText(parent, text, color)
|
||||
local t = label({ AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.45), Size = UDim2.fromOffset(300, 60),
|
||||
Text = text, TextSize = 48, TextColor3 = color or OK, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 40, Parent = parent }, 3)
|
||||
local sc = new("UIScale", { Scale = 0.6, Parent = t })
|
||||
tween(sc, 0.25, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
tween(t, 1.1, { Position = UDim2.fromScale(0.5, 0.05), TextTransparency = 1 })
|
||||
tween(t.UIStroke, 1.1, { Transparency = 1 })
|
||||
task.delay(1.15, function() t:Destroy() end)
|
||||
end
|
||||
function K.flash(card, radius)
|
||||
local f = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = WHITE, BackgroundTransparency = 0.45, ZIndex = 39, Parent = card }, { corner(UDim.new(0, radius or 30)) })
|
||||
tween(f, 0.5, { BackgroundTransparency = 1 })
|
||||
task.delay(0.55, function() f:Destroy() end)
|
||||
end
|
||||
-- vertical scrolling list / grid
|
||||
function K.scroll(parent, pos, size, layout)
|
||||
local s = new("ScrollingFrame", { Position = pos, Size = size, BackgroundTransparency = 1, BorderSizePixel = 0, ScrollBarThickness = 10, ZIndex = 4,
|
||||
ScrollBarImageColor3 = GOLD, AutomaticCanvasSize = Enum.AutomaticSize.Y, CanvasSize = UDim2.new(), ScrollingDirection = Enum.ScrollingDirection.Y, Parent = parent })
|
||||
if layout then layout.Parent = s end
|
||||
return s
|
||||
end
|
||||
-- gift + title + hint (+ optional button) for an empty list
|
||||
function K.emptyState(props, title, hint)
|
||||
local f = new("Frame", props)
|
||||
f.BackgroundTransparency = 1
|
||||
f.Parent = props.Parent
|
||||
art("gift", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 10), Size = UDim2.fromOffset(170, 170), ScaleType = Enum.ScaleType.Fit, ZIndex = 5, Parent = f })
|
||||
maxText(label({ Position = UDim2.new(0, 40, 0, 190), Size = UDim2.new(1, -80, 0, 50), Text = title, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = f }, 3), 42)
|
||||
maxText(label({ Position = UDim2.new(0, 40, 0, 246), Size = UDim2.new(1, -80, 0, 60), Text = hint, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = f }, 1.5), 26)
|
||||
return f
|
||||
end
|
||||
|
||||
-- links between windows: OrnamentCraftUI registers K.nav.<Window> = function(tabId) ... end
|
||||
K.nav = {}
|
||||
function K.go(window, tab)
|
||||
local f = K.nav[window]
|
||||
if f then f(tab) end
|
||||
end
|
||||
|
||||
-- toy tile (button): dark rounded square, the toy's pattern on a disc, name, rarity line, optional value line.
|
||||
-- o = { Config, miniPattern, parent, item, w, h, order, z, value } -> { button, stroke, scale, setSelected, lock }
|
||||
function K.toyTile(o)
|
||||
local Config = o.Config
|
||||
local it = o.item
|
||||
local r = Config.RarityById[it.Rarity]
|
||||
local v = it.Variant and Config.VariantById[it.Variant]
|
||||
local z = o.z or 5
|
||||
local edge = v and v.Color or r.Color
|
||||
local b = new("TextButton", { Text = "", AutoButtonColor = false, BackgroundColor3 = Color3.fromRGB(10, 26, 34), Size = UDim2.fromOffset(o.w, o.h),
|
||||
LayoutOrder = o.order or 0, ZIndex = z, Parent = o.parent }, { corner(UDim.new(0, 18)) })
|
||||
local st = new("UIStroke", { Color = edge, Thickness = 2.5, ApplyStrokeMode = Enum.ApplyStrokeMode.Border, Parent = b })
|
||||
local sc = new("UIScale", { Parent = b })
|
||||
local d = math.floor(math.min(o.w * 0.66, o.h * 0.52))
|
||||
local disc = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 6), Size = UDim2.fromOffset(d, d), BackgroundColor3 = Color3.new(0, 0, 0),
|
||||
BackgroundTransparency = 0.4, ZIndex = z + 1, Parent = b }, { corner(UDim.new(0.5, 0)) })
|
||||
local mini = o.miniPattern(Config.ToyById[it.Toy].Mask, r.Color, math.floor(d * 0.72), disc)
|
||||
mini.AnchorPoint = Vector2.new(0.5, 0.5)
|
||||
mini.Position = UDim2.fromScale(0.5, 0.5)
|
||||
mini.ZIndex = z + 2
|
||||
for _, x in mini:GetDescendants() do if x:IsA("GuiObject") then x.ZIndex = z + 2 end end
|
||||
local y = d + 8
|
||||
local lineH = math.floor((o.h - y - 4) / (o.value and 3 or 2))
|
||||
maxText(label({ Position = UDim2.fromOffset(4, y), Size = UDim2.new(1, -8, 0, lineH), Text = Config.ToyById[it.Toy].Name, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = z + 1, Parent = b }, 1.5), 22)
|
||||
maxText(label({ Position = UDim2.fromOffset(4, y + lineH), Size = UDim2.new(1, -8, 0, lineH), Text = r.Name .. (v and (" · " .. v.Name) or ""), TextScaled = true,
|
||||
TextColor3 = edge, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = z + 1, Parent = b }, 1.5), 18)
|
||||
if o.value then
|
||||
maxText(label({ Position = UDim2.fromOffset(4, y + lineH * 2), Size = UDim2.new(1, -8, 0, lineH), Text = o.valueText or (Config.Value(it) .. " shards"), TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = Color3.fromRGB(190, 225, 255), TextXAlignment = Enum.TextXAlignment.Center, ZIndex = z + 1, Parent = b }, 1.5), 16)
|
||||
end
|
||||
local t = { button = b, stroke = st, scale = sc, selected = false, locked = false, inert = o.inert }
|
||||
local function paint(hover, down)
|
||||
st.Color = t.selected and GOLD or edge
|
||||
st.Thickness = t.selected and 5 or 2.5
|
||||
local live = not t.locked and not t.inert
|
||||
tween(sc, 0.12, { Scale = (down and live) and 0.94 or (hover and live) and 1.06 or t.selected and 1.04 or 1 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
function t.setSelected(v2) t.selected = v2; paint() end
|
||||
function t.lock(text)
|
||||
t.locked = true
|
||||
local f = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.12, ZIndex = z + 5, Parent = b }, { corner(UDim.new(0, 18)) })
|
||||
maxText(label({ Position = UDim2.fromScale(0.06, 0.2), Size = UDim2.fromScale(0.88, 0.6), Text = text, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = z + 6, Parent = f }, 2), 24)
|
||||
end
|
||||
function t.wiggle()
|
||||
tween(b, 0.05, { Rotation = -4 }).Completed:Wait()
|
||||
tween(b, 0.07, { Rotation = 4 }).Completed:Wait()
|
||||
tween(b, 0.06, { Rotation = 0 })
|
||||
end
|
||||
local hover = false
|
||||
b.MouseEnter:Connect(function() hover = true; paint(true) end)
|
||||
b.MouseLeave:Connect(function() hover = false; paint(false) end)
|
||||
b.InputBegan:Connect(function(i) if isPress(i) then paint(hover, true) end end)
|
||||
b.InputEnded:Connect(function(i) if isPress(i) then paint(hover) end end)
|
||||
return t
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- pill button with states
|
||||
local ART_FOR = { ready = "gold", alt = "blue", info = "blue", confirm = "red", danger = "red", done = "green", off = "grey", busy = "grey" }
|
||||
local LIVE = { ready = true, alt = true, confirm = true, danger = true }
|
||||
function K.pill(parent, props, onClick)
|
||||
local textMax = props.TextMax or 32
|
||||
props.TextMax = nil
|
||||
props.AutoButtonColor = false
|
||||
local b = art("gold", props, true)
|
||||
b.Parent = parent
|
||||
local p, z = b.Position, b.Size
|
||||
b.AnchorPoint = Vector2.new(0.5, 0.5)
|
||||
b.Position = p + UDim2.new(z.X.Scale / 2, z.X.Offset / 2, z.Y.Scale / 2, z.Y.Offset / 2)
|
||||
local sc = new("UIScale", { Parent = b })
|
||||
local ring = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.new(1, 4, 1, 4),
|
||||
BackgroundTransparency = 1, ZIndex = 1, Parent = b }, { corner(UDim.new(0.5, 0)) })
|
||||
local ringStroke = new("UIStroke", { Color = Color3.fromRGB(255, 240, 180), Thickness = 4, Transparency = 1, Parent = ring })
|
||||
local cap = maxText(label({ Position = UDim2.fromScale(0.08, 0.16), Size = UDim2.fromScale(0.84, 0.62), Text = "", TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = (props.ZIndex or 1) + 1, Parent = b }, 2.5), textMax)
|
||||
local o = { button = b, state = "ready", hover = false }
|
||||
local dots
|
||||
local function paint()
|
||||
local s = o.state
|
||||
setArt(b, ART_FOR[s] or "gold")
|
||||
local live = LIVE[s] == true
|
||||
b.ImageColor3 = (o.down and live) and Color3.fromRGB(205, 205, 205) or WHITE
|
||||
cap.TextColor3 = s == "off" and Color3.fromRGB(214, 220, 226) or WHITE
|
||||
cap.Position = UDim2.fromScale(0.08, (o.down and live) and 0.2 or 0.16)
|
||||
ringStroke.Transparency = (o.hover and live) and 0.15 or 1
|
||||
local target = not live and 1 or o.down and 0.94 or o.hover and 1.05 or 1
|
||||
tween(sc, o.down and 0.07 or 0.14, { Scale = target }, o.down and Enum.EasingStyle.Quad or Enum.EasingStyle.Back)
|
||||
end
|
||||
function o.set(state, caption)
|
||||
if caption then cap.Text = caption end
|
||||
if state == o.state and state ~= "busy" then paint() return end
|
||||
if state == "busy" and o.state == "busy" then return end
|
||||
o.state = state
|
||||
b.Active = LIVE[state] == true
|
||||
b.Selectable = b.Active
|
||||
if state == "busy" then
|
||||
local my = {}
|
||||
dots = my
|
||||
task.spawn(function()
|
||||
local n = 0
|
||||
while dots == my and o.state == "busy" do
|
||||
n = n % 3 + 1
|
||||
cap.Text = string.rep("•", n)
|
||||
task.wait(0.25)
|
||||
end
|
||||
end)
|
||||
else
|
||||
dots = nil
|
||||
end
|
||||
paint()
|
||||
end
|
||||
function o.wiggle()
|
||||
tween(b, 0.05, { Rotation = -3 }).Completed:Wait()
|
||||
tween(b, 0.07, { Rotation = 3 }).Completed:Wait()
|
||||
tween(b, 0.06, { Rotation = 0 })
|
||||
end
|
||||
b.MouseEnter:Connect(function() o.hover = true; paint() end)
|
||||
b.MouseLeave:Connect(function() o.hover, o.down = false, false; paint() end)
|
||||
b.SelectionGained:Connect(function() o.hover = true; paint() end)
|
||||
b.SelectionLost:Connect(function() o.hover = false; paint() end)
|
||||
b.InputBegan:Connect(function(input) if isPress(input) then o.down = true; paint() end end)
|
||||
b.InputEnded:Connect(function(input) if isPress(input) then o.down = false; paint() end end)
|
||||
b.Activated:Connect(function()
|
||||
if LIVE[o.state] then
|
||||
onClick(o.state)
|
||||
elseif o.state == "off" then
|
||||
o.wiggle() -- "can't"
|
||||
end
|
||||
end)
|
||||
paint()
|
||||
return o
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- filter chip (green; gold when selected)
|
||||
function K.chip(parent, props, text, onClick, dot)
|
||||
props.AutoButtonColor = false
|
||||
local b = art("green", props, true)
|
||||
b.Parent = parent
|
||||
local sc = new("UIScale", { Parent = b })
|
||||
local z = (props.ZIndex or 4) + 1
|
||||
local x0 = 0.1
|
||||
if dot then
|
||||
new("Frame", { AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0.08, 0, 0.47, 0), Size = UDim2.fromOffset(18, 18), BackgroundColor3 = dot, ZIndex = z, Parent = b },
|
||||
{ corner(UDim.new(0.5, 0)), new("UIStroke", { Color = INK, Thickness = 2 }) })
|
||||
x0 = 0.2
|
||||
end
|
||||
local cap = maxText(label({ Position = UDim2.fromScale(x0, 0.18), Size = UDim2.fromScale(0.92 - x0, 0.58), Text = text, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = z, Parent = b }, 2), 24)
|
||||
local o = { button = b, selected = false, hover = false, down = false }
|
||||
local function paint()
|
||||
setArt(b, o.selected and "gold" or "green")
|
||||
b.ImageColor3 = o.down and Color3.fromRGB(205, 205, 205) or WHITE
|
||||
cap.TextColor3 = o.selected and WHITE or Color3.fromRGB(236, 248, 238)
|
||||
tween(sc, 0.12, { Scale = o.down and 0.95 or (o.hover or o.selected) and 1.04 or 1 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
function o.setSelected(v) o.selected = v; paint() end
|
||||
b.MouseEnter:Connect(function() o.hover = true; paint() end)
|
||||
b.MouseLeave:Connect(function() o.hover, o.down = false, false; paint() end)
|
||||
b.InputBegan:Connect(function(input) if isPress(input) then o.down = true; paint() end end)
|
||||
b.InputEnded:Connect(function(input) if isPress(input) then o.down = false; paint() end end)
|
||||
b.Activated:Connect(function() onClick() end)
|
||||
paint()
|
||||
return o
|
||||
end
|
||||
|
||||
-- price plate: crystal + number (orange when you can not afford it)
|
||||
function K.pricePlate(parent, pos, size, z)
|
||||
z = z or 3
|
||||
local f = new("Frame", { Position = pos, Size = size, BackgroundColor3 = NAVY, BackgroundTransparency = 0.1, ZIndex = z, Parent = parent }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = Color3.fromRGB(190, 225, 255), Thickness = 2 }),
|
||||
})
|
||||
art("crystal", { Position = UDim2.new(0, -10, 0.5, -30), Size = UDim2.fromOffset(60, 60), ZIndex = z + 1, Parent = f })
|
||||
local t = maxText(label({ Position = UDim2.new(0, 52, 0, 4), Size = UDim2.new(1, -62, 1, -8), Text = "", TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = z + 1, Parent = f }, 2), 32)
|
||||
return f, t
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- window frame + tabs
|
||||
-- opts: win, title, subtitle, tabs = { { id, text, icon, tip } }, closeWindow, fmtNum, onTab(id)
|
||||
K.AREA_POS, K.AREA_SIZE = UDim2.fromOffset(70, 346), UDim2.fromOffset(1260, 566)
|
||||
function K.chrome(opts)
|
||||
local win = opts.win
|
||||
local panel = win.panel
|
||||
local WIDTH, HEIGHT = 1400, 1000
|
||||
win.w, win.h = WIDTH, HEIGHT
|
||||
panel.Size = UDim2.fromOffset(WIDTH, HEIGHT)
|
||||
panel.BackgroundTransparency = 1
|
||||
for _, c in panel:GetChildren() do
|
||||
if c:IsA("UIStroke") then c.Enabled = false end
|
||||
if c:IsA("Frame") then c.Visible = false end -- makeWindow's title bar
|
||||
end
|
||||
local fmt = opts.fmtNum
|
||||
|
||||
local bg = new("Frame", { Name = "Bg", Size = UDim2.fromScale(1, 1), BackgroundColor3 = WHITE, ZIndex = 0, Parent = panel }, {
|
||||
corner(UDim.new(0, 44)),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(Color3.fromRGB(22, 84, 70), Color3.fromRGB(8, 36, 44)) }),
|
||||
new("UIStroke", { Name = "GoldEdge", Color = Color3.fromRGB(242, 196, 82), Thickness = 5 }),
|
||||
})
|
||||
new("Frame", { Position = UDim2.fromOffset(12, 12), Size = UDim2.new(1, -24, 1, -24), BackgroundTransparency = 1, ZIndex = 0, Parent = bg }, {
|
||||
corner(UDim.new(0, 36)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.55 }),
|
||||
})
|
||||
-- twinkling stars in the header sky
|
||||
local rng = Random.new(7)
|
||||
for _ = 1, 26 do
|
||||
local s = rng:NextInteger(3, 7)
|
||||
local star = new("Frame", { Position = UDim2.fromOffset(rng:NextInteger(40, 1360), rng:NextInteger(24, 190)), Size = UDim2.fromOffset(s, s),
|
||||
BackgroundColor3 = WHITE, BackgroundTransparency = rng:NextNumber(0.2, 0.6), ZIndex = 1, Parent = panel }, { corner(UDim.new(0.5, 0)) })
|
||||
local delay0 = rng:NextNumber(0, 3)
|
||||
task.spawn(function()
|
||||
task.wait(delay0)
|
||||
while star.Parent do
|
||||
tween(star, 1.4, { BackgroundTransparency = 0.85 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
tween(star, 1.4, { BackgroundTransparency = 0.2 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
end
|
||||
end)
|
||||
end
|
||||
art("garland", { Position = UDim2.fromOffset(20, -70), Size = UDim2.fromOffset(330, 330), ScaleType = Enum.ScaleType.Fit, ZIndex = 2, Parent = panel })
|
||||
art("garland", { Position = UDim2.fromOffset(1050, -70), Size = UDim2.fromOffset(330, 330), ScaleType = Enum.ScaleType.Fit, ZIndex = 2, Parent = panel })
|
||||
|
||||
-- ribbon title + subtitle
|
||||
local ribbon = art("ribbon", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.fromOffset(WIDTH / 2, -22), Size = UDim2.fromOffset(480, 271), ZIndex = 3, Parent = panel })
|
||||
maxText(label({ Position = UDim2.fromScale(0.14, 0.5), Size = UDim2.fromScale(0.72, 0.25), Text = opts.title, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 4, Parent = ribbon }, 3.5), 64)
|
||||
maxText(label({ Position = UDim2.fromOffset(60, 132), Size = UDim2.fromOffset(330, 56), Text = opts.subtitle or "", TextScaled = true,
|
||||
TextColor3 = SOFT, FontFace = BODY, ZIndex = 3, Parent = panel }, 1.5), 24)
|
||||
|
||||
-- balance plate (animated count)
|
||||
local balance = art("blue", { Position = UDim2.fromOffset(1000, 120), Size = UDim2.fromOffset(250, 84), ZIndex = 3, Parent = panel })
|
||||
art("crystal", { Position = UDim2.fromOffset(-26, -10), Size = UDim2.fromOffset(100, 100), ZIndex = 4, Parent = balance })
|
||||
local balanceText = maxText(label({ Position = UDim2.fromOffset(72, 12), Size = UDim2.new(1, -90, 1, -24), Text = "0", TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 4, Parent = balance }, 3), 40)
|
||||
local lastShown = 0
|
||||
local function setBalance(v, instant)
|
||||
local from = lastShown
|
||||
lastShown = v
|
||||
if instant or from == v or not win.overlay.Visible then balanceText.Text = fmt(v) return end
|
||||
local nv = Instance.new("NumberValue")
|
||||
nv.Value = from
|
||||
nv.Changed:Connect(function(x) balanceText.Text = fmt(x) end)
|
||||
tween(nv, 0.45, { Value = v }).Completed:Connect(function() balanceText.Text = fmt(v); nv:Destroy() end)
|
||||
end
|
||||
|
||||
-- close: drawn in code (red glossy square, gold rim, snow cap, "X"; Fredoka has no ✕ glyph)
|
||||
local close = new("TextButton", { Name = "Close", AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(1320, 92), Size = UDim2.fromOffset(96, 96), Text = "",
|
||||
BackgroundColor3 = Color3.fromRGB(214, 36, 46), AutoButtonColor = false, ZIndex = 5, Parent = panel }, {
|
||||
corner(UDim.new(0, 24)),
|
||||
new("UIStroke", { Color = GOLD, Thickness = 5, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }),
|
||||
})
|
||||
new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 6), Size = UDim2.new(1, -16, 0.4, 0), BackgroundColor3 = WHITE,
|
||||
BackgroundTransparency = 0.8, ZIndex = 6, Parent = close }, { corner(UDim.new(0, 18)), new("UIGradient", { Rotation = 90, Transparency = NumberSequence.new(0.1, 1) }) })
|
||||
new("Frame", { Position = UDim2.new(0, -6, 0, -12), Size = UDim2.new(1, 12, 0, 24), BackgroundColor3 = Color3.fromRGB(245, 250, 255), ZIndex = 8, Parent = close }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIGradient", { Rotation = 90, Color = ColorSequence.new(WHITE, Color3.fromRGB(205, 222, 240)) }),
|
||||
})
|
||||
label({ Position = UDim2.fromScale(0.14, 0.16), Size = UDim2.fromScale(0.72, 0.72), Text = "X", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 7, Parent = close }, 3)
|
||||
local closeScale = new("UIScale", { Parent = close })
|
||||
close.MouseEnter:Connect(function() tween(closeScale, 0.14, { Scale = 1.08 }, Enum.EasingStyle.Back); tween(close, 0.14, { Rotation = 6 }) end)
|
||||
close.MouseLeave:Connect(function() tween(closeScale, 0.14, { Scale = 1 }); tween(close, 0.14, { Rotation = 0 }) end)
|
||||
close.InputBegan:Connect(function(i) if isPress(i) then tween(closeScale, 0.06, { Scale = 0.92 }) end end)
|
||||
close.Activated:Connect(function() opts.closeWindow() end)
|
||||
|
||||
-- content panel + footer tip
|
||||
art("panel", { Position = UDim2.fromOffset(40, 300), Size = UDim2.fromOffset(1320, 632), ScaleType = Enum.ScaleType.Slice,
|
||||
SliceCenter = Rect.new(60, 70, 218, 180), ZIndex = 2, Parent = panel })
|
||||
art("holly", { Position = UDim2.fromOffset(1262, 262), Size = UDim2.fromOffset(130, 130), ScaleType = Enum.ScaleType.Fit, ZIndex = 6, Parent = panel })
|
||||
art("gift", { Position = UDim2.fromOffset(-34, 850), Size = UDim2.fromOffset(150, 150), ScaleType = Enum.ScaleType.Fit, ZIndex = 6, Parent = panel })
|
||||
local tip = maxText(label({ Position = UDim2.fromOffset(130, 940), Size = UDim2.fromOffset(1140, 44), Text = "", TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 3, Parent = panel }, 1.5), 26)
|
||||
|
||||
-- pages: a CanvasGroup each (fade + slide on switch)
|
||||
local AREA_POS, AREA_SIZE = K.AREA_POS, K.AREA_SIZE
|
||||
local pages = {}
|
||||
local function makePage(id, withScroll)
|
||||
local g = new("CanvasGroup", { Name = "Page" .. id, Position = AREA_POS, Size = AREA_SIZE, BackgroundTransparency = 1, Visible = false, ZIndex = 4, Parent = panel })
|
||||
pages[id] = { group = g }
|
||||
if withScroll then
|
||||
return g, K.scroll(g, UDim2.new(), UDim2.fromScale(1, 1))
|
||||
end
|
||||
return g
|
||||
end
|
||||
|
||||
-- tabs
|
||||
local tabs, current = {}, nil
|
||||
local self = { panel = panel, tabs = tabs, makePage = makePage, setBalance = setBalance, tip = tip }
|
||||
local startX = math.floor((WIDTH - (#opts.tabs * 300 + (#opts.tabs - 1) * 22)) / 2)
|
||||
for i, t in opts.tabs do
|
||||
local x = startX + (i - 1) * 322
|
||||
local b = art("green", { Name = "Tab" .. t.id, AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(x + 150, 258), Size = UDim2.fromOffset(300, 96),
|
||||
AutoButtonColor = false, ZIndex = 3, Parent = panel }, true)
|
||||
local sc = new("UIScale", { Parent = b })
|
||||
local ring = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromScale(0.5, 0.5), Size = UDim2.new(1, 4, 1, 4), BackgroundTransparency = 1, Parent = b }, { corner(UDim.new(0.5, 0)) })
|
||||
local ringStroke = new("UIStroke", { Color = Color3.fromRGB(255, 240, 180), Thickness = 4, Transparency = 1, Parent = ring })
|
||||
label({ Position = UDim2.fromScale(0.07, 0.17), Size = UDim2.fromScale(0.2, 0.62), Text = t.icon, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 4, Parent = b }, 0)
|
||||
local cap = maxText(label({ Position = UDim2.fromScale(0.27, 0.17), Size = UDim2.fromScale(0.66, 0.6), Text = t.text, TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 4, Parent = b }, 2.5), 34)
|
||||
local badge = new("Frame", { AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.new(1, -18, 0, 10), Size = UDim2.fromOffset(46, 46),
|
||||
BackgroundColor3 = Color3.fromRGB(226, 40, 52), Visible = false, ZIndex = 6, Parent = b }, { corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 3 }) })
|
||||
local badgeText = label({ Size = UDim2.fromScale(1, 1), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 7, Parent = badge }, 1.5)
|
||||
new("UIPadding", { PaddingTop = UDim.new(0.2, 0), PaddingBottom = UDim.new(0.2, 0), PaddingLeft = UDim.new(0.15, 0), PaddingRight = UDim.new(0.15, 0), Parent = badge })
|
||||
local badgeScale = new("UIScale", { Parent = badge })
|
||||
local o = { button = b, hover = false, down = false, count = 0 }
|
||||
function o.paint()
|
||||
local sel = current == t.id
|
||||
setArt(b, sel and "red" or "green")
|
||||
b.ImageColor3 = (o.down and not sel) and Color3.fromRGB(205, 205, 205) or WHITE
|
||||
cap.TextColor3 = sel and WHITE or Color3.fromRGB(236, 248, 238)
|
||||
ringStroke.Transparency = (o.hover and not sel) and 0.2 or 1
|
||||
b.Position = UDim2.fromOffset(x + 150, sel and 252 or 258)
|
||||
tween(sc, 0.14, { Scale = o.down and 0.95 or sel and 1.07 or o.hover and 1.04 or 1 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
function o.setBadge(n)
|
||||
badge.Visible = n > 0
|
||||
badgeText.Text = n > 9 and "9+" or tostring(n)
|
||||
if n > o.count then
|
||||
badgeScale.Scale = 1.5
|
||||
tween(badgeScale, 0.3, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
o.count = n
|
||||
end
|
||||
b.MouseEnter:Connect(function() o.hover = true; o.paint() end)
|
||||
b.MouseLeave:Connect(function() o.hover, o.down = false, false; o.paint() end)
|
||||
b.SelectionGained:Connect(function() o.hover = true; o.paint() end)
|
||||
b.SelectionLost:Connect(function() o.hover = false; o.paint() end)
|
||||
b.InputBegan:Connect(function(input) if isPress(input) then o.down = true; o.paint() end end)
|
||||
b.InputEnded:Connect(function(input) if isPress(input) then o.down = false; o.paint() end end)
|
||||
b.Activated:Connect(function() self.showTab(t.id) end)
|
||||
tabs[t.id] = o
|
||||
end
|
||||
|
||||
function self.current() return current end
|
||||
function self.showTab(id, force)
|
||||
if current == id and not force then return end
|
||||
local prev = current
|
||||
current = id
|
||||
for _, t in tabs do t.paint() end
|
||||
for pid, p in pages do
|
||||
if pid == id then
|
||||
p.group.Visible = true
|
||||
if prev ~= id then
|
||||
p.group.GroupTransparency = 1
|
||||
p.group.Position = AREA_POS + UDim2.fromOffset(0, 24)
|
||||
tween(p.group, 0.22, { GroupTransparency = 0, Position = AREA_POS })
|
||||
end
|
||||
elseif pid == prev then
|
||||
p.group.Visible = false
|
||||
end
|
||||
end
|
||||
for _, t in opts.tabs do if t.id == id then tip.Text = t.tip; tip.TextColor3 = SOFT end end
|
||||
if opts.onTab then opts.onTab(id) end
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
return K
|
||||
@@ -0,0 +1,185 @@
|
||||
-- ShopWindow: "Магазин" — decorations for the player's plot, paid in shards (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Все товары / Украшения / Развлечения / Как это работает. "Все товары" shows a badge with the number of
|
||||
-- things you can buy right now. Card button: ready "Купить" -> busy -> "Поставить" (blue, starts placing right
|
||||
-- away through K.nav.Place = OrnamentCraftUI's startPlacing; the garland opens the "string it on the tree" mode);
|
||||
-- off "Нужно ещё N" when you are short of shards.
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local S = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, BODY = K.WHITE, K.GOLD, K.SOFT, K.OK, K.BODY
|
||||
local new, corner, art, label, maxText, pill, pricePlate = K.new, K.corner, K.art, K.label, K.maxText, K.pill, K.pricePlate
|
||||
|
||||
-- product pictures (GUI/магазин/roblox) + card colour + tab
|
||||
local PRODUCTS = {
|
||||
Tree = { img = "rbxassetid://103785076834354", card = "cardGreen", tab = "Decor", short = "Decorate it with your ornaments" },
|
||||
PullUpBar = { img = "rbxassetid://103992671287296", card = "cardCyan", tab = "Fun", short = "XP, +1 shard per 10 in a row, up to 60 per set" },
|
||||
Bench = { img = "rbxassetid://83102967647787", card = "cardViolet", tab = "Fun", short = "A workout corner" },
|
||||
Fireworks = { img = "rbxassetid://102801089134457", card = "cardOrange", tab = "Decor", short = "The whole server sees the show" },
|
||||
Garland = { card = "cardViolet", tab = "Decor", short = "Wrap your tree in lights" }, -- no picture yet: 3D preview
|
||||
}
|
||||
|
||||
-- 3D preview for products without a picture (a tree item is shown on the tree)
|
||||
local function preview(card, it)
|
||||
local vp = K.new("ViewportFrame", { Position = UDim2.fromOffset(26, 44), Size = UDim2.fromOffset(230, 210), BackgroundTransparency = 1,
|
||||
Ambient = Color3.fromRGB(165, 165, 180), LightColor = Color3.fromRGB(255, 245, 230), LightDirection = Vector3.new(-1, -1.3, -1), ZIndex = 5, Parent = card })
|
||||
task.spawn(function()
|
||||
local decor = game:GetService("ReplicatedStorage"):WaitForChild("OrnamentMachine"):WaitForChild("Decor")
|
||||
local template = decor:FindFirstChild(it.Model)
|
||||
if not template then return end
|
||||
local tree = it.OnTree and decor:FindFirstChild("ChristmasTree")
|
||||
pcall(function() game:GetService("ContentProvider"):PreloadAsync({ template, tree }) end)
|
||||
local model = Instance.new("Model")
|
||||
if tree then local t = tree:Clone(); t:PivotTo(CFrame.new()); t.Parent = model end
|
||||
local m = template:Clone()
|
||||
m:PivotTo(CFrame.new())
|
||||
m.Parent = model
|
||||
model.WorldPivot = CFrame.new() -- pivot at the foot, not the box centre
|
||||
model:PivotTo(CFrame.Angles(0, math.rad(-30), 0))
|
||||
model.Parent = vp
|
||||
local _, size = model:GetBoundingBox()
|
||||
local cam = Instance.new("Camera")
|
||||
cam.FieldOfView = 40
|
||||
cam.CFrame = CFrame.lookAt(Vector3.new(0, size.Y * 0.62, math.max(size.X, size.Y, size.Z) * 1.5), Vector3.new(0, size.Y * 0.47, 0))
|
||||
cam.Parent = vp
|
||||
vp.CurrentCamera = cam
|
||||
end)
|
||||
end
|
||||
|
||||
function S.install(ctx)
|
||||
local Config, player, remote = ctx.Config, ctx.player, ctx.remote
|
||||
local fmt = ctx.fmtNum
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local refresh
|
||||
local TABS = {
|
||||
{ id = "All", text = "All items", icon = "🛍", tip = "Purchases appear on your plot and stay forever." },
|
||||
{ id = "Decor", text = "Decorations", icon = "🎄", tip = "The tree is the main decoration: you hang generator ornaments on it." },
|
||||
{ id = "Fun", text = "Activities", icon = "🎉", tip = "Workout gear gives XP — that unlocks the market and trading faster." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "You can move bought items or store them in your inventory any time." },
|
||||
}
|
||||
local ch = K.chrome({ win = win, title = "SHOP", subtitle = "Decorations and activities\nfor your plot", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = fmt, onTab = function() refresh() end })
|
||||
|
||||
local cards = {}
|
||||
local busy = {}
|
||||
local function productCard(parent, it, order)
|
||||
local p = PRODUCTS[it.Id] or { card = "cardGreen", short = "" }
|
||||
local card = art(p.card, { LayoutOrder = order, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = parent })
|
||||
if p.img then
|
||||
new("ImageLabel", { Position = UDim2.fromOffset(26, 44), Size = UDim2.fromOffset(230, 210), BackgroundTransparency = 1, Image = p.img, ScaleType = Enum.ScaleType.Fit, ZIndex = 5, Parent = card })
|
||||
else
|
||||
preview(card, it)
|
||||
end
|
||||
maxText(label({ Position = UDim2.fromOffset(270, 40), Size = UDim2.fromOffset(320, 46), Text = it.Name, TextScaled = true, ZIndex = 5, Parent = card }, 3), 38)
|
||||
maxText(label({ Position = UDim2.fromOffset(272, 88), Size = UDim2.fromOffset(318, 62), Text = it.Desc or p.short, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 21)
|
||||
local status = maxText(label({ Position = UDim2.fromOffset(272, 152), Size = UDim2.fromOffset(318, 28), Text = "", TextScaled = true, FontFace = BODY, ZIndex = 5, Parent = card }, 1.5), 21)
|
||||
local plate, price = pricePlate(card, UDim2.fromOffset(268, 196), UDim2.fromOffset(140, 50), 5)
|
||||
price.Text = fmt(it.Price)
|
||||
local c = { it = it, card = card, status = status, plate = plate, price = price }
|
||||
local btn
|
||||
btn = pill(card, { Position = UDim2.fromOffset(420, 188), Size = UDim2.fromOffset(176, 64), ZIndex = 5, TextMax = 28 }, function(state)
|
||||
if state == "alt" then
|
||||
-- already bought: go straight to placing it (garland: stringing it on the tree), not to the inventory
|
||||
if K.nav.Place then K.nav.Place(it.Id) else K.go("Inventory", "Items") end
|
||||
return
|
||||
end
|
||||
busy[it.Id] = true
|
||||
refresh()
|
||||
task.spawn(function()
|
||||
local ok, res = pcall(remote.InvokeServer, remote, "Buy", it.Id)
|
||||
res = (ok and type(res) == "table") and res or { ok = false, msg = "No connection to the shop" }
|
||||
busy[it.Id] = nil
|
||||
ctx.toast(res.msg or (res.ok and "Bought" or "Failed"), res.ok and OK or K.WARN)
|
||||
if res.ok then
|
||||
for _, other in cards do if other.it == it then K.flash(other.card); K.floatText(other.card, "Bought!") end end
|
||||
end
|
||||
refresh()
|
||||
end)
|
||||
end)
|
||||
c.btn = btn
|
||||
table.insert(cards, c)
|
||||
end
|
||||
local GRID = function(scroll)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(615, 272), CellPadding = UDim2.fromOffset(18, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = scroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 2), PaddingTop = UDim.new(0, 2), Parent = scroll })
|
||||
end
|
||||
for _, tabId in { "All", "Decor", "Fun" } do
|
||||
local _, scroll = ch.makePage(tabId, true)
|
||||
GRID(scroll)
|
||||
for _, it in Config.SHOP do
|
||||
local p = PRODUCTS[it.Id]
|
||||
if tabId == "All" or (p and p.tab == tabId) then productCard(scroll, it, it.Order) end
|
||||
end
|
||||
end
|
||||
|
||||
-- help page
|
||||
local _, heScroll = ch.makePage("Help", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardCyan", icon = "🛍", title = "Buy", btn = "To Items", go = function() ch.showTab("All") end,
|
||||
text = "Everything costs shards. You buy each item once — it's yours forever." },
|
||||
{ card = "cardViolet", icon = "🏠", title = "Place on your plot", btn = "Inventory", go = function() K.go("Inventory", "Items") end,
|
||||
text = "Bought items are in your inventory. “Place” — pick a spot: click places, R rotates, Esc cancels." },
|
||||
{ card = "cardOrange", icon = "🎄", title = "Decorate the tree", btn = "My Ornaments", go = function() K.go("Inventory", "Toys") end,
|
||||
text = "Place a tree, hold an ornament from your inventory and click a glowing dot on the tree." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, h.go)
|
||||
go.set("alt", h.btn)
|
||||
end
|
||||
|
||||
refresh = function()
|
||||
local shards = attr("Shards", 0)
|
||||
ch.setBalance(shards)
|
||||
local can = {}
|
||||
for _, c in cards do
|
||||
local owned = attr("Decor_" .. c.it.Id, false)
|
||||
local placed = attr("Placed_" .. c.it.Id, false)
|
||||
c.plate.Visible = not owned
|
||||
c.price.TextColor3 = shards >= c.it.Price and WHITE or K.WARN
|
||||
if owned then
|
||||
local onTree = c.it.OnTree
|
||||
c.status.Text = placed and (onTree and "on the tree" or "on your plot") or "bought · in inventory"
|
||||
c.status.TextColor3 = OK
|
||||
c.btn.set("alt", onTree and (placed and "Rehang" or "On Tree") or (placed and "Move" or "Place"))
|
||||
elseif busy[c.it.Id] then
|
||||
c.btn.set("busy")
|
||||
elseif shards >= c.it.Price then
|
||||
c.status.Text, c.status.TextColor3 = "available", GOLD
|
||||
c.btn.set("ready", "Buy")
|
||||
can[c.it.Id] = true
|
||||
else
|
||||
c.status.Text, c.status.TextColor3 = "not enough shards", SOFT
|
||||
c.btn.set("off", "Need " .. fmt(c.it.Price - shards))
|
||||
end
|
||||
end
|
||||
local n = 0
|
||||
for _ in can do n += 1 end
|
||||
ch.tabs.All.setBadge(n)
|
||||
end
|
||||
local function live() if win.overlay.Visible then refresh() end end
|
||||
player:GetAttributeChangedSignal("Shards"):Connect(live)
|
||||
for _, it in Config.SHOP do
|
||||
player:GetAttributeChangedSignal("Decor_" .. it.Id):Connect(live)
|
||||
player:GetAttributeChangedSignal("Placed_" .. it.Id):Connect(live)
|
||||
end
|
||||
ch.showTab("All")
|
||||
return {
|
||||
open = function(tab)
|
||||
ch.setBalance(attr("Shards", 0), true)
|
||||
if tab then ch.showTab(tab) end
|
||||
refresh()
|
||||
end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return S
|
||||
@@ -0,0 +1,301 @@
|
||||
-- ShredderWindow: "Шредер" — pick toys and recycle them into shards (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Переработка / Ценность / Как это работает.
|
||||
-- Переработка : toy tiles (click = select, gold ring + tick), quick actions Выбрать всё / Обычные / Снять выбор,
|
||||
-- storage count. Right: selected count, shards you get, batch bonus, warning for rare toys.
|
||||
-- Button: off "Выбери игрушки" -> ready "Переработать" -> confirm "Точно? Нажми ещё раз"
|
||||
-- (only when legendary / mythic / special toys are selected) ; off "Шредер работает" while busy.
|
||||
-- Ценность : shards per rarity, variant multipliers, batch bonus, shredder upgrade.
|
||||
-- RemoteEvent Recycle:FireServer(machine, uids). getCards() is shared with the Workshop (fusion page).
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local S = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, WARN, BODY = K.WHITE, K.GOLD, K.SOFT, K.OK, K.WARN, K.BODY
|
||||
local new, corner, art, label, maxText, pill, tween = K.new, K.corner, K.art, K.label, K.maxText, K.pill, K.tween
|
||||
local ICE = Color3.fromRGB(190, 225, 255)
|
||||
|
||||
function S.install(ctx)
|
||||
local Config, player, remote = ctx.Config, ctx.player, ctx.remote
|
||||
local fmt = ctx.fmtNum
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local BONUS = math.floor(Config.BATCH_BONUS * 100 + 0.5)
|
||||
local TABS = {
|
||||
{ id = "Recycle", text = "Recycle", icon = "♻️", tip = Config.BATCH_SIZE .. "+ identical ornaments at once — bonus +" .. BONUS .. "% shards." },
|
||||
{ id = "Values", text = "Value", icon = "💎", tip = "Special ornaments (golden, shiny) are worth several times more." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "The shredder doesn't touch ornaments on the tree — take them down first." },
|
||||
}
|
||||
local refresh
|
||||
local ch = K.chrome({ win = win, title = "SHREDDER", subtitle = "Turn extra ornaments\ninto shards", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = fmt, onTab = function() if win.overlay.Visible then refresh() end end })
|
||||
|
||||
local function darkPanel(parent, pos, size, z)
|
||||
return new("Frame", { Position = pos, Size = size, BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.5, ZIndex = z or 4, Parent = parent }, {
|
||||
corner(UDim.new(0, 22)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.4 }),
|
||||
})
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- recycle page
|
||||
local rg = ch.makePage("Recycle")
|
||||
local listPanel = darkPanel(rg, UDim2.fromOffset(0, 0), UDim2.fromOffset(820, 566))
|
||||
local cards, selected, confirmArmed = {}, {}, nil
|
||||
local function selectWhere(pred)
|
||||
selected = {}
|
||||
local cand = {}
|
||||
for uid, c in cards do
|
||||
if pred(c) then table.insert(cand, { uid = uid, idx = c.rarity.Index + (c.item.Variant and 10 or 0) }) end
|
||||
end
|
||||
table.sort(cand, function(a, b) return a.idx < b.idx end) -- cheapest first
|
||||
for k = 1, math.min(#cand, Config.MAX_RECYCLE) do selected[cand[k].uid] = true end
|
||||
confirmArmed = nil
|
||||
refresh()
|
||||
end
|
||||
local allBtn = pill(listPanel, { Name = "SelectAll", Position = UDim2.fromOffset(12, 10), Size = UDim2.fromOffset(200, 56), ZIndex = 5, TextMax = 24 }, function()
|
||||
selectWhere(function() return true end)
|
||||
end)
|
||||
local commonBtn = pill(listPanel, { Name = "SelectCommon", Position = UDim2.fromOffset(218, 10), Size = UDim2.fromOffset(170, 56), ZIndex = 5, TextMax = 24 }, function()
|
||||
selectWhere(function(c) return c.rarity.Id == "Common" and not c.item.Variant end)
|
||||
end)
|
||||
local noneBtn = pill(listPanel, { Name = "SelectNone", Position = UDim2.fromOffset(394, 10), Size = UDim2.fromOffset(190, 56), ZIndex = 5, TextMax = 24 }, function()
|
||||
selected = {}; confirmArmed = nil; refresh()
|
||||
end)
|
||||
local stock = maxText(label({ Position = UDim2.fromOffset(596, 18), Size = UDim2.fromOffset(206, 40), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 5, Parent = listPanel }, 2), 30)
|
||||
local grid = K.scroll(listPanel, UDim2.fromOffset(0, 74), UDim2.new(1, -4, 1, -80), new("UIGridLayout", { CellSize = UDim2.fromOffset(148, 196), CellPadding = UDim2.fromOffset(10, 10), SortOrder = Enum.SortOrder.LayoutOrder }))
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 14), PaddingTop = UDim.new(0, 10), PaddingBottom = UDim.new(0, 10), Parent = grid })
|
||||
local empty = K.emptyState({ Position = UDim2.fromOffset(0, 90), Size = UDim2.new(1, 0, 0, 330), ZIndex = 5, Parent = listPanel }, "No ornaments yet",
|
||||
"Make them in the generator and bring extras here.")
|
||||
|
||||
-- right: summary + action
|
||||
local sum = darkPanel(rg, UDim2.fromOffset(840, 0), UDim2.fromOffset(420, 566))
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 12), Size = UDim2.fromOffset(380, 34), Text = "Selected", TextScaled = true, TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = sum }, 2), 28)
|
||||
local selText = maxText(label({ Position = UDim2.fromOffset(20, 46), Size = UDim2.fromOffset(380, 64), Text = "0", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = sum }, 3), 56)
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 118), Size = UDim2.fromOffset(380, 34), Text = "You get", TextScaled = true, TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = sum }, 2), 28)
|
||||
local getPlate = art("blue", { Position = UDim2.fromOffset(60, 156), Size = UDim2.fromOffset(300, 92), ZIndex = 5, Parent = sum })
|
||||
art("crystal", { Position = UDim2.fromOffset(-24, -8), Size = UDim2.fromOffset(104, 104), ZIndex = 6, Parent = getPlate })
|
||||
local getText = maxText(label({ Position = UDim2.fromOffset(78, 14), Size = UDim2.new(1, -96, 1, -28), Text = "+0", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = getPlate }, 3), 46)
|
||||
local getScale = new("UIScale", { Parent = getPlate })
|
||||
local batchText = maxText(label({ Position = UDim2.fromOffset(20, 262), Size = UDim2.fromOffset(380, 56), Text = "", TextScaled = true, TextWrapped = true, FontFace = BODY, TextColor3 = OK,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = sum }, 1.5), 22)
|
||||
local riskText = maxText(label({ Position = UDim2.fromOffset(20, 324), Size = UDim2.fromOffset(380, 70), Text = "", TextScaled = true, TextWrapped = true, TextColor3 = WARN,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = sum }, 2), 24)
|
||||
local maxNote = maxText(label({ Position = UDim2.fromOffset(20, 398), Size = UDim2.fromOffset(380, 40), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = SOFT,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = sum }, 1.5), 20)
|
||||
local function selectedItems()
|
||||
local uids, items = {}, {}
|
||||
for uid in selected do
|
||||
local c = cards[uid]
|
||||
if c then table.insert(uids, uid); table.insert(items, c.item) end
|
||||
end
|
||||
return uids, items
|
||||
end
|
||||
local function isRisky(it) return Config.RarityById[it.Rarity].Index >= 5 or it.Variant ~= nil end
|
||||
local recBtn
|
||||
recBtn = pill(sum, { Name = "RecycleButton", Position = UDim2.fromOffset(20, 452), Size = UDim2.fromOffset(380, 96), ZIndex = 5, TextMax = 34 }, function(state)
|
||||
local uids, items = selectedItems()
|
||||
if #uids == 0 then return end
|
||||
local risky = false
|
||||
for _, it in items do if isRisky(it) then risky = true end end
|
||||
if risky and state ~= "confirm" then confirmArmed = true; refresh() return end
|
||||
local m = ctx.machine()
|
||||
if not m then ctx.toast("Go to your shredder", WARN) return end
|
||||
if m:GetAttribute("ShredderBusy") then ctx.toast("The shredder is still working, wait a couple of seconds", WARN) return end
|
||||
remote:FireServer(m, uids)
|
||||
selected = {}
|
||||
confirmArmed = nil
|
||||
ctx.closeWindow()
|
||||
refresh()
|
||||
end)
|
||||
|
||||
-- tiles
|
||||
local function tileValue(data)
|
||||
return math.floor(Config.Value(data) * Config.ShredderMult(attr("Upg_Shredder", 0)) + 0.5)
|
||||
end
|
||||
local function addCard(item)
|
||||
local uid = item.Name
|
||||
if item:GetAttribute("OnTree") or cards[uid] then return end
|
||||
local data = { Toy = item:GetAttribute("Toy"), Rarity = item:GetAttribute("Rarity"), Variant = item:GetAttribute("Variant") }
|
||||
local toy, r = Config.ToyById[data.Toy], Config.RarityById[data.Rarity]
|
||||
if not toy or not r then return end
|
||||
local orderN = item:GetAttribute("Order") or 0
|
||||
local t = K.toyTile({ Config = Config, miniPattern = ctx.miniPattern, parent = grid, item = data, w = 148, h = 196, z = 6, value = true,
|
||||
valueText = "+" .. fmt(tileValue(data)), order = (#Config.RARITIES - r.Index) * 1000000 - (data.Variant and 500000 or 0) - orderN })
|
||||
local tick = new("Frame", { AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -6, 0, 6), Size = UDim2.fromOffset(38, 38), BackgroundColor3 = GOLD, Visible = false, ZIndex = 14, Parent = t.button }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = K.INK, Thickness = 2 }),
|
||||
})
|
||||
label({ Size = UDim2.fromScale(1, 1), Text = "✔️", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 15, Parent = tick }, 0)
|
||||
t.button.Activated:Connect(function()
|
||||
if selected[uid] then
|
||||
selected[uid] = nil
|
||||
else
|
||||
local n = 0
|
||||
for _ in selected do n += 1 end
|
||||
if n >= Config.MAX_RECYCLE then
|
||||
t.wiggle()
|
||||
ctx.toast("You can recycle up to " .. Config.MAX_RECYCLE .. " ornaments", WARN)
|
||||
return
|
||||
end
|
||||
selected[uid] = true
|
||||
end
|
||||
confirmArmed = nil
|
||||
refresh()
|
||||
end)
|
||||
cards[uid] = { tile = t, tick = tick, item = data, rarity = r }
|
||||
end
|
||||
local function removeCard(item)
|
||||
local c = cards[item.Name]
|
||||
if c then c.tile.button:Destroy() end
|
||||
cards[item.Name] = nil
|
||||
selected[item.Name] = nil
|
||||
end
|
||||
local queued = false
|
||||
local function later()
|
||||
if queued then return end
|
||||
queued = true
|
||||
task.defer(function() queued = false; refresh() end)
|
||||
end
|
||||
local function watchInventory(inv)
|
||||
local function watchTree(item)
|
||||
item:GetAttributeChangedSignal("OnTree"):Connect(function()
|
||||
if item:GetAttribute("OnTree") then removeCard(item) else addCard(item) end
|
||||
later()
|
||||
end)
|
||||
end
|
||||
for _, item in inv:GetChildren() do watchTree(item); addCard(item) end
|
||||
inv.ChildAdded:Connect(function(item)
|
||||
watchTree(item)
|
||||
task.defer(function() addCard(item); later() end)
|
||||
end)
|
||||
inv.ChildRemoved:Connect(function(item) removeCard(item); later() end)
|
||||
later()
|
||||
end
|
||||
task.spawn(function() watchInventory(player:WaitForChild("OrnamentInventory")) end)
|
||||
-- the shredder upgrade changes every tile's value: rebuild them
|
||||
player:GetAttributeChangedSignal("Upg_Shredder"):Connect(function()
|
||||
local inv = player:FindFirstChild("OrnamentInventory")
|
||||
for _, c in cards do c.tile.button:Destroy() end
|
||||
cards = {}
|
||||
for _, item in inv and inv:GetChildren() or {} do addCard(item) end
|
||||
later()
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- values page
|
||||
local vg = ch.makePage("Values")
|
||||
local vaPanel = darkPanel(vg, UDim2.fromOffset(0, 0), UDim2.fromOffset(620, 566))
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 10), Size = UDim2.fromOffset(580, 38), Text = "Shards per ornament", TextScaled = true, ZIndex = 5, Parent = vaPanel }, 2), 32)
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 52), Size = UDim2.fromOffset(580, 28), Text = "by rarity, before variant and ornament multipliers", TextScaled = true, FontFace = BODY, TextColor3 = SOFT, ZIndex = 5, Parent = vaPanel }, 1.5), 20)
|
||||
local valRows = {}
|
||||
for i, r in Config.RARITIES do
|
||||
local y = 92 + (i - 1) * 76
|
||||
local row = new("Frame", { Position = UDim2.fromOffset(16, y), Size = UDim2.fromOffset(588, 66), BackgroundColor3 = Color3.fromRGB(12, 40, 52), ZIndex = 5, Parent = vaPanel }, {
|
||||
corner(UDim.new(0, 18)), new("UIStroke", { Color = r.Color, Thickness = 2, Transparency = 0.3 }),
|
||||
})
|
||||
new("Frame", { AnchorPoint = Vector2.new(0, 0.5), Position = UDim2.new(0, 16, 0.5, 0), Size = UDim2.fromOffset(26, 26), BackgroundColor3 = r.Color, ZIndex = 6, Parent = row }, { corner(UDim.new(0.5, 0)) })
|
||||
maxText(label({ Position = UDim2.fromOffset(56, 14), Size = UDim2.fromOffset(300, 38), Text = r.Name, TextScaled = true, TextColor3 = r.Color, ZIndex = 6, Parent = row }, 2), 30)
|
||||
valRows[i] = { r = r, t = maxText(label({ Position = UDim2.fromOffset(340, 14), Size = UDim2.fromOffset(230, 38), Text = "", TextScaled = true,
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 6, Parent = row }, 2), 30) }
|
||||
end
|
||||
local moPanel = darkPanel(vg, UDim2.fromOffset(640, 0), UDim2.fromOffset(620, 566))
|
||||
maxText(label({ Position = UDim2.fromOffset(20, 10), Size = UDim2.fromOffset(580, 38), Text = "Multipliers", TextScaled = true, ZIndex = 5, Parent = moPanel }, 2), 32)
|
||||
local lines = {}
|
||||
for _, v in Config.VARIANTS do table.insert(lines, { v.Name .. " ornament", "x" .. v.Mult, v.Color }) end
|
||||
for _, toy in Config.TOYS do if toy.Mult ~= 1 then table.insert(lines, { toy.Name, "x" .. toy.Mult, Color3.fromRGB(255, 205, 90) }) end end
|
||||
table.insert(lines, { Config.BATCH_SIZE .. "+ identical at once", "+" .. BONUS .. "%", OK })
|
||||
local upgLine = #lines + 1
|
||||
table.insert(lines, { "Shredder upgrade", "", ICE })
|
||||
local upgText
|
||||
for i, l in lines do
|
||||
local y = 58 + (i - 1) * 46
|
||||
if y > 520 then break end
|
||||
maxText(label({ Position = UDim2.fromOffset(24, y), Size = UDim2.fromOffset(400, 36), Text = l[1], TextScaled = true, FontFace = BODY, TextColor3 = l[3], ZIndex = 5, Parent = moPanel }, 1.5), 26)
|
||||
local t = maxText(label({ Position = UDim2.fromOffset(430, y), Size = UDim2.fromOffset(166, 36), Text = l[2], TextScaled = true, TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 5, Parent = moPanel }, 2), 28)
|
||||
if i == upgLine then upgText = t end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- help page
|
||||
local _, heScroll = ch.makePage("Help", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardCyan", icon = "👆", title = "1. Select", btn = "To Ornaments", go = function() ch.showTab("Recycle") end,
|
||||
text = "Click ornaments or use “Select all” / “Common”. Up to " .. Config.MAX_RECYCLE .. " ornaments at once." },
|
||||
{ card = "cardViolet", icon = "♻️", title = "2. Recycle", btn = "Value", go = function() ch.showTab("Values") end,
|
||||
text = "Ornaments turn into shards. For rare and special ones the shredder asks to confirm — so you won't lose them by accident." },
|
||||
{ card = "cardOrange", icon = "⚡", title = "3. Upgrade", btn = "Workshop", go = function() K.go("Workshop", "Upgrades") end,
|
||||
text = "The shredder upgrade in the Workshop gives more shards from every ornament." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, h.go)
|
||||
go.set("alt", h.btn)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- refresh
|
||||
local lastGet = 0
|
||||
refresh = function()
|
||||
ch.setBalance(attr("Shards", 0))
|
||||
local uids, items = selectedItems()
|
||||
local shards = Config.RecycleYield(items, attr("Upg_Shredder", 0))
|
||||
local risky, perToy = false, {}
|
||||
for _, it in items do
|
||||
if isRisky(it) then risky = true end
|
||||
perToy[it.Toy] = (perToy[it.Toy] or 0) + 1
|
||||
end
|
||||
local batches = {}
|
||||
for toyId, n in perToy do if n >= Config.BATCH_SIZE then table.insert(batches, Config.ToyById[toyId].Name) end end
|
||||
local owned = 0
|
||||
for uid, c in cards do
|
||||
owned += 1
|
||||
local on = selected[uid] == true
|
||||
c.tile.setSelected(on)
|
||||
c.tick.Visible = on
|
||||
end
|
||||
stock.Text = owned .. " / " .. Config.StorageCap(attr("Upg_Storage", 0))
|
||||
empty.Visible = owned == 0
|
||||
selText.Text = tostring(#uids)
|
||||
maxNote.Text = #uids >= Config.MAX_RECYCLE and ("that's the max at once (" .. Config.MAX_RECYCLE .. ")") or ""
|
||||
getText.Text = "+" .. fmt(shards)
|
||||
if shards ~= lastGet and shards > 0 then
|
||||
getScale.Scale = 1.08
|
||||
tween(getScale, 0.2, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
end
|
||||
lastGet = shards
|
||||
batchText.Text = #batches > 0 and ("Bonus +" .. BONUS .. "% for a batch: " .. table.concat(batches, ", ")) or (#uids > 0 and "" or "Click ornaments on the left to select them")
|
||||
riskText.Text = risky and "Your selection has legendary, mythic or special ornaments!" or ""
|
||||
-- quick actions
|
||||
if owned == 0 then allBtn.set("off", "Select all") else allBtn.set("alt", "Select all") end
|
||||
local anyCommon = false
|
||||
for _, c in cards do if c.rarity.Id == "Common" and not c.item.Variant then anyCommon = true break end end
|
||||
if anyCommon then commonBtn.set("alt", "Common") else commonBtn.set("off", "Common") end
|
||||
if #uids > 0 then noneBtn.set("alt", "Deselect") else noneBtn.set("off", "Deselect") end
|
||||
-- main button
|
||||
local m = ctx.machine()
|
||||
if #uids == 0 then recBtn.set("off", "Select ornaments")
|
||||
elseif m and m:GetAttribute("ShredderBusy") then recBtn.set("off", "Shredder working")
|
||||
elseif confirmArmed and risky then recBtn.set("confirm", "Sure? Click again")
|
||||
else recBtn.set("ready", "Recycle · " .. #uids) end
|
||||
-- values page
|
||||
local mult = Config.ShredderMult(attr("Upg_Shredder", 0))
|
||||
for _, vr in valRows do vr.t.Text = fmt(math.floor(vr.r.Shards * mult + 0.5)) .. " shards" end
|
||||
if upgText then upgText.Text = string.format("x%.2f", mult) end
|
||||
end
|
||||
player:GetAttributeChangedSignal("Shards"):Connect(function() if win.overlay.Visible then ch.setBalance(attr("Shards", 0)) end end)
|
||||
|
||||
ch.showTab("Recycle")
|
||||
return {
|
||||
open = function(tab)
|
||||
confirmArmed = nil
|
||||
ch.setBalance(attr("Shards", 0), true)
|
||||
if tab then ch.showTab(tab) end
|
||||
refresh()
|
||||
end,
|
||||
refresh = refresh,
|
||||
getCards = function() return cards end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return S
|
||||
@@ -0,0 +1,58 @@
|
||||
-- Snowfall (LocalScript, StarterPlayerScripts): light snowfall for atmosphere, only on the client.
|
||||
-- An invisible flat part hangs above the camera and follows it; its ParticleEmitter drops soft flakes into the
|
||||
-- world (the flakes are not locked to the part, so they stay where they are while the camera moves).
|
||||
-- A slow, changing wind makes the flakes drift. Fewer flakes on phones.
|
||||
local RunService = game:GetService("RunService")
|
||||
local UIS = game:GetService("UserInputService")
|
||||
|
||||
local AREA = 90 -- studs: size of the snowing square around the camera
|
||||
local HEIGHT = 30 -- studs above the camera where the flakes appear
|
||||
local RATE = UIS.TouchEnabled and not UIS.KeyboardEnabled and 160 or 300 -- flakes per second ("небольшой" снегопад)
|
||||
|
||||
local cloud = Instance.new("Part")
|
||||
cloud.Name = "SnowCloud"
|
||||
cloud.Anchored, cloud.CanCollide, cloud.CanQuery, cloud.CanTouch, cloud.CastShadow = true, false, false, false, false
|
||||
cloud.Transparency = 1
|
||||
cloud.Size = Vector3.new(AREA, 1, AREA)
|
||||
|
||||
local snow = Instance.new("ParticleEmitter")
|
||||
snow.Name = "Snow"
|
||||
snow.Texture = "rbxasset://textures/particles/sparkles_main.dds" -- built-in white star = snowflake
|
||||
snow.Color = ColorSequence.new(Color3.fromRGB(255, 255, 255))
|
||||
snow.LightEmission = 0.35
|
||||
snow.LightInfluence = 0.4 -- night map: a bit of own glow, so the flakes are visible but not neon
|
||||
snow.Size = NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0, 0.4, 0.12),
|
||||
NumberSequenceKeypoint.new(1, 0.4, 0.12),
|
||||
})
|
||||
snow.Transparency = NumberSequence.new({
|
||||
NumberSequenceKeypoint.new(0, 1),
|
||||
NumberSequenceKeypoint.new(0.08, 0.15),
|
||||
NumberSequenceKeypoint.new(0.85, 0.15),
|
||||
NumberSequenceKeypoint.new(1, 1),
|
||||
})
|
||||
snow.EmissionDirection = Enum.NormalId.Bottom
|
||||
snow.Shape = Enum.ParticleEmitterShape.Box
|
||||
snow.ShapeStyle = Enum.ParticleEmitterShapeStyle.Volume
|
||||
snow.Speed = NumberRange.new(4, 7)
|
||||
snow.SpreadAngle = Vector2.new(12, 12)
|
||||
snow.Lifetime = NumberRange.new(9, 12)
|
||||
snow.Rotation = NumberRange.new(0, 360)
|
||||
snow.RotSpeed = NumberRange.new(-40, 40)
|
||||
snow.Drag = 0 -- no drag: with drag the flakes stop and hang up at the cloud
|
||||
snow.Rate = RATE
|
||||
snow.LockedToPart = false
|
||||
snow.Parent = cloud
|
||||
|
||||
cloud.Parent = workspace.CurrentCamera or workspace
|
||||
|
||||
-- follow the camera (flat, ignore its rotation) + slow changing wind
|
||||
RunService.RenderStepped:Connect(function()
|
||||
local cam = workspace.CurrentCamera
|
||||
if not cam then return end
|
||||
if cloud.Parent ~= cam then cloud.Parent = cam end
|
||||
local p = cam.CFrame.Position
|
||||
cloud.CFrame = CFrame.new(p.X, p.Y + HEIGHT, p.Z)
|
||||
local t = os.clock()
|
||||
snow.Acceleration = Vector3.new(1.2 * math.sin(t * 0.11) + 0.5 * math.sin(t * 0.37), 0, 0.9 * math.cos(t * 0.09) + 0.4 * math.sin(t * 0.29))
|
||||
end)
|
||||
@@ -0,0 +1,392 @@
|
||||
-- TradeWindow: "Обмен" between two players on the server (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Игроки / Сделка / Как это работает. "Сделка" gets a badge while a trade is open.
|
||||
-- Игроки : one row per player with level; button: ready "Предложить обмен", off when a level is too low,
|
||||
-- info "Запрос отправлен" for a while after sending.
|
||||
-- Сделка : two columns (you / them): offered toys, value, ready status; your shards stepper and your toys
|
||||
-- (click adds, click on an offered toy removes, fresh toys locked). Buttons: Готов <-> Не готов,
|
||||
-- Подтвердить (off until both are ready and the countdown ends, then ready; "Ждём второго" after it),
|
||||
-- Отменить. A warning shows when one side is worth much more.
|
||||
-- The incoming request is a small popup on top of the screen (Принять / Отклонить + timer bar).
|
||||
-- RemoteEvent "Trade": Request / Respond / SetShards / AddItem / RemoveItem / Ready / Confirm / Cancel;
|
||||
-- server -> client: Incoming / State / Closed.
|
||||
local Players = game:GetService("Players")
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local T = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, WARN, BODY, NAVY = K.WHITE, K.GOLD, K.SOFT, K.OK, K.WARN, K.BODY, K.NAVY
|
||||
local new, corner, art, label, maxText, pill, tween = K.new, K.corner, K.art, K.label, K.maxText, K.pill, K.tween
|
||||
local PANEL = Color3.new(0, 0, 0)
|
||||
|
||||
function T.install(ctx)
|
||||
local Config, player, remote = ctx.Config, ctx.player, ctx.remote
|
||||
local TR = Config.TRADE
|
||||
local fmt = ctx.fmtNum
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local TAX = math.floor(TR.TAX * 100 + 0.5)
|
||||
local state, lastTheirs = nil, {}
|
||||
local refresh, render
|
||||
local TABS = {
|
||||
{ id = "Players", text = "Players", icon = "👥", tip = "Trading unlocks at level " .. TR.MIN_LEVEL .. " for both players." },
|
||||
{ id = "Deal", text = "Deal", icon = "🤝", tip = "Any change clears “Ready” for both players — so nobody can swap an ornament at the last moment." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "Tax " .. TAX .. "% applies only to shards sent; ornaments are tax-free." },
|
||||
}
|
||||
local ch = K.chrome({ win = win, title = "TRADE", subtitle = "Trade ornaments\nwith players on this server", tabs = TABS,
|
||||
closeWindow = function()
|
||||
if state then remote:FireServer("Cancel") end
|
||||
ctx.closeWindow()
|
||||
end, fmtNum = fmt, onTab = function() if win.overlay.Visible then refresh() end end })
|
||||
|
||||
local function darkPanel(parent, pos, size, z)
|
||||
return new("Frame", { Position = pos, Size = size, BackgroundColor3 = PANEL, BackgroundTransparency = 0.5, ZIndex = z or 4, Parent = parent }, {
|
||||
corner(UDim.new(0, 22)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.4 }),
|
||||
})
|
||||
end
|
||||
local function statusChip(parent, pos)
|
||||
local f = new("Frame", { AnchorPoint = Vector2.new(1, 0.5), Position = pos, Size = UDim2.fromOffset(150, 38), BackgroundColor3 = Color3.fromRGB(70, 82, 100), ZIndex = 6, Parent = parent }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 2, Transparency = 0.5 }),
|
||||
})
|
||||
local t = maxText(label({ Position = UDim2.fromOffset(8, 5), Size = UDim2.new(1, -16, 1, -10), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 7, Parent = f }, 1.5), 22)
|
||||
return function(side)
|
||||
local s = side.confirmed and "confirmed" or side.ready and "ready" or "not ready"
|
||||
t.Text = s
|
||||
f.BackgroundColor3 = side.confirmed and Color3.fromRGB(200, 140, 30) or side.ready and Color3.fromRGB(40, 150, 80) or Color3.fromRGB(70, 82, 100)
|
||||
end
|
||||
end
|
||||
local function tileGrid(parent, pos, size)
|
||||
local s = K.scroll(parent, pos, size, new("UIGridLayout", { CellSize = UDim2.fromOffset(112, 150), CellPadding = UDim2.fromOffset(8, 8), SortOrder = Enum.SortOrder.LayoutOrder }))
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 10), PaddingTop = UDim.new(0, 12), PaddingBottom = UDim.new(0, 8), Parent = s })
|
||||
return s
|
||||
end
|
||||
local function clear(f) for _, c in f:GetChildren() do if c:IsA("GuiObject") then c:Destroy() end end end
|
||||
|
||||
---------------------------------------------------------------- players
|
||||
local _, plScroll = ch.makePage("Players", true)
|
||||
new("UIListLayout", { Padding = UDim.new(0, 12), SortOrder = Enum.SortOrder.LayoutOrder, Parent = plScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 18), PaddingTop = UDim.new(0, 4), PaddingBottom = UDim.new(0, 4), Parent = plScroll })
|
||||
local requested = {} -- userId -> os.clock() of my request
|
||||
local function rebuildPlayers()
|
||||
clear(plScroll)
|
||||
local myLvl = attr("Level", 1)
|
||||
local n = 0
|
||||
for _, p in Players:GetPlayers() do
|
||||
if p ~= player then
|
||||
n += 1
|
||||
local lvl = p:GetAttribute("Level") or 1
|
||||
local row = new("Frame", { Size = UDim2.new(1, 0, 0, 112), BackgroundColor3 = PANEL, BackgroundTransparency = 0.45, LayoutOrder = n, ZIndex = 5, Parent = plScroll }, {
|
||||
corner(UDim.new(0, 26)), new("UIStroke", { Color = GOLD, Thickness = 2, Transparency = 0.3 }),
|
||||
})
|
||||
local face = new("ImageLabel", { Position = UDim2.fromOffset(14, 10), Size = UDim2.fromOffset(92, 92), BackgroundColor3 = NAVY, Image = "", ZIndex = 6, Parent = row }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 3 }),
|
||||
})
|
||||
task.spawn(function()
|
||||
local ok, img = pcall(Players.GetUserThumbnailAsync, Players, p.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size150x150)
|
||||
if ok and face.Parent then face.Image = img end
|
||||
end)
|
||||
maxText(label({ Position = UDim2.fromOffset(124, 14), Size = UDim2.fromOffset(640, 44), Text = p.DisplayName, TextScaled = true, ZIndex = 6, Parent = row }, 2.5), 36)
|
||||
maxText(label({ Position = UDim2.fromOffset(126, 60), Size = UDim2.fromOffset(640, 30), Text = "@" .. p.Name .. " · level " .. lvl, TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = lvl >= TR.MIN_LEVEL and OK or SOFT, ZIndex = 6, Parent = row }, 1.5), 22)
|
||||
local btn
|
||||
btn = pill(row, { Position = UDim2.fromOffset(880, 20), Size = UDim2.fromOffset(330, 72), ZIndex = 6, TextMax = 28 }, function()
|
||||
requested[p.UserId] = os.clock()
|
||||
remote:FireServer("Request", p)
|
||||
ctx.toast("Request sent: " .. p.DisplayName, OK)
|
||||
rebuildPlayers()
|
||||
end)
|
||||
if state then btn.set("info", "You are already trading")
|
||||
elseif requested[p.UserId] and os.clock() - requested[p.UserId] < 15 then btn.set("info", "Request sent")
|
||||
elseif myLvl < TR.MIN_LEVEL then btn.set("off", "Level " .. TR.MIN_LEVEL .. "+")
|
||||
elseif lvl < TR.MIN_LEVEL then btn.set("off", "Player is level " .. lvl)
|
||||
else btn.set("ready", "Offer a trade") end
|
||||
end
|
||||
end
|
||||
if n == 0 then
|
||||
local e = K.emptyState({ Size = UDim2.new(1, 0, 0, 500), ZIndex = 5, Parent = plScroll }, "Nobody else is on this server",
|
||||
"Invite a friend — trading works between players on the same server.")
|
||||
e.LayoutOrder = 1
|
||||
end
|
||||
end
|
||||
Players.PlayerAdded:Connect(function() if win.overlay.Visible and ch.current() == "Players" then rebuildPlayers() end end)
|
||||
Players.PlayerRemoving:Connect(function() task.defer(function() if win.overlay.Visible and ch.current() == "Players" then rebuildPlayers() end end) end)
|
||||
|
||||
---------------------------------------------------------------- deal
|
||||
local dealG = ch.makePage("Deal")
|
||||
local noDeal = K.emptyState({ Position = UDim2.fromOffset(0, 60), Size = UDim2.new(1, 0, 0, 420), ZIndex = 5, Parent = dealG }, "No active trade",
|
||||
"Pick a player in the “Players” tab and offer a trade — or accept someone's request.")
|
||||
local pickBtn = pill(noDeal, { Position = UDim2.new(0.5, -160, 0, 320), Size = UDim2.fromOffset(320, 66), ZIndex = 6, TextMax = 28 }, function() ch.showTab("Players") end)
|
||||
pickBtn.set("alt", "Pick a player")
|
||||
local deal = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundTransparency = 1, Visible = false, ZIndex = 4, Parent = dealG })
|
||||
-- left: me
|
||||
local myHead = darkPanel(deal, UDim2.fromOffset(0, 0), UDim2.fromOffset(620, 56))
|
||||
maxText(label({ Position = UDim2.fromOffset(18, 8), Size = UDim2.fromOffset(240, 40), Text = "You give", TextScaled = true, ZIndex = 6, Parent = myHead }, 2.5), 30)
|
||||
local myValue = maxText(label({ Position = UDim2.fromOffset(260, 12), Size = UDim2.fromOffset(186, 32), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = Color3.fromRGB(190, 225, 255),
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 6, Parent = myHead }, 1.5), 22)
|
||||
local myChip = statusChip(myHead, UDim2.new(1, -10, 0.5, 0))
|
||||
local myOffer = darkPanel(deal, UDim2.fromOffset(0, 62), UDim2.fromOffset(620, 190))
|
||||
local myGrid = tileGrid(myOffer, UDim2.new(), UDim2.fromScale(1, 1))
|
||||
local myHint = maxText(label({ Position = UDim2.fromOffset(20, 70), Size = UDim2.new(1, -40, 0, 50), Text = "Click one of your ornaments below to put it here", TextScaled = true, TextWrapped = true,
|
||||
FontFace = BODY, TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = myOffer }, 1.5), 22)
|
||||
maxText(label({ Position = UDim2.fromOffset(6, 268), Size = UDim2.fromOffset(130, 40), Text = "Shards", TextScaled = true, ZIndex = 5, Parent = deal }, 2), 28)
|
||||
local boxWrap = new("Frame", { Position = UDim2.fromOffset(206, 260), Size = UDim2.fromOffset(180, 56), BackgroundColor3 = NAVY, ZIndex = 5, Parent = deal }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = Color3.fromRGB(190, 225, 255), Thickness = 2 }),
|
||||
})
|
||||
art("crystal", { Position = UDim2.new(0, -8, 0.5, -28), Size = UDim2.fromOffset(56, 56), ZIndex = 6, Parent = boxWrap })
|
||||
local shardBox = new("TextBox", { Position = UDim2.fromOffset(46, 6), Size = UDim2.new(1, -60, 1, -12), BackgroundTransparency = 1, Text = "0", PlaceholderText = "0", ClearTextOnFocus = false,
|
||||
FontFace = K.FONT, TextScaled = true, TextColor3 = WHITE, ZIndex = 6, Parent = boxWrap })
|
||||
maxText(shardBox, 32)
|
||||
local function sendShards(n) remote:FireServer("SetShards", math.clamp(math.floor(n or tonumber(shardBox.Text) or 0), 0, attr("Shards", 0))) end
|
||||
local minus = pill(deal, { Position = UDim2.fromOffset(136, 260), Size = UDim2.fromOffset(62, 56), ZIndex = 5, TextMax = 36 }, function() sendShards((state and state.me.shards or 0) - 10) end)
|
||||
local plus = pill(deal, { Position = UDim2.fromOffset(394, 260), Size = UDim2.fromOffset(62, 56), ZIndex = 5, TextMax = 36 }, function() sendShards((state and state.me.shards or 0) + 10) end)
|
||||
minus.set("alt", "-")
|
||||
plus.set("alt", "+")
|
||||
local setBtn = pill(deal, { Position = UDim2.fromOffset(464, 260), Size = UDim2.fromOffset(156, 56), ZIndex = 5, TextMax = 26 }, function() sendShards() end)
|
||||
setBtn.set("alt", "Set")
|
||||
shardBox:GetPropertyChangedSignal("Text"):Connect(function()
|
||||
local d = shardBox.Text:gsub("%D", "")
|
||||
if d ~= shardBox.Text then shardBox.Text = d end
|
||||
end)
|
||||
shardBox.FocusLost:Connect(function(enter) if enter then sendShards() end end)
|
||||
local myShardNote = maxText(label({ Position = UDim2.fromOffset(6, 320), Size = UDim2.fromOffset(614, 26), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = SOFT, ZIndex = 5, Parent = deal }, 1.5), 19)
|
||||
local invPanel = darkPanel(deal, UDim2.fromOffset(0, 352), UDim2.fromOffset(620, 214))
|
||||
maxText(label({ Position = UDim2.fromOffset(16, 6), Size = UDim2.fromOffset(590, 28), Text = "Your ornaments — click to add", TextScaled = true, FontFace = BODY, TextColor3 = SOFT, ZIndex = 5, Parent = invPanel }, 1.5), 20)
|
||||
local invGrid = tileGrid(invPanel, UDim2.fromOffset(0, 34), UDim2.new(1, 0, 1, -38))
|
||||
-- right: them
|
||||
local thHead = darkPanel(deal, UDim2.fromOffset(640, 0), UDim2.fromOffset(620, 56))
|
||||
local thTitle = maxText(label({ Position = UDim2.fromOffset(18, 8), Size = UDim2.fromOffset(250, 40), Text = "", TextScaled = true, ZIndex = 6, Parent = thHead }, 2.5), 30)
|
||||
local thValue = maxText(label({ Position = UDim2.fromOffset(270, 12), Size = UDim2.fromOffset(176, 32), Text = "", TextScaled = true, FontFace = BODY, TextColor3 = Color3.fromRGB(190, 225, 255),
|
||||
TextXAlignment = Enum.TextXAlignment.Right, ZIndex = 6, Parent = thHead }, 1.5), 22)
|
||||
local thChip = statusChip(thHead, UDim2.new(1, -10, 0.5, 0))
|
||||
local thOffer = darkPanel(deal, UDim2.fromOffset(640, 62), UDim2.fromOffset(620, 190))
|
||||
local thGrid = tileGrid(thOffer, UDim2.new(), UDim2.fromScale(1, 1))
|
||||
local thHint = maxText(label({ Position = UDim2.fromOffset(20, 70), Size = UDim2.new(1, -40, 0, 50), Text = "Nothing added yet", TextScaled = true,
|
||||
FontFace = BODY, TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = thOffer }, 1.5), 22)
|
||||
local thShards = new("Frame", { Position = UDim2.fromOffset(640, 260), Size = UDim2.fromOffset(620, 56), BackgroundColor3 = NAVY, ZIndex = 5, Parent = deal }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = Color3.fromRGB(190, 225, 255), Thickness = 2 }),
|
||||
})
|
||||
art("crystal", { Position = UDim2.new(0, -6, 0.5, -28), Size = UDim2.fromOffset(56, 56), ZIndex = 6, Parent = thShards })
|
||||
local thShardsText = maxText(label({ Position = UDim2.fromOffset(58, 8), Size = UDim2.new(1, -72, 1, -16), Text = "", TextScaled = true, ZIndex = 6, Parent = thShards }, 2), 28)
|
||||
local warnText = maxText(label({ Position = UDim2.fromOffset(640, 324), Size = UDim2.fromOffset(620, 40), Text = "", TextScaled = true, TextWrapped = true, TextColor3 = WARN,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = deal }, 1.5), 22)
|
||||
local stepText = maxText(label({ Position = UDim2.fromOffset(640, 368), Size = UDim2.fromOffset(620, 48), Text = "", TextScaled = true, TextColor3 = GOLD,
|
||||
TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = deal }, 2.5), 34)
|
||||
local readyBtn = pill(deal, { Position = UDim2.fromOffset(640, 440), Size = UDim2.fromOffset(196, 84), ZIndex = 5, TextMax = 30 }, function()
|
||||
if state then remote:FireServer("Ready", not state.me.ready) end
|
||||
end)
|
||||
local confirmBtn -- declared first: the click callback below refers to it
|
||||
confirmBtn = pill(deal, { Position = UDim2.fromOffset(842, 440), Size = UDim2.fromOffset(216, 84), ZIndex = 5, TextMax = 28 }, function()
|
||||
if state and state.canConfirm then confirmBtn.set("busy"); remote:FireServer("Confirm") end
|
||||
end)
|
||||
local cancelBtn = pill(deal, { Position = UDim2.fromOffset(1064, 440), Size = UDim2.fromOffset(196, 84), ZIndex = 5, TextMax = 30 }, function() remote:FireServer("Cancel") end)
|
||||
cancelBtn.set("danger", "Cancel")
|
||||
|
||||
local function stepLine()
|
||||
local me, them = state.me, state.them
|
||||
if state.countdown and state.countdown > 0 then return "Confirm in " .. math.ceil(state.countdown) .. "s" end
|
||||
if me.confirmed then return "Waiting for " .. them.name .. " to confirm" end
|
||||
if state.canConfirm then return "All set — confirm!" end
|
||||
if me.ready and not them.ready then return "Waiting for " .. them.name .. " to press “Ready”" end
|
||||
if not me.ready then return "Check both offers and press “Ready”" end
|
||||
return ""
|
||||
end
|
||||
render = function()
|
||||
ch.tabs.Deal.setBadge(state and 1 or 0)
|
||||
noDeal.Visible = state == nil
|
||||
deal.Visible = state ~= nil
|
||||
if not state then return end
|
||||
local me, them = state.me, state.them
|
||||
myValue.Text = "value " .. fmt(me.value)
|
||||
thValue.Text = "value " .. fmt(them.value)
|
||||
thTitle.Text = them.name .. " gives"
|
||||
myChip(me)
|
||||
thChip(them)
|
||||
-- my offer (click removes)
|
||||
clear(myGrid)
|
||||
local inOffer = {}
|
||||
for k, it in me.items do
|
||||
inOffer[it.uid] = true
|
||||
local t = K.toyTile({ Config = Config, miniPattern = ctx.miniPattern, parent = myGrid, item = it, w = 112, h = 150, order = k, z = 6, value = true })
|
||||
t.button.Activated:Connect(function() remote:FireServer("RemoveItem", it.uid) end)
|
||||
end
|
||||
myHint.Visible = #me.items == 0
|
||||
-- their offer (new items marked)
|
||||
clear(thGrid)
|
||||
local now = {}
|
||||
for k, it in them.items do
|
||||
now[it.uid] = true
|
||||
local t = K.toyTile({ Config = Config, miniPattern = ctx.miniPattern, parent = thGrid, item = it, w = 112, h = 150, order = k, z = 6, value = true, inert = true })
|
||||
if not lastTheirs[it.uid] then
|
||||
t.setSelected(true)
|
||||
local tag = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, -10), Size = UDim2.fromOffset(84, 24), BackgroundColor3 = GOLD, ZIndex = 12, Parent = t.button }, { corner(UDim.new(0.5, 0)) })
|
||||
maxText(label({ Position = UDim2.fromOffset(4, 2), Size = UDim2.new(1, -8, 1, -4), Text = "NEW", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 13, Parent = tag }, 1.5), 18)
|
||||
end
|
||||
end
|
||||
lastTheirs = now
|
||||
thHint.Visible = #them.items == 0
|
||||
-- shards
|
||||
if not shardBox:IsFocused() then shardBox.Text = tostring(me.shards) end
|
||||
myShardNote.Text = me.shards > 0 and ("arrives: " .. fmt(math.floor(me.shards * (1 - TR.TAX))) .. " after " .. TAX .. "% · you have " .. fmt(attr("Shards", 0)))
|
||||
or ("you have " .. fmt(attr("Shards", 0)) .. " shards")
|
||||
thShardsText.Text = them.shards > 0 and ("+" .. fmt(math.floor(them.shards * (1 - TR.TAX))) .. " shards to you (after tax)") or "offers no shards"
|
||||
-- my toys
|
||||
clear(invGrid)
|
||||
local inv = player:FindFirstChild("OrnamentInventory")
|
||||
local list = {}
|
||||
for _, c in inv and inv:GetChildren() or {} do
|
||||
if not inOffer[c.Name] and not c:GetAttribute("OnTree") then table.insert(list, c) end
|
||||
end
|
||||
table.sort(list, function(x, y)
|
||||
local rx, ry = Config.RarityById[x:GetAttribute("Rarity")], Config.RarityById[y:GetAttribute("Rarity")]
|
||||
if rx.Index ~= ry.Index then return rx.Index > ry.Index end
|
||||
return (x:GetAttribute("Order") or 0) > (y:GetAttribute("Order") or 0)
|
||||
end)
|
||||
local full = #me.items >= TR.MAX_ITEMS
|
||||
for k, c in list do
|
||||
local it = { Toy = c:GetAttribute("Toy"), Rarity = c:GetAttribute("Rarity"), Variant = c:GetAttribute("Variant") }
|
||||
local t = K.toyTile({ Config = Config, miniPattern = ctx.miniPattern, parent = invGrid, item = it, w = 112, h = 150, order = k, z = 6, value = true })
|
||||
local age = os.time() - (c:GetAttribute("Created") or 0)
|
||||
if age < TR.MIN_AGE then
|
||||
t.lock("🔒\n" .. math.ceil((TR.MIN_AGE - age) / 60) .. " min")
|
||||
t.button.Activated:Connect(function() t.wiggle(); ctx.toast("New ornaments can be traded in " .. (TR.MIN_AGE // 60) .. " min", WARN) end)
|
||||
else
|
||||
t.button.Activated:Connect(function()
|
||||
if full then t.wiggle(); ctx.toast("No more than " .. TR.MAX_ITEMS .. " ornaments per trade", WARN) return end
|
||||
remote:FireServer("AddItem", c.Name)
|
||||
end)
|
||||
end
|
||||
end
|
||||
-- warning + step + buttons
|
||||
local hi, lo = math.max(me.value, them.value), math.min(me.value, them.value)
|
||||
if (me.value > 0 or them.value > 0) and (lo == 0 or hi / lo > TR.WARN_RATIO) then
|
||||
warnText.Text = me.value > them.value and "Warning: you're giving much more than you get!" or "You're getting much more — make sure it's fair."
|
||||
else
|
||||
warnText.Text = ""
|
||||
end
|
||||
stepText.Text = stepLine()
|
||||
if me.confirmed then readyBtn.set("off", "Ready")
|
||||
elseif me.ready then readyBtn.set("alt", "Not ready")
|
||||
else readyBtn.set("ready", "Ready") end
|
||||
if me.confirmed then confirmBtn.set("done", "Confirmed")
|
||||
elseif state.canConfirm then confirmBtn.set("ready", "Confirm")
|
||||
elseif state.countdown and state.countdown > 0 then confirmBtn.set("off", "In " .. math.ceil(state.countdown) .. "s")
|
||||
else confirmBtn.set("off", "Press “Ready” first") end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- help
|
||||
local _, heScroll = ch.makePage("Help", true)
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardCyan", icon = "👥", title = "1. Invite", tab = "Players",
|
||||
text = "Pick a player and offer a trade. Both need level " .. TR.MIN_LEVEL .. ". New ornaments can be traded " .. (TR.MIN_AGE // 60) .. " min after they are made." },
|
||||
{ card = "cardViolet", icon = "🎁", title = "2. Add", tab = "Deal",
|
||||
text = "Up to " .. TR.MAX_ITEMS .. " ornaments and shards (tax " .. TAX .. "%). Click your ornament to add it, click an added one to remove it." },
|
||||
{ card = "cardOrange", icon = "🤝", title = "3. Confirm", tab = "Deal",
|
||||
text = "Both press “Ready”, then after " .. TR.COUNTDOWN .. "s — “Confirm”. Any change clears “Ready” for both." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = K.CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, function() ch.showTab(h.tab) end)
|
||||
go.set("alt", "Open")
|
||||
end
|
||||
|
||||
refresh = function()
|
||||
ch.setBalance(attr("Shards", 0))
|
||||
if ch.current() == "Players" then rebuildPlayers() elseif ch.current() == "Deal" then render() end
|
||||
if attr("Level", 1) < TR.MIN_LEVEL and ch.current() ~= "Help" then
|
||||
ch.tip.Text = "🔒 Trading unlocks at level " .. TR.MIN_LEVEL .. " — you are level " .. attr("Level", 1) .. "."
|
||||
ch.tip.TextColor3 = WARN
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- incoming request popup
|
||||
local popup = new("Frame", { Name = "TradeRequest", AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 16), Size = UDim2.fromOffset(470, 150),
|
||||
BackgroundColor3 = WHITE, Visible = false, ZIndex = 40, Parent = ctx.gui }, {
|
||||
corner(UDim.new(0, 22)),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(Color3.fromRGB(22, 84, 70), Color3.fromRGB(8, 36, 44)) }),
|
||||
new("UIStroke", { Color = Color3.fromRGB(242, 196, 82), Thickness = 3 }),
|
||||
})
|
||||
local popScale = new("UIScale", { Parent = popup })
|
||||
label({ Position = UDim2.fromOffset(14, 12), Size = UDim2.fromOffset(56, 56), Text = "🤝", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 41, Parent = popup }, 0)
|
||||
local popText = maxText(label({ Position = UDim2.fromOffset(80, 12), Size = UDim2.fromOffset(376, 56), Text = "", TextScaled = true, TextWrapped = true, ZIndex = 41, Parent = popup }, 2), 24)
|
||||
local popBarBg = new("Frame", { Position = UDim2.fromOffset(16, 74), Size = UDim2.new(1, -32, 0, 8), BackgroundColor3 = Color3.fromRGB(10, 20, 26), ZIndex = 41, Parent = popup }, { corner(UDim.new(0.5, 0)) })
|
||||
local popBar = new("Frame", { Size = UDim2.fromScale(1, 1), BackgroundColor3 = GOLD, ZIndex = 42, Parent = popBarBg }, { corner(UDim.new(0.5, 0)) })
|
||||
local pendingFrom
|
||||
local function closePopup() popup.Visible = false; pendingFrom = nil end
|
||||
local accept = pill(popup, { Position = UDim2.fromOffset(16, 90), Size = UDim2.fromOffset(212, 50), ZIndex = 41, TextMax = 24 }, function()
|
||||
if pendingFrom then remote:FireServer("Respond", pendingFrom, true) end
|
||||
closePopup()
|
||||
end)
|
||||
local decline = pill(popup, { Position = UDim2.fromOffset(242, 90), Size = UDim2.fromOffset(212, 50), ZIndex = 41, TextMax = 24 }, function()
|
||||
if pendingFrom then remote:FireServer("Respond", pendingFrom, false) end
|
||||
closePopup()
|
||||
end)
|
||||
accept.set("ready", "Accept")
|
||||
decline.set("danger", "Decline")
|
||||
|
||||
---------------------------------------------------------------- server events
|
||||
remote.OnClientEvent:Connect(function(kind, data)
|
||||
if kind == "Incoming" then
|
||||
pendingFrom = data.from
|
||||
popText.Text = data.name .. " (lvl " .. data.level .. ") wants to trade"
|
||||
popup.Visible = true
|
||||
popScale.Scale = 0.85
|
||||
tween(popScale, 0.25, { Scale = 1 }, Enum.EasingStyle.Back)
|
||||
popBar.Size = UDim2.fromScale(1, 1)
|
||||
tween(popBar, data.ttl, { Size = UDim2.fromScale(0, 1) }, Enum.EasingStyle.Linear)
|
||||
local mine = pendingFrom
|
||||
task.delay(data.ttl, function() if pendingFrom == mine then closePopup() end end)
|
||||
elseif kind == "State" then
|
||||
local first = state == nil
|
||||
state = data
|
||||
if first then
|
||||
lastTheirs = {}
|
||||
for _, it in data.them.items do lastTheirs[it.uid] = true end
|
||||
requested = {}
|
||||
end
|
||||
if not win.overlay.Visible then ctx.openWindow() end
|
||||
if ch.current() ~= "Deal" then ch.showTab("Deal") else render() end
|
||||
elseif kind == "Closed" then
|
||||
state = nil
|
||||
lastTheirs = {}
|
||||
render()
|
||||
if win.overlay.Visible then ctx.closeWindow() end
|
||||
if data then ctx.toast(data, WARN) end
|
||||
end
|
||||
end)
|
||||
-- local countdown tick (the server re-sends the state when the countdown ends)
|
||||
task.spawn(function()
|
||||
while true do
|
||||
task.wait(0.25)
|
||||
if state and state.countdown and state.countdown > 0 and win.overlay.Visible then
|
||||
state.countdown = math.max(0, state.countdown - 0.25)
|
||||
stepText.Text = stepLine()
|
||||
if not state.me.confirmed and not state.canConfirm then confirmBtn.set("off", "In " .. math.ceil(state.countdown) .. "s") end
|
||||
end
|
||||
end
|
||||
end)
|
||||
task.spawn(function()
|
||||
local inv = player:WaitForChild("OrnamentInventory")
|
||||
local function changed() if state and win.overlay.Visible then task.defer(render) end end
|
||||
inv.ChildAdded:Connect(changed)
|
||||
inv.ChildRemoved:Connect(changed)
|
||||
end)
|
||||
player:GetAttributeChangedSignal("Shards"):Connect(function() if win.overlay.Visible then ch.setBalance(attr("Shards", 0)) end end)
|
||||
|
||||
ch.showTab("Players")
|
||||
return {
|
||||
open = function()
|
||||
ch.setBalance(attr("Shards", 0), true)
|
||||
local want = state and "Deal" or ch.current()
|
||||
if want ~= ch.current() then ch.showTab(want) else refresh() end
|
||||
end,
|
||||
active = function() return state ~= nil end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return T
|
||||
@@ -0,0 +1,780 @@
|
||||
-- TutorialGuide (LocalScript, StarterPlayerScripts): the first-time tutorial. Runs once per player (attribute
|
||||
-- TutorialDone from OrnamentPlayerData; "Done" goes to the server through the Tutorial remote).
|
||||
-- It never changes the other UI scripts: it watches the windows of OrnamentCraftGui and puts its own layer on top.
|
||||
-- spotlight : the screen is dimmed and blocked except a "hole" around one element (gold pulsing ring + hand +
|
||||
-- a speech bubble). Either the bubble has a "Дальше" button (the hole is blocked too) or the player must
|
||||
-- press the element itself (the hole lets clicks through) and the step waits for the result.
|
||||
-- walk : glowing chevrons on the ground lead to the generator / shredder, a sign floats over the target, a
|
||||
-- banner says what to do; the HUD buttons are blocked.
|
||||
-- Flow: welcome -> balance -> level -> walk to the generator -> generator window (grid, drops, booster, Автоузор,
|
||||
-- Создать) -> the first toy -> walk to the shredder -> shredder window (pick the toy, Переработать) -> shards back
|
||||
-- -> shop button -> shop window -> close -> done. "Пропустить" (top right) ends it at any time.
|
||||
-- If a window is closed in the middle (E, walking away), the tutorial goes back to the walk step of that machine.
|
||||
local Players = game:GetService("Players")
|
||||
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
||||
local RunService = game:GetService("RunService")
|
||||
local UIS = game:GetService("UserInputService")
|
||||
local GuiService = game:GetService("GuiService")
|
||||
local TweenService = game:GetService("TweenService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local folder = ReplicatedStorage:WaitForChild("OrnamentMachine")
|
||||
local Config = require(folder:WaitForChild("Config"))
|
||||
local tutorialRemote = folder:WaitForChild("Tutorial", 30)
|
||||
local K = require(player:WaitForChild("PlayerScripts"):WaitForChild("OrnamentCraftUI"):WaitForChild("ShopKit"))
|
||||
|
||||
---------------------------------------------------------------- start conditions
|
||||
do
|
||||
local t = os.clock()
|
||||
while not player:GetAttribute("DataLoaded") and os.clock() - t < 60 do task.wait(0.2) end
|
||||
end
|
||||
-- already done: wait — an admin can reset it (TutorialDone -> false), then it starts right away
|
||||
while player:GetAttribute("TutorialDone") do player:GetAttributeChangedSignal("TutorialDone"):Wait() end
|
||||
local playerGui = player:WaitForChild("PlayerGui")
|
||||
local gui = playerGui:WaitForChild("OrnamentCraftGui", 30)
|
||||
if not gui then return end
|
||||
-- wait for the opening camera shot (IntroCamera sets the local attribute IntroDone at its end)
|
||||
do
|
||||
local t = os.clock()
|
||||
while player:GetAttribute("IntroDone") ~= true and os.clock() - t < 60 do task.wait(0.1) end
|
||||
end
|
||||
task.wait(0.4)
|
||||
|
||||
local GOLD = Color3.fromRGB(255, 205, 70)
|
||||
local NAVY = Color3.fromRGB(14, 32, 52)
|
||||
local WHITE = Color3.new(1, 1, 1)
|
||||
local SOFT = Color3.fromRGB(200, 225, 235)
|
||||
local TOUCH = UIS.TouchEnabled and not UIS.KeyboardEnabled
|
||||
local OPEN_HINT = TOUCH and "press the “Open” button at the machine" or "press E"
|
||||
|
||||
local function new(class, props, children)
|
||||
local o = Instance.new(class)
|
||||
if o:IsA("GuiButton") then o:SetAttribute("UXDone", true) end -- OrnamentUX must not restyle / re-anchor them
|
||||
for k, v in props or {} do if k ~= "Parent" then o[k] = v end end
|
||||
for _, c in children or {} do c.Parent = o end
|
||||
if props and props.Parent then o.Parent = props.Parent end
|
||||
return o
|
||||
end
|
||||
local function tween(o, t, props, style)
|
||||
local tw = TweenService:Create(o, TweenInfo.new(t, style or Enum.EasingStyle.Quad, Enum.EasingDirection.Out), props)
|
||||
tw:Play()
|
||||
return tw
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- the player's machine
|
||||
local function myMachine()
|
||||
local idx = player:GetAttribute("PlotIndex")
|
||||
local zone = idx and workspace:FindFirstChild("Zones") and workspace.Zones:FindFirstChild("Zone_" .. idx)
|
||||
return zone and zone:FindFirstChild("OrnamentMachine"), zone and zone:FindFirstChild("Plot")
|
||||
end
|
||||
local function hrp()
|
||||
return player.Character and player.Character:FindFirstChild("HumanoidRootPart")
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- freeze the character (while a window is explained)
|
||||
local saved
|
||||
local function freeze(on)
|
||||
local h = player.Character and player.Character:FindFirstChildOfClass("Humanoid")
|
||||
if not h then return end
|
||||
if on and not saved then
|
||||
saved = { h, h.WalkSpeed, h.JumpPower, h.JumpHeight }
|
||||
h.WalkSpeed, h.JumpPower, h.JumpHeight = 0, 0, 0
|
||||
elseif not on and saved then
|
||||
if saved[1].Parent then saved[1].WalkSpeed, saved[1].JumpPower, saved[1].JumpHeight = saved[2], saved[3], saved[4] end
|
||||
saved = nil
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- overlay
|
||||
local tg = new("ScreenGui", { Name = "TutorialGui", IgnoreGuiInset = true, DisplayOrder = 50, ResetOnSpawn = false,
|
||||
ZIndexBehavior = Enum.ZIndexBehavior.Sibling, Parent = playerGui })
|
||||
local DIM = 0.42
|
||||
local function blocker(transp)
|
||||
local b = new("TextButton", { Text = "", AutoButtonColor = false, BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = transp,
|
||||
BorderSizePixel = 0, Visible = false, ZIndex = 1 })
|
||||
b:SetAttribute("NoSound", true) -- UISounds: the dark walls only swallow clicks, they are not buttons
|
||||
b.Parent = tg
|
||||
return b
|
||||
end
|
||||
local walls = { blocker(DIM), blocker(DIM), blocker(DIM), blocker(DIM) } -- around the hole
|
||||
local holeCover = blocker(1) -- over the hole when it must not be pressed
|
||||
local hudBlock = { blocker(0.55), blocker(0.55), blocker(0.55) } -- walk mode: HUD buttons
|
||||
for _, b in hudBlock do new("UICorner", { CornerRadius = UDim.new(0, 18), Parent = b }) end
|
||||
|
||||
local ring = new("Frame", { BackgroundTransparency = 1, Visible = false, ZIndex = 3, Parent = tg }, {
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 16) }),
|
||||
})
|
||||
local ringStroke = new("UIStroke", { Color = GOLD, Thickness = 4, Parent = ring })
|
||||
local hand = new("TextLabel", { BackgroundTransparency = 1, Text = "👆", TextSize = 54, Size = UDim2.fromOffset(70, 70), AnchorPoint = Vector2.new(0.5, 0.5),
|
||||
Visible = false, ZIndex = 6, Parent = tg })
|
||||
|
||||
-- speech bubble
|
||||
local bubble = new("Frame", { Name = "Bubble", BackgroundColor3 = NAVY, BackgroundTransparency = 0.04, Size = UDim2.fromOffset(470, 0),
|
||||
AutomaticSize = Enum.AutomaticSize.Y, Visible = false, ZIndex = 4, Parent = tg }, {
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 22) }),
|
||||
new("UIStroke", { Color = GOLD, Thickness = 3 }),
|
||||
new("UIPadding", { PaddingTop = UDim.new(0, 16), PaddingBottom = UDim.new(0, 16), PaddingLeft = UDim.new(0, 18), PaddingRight = UDim.new(0, 18) }),
|
||||
new("UIListLayout", { Padding = UDim.new(0, 12), SortOrder = Enum.SortOrder.LayoutOrder, HorizontalAlignment = Enum.HorizontalAlignment.Center }),
|
||||
})
|
||||
local bubbleScale = new("UIScale", { Parent = bubble })
|
||||
local stepLabel = new("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 22), FontFace = K.FONT, TextSize = 18, TextColor3 = GOLD,
|
||||
TextXAlignment = Enum.TextXAlignment.Left, LayoutOrder = 0, ZIndex = 5, Parent = bubble })
|
||||
local bubbleText = new("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, TextWrapped = true, RichText = true,
|
||||
FontFace = K.FONT, TextSize = 25, TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Left, LayoutOrder = 1, ZIndex = 5, Parent = bubble }, {
|
||||
new("UIStroke", { Color = Color3.fromRGB(8, 14, 24), Thickness = 1.5 }),
|
||||
})
|
||||
local btnRow = new("Frame", { Name = "TutButtons", BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 74), LayoutOrder = 2, ZIndex = 5, Visible = false, Parent = bubble })
|
||||
|
||||
-- walk banner
|
||||
local banner = new("Frame", { BackgroundColor3 = NAVY, BackgroundTransparency = 0.08, AnchorPoint = Vector2.new(0.5, 0), Size = UDim2.fromOffset(560, 0),
|
||||
AutomaticSize = Enum.AutomaticSize.Y, Visible = false, ZIndex = 4, Parent = tg }, {
|
||||
new("UICorner", { CornerRadius = UDim.new(0, 20) }),
|
||||
new("UIStroke", { Color = GOLD, Thickness = 3 }),
|
||||
new("UIPadding", { PaddingTop = UDim.new(0, 12), PaddingBottom = UDim.new(0, 12), PaddingLeft = UDim.new(0, 18), PaddingRight = UDim.new(0, 18) }),
|
||||
})
|
||||
local bannerScale = new("UIScale", { Parent = banner })
|
||||
local bannerText = new("TextLabel", { BackgroundTransparency = 1, Size = UDim2.new(1, 0, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, TextWrapped = true, RichText = true,
|
||||
FontFace = K.FONT, TextSize = 26, TextColor3 = WHITE, ZIndex = 5, Parent = banner }, { new("UIStroke", { Color = Color3.fromRGB(8, 14, 24), Thickness = 1.5 }) })
|
||||
|
||||
-- skip
|
||||
local skipBtn = new("TextButton", { Name = "SkipTutorial", Text = "Skip tutorial", FontFace = K.FONT, TextSize = 18, TextColor3 = WHITE, AutoButtonColor = true,
|
||||
BackgroundColor3 = Color3.fromRGB(60, 70, 84), BackgroundTransparency = 0.25, AnchorPoint = Vector2.new(1, 1), Size = UDim2.fromOffset(210, 38), ZIndex = 8, Parent = tg }, {
|
||||
new("UICorner", { CornerRadius = UDim.new(0.5, 0) }),
|
||||
new("UIStroke", { Color = Color3.fromRGB(200, 210, 220), Thickness = 1.5, Transparency = 0.4, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }),
|
||||
})
|
||||
|
||||
---------------------------------------------------------------- state + layout (every frame)
|
||||
local S = { mode = "none", target = nil, interactive = false, below = true }
|
||||
local function screenRect(obj)
|
||||
if not obj or not obj.Parent then return nil end
|
||||
local sg = obj:FindFirstAncestorOfClass("ScreenGui")
|
||||
local off = (sg and not sg.IgnoreGuiInset) and GuiService:GetGuiInset() or Vector2.zero
|
||||
local p, s = obj.AbsolutePosition + off, obj.AbsoluteSize
|
||||
if s.X < 2 or s.Y < 2 then return nil end
|
||||
return p, s
|
||||
end
|
||||
local function visibleChain(obj)
|
||||
local o = obj
|
||||
while o and not o:IsA("ScreenGui") do
|
||||
if o:IsA("GuiObject") and not o.Visible then return false end
|
||||
o = o.Parent
|
||||
end
|
||||
return o ~= nil and o.Enabled
|
||||
end
|
||||
|
||||
local function hudParts()
|
||||
local hud = gui:FindFirstChild("Hud")
|
||||
if not hud then return {} end
|
||||
local list = {}
|
||||
for _, n in { "Status", "Menu", "MenuRight" } do
|
||||
local f = hud:FindFirstChild(n)
|
||||
if f and f.Visible then table.insert(list, f) end
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
local layoutConn
|
||||
layoutConn = RunService.RenderStepped:Connect(function()
|
||||
local scr = tg.AbsoluteSize
|
||||
local ui = math.clamp(math.min(scr.X / 1100, scr.Y / 700), 0.62, 1.15)
|
||||
local inset = GuiService:GetGuiInset()
|
||||
local t = os.clock()
|
||||
bubbleScale.Scale, bannerScale.Scale = ui, ui
|
||||
-- bottom right corner: the windows have their close button top right, the HUD sits on the left
|
||||
skipBtn.Position = UDim2.fromOffset(scr.X - 10, scr.Y - 10)
|
||||
skipBtn.Size = UDim2.fromOffset(210 * ui, 38 * ui)
|
||||
skipBtn.TextSize = math.floor(18 * ui)
|
||||
|
||||
local spot = S.mode == "spot"
|
||||
local card = S.mode == "card"
|
||||
local walk = S.mode == "walk"
|
||||
-- hole
|
||||
local p, s
|
||||
if spot and S.target then
|
||||
local obj = S.target()
|
||||
if obj and visibleChain(obj) then p, s = screenRect(obj) end
|
||||
end
|
||||
if p then
|
||||
local pad = 8
|
||||
p, s = p - Vector2.new(pad, pad), s + Vector2.new(pad * 2, pad * 2)
|
||||
end
|
||||
local blocking = spot or card
|
||||
for _, w in walls do w.Visible = blocking end
|
||||
if blocking then
|
||||
if p then
|
||||
-- whole pixels, otherwise thin light seams show between the dark walls
|
||||
local x, y = math.floor(p.X), math.floor(p.Y)
|
||||
local w, h = math.ceil(p.X + s.X) - x, math.ceil(p.Y + s.Y) - y
|
||||
p, s = Vector2.new(x, y), Vector2.new(w, h)
|
||||
walls[1].Position, walls[1].Size = UDim2.fromOffset(0, 0), UDim2.fromOffset(scr.X, math.max(0, y))
|
||||
walls[2].Position, walls[2].Size = UDim2.fromOffset(0, y + h), UDim2.fromOffset(scr.X, math.max(0, scr.Y - y - h))
|
||||
walls[3].Position, walls[3].Size = UDim2.fromOffset(0, y), UDim2.fromOffset(math.max(0, x), h)
|
||||
walls[4].Position, walls[4].Size = UDim2.fromOffset(x + w, y), UDim2.fromOffset(math.max(0, scr.X - x - w), h)
|
||||
else
|
||||
walls[1].Position, walls[1].Size = UDim2.fromOffset(0, 0), UDim2.fromOffset(scr.X, scr.Y)
|
||||
for i = 2, 4 do walls[i].Size = UDim2.fromOffset(0, 0) end
|
||||
end
|
||||
end
|
||||
holeCover.Visible = spot and p ~= nil and not S.interactive
|
||||
if holeCover.Visible then holeCover.Position, holeCover.Size = UDim2.fromOffset(p.X, p.Y), UDim2.fromOffset(s.X, s.Y) end
|
||||
ring.Visible = p ~= nil
|
||||
if p then
|
||||
local grow = 3 + 3 * math.sin(t * 5)
|
||||
ring.Position = UDim2.fromOffset(p.X - grow, p.Y - grow)
|
||||
ring.Size = UDim2.fromOffset(s.X + grow * 2, s.Y + grow * 2)
|
||||
ringStroke.Transparency = 0.15 + 0.25 * (0.5 + 0.5 * math.sin(t * 5))
|
||||
end
|
||||
|
||||
-- bubble
|
||||
bubble.Visible = spot or card
|
||||
if bubble.Visible then
|
||||
local bs = bubble.AbsoluteSize -- already scaled
|
||||
local bx, by
|
||||
if p then
|
||||
local cx = p.X + s.X / 2
|
||||
bx = math.clamp(cx - bs.X / 2, 10, scr.X - bs.X - 10)
|
||||
local gap = 70 * ui
|
||||
local spaceBelow = scr.Y - (p.Y + s.Y)
|
||||
if spaceBelow >= bs.Y + gap + 10 then
|
||||
by, S.below = p.Y + s.Y + gap, true
|
||||
elseif p.Y >= bs.Y + gap + 10 then
|
||||
by, S.below = p.Y - gap - bs.Y, false
|
||||
else
|
||||
-- no room above / below: beside the element
|
||||
S.below = nil
|
||||
by = math.clamp(p.Y + s.Y / 2 - bs.Y / 2, 10, scr.Y - bs.Y - 10)
|
||||
if p.X + s.X + bs.X + 30 < scr.X then bx = p.X + s.X + 24 else bx = math.max(10, p.X - bs.X - 24) end
|
||||
end
|
||||
-- the hand points at the element
|
||||
hand.Visible = true
|
||||
hand.TextSize = math.floor(54 * ui)
|
||||
local bob = 8 * math.sin(t * 6)
|
||||
if S.below == false then
|
||||
hand.Text = "👇"
|
||||
hand.Position = UDim2.fromOffset(cx, p.Y - 32 * ui - bob)
|
||||
elseif S.below == true then
|
||||
hand.Text = "👆"
|
||||
hand.Position = UDim2.fromOffset(cx, p.Y + s.Y + 32 * ui + bob)
|
||||
else
|
||||
hand.Visible = false
|
||||
end
|
||||
else
|
||||
hand.Visible = false
|
||||
bx, by = scr.X / 2 - bs.X / 2, scr.Y / 2 - bs.Y / 2
|
||||
end
|
||||
bubble.Position = UDim2.fromOffset(bx, by)
|
||||
else
|
||||
hand.Visible = false
|
||||
end
|
||||
|
||||
-- walk mode: banner + HUD blocked
|
||||
banner.Visible = walk and bannerText.Text ~= ""
|
||||
banner.Position = UDim2.fromOffset(scr.X / 2, inset.Y + 12)
|
||||
local parts = walk and hudParts() or {}
|
||||
for i, b in hudBlock do
|
||||
local f = parts[i]
|
||||
local pp, ss
|
||||
if f then pp, ss = screenRect(f) end
|
||||
b.Visible = pp ~= nil
|
||||
if pp then b.Position, b.Size = UDim2.fromOffset(pp.X - 4, pp.Y - 4), UDim2.fromOffset(ss.X + 8, ss.Y + 8) end
|
||||
end
|
||||
end)
|
||||
|
||||
---------------------------------------------------------------- flow helpers
|
||||
local skipped = false
|
||||
local SKIP = {}
|
||||
local function check() if skipped then error(SKIP) end end
|
||||
local function waitUntil(cond, lost, timeout)
|
||||
local t0 = os.clock()
|
||||
while true do
|
||||
check()
|
||||
if cond() then return "ok" end
|
||||
if lost and lost() then return "lost" end
|
||||
if timeout and os.clock() - t0 > timeout then return "timeout" end
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
end
|
||||
|
||||
local pillObjs = {}
|
||||
local function setButtons(list)
|
||||
for _, c in btnRow:GetChildren() do c:Destroy() end
|
||||
pillObjs = {}
|
||||
btnRow.Visible = list ~= nil and #list > 0
|
||||
if not btnRow.Visible then return end
|
||||
local n = #list
|
||||
local w = n == 1 and 260 or 200
|
||||
local total = n * w + (n - 1) * 14
|
||||
local x0 = (434 - total) / 2
|
||||
for i, b in list do
|
||||
local o = K.pill(btnRow, { Name = "TutBtn" .. i, Position = UDim2.fromOffset(x0 + (i - 1) * (w + 14), 2), Size = UDim2.fromOffset(w, 70), ZIndex = 6, TextMax = 28 }, b.fn)
|
||||
o.set(b.kind or "ready", b.text)
|
||||
table.insert(pillObjs, o)
|
||||
end
|
||||
end
|
||||
|
||||
local stepNo, STEPS = 0, 9
|
||||
local function setStep(n) stepNo = n end
|
||||
local function header() stepLabel.Text = stepNo > 0 and ("TUTORIAL · step " .. stepNo .. " of " .. STEPS) or "TUTORIAL" end
|
||||
|
||||
-- shows a bubble; returns when the button is pressed / the condition is met
|
||||
-- target : function -> GuiObject (nil = centred card, the whole screen blocked)
|
||||
-- opts.next: caption of the "Дальше" button opts.cond: wait for this instead (the element can be pressed)
|
||||
-- opts.lost: returns "lost" when this becomes true
|
||||
local function say(target, text, opts)
|
||||
opts = opts or {}
|
||||
check()
|
||||
header()
|
||||
bubbleText.Text = text
|
||||
S.target = target
|
||||
S.mode = target and "spot" or "card"
|
||||
S.interactive = opts.cond ~= nil
|
||||
local pressed = nil
|
||||
if opts.buttons then
|
||||
local list = {}
|
||||
for _, b in opts.buttons do table.insert(list, { text = b.text, kind = b.kind, fn = function() pressed = b.id end }) end
|
||||
setButtons(list)
|
||||
elseif opts.cond then
|
||||
setButtons(nil)
|
||||
else
|
||||
setButtons({ { text = opts.next or "Next", fn = function() pressed = "next" end } })
|
||||
end
|
||||
-- pop-in
|
||||
bubble.Size = UDim2.fromOffset(470, 0)
|
||||
local r
|
||||
if opts.cond then
|
||||
r = waitUntil(opts.cond, opts.lost, opts.timeout)
|
||||
else
|
||||
r = waitUntil(function() return pressed ~= nil end, opts.lost)
|
||||
if r == "ok" then r = pressed end
|
||||
end
|
||||
return r
|
||||
end
|
||||
|
||||
local function walkMode(text)
|
||||
S.mode = "walk"
|
||||
S.target = nil
|
||||
bannerText.Text = text
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- ground markers
|
||||
local markerFolder = new("Folder", { Name = "TutorialMarkers", Parent = workspace })
|
||||
local markers = {}
|
||||
local targetFx = {}
|
||||
local function clearMarkers()
|
||||
for _, m in markers do for _, p in m.parts do p:Destroy() end end
|
||||
markers = {}
|
||||
end
|
||||
local function clearTarget()
|
||||
for _, o in targetFx do o:Destroy() end
|
||||
targetFx = {}
|
||||
clearMarkers()
|
||||
end
|
||||
local rayParams = RaycastParams.new()
|
||||
rayParams.FilterType = Enum.RaycastFilterType.Exclude
|
||||
local function groundAt(pos)
|
||||
local ignore = { markerFolder }
|
||||
if player.Character then table.insert(ignore, player.Character) end
|
||||
rayParams.FilterDescendantsInstances = ignore
|
||||
local hit = workspace:Raycast(Vector3.new(pos.X, pos.Y + 20, pos.Z), Vector3.new(0, -60, 0), rayParams)
|
||||
return hit and hit.Position.Y or pos.Y
|
||||
end
|
||||
local function part(props)
|
||||
local p = Instance.new("Part")
|
||||
p.Anchored, p.CanCollide, p.CanQuery, p.CanTouch, p.CastShadow = true, false, false, false, false
|
||||
p.Material = Enum.Material.Neon
|
||||
p.Color = GOLD
|
||||
for k, v in props do p[k] = v end
|
||||
p.Parent = markerFolder
|
||||
return p
|
||||
end
|
||||
local function chevron(pos, dir)
|
||||
local y = groundAt(pos) + 0.08
|
||||
local tip = Vector3.new(pos.X, y, pos.Z) + dir * 0.7
|
||||
local parts = {}
|
||||
for _, a in { math.rad(140), math.rad(-140) } do
|
||||
local armDir = CFrame.Angles(0, a, 0):VectorToWorldSpace(dir)
|
||||
local center = tip + armDir * 0.75
|
||||
table.insert(parts, part({ Size = Vector3.new(0.38, 0.08, 1.6), CFrame = CFrame.lookAt(center, center + armDir) }))
|
||||
end
|
||||
return { parts = parts }
|
||||
end
|
||||
local function buildPath(points)
|
||||
clearMarkers()
|
||||
local idx = 0
|
||||
local carry = 2.2 -- the first chevron a bit in front of the player
|
||||
for i = 1, #points - 1 do
|
||||
local a = Vector3.new(points[i].X, 0, points[i].Z)
|
||||
local b = Vector3.new(points[i + 1].X, 0, points[i + 1].Z)
|
||||
local seg = b - a
|
||||
local len = seg.Magnitude
|
||||
if len > 0.1 then
|
||||
local dir = seg.Unit
|
||||
local d = carry
|
||||
while d < len - 0.5 do
|
||||
idx += 1
|
||||
local pos = a + dir * d
|
||||
local m = chevron(Vector3.new(pos.X, points[i].Y, pos.Z), dir)
|
||||
m.index = idx
|
||||
table.insert(markers, m)
|
||||
d += 2.6
|
||||
end
|
||||
carry = d - len
|
||||
end
|
||||
end
|
||||
end
|
||||
-- running light along the chevrons, towards the target
|
||||
local markerConn = RunService.Heartbeat:Connect(function()
|
||||
local t = os.clock()
|
||||
for _, m in markers do
|
||||
local wave = (t * 1.6 - m.index * 0.12) % 1
|
||||
local tr = 0.05 + 0.6 * wave
|
||||
for _, p in m.parts do p.Transparency = tr end
|
||||
end
|
||||
end)
|
||||
|
||||
-- big pulsing ring on the ground at the target + a floating sign
|
||||
local function showTarget(anchorPart, stand, title)
|
||||
clearTarget()
|
||||
local y = groundAt(stand) + 0.06
|
||||
local disc = part({ Shape = Enum.PartType.Cylinder, Size = Vector3.new(0.1, 6, 6), Transparency = 0.45,
|
||||
CFrame = CFrame.new(stand.X, y, stand.Z) * CFrame.Angles(0, 0, math.rad(90)) })
|
||||
table.insert(targetFx, disc)
|
||||
task.spawn(function()
|
||||
while disc.Parent do
|
||||
local s = 5.5 + 1.2 * math.sin(os.clock() * 4)
|
||||
disc.Size = Vector3.new(0.1, s, s)
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
end)
|
||||
local bb = new("BillboardGui", { Name = "TutorialSign", Adornee = anchorPart, AlwaysOnTop = true, Size = UDim2.fromOffset(240, 110),
|
||||
StudsOffsetWorldSpace = Vector3.new(0, 6, 0), LightInfluence = 0, ResetOnSpawn = false, Parent = playerGui }) -- a BillboardGui inside a ScreenGui is not drawn
|
||||
local f = new("Frame", { BackgroundTransparency = 1, Size = UDim2.fromScale(1, 1), Parent = bb })
|
||||
new("TextLabel", { BackgroundColor3 = NAVY, BackgroundTransparency = 0.05, Size = UDim2.new(1, 0, 0, 52), Text = title, FontFace = K.FONT, TextSize = 28,
|
||||
TextColor3 = WHITE, Parent = f }, { new("UICorner", { CornerRadius = UDim.new(0, 16) }), new("UIStroke", { Color = GOLD, Thickness = 3, ApplyStrokeMode = Enum.ApplyStrokeMode.Border }) })
|
||||
local arrow = new("TextLabel", { BackgroundTransparency = 1, Position = UDim2.fromOffset(0, 50), Size = UDim2.new(1, 0, 0, 56), Text = "▼", FontFace = K.FONT, TextSize = 48,
|
||||
TextColor3 = GOLD, Parent = f }, { new("UIStroke", { Color = Color3.fromRGB(60, 40, 0), Thickness = 2 }) })
|
||||
table.insert(targetFx, bb)
|
||||
task.spawn(function()
|
||||
while bb.Parent do
|
||||
arrow.Position = UDim2.fromOffset(0, 50 + 8 * math.sin(os.clock() * 6))
|
||||
RunService.Heartbeat:Wait()
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- walk to a machine part
|
||||
-- route: (outside the zone) player -> in front of the gate -> just inside the gate -> the spot at the machine
|
||||
local function walkTo(anchorPart, title, windowName, nearText, farText)
|
||||
local _, plot = myMachine()
|
||||
local win = gui:FindFirstChild(windowName)
|
||||
local stand
|
||||
do
|
||||
local inner = plot and (plot.Position - Vector3.new(plot.CFrame.LookVector.X, 0, plot.CFrame.LookVector.Z).Unit * (plot.Size.Z / 2 - 3)) or anchorPart.Position
|
||||
local towards = Vector3.new(inner.X - anchorPart.Position.X, 0, inner.Z - anchorPart.Position.Z)
|
||||
stand = anchorPart.Position + (towards.Magnitude > 0.1 and towards.Unit * 4.5 or Vector3.zero)
|
||||
end
|
||||
showTarget(anchorPart, stand, title)
|
||||
local lastBuild, lastPos = 0, nil
|
||||
freeze(false)
|
||||
walkMode(farText)
|
||||
local r = waitUntil(function()
|
||||
if win and win.Visible then return true end
|
||||
local root = hrp()
|
||||
if root then
|
||||
local pos = root.Position
|
||||
local flatD = Vector3.new(anchorPart.Position.X - pos.X, 0, anchorPart.Position.Z - pos.Z).Magnitude
|
||||
bannerText.Text = flatD < 12 and nearText or farText
|
||||
if (not lastPos or (pos - lastPos).Magnitude > 2.5 or os.clock() - lastBuild > 3) then
|
||||
lastPos, lastBuild = pos, os.clock()
|
||||
local pts = { pos }
|
||||
if plot then
|
||||
local look = Vector3.new(plot.CFrame.LookVector.X, 0, plot.CFrame.LookVector.Z).Unit
|
||||
local loc = plot.CFrame:PointToObjectSpace(pos)
|
||||
local inside = math.abs(loc.X) < plot.Size.X / 2 - 1 and math.abs(loc.Z) < plot.Size.Z / 2 - 1
|
||||
if not inside then
|
||||
table.insert(pts, plot.Position - look * (plot.Size.Z / 2 + 3))
|
||||
table.insert(pts, plot.Position - look * (plot.Size.Z / 2 - 3))
|
||||
end
|
||||
end
|
||||
table.insert(pts, stand)
|
||||
if (Vector3.new(stand.X, 0, stand.Z) - Vector3.new(pos.X, 0, pos.Z)).Magnitude < 3 then clearMarkers() else buildPath(pts) end
|
||||
end
|
||||
end
|
||||
return false
|
||||
end)
|
||||
clearTarget()
|
||||
return r
|
||||
end
|
||||
|
||||
-- another window opened instead of the right one: ask to close it
|
||||
local WINDOWS = { "CraftMenu", "RecycleMenu", "WorkshopMenu", "TradeMenu", "MarketMenu", "ShopMenu", "PremiumMenu", "InventoryMenu" }
|
||||
local function openWindowOtherThan(name)
|
||||
for _, n in WINDOWS do
|
||||
local w = gui:FindFirstChild(n)
|
||||
if n ~= name and w and w.Visible then return w end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
local function closeButtonOf(w)
|
||||
local p = w:FindFirstChild("Panel")
|
||||
return p and (p:FindFirstChild("Close") or p:FindFirstChild("ArtClose"))
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- the steps
|
||||
local function inventory() return player:FindFirstChild("OrnamentInventory") end
|
||||
local function countSlots()
|
||||
local s = player:GetAttribute("CraftSlots")
|
||||
if typeof(s) ~= "string" then return 0 end
|
||||
local _, n = s:gsub("1", "")
|
||||
return n
|
||||
end
|
||||
local function find(root, name)
|
||||
return root and root:FindFirstChild(name, true)
|
||||
end
|
||||
local function panelWithLabel(root, text)
|
||||
if not root then return nil end
|
||||
for _, d in root:GetDescendants() do
|
||||
if d:IsA("TextLabel") and d.Text == text then return d.Parent end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
local function welcome()
|
||||
setStep(0)
|
||||
local r = say(nil, "<font size=\"32\" color=\"#FFCD46\"><b>Hi there! 🎄</b></font>\nHere you make Christmas ornaments from magic shards, collect rare ones and decorate your plot.\n\nLet me show you how it all works — it only takes a couple of minutes.",
|
||||
{ buttons = { { id = "go", text = "Let's go!" }, { id = "skip", text = "Skip", kind = "alt" } } })
|
||||
if r == "skip" then skipped = true; check() end
|
||||
end
|
||||
|
||||
local function hudIntro()
|
||||
setStep(1)
|
||||
local shardRow = function() return find(gui:FindFirstChild("Hud"), "ShardRow") end
|
||||
say(shardRow, "These are your <font color=\"#9FE0FF\"><b>shards 💎</b></font> — the main currency of the game.\nThe generator turns them into ornaments, and you spend them in the shop.\n\nWhile you're low on shards, they build up on their own — the bar under the number shows when the next one arrives.")
|
||||
say(function() return find(gui:FindFirstChild("Hud"), "LevelRow") end,
|
||||
"And this is your <font color=\"#FFCD46\"><b>level</b></font>. You get XP from generating, fusing and workout gear.\nNew levels unlock new ornaments, the market and trading.")
|
||||
end
|
||||
|
||||
local function generatorPhase()
|
||||
local machine = myMachine()
|
||||
if not machine then return end
|
||||
local genPart = machine:FindFirstChild("Gen_Button") or machine:FindFirstChild("Glass_Chamber")
|
||||
local craft = gui:FindFirstChild("CraftMenu")
|
||||
if not genPart or not craft then return end
|
||||
local function lost() return not craft.Visible end
|
||||
while true do
|
||||
check()
|
||||
setStep(2)
|
||||
-- 1) walk
|
||||
local other = openWindowOtherThan("CraftMenu")
|
||||
if other then
|
||||
freeze(true)
|
||||
say(function() return closeButtonOf(other) end, "Right now we need the generator — close this window.", { cond = function() return not other.Visible end })
|
||||
end
|
||||
walkTo(genPart, "GENERATOR", "CraftMenu",
|
||||
"You're at the generator! Now " .. OPEN_HINT .. "\n(or just click the generator itself)",
|
||||
"Go to your <font color=\"#FFCD46\"><b>generator</b></font> — follow the glowing arrows on the ground")
|
||||
if not craft.Visible then continue end
|
||||
-- 2) the window
|
||||
freeze(true)
|
||||
setStep(3)
|
||||
local page = craft.Panel:FindFirstChild("PageCreate")
|
||||
local res = "ok"
|
||||
if page and not page.Visible then
|
||||
res = say(function() return craft.Panel:FindFirstChild("TabCreate") end, "Open the “Create” tab.", { cond = function() return page.Visible end, lost = lost })
|
||||
end
|
||||
local grid = function() local s = find(page, "ShardSlot1"); return s and s.Parent end
|
||||
if res == "ok" then
|
||||
res = say(grid, "This is the <b>pattern grid</b>. Each cell is one shard.\nTo make an ornament, put in at least <font color=\"#FFCD46\"><b>" .. Config.MIN_SHARDS .. "</b></font> shards. More shards mean more luck!", { lost = lost })
|
||||
end
|
||||
if res == "next" then
|
||||
res = say(function() return panelWithLabel(page, "Possible drops") end,
|
||||
"Here you can see <b>which ornaments can drop</b> and their odds.\nIf the pattern looks like an ornament, the odds for that one go up.", { lost = lost })
|
||||
end
|
||||
if res == "next" then
|
||||
res = say(function() local b = find(page, "BoosterSlot"); return b and b.Parent end,
|
||||
"<b>Boosters</b> multiply the luck of one generation. They're crafted in the Workshop — you can skip them for now.", { lost = lost })
|
||||
end
|
||||
if res == "next" then
|
||||
if countSlots() >= Config.MIN_SHARDS then
|
||||
res = "ok"
|
||||
else
|
||||
setStep(4)
|
||||
res = say(function() return find(page, "Autofill") end,
|
||||
"The easiest way — press <font color=\"#9FE0FF\"><b>“Auto Pattern”</b></font>: the generator lays out the best pattern for you.",
|
||||
{ cond = function() return countSlots() >= Config.MIN_SHARDS end, lost = lost })
|
||||
end
|
||||
end
|
||||
if res == "ok" then
|
||||
setStep(4)
|
||||
local before = {}
|
||||
local inv = inventory()
|
||||
for _, c in inv and inv:GetChildren() or {} do before[c.Name] = true end
|
||||
local newToy
|
||||
local function scan()
|
||||
for _, c in inv and inv:GetChildren() or {} do if not before[c.Name] then newToy = c end end
|
||||
return newToy
|
||||
end
|
||||
res = say(function() return find(page, "GenerateButton") end,
|
||||
"Great, the pattern is ready! Now press <font color=\"#FFCD46\"><b>“Create”</b></font> ✨",
|
||||
{ cond = function() return scan() ~= nil or (not craft.Visible and machine:GetAttribute("GeneratorBusy") == true) end,
|
||||
lost = function() return not craft.Visible and not machine:GetAttribute("GeneratorBusy") end })
|
||||
if res == "lost" then
|
||||
-- the window may close a moment before the busy flag arrives
|
||||
res = waitUntil(function() return machine:GetAttribute("GeneratorBusy") == true or scan() ~= nil end, nil, 1.5)
|
||||
end
|
||||
if res == "ok" then
|
||||
freeze(false)
|
||||
walkMode("Look — the generator is making an ornament! ✨")
|
||||
waitUntil(function() return scan() ~= nil end, nil, 25)
|
||||
if newToy then
|
||||
task.wait(1.2) -- let the big "new toy" notification show
|
||||
freeze(true)
|
||||
local toy = Config.ToyById[newToy:GetAttribute("Toy")]
|
||||
local rar = Config.RarityById[newToy:GetAttribute("Rarity")]
|
||||
local col = rar and rar.Color or WHITE
|
||||
local hex = string.format("#%02X%02X%02X", col.R * 255, col.G * 255, col.B * 255)
|
||||
setStep(5)
|
||||
say(nil, "<font size=\"32\" color=\"#FFCD46\"><b>Hooray, your first ornament! 🎉</b></font>\n<b>" .. (toy and toy.Name or "Ornament") .. "</b> · <font color=\"" .. hex .. "\"><b>" ..
|
||||
(rar and rar.Name or "") .. "</b></font>\n\nAll ornaments are kept in your <b>Inventory</b> — you can hang them on your tree, sell them on the market or trade them.\nExtras turn back into shards in the <b>shredder</b>. Come on, I'll show you!",
|
||||
{ next = "Let's go" })
|
||||
return newToy
|
||||
end
|
||||
end
|
||||
end
|
||||
-- the window was closed in the middle: back to the walk
|
||||
freeze(false)
|
||||
end
|
||||
end
|
||||
|
||||
local function shredderPhase(toyItem)
|
||||
local machine = myMachine()
|
||||
if not machine then return end
|
||||
local recPart = machine:FindFirstChild("Rec_Button")
|
||||
local shred = gui:FindFirstChild("RecycleMenu")
|
||||
if not recPart or not shred then return end
|
||||
local function lost() return not shred.Visible end
|
||||
while true do
|
||||
check()
|
||||
setStep(6)
|
||||
local other = openWindowOtherThan("RecycleMenu")
|
||||
if other then
|
||||
freeze(true)
|
||||
say(function() return closeButtonOf(other) end, "Now we need the shredder — close this window.", { cond = function() return not other.Visible end })
|
||||
end
|
||||
walkTo(recPart, "SHREDDER", "RecycleMenu",
|
||||
"You're at the shredder! Now " .. OPEN_HINT .. "\n(or click the shredder itself)",
|
||||
"Now go to the <font color=\"#7CF0A0\"><b>shredder</b></font> — it's the other half of the machine")
|
||||
if not shred.Visible then continue end
|
||||
freeze(true)
|
||||
setStep(7)
|
||||
local page = shred.Panel:FindFirstChild("PageRecycle")
|
||||
local res = "ok"
|
||||
if page and not page.Visible then
|
||||
res = say(function() return shred.Panel:FindFirstChild("TabRecycle") end, "Open the “Recycle” tab.", { cond = function() return page.Visible end, lost = lost })
|
||||
end
|
||||
local recBtn = find(page, "RecycleButton")
|
||||
local function tile()
|
||||
local list = find(page, "SelectAll")
|
||||
local sf = list and list.Parent:FindFirstChildWhichIsA("ScrollingFrame", true)
|
||||
if not sf then return nil end
|
||||
local best
|
||||
for _, c in sf:GetChildren() do
|
||||
if c:IsA("TextButton") and c.Visible and (not best or c.LayoutOrder < best.LayoutOrder) then best = c end
|
||||
end
|
||||
return best
|
||||
end
|
||||
if res == "ok" then
|
||||
res = say(function() local b = find(page, "SelectAll"); return b and b.Parent end,
|
||||
"Here are all your ornaments. The shredder turns them back into <font color=\"#9FE0FF\"><b>shards</b></font>.\nRare ornaments give more shards.", { lost = lost })
|
||||
end
|
||||
if res == "next" then
|
||||
res = say(tile, "Click an ornament to <b>select</b> it.", { cond = function() return recBtn and recBtn.Active end, lost = lost })
|
||||
end
|
||||
if res == "ok" then
|
||||
res = say(function() return recBtn and recBtn.Parent end,
|
||||
"On the right you can see how many shards you'll get.\n\nPress <font color=\"#FFCD46\"><b>“Recycle”</b></font>!", { cond = function() return not shred.Visible end })
|
||||
-- (pressing it closes the window)
|
||||
local startShards = player:GetAttribute("Shards") or 0
|
||||
freeze(false)
|
||||
walkMode("The shredder is recycling the ornament… ♻️")
|
||||
local got = waitUntil(function() return (player:GetAttribute("Shards") or 0) > startShards or machine:GetAttribute("ShredderBusy") == true end, nil, 2.5)
|
||||
if got == "ok" then
|
||||
waitUntil(function() return (player:GetAttribute("Shards") or 0) > startShards end, nil, 15)
|
||||
local gained = (player:GetAttribute("Shards") or 0) - startShards
|
||||
task.wait(0.8)
|
||||
freeze(true)
|
||||
setStep(8)
|
||||
say(function() return find(gui:FindFirstChild("Hud"), "ShardRow") end,
|
||||
(gained > 0 and ("<font color=\"#9FE0FF\"><b>+" .. gained .. " shards</b></font> are back in your balance! 💎\n") or "") ..
|
||||
"That's the game loop: make ornaments, keep the best ones and recycle the extras into shards for new tries.")
|
||||
return
|
||||
end
|
||||
end
|
||||
freeze(false)
|
||||
end
|
||||
end
|
||||
|
||||
local function shopPhase()
|
||||
local shopWin = gui:FindFirstChild("ShopMenu")
|
||||
if not shopWin then return end
|
||||
setStep(9)
|
||||
freeze(true)
|
||||
local other = openWindowOtherThan("ShopMenu")
|
||||
if other then
|
||||
say(function() return closeButtonOf(other) end, "Close this window.", { cond = function() return not other.Visible end })
|
||||
end
|
||||
say(function() return find(gui:FindFirstChild("Hud"), "ShopButton") end,
|
||||
"One last thing — the <font color=\"#FF8A8A\"><b>Shop</b></font>. Press the shop button.", { cond = function() return shopWin.Visible end })
|
||||
local function page()
|
||||
for _, c in shopWin.Panel:GetChildren() do
|
||||
if c:IsA("CanvasGroup") and c.Name:sub(1, 4) == "Page" and c.Visible then return c end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
local r = say(page, "Here you spend shards on <b>decorations for your plot</b>: a tree, garlands, workout gear and more.\nPlace what you buy with the “Place” button, and hang ornaments from your inventory on your tree 🎄",
|
||||
{ lost = function() return not shopWin.Visible end })
|
||||
if r == "next" and shopWin.Visible then
|
||||
say(function() return closeButtonOf(shopWin) end, "Close the shop and start playing!", { cond = function() return not shopWin.Visible end })
|
||||
end
|
||||
end
|
||||
|
||||
local function finish()
|
||||
S.mode = "card"
|
||||
say(nil, "<font size=\"32\" color=\"#FFCD46\"><b>Tutorial complete! ⭐</b></font>\nNow you know the basics. Generate ornaments, collect rare ones, upgrade your machine in the <b>Workshop</b> and decorate your tree.\n\nGood luck and Happy New Year! 🎄",
|
||||
{ next = "Play!" })
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- run
|
||||
local running = true
|
||||
skipBtn.Activated:Connect(function()
|
||||
if not running then return end
|
||||
skipped = true
|
||||
end)
|
||||
|
||||
local ok, err = pcall(function()
|
||||
welcome()
|
||||
hudIntro()
|
||||
local toy = generatorPhase()
|
||||
if toy then shredderPhase(toy) end
|
||||
shopPhase()
|
||||
finish()
|
||||
end)
|
||||
if not ok and err ~= SKIP then warn("[Tutorial] " .. tostring(err)) end
|
||||
running = false
|
||||
layoutConn:Disconnect()
|
||||
markerConn:Disconnect()
|
||||
freeze(false)
|
||||
clearTarget()
|
||||
markerFolder:Destroy()
|
||||
tg:Destroy()
|
||||
if tutorialRemote then tutorialRemote:FireServer("Done") end
|
||||
|
||||
-- an admin can reset the tutorial again later in this session: wait for TutorialDone true -> false and run a fresh copy
|
||||
do
|
||||
local t = os.clock()
|
||||
while player:GetAttribute("TutorialDone") ~= true and os.clock() - t < 15 do task.wait(0.2) end
|
||||
while player:GetAttribute("TutorialDone") do player:GetAttributeChangedSignal("TutorialDone"):Wait() end
|
||||
local copy = script:Clone()
|
||||
copy.Parent = script.Parent
|
||||
script:Destroy()
|
||||
end
|
||||
@@ -0,0 +1,57 @@
|
||||
-- UISounds (LocalScript, StarterPlayerScripts): sounds for every button of the interface.
|
||||
-- hover (mouse only) -> SoundService.UISounds["Cream keyboard"]
|
||||
-- click / tap -> SoundService.UISounds["keyboard click"]
|
||||
-- Works on all buttons in PlayerGui, also the ones the UI scripts create later.
|
||||
-- A button with the attribute NoSound = true stays silent (invisible blockers of the tutorial, etc.).
|
||||
local Players = game:GetService("Players")
|
||||
local SoundService = game:GetService("SoundService")
|
||||
local UIS = game:GetService("UserInputService")
|
||||
|
||||
local player = Players.LocalPlayer
|
||||
local pg = player:WaitForChild("PlayerGui")
|
||||
local folder = SoundService:WaitForChild("UISounds", 10)
|
||||
local hoverSound = folder and folder:FindFirstChild("Cream keyboard")
|
||||
local clickSound = folder and folder:FindFirstChild("keyboard click")
|
||||
if not hoverSound and not clickSound then return end
|
||||
|
||||
local HOVER_GAP = 0.06 -- seconds: moving fast across a row of buttons must not machine-gun the sound
|
||||
local lastHover, lastClick = 0, 0
|
||||
local lastInputTouch = false
|
||||
UIS.LastInputTypeChanged:Connect(function(t) lastInputTouch = t == Enum.UserInputType.Touch end)
|
||||
|
||||
local function play(sound)
|
||||
if sound then SoundService:PlayLocalSound(sound) end
|
||||
end
|
||||
|
||||
local function silent(b)
|
||||
return b:GetAttribute("NoSound") == true
|
||||
end
|
||||
|
||||
local done = setmetatable({}, { __mode = "k" })
|
||||
local function hookButton(b)
|
||||
if done[b] or not b:IsA("GuiButton") then return end
|
||||
done[b] = true
|
||||
b.MouseEnter:Connect(function()
|
||||
-- on touch screens MouseEnter fires on the tap itself: only the click sound there
|
||||
if lastInputTouch or not UIS.MouseEnabled or silent(b) or not b.Active then return end
|
||||
local now = os.clock()
|
||||
if now - lastHover < HOVER_GAP then return end
|
||||
lastHover = now
|
||||
play(hoverSound)
|
||||
end)
|
||||
b.Activated:Connect(function()
|
||||
if silent(b) then return end
|
||||
local now = os.clock()
|
||||
if now - lastClick < 0.03 then return end -- one press = one sound
|
||||
lastClick = now
|
||||
play(clickSound)
|
||||
end)
|
||||
end
|
||||
|
||||
local function hookGui(gui)
|
||||
if not gui:IsA("LayerCollector") then return end
|
||||
for _, d in gui:GetDescendants() do hookButton(d) end
|
||||
gui.DescendantAdded:Connect(hookButton)
|
||||
end
|
||||
for _, g in pg:GetChildren() do hookGui(g) end
|
||||
pg.ChildAdded:Connect(hookGui)
|
||||
@@ -0,0 +1,427 @@
|
||||
-- WorkshopWindow: the "Мастерская" window in the New Year shop style (frame, tabs, buttons: ShopKit).
|
||||
-- Tabs: Улучшения / Слияние / Бустеры / Как это работает. A tab shows a badge with the number of actions you
|
||||
-- can do there right now. Button states: see ShopKit.pill. Results: the card flashes and a "+1" floats up.
|
||||
local K = require(script.Parent:WaitForChild("ShopKit"))
|
||||
|
||||
local W = {}
|
||||
|
||||
local WHITE, GOLD, SOFT, OK, WARN, NAVY, BODY = K.WHITE, K.GOLD, K.SOFT, K.OK, K.WARN, K.NAVY, K.BODY
|
||||
local CARD_SLICE = K.CARD_SLICE
|
||||
local tween, new, corner, art, label, maxText = K.tween, K.new, K.corner, K.art, K.label, K.maxText
|
||||
local floatText, flash, pill, pricePlate = K.floatText, K.flash, K.pill, K.pricePlate
|
||||
|
||||
function W.install(ctx)
|
||||
local Config, player, remote = ctx.Config, ctx.player, ctx.remote
|
||||
local fmt = ctx.fmtNum
|
||||
local function attr(n, d) local v = player:GetAttribute(n); if v == nil then return d end return v end
|
||||
local win = ctx.win
|
||||
local refresh
|
||||
|
||||
local TABS = {
|
||||
{ id = "Upgrades", text = "Upgrades", icon = "🛠", tip = "Tip: “Generator Luck” pays off fastest — it works on every generation." },
|
||||
{ id = "Fusion", text = "Fusion", icon = "✨", tip = "Fusion: " .. Config.FUSION_COUNT .. " identical ornaments + shards = 1 “Fused” ornament one rarity higher — worth more than you put in." },
|
||||
{ id = "Boosters", text = "Boosters", icon = "🍀", tip = "A booster goes in the generator slot and is used up when you make an ornament. Best with 16 shards." },
|
||||
{ id = "Help", text = "How It Works", icon = "📖", tip = "The Workshop is always open — the “Workshop” button on the left of the screen." },
|
||||
}
|
||||
local ch = K.chrome({ win = win, title = "WORKSHOP", subtitle = "Upgrade the generator,\nfuse and craft", tabs = TABS,
|
||||
closeWindow = ctx.closeWindow, fmtNum = fmt, onTab = function() refresh() end })
|
||||
local panel, tabs = ch.panel, ch.tabs
|
||||
local function makePage(id) local _, s = ch.makePage(id, true); return s end
|
||||
|
||||
---------------------------------------------------------------- upgrades page: 2 x 2 ray cards
|
||||
local UPG = {
|
||||
Luck = { icon = "🍀", card = "cardGreen" }, Regen = { icon = "⏳", card = "cardCyan" },
|
||||
Shredder = { icon = "♻️", card = "cardViolet" }, Storage = { icon = "📦", card = "cardOrange" },
|
||||
}
|
||||
local function effectText(u, level)
|
||||
if u.Id == "Luck" then return string.format("luck x%.2f", Config.LuckMult(level)) end
|
||||
if u.Id == "Regen" then return string.format("cap %d · +1 per %.1fs", Config.RegenCap(level), Config.RegenSeconds(level)) end
|
||||
if u.Id == "Shredder" then return string.format("recycling x%.2f", Config.ShredderMult(level)) end
|
||||
if u.Id == "Storage" then return Config.StorageCap(level) .. " slots" end
|
||||
return ""
|
||||
end
|
||||
local upScroll = makePage("Upgrades")
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(615, 272), CellPadding = UDim2.fromOffset(18, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = upScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 2), PaddingTop = UDim.new(0, 2), Parent = upScroll })
|
||||
local pending = {} -- key -> os.clock() of the request (busy state)
|
||||
local upCards = {}
|
||||
for _, u in Config.UPGRADES do
|
||||
local d = UPG[u.Id] or { icon = "⭐", card = "cardGreen" }
|
||||
local card = art(d.card, { LayoutOrder = u.Order, ScaleType = Enum.ScaleType.Slice, SliceCenter = CARD_SLICE, ZIndex = 4, Parent = upScroll })
|
||||
local disc = new("Frame", { Position = UDim2.fromOffset(30, 50), Size = UDim2.fromOffset(128, 128), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.6, ZIndex = 5, Parent = card }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 4 }),
|
||||
})
|
||||
label({ Size = UDim2.fromScale(1, 1), Text = d.icon, TextSize = 68, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = disc }, 0)
|
||||
local lvl = label({ AnchorPoint = Vector2.new(0.5, 0.5), Position = UDim2.fromOffset(94, 204), Size = UDim2.fromOffset(140, 40), Text = "", TextSize = 28,
|
||||
TextColor3 = GOLD, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = card }, 2.5)
|
||||
maxText(label({ Position = UDim2.fromOffset(180, 40), Size = UDim2.fromOffset(410, 46), Text = u.Name, TextScaled = true, ZIndex = 5, Parent = card }, 3), 38)
|
||||
maxText(label({ Position = UDim2.fromOffset(182, 86), Size = UDim2.fromOffset(410, 30), Text = u.Desc, TextScaled = true, FontFace = BODY, ZIndex = 5, Parent = card }, 1.5), 21)
|
||||
local pipRow = new("Frame", { Position = UDim2.fromOffset(182, 124), Size = UDim2.fromOffset(410, 24), BackgroundTransparency = 1, ZIndex = 5, Parent = card }, {
|
||||
new("UIListLayout", { FillDirection = Enum.FillDirection.Horizontal, Padding = UDim.new(0, 7), SortOrder = Enum.SortOrder.LayoutOrder, VerticalAlignment = Enum.VerticalAlignment.Center }),
|
||||
})
|
||||
local pips = {}
|
||||
for k = 1, u.Max do
|
||||
pips[k] = new("Frame", { Size = UDim2.fromOffset(28, 22), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.55, LayoutOrder = k, ZIndex = 5, Parent = pipRow }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 1.5, Transparency = 0.5 }),
|
||||
})
|
||||
end
|
||||
local eff = maxText(label({ Position = UDim2.fromOffset(182, 156), Size = UDim2.fromOffset(410, 30), Text = "", TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = OK, ZIndex = 5, Parent = card }, 1.5), 22)
|
||||
local _, price = pricePlate(card, UDim2.fromOffset(196, 198), UDim2.fromOffset(150, 48))
|
||||
local btn
|
||||
btn = pill(card, { Position = UDim2.fromOffset(362, 190), Size = UDim2.fromOffset(232, 64), ZIndex = 5, TextMax = 30 }, function()
|
||||
pending["Upg_" .. u.Id] = os.clock()
|
||||
btn.set("busy")
|
||||
remote:FireServer("Upgrade", u.Id)
|
||||
end)
|
||||
upCards[u.Id] = { card = card, lvl = lvl, pips = pips, eff = eff, price = price, btn = btn, u = u }
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- boosters page: 2 big cards
|
||||
local boScroll = makePage("Boosters")
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(615, 470), CellPadding = UDim2.fromOffset(18, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = boScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 2), PaddingTop = UDim.new(0, 2), Parent = boScroll })
|
||||
local bOrder = {}
|
||||
for id, b in Config.BOOSTERS do table.insert(bOrder, { id = id, b = b }) end
|
||||
table.sort(bOrder, function(x, y) return x.b.Order < y.b.Order end)
|
||||
local boCards = {}
|
||||
for i, e in bOrder do
|
||||
local card = art(i == 1 and "cardGreen" or "cardOrange", { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = CARD_SLICE, ZIndex = 4, Parent = boScroll })
|
||||
local orb = new("Frame", { AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 52), Size = UDim2.fromOffset(170, 170), BackgroundColor3 = e.b.Color, ZIndex = 5, Parent = card }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 6 }),
|
||||
new("UIGradient", { Rotation = 90, Color = ColorSequence.new(WHITE, Color3.fromRGB(170, 170, 170)) }),
|
||||
})
|
||||
label({ Size = UDim2.fromScale(1, 1), Text = "x" .. e.b.Luck, TextSize = 76, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 6, Parent = orb }, 4)
|
||||
local orbScale = new("UIScale", { Parent = orb })
|
||||
task.spawn(function()
|
||||
while orb.Parent do
|
||||
tween(orbScale, 1.6, { Scale = 1.05 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
tween(orbScale, 1.6, { Scale = 1 }, Enum.EasingStyle.Sine).Completed:Wait()
|
||||
end
|
||||
end)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 236), Size = UDim2.new(1, -60, 0, 50), Text = e.b.Name, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 44)
|
||||
maxText(label({ Position = UDim2.fromOffset(40, 288), Size = UDim2.new(1, -80, 0, 30), Text = "one generation luck x" .. e.b.Luck, TextScaled = true, FontFace = BODY,
|
||||
TextColor3 = SOFT, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 1.5), 22)
|
||||
local owned = new("Frame", { AnchorPoint = Vector2.new(1, 0), Position = UDim2.new(1, -30, 0, 44), Size = UDim2.fromOffset(140, 50), BackgroundColor3 = NAVY,
|
||||
BackgroundTransparency = 0.15, ZIndex = 6, Parent = card }, { corner(UDim.new(0.5, 0)), new("UIStroke", { Color = GOLD, Thickness = 2 }) })
|
||||
local ownedText = maxText(label({ Position = UDim2.fromOffset(8, 6), Size = UDim2.new(1, -16, 1, -12), Text = "", TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 7, Parent = owned }, 2), 26)
|
||||
local _, price = pricePlate(card, UDim2.fromOffset(60, 344), UDim2.fromOffset(180, 56))
|
||||
local btn
|
||||
btn = pill(card, { Position = UDim2.fromOffset(262, 334), Size = UDim2.fromOffset(300, 76), ZIndex = 5, TextMax = 34 }, function()
|
||||
pending["Booster_" .. e.id] = os.clock()
|
||||
btn.set("busy")
|
||||
remote:FireServer("CraftBooster", e.id)
|
||||
end)
|
||||
boCards[e.id] = { card = card, owned = ownedText, price = price, btn = btn, b = e.b }
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- fusion page: one row per toy group
|
||||
local fuScroll = makePage("Fusion")
|
||||
new("UIListLayout", { Padding = UDim.new(0, 14), SortOrder = Enum.SortOrder.LayoutOrder, Parent = fuScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingRight = UDim.new(0, 18), PaddingTop = UDim.new(0, 4), PaddingBottom = UDim.new(0, 4), Parent = fuScroll })
|
||||
local fuRows = {}
|
||||
local function fusionGroups()
|
||||
local groups = {}
|
||||
for _, c in ctx.getCards() do
|
||||
local it = c.item
|
||||
if not it.Variant and Config.RARITIES[c.rarity.Index + 1] then
|
||||
local key = it.Toy .. "|" .. it.Rarity
|
||||
groups[key] = groups[key] or { key = key, toy = Config.ToyById[it.Toy], rarity = c.rarity, n = 0 }
|
||||
groups[key].n += 1
|
||||
end
|
||||
end
|
||||
local list = {}
|
||||
for _, g in groups do table.insert(list, g) end
|
||||
table.sort(list, function(x, y)
|
||||
local rx, ry = x.n >= Config.FUSION_COUNT, y.n >= Config.FUSION_COUNT
|
||||
if rx ~= ry then return rx end
|
||||
if x.rarity.Index ~= y.rarity.Index then return x.rarity.Index > y.rarity.Index end
|
||||
return x.n > y.n
|
||||
end)
|
||||
return list
|
||||
end
|
||||
local function rebuildFusion()
|
||||
for _, r in fuRows do r:Destroy() end
|
||||
fuRows = {}
|
||||
local shards = attr("Shards", 0)
|
||||
local list = fusionGroups()
|
||||
if #list == 0 then
|
||||
table.insert(fuRows, K.emptyState({ Size = UDim2.new(1, 0, 0, 520), Parent = fuScroll }, "Nothing to fuse yet",
|
||||
"Collect " .. Config.FUSION_COUNT .. " identical ornaments of one rarity in the generator — then fuse them into a rarer one."))
|
||||
return 0
|
||||
end
|
||||
local ready = 0
|
||||
for i, g in list do
|
||||
local nextR = Config.RARITIES[g.rarity.Index + 1]
|
||||
local cost = Config.FUSION_COST[g.rarity.Id] or 0
|
||||
local enough, rich = g.n >= Config.FUSION_COUNT, shards >= cost
|
||||
if enough and rich then ready += 1 end
|
||||
local row = new("Frame", { Size = UDim2.new(1, 0, 0, 128), BackgroundColor3 = Color3.new(0, 0, 0), BackgroundTransparency = 0.45, LayoutOrder = i, ZIndex = 5, Parent = fuScroll }, {
|
||||
corner(UDim.new(0, 26)), new("UIStroke", { Color = enough and GOLD or Color3.fromRGB(120, 150, 140), Thickness = enough and 3 or 2, Transparency = enough and 0 or 0.4 }),
|
||||
})
|
||||
local tile = new("Frame", { Position = UDim2.fromOffset(18, 14), Size = UDim2.fromOffset(100, 100), BackgroundColor3 = Color3.fromRGB(12, 30, 40), ZIndex = 6, Parent = row }, {
|
||||
corner(UDim.new(0, 18)), new("UIStroke", { Color = g.rarity.Color, Thickness = 3 }),
|
||||
})
|
||||
local mini = ctx.miniPattern(g.toy.Mask, g.rarity.Color, 76, tile)
|
||||
mini.AnchorPoint = Vector2.new(0.5, 0.5)
|
||||
mini.Position = UDim2.fromScale(0.5, 0.5)
|
||||
mini.ZIndex = 7
|
||||
maxText(label({ Position = UDim2.fromOffset(140, 14), Size = UDim2.fromOffset(560, 42), Text = g.toy.Name .. " · " .. g.rarity.Name .. " → " .. nextR.Name .. " · Fused",
|
||||
TextScaled = true, ZIndex = 6, Parent = row }, 2.5), 34)
|
||||
new("Frame", { Position = UDim2.fromOffset(142, 62), Size = UDim2.fromOffset(14, 14), BackgroundColor3 = g.rarity.Color, ZIndex = 6, Parent = row }, { corner(UDim.new(0.5, 0)) })
|
||||
new("Frame", { Position = UDim2.fromOffset(162, 62), Size = UDim2.fromOffset(14, 14), BackgroundColor3 = nextR.Color, ZIndex = 6, Parent = row }, { corner(UDim.new(0.5, 0)) })
|
||||
local bar = new("Frame", { Position = UDim2.fromOffset(190, 60), Size = UDim2.fromOffset(330, 20), BackgroundColor3 = Color3.fromRGB(10, 20, 26), ZIndex = 6, Parent = row }, {
|
||||
corner(UDim.new(0.5, 0)), new("UIStroke", { Color = WHITE, Thickness = 1.5, Transparency = 0.6 }),
|
||||
})
|
||||
new("Frame", { Size = UDim2.fromScale(math.clamp(g.n / Config.FUSION_COUNT, 0.04, 1), 1), BackgroundColor3 = enough and OK or g.rarity.Color, ZIndex = 7, Parent = bar }, { corner(UDim.new(0.5, 0)) })
|
||||
maxText(label({ Position = UDim2.fromOffset(142, 86), Size = UDim2.fromOffset(560, 30), TextScaled = true, FontFace = BODY, ZIndex = 6, Parent = row,
|
||||
Text = "have " .. g.n .. " / " .. Config.FUSION_COUNT .. (enough and " · ready to fuse!" or (" · need " .. (Config.FUSION_COUNT - g.n)))
|
||||
.. " · costs " .. fmt(Config.Value({ Toy = g.toy.Id, Rarity = nextR.Id, Variant = "Fused" }))
|
||||
.. " (put in " .. fmt(Config.FUSION_COUNT * Config.Value({ Toy = g.toy.Id, Rarity = g.rarity.Id }) + cost) .. ")",
|
||||
TextColor3 = enough and OK or SOFT }, 1.5), 22)
|
||||
local _, price = pricePlate(row, UDim2.fromOffset(726, 38), UDim2.fromOffset(170, 52))
|
||||
price.Text = fmt(cost)
|
||||
price.TextColor3 = rich and WHITE or WARN
|
||||
local btn
|
||||
btn = pill(row, { Position = UDim2.fromOffset(916, 28), Size = UDim2.fromOffset(300, 72), ZIndex = 6, TextMax = 32 }, function()
|
||||
pending["Fuse"] = os.clock()
|
||||
btn.set("busy")
|
||||
remote:FireServer("Fuse", g.toy.Id, g.rarity.Id)
|
||||
end)
|
||||
if pending["Fuse"] and os.clock() - pending["Fuse"] < 2.5 then
|
||||
btn.set("busy")
|
||||
elseif not enough then
|
||||
btn.set("off", "Need " .. (Config.FUSION_COUNT - g.n) .. " pcs")
|
||||
elseif not rich then
|
||||
btn.set("off", "Need " .. fmt(cost - shards))
|
||||
else
|
||||
btn.set("ready", "Fuse")
|
||||
end
|
||||
table.insert(fuRows, row)
|
||||
end
|
||||
return ready
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- help page: three explainer cards
|
||||
local heScroll = makePage("Help")
|
||||
new("UIGridLayout", { CellSize = UDim2.fromOffset(404, 540), CellPadding = UDim2.fromOffset(20, 18), SortOrder = Enum.SortOrder.LayoutOrder, Parent = heScroll })
|
||||
new("UIPadding", { PaddingLeft = UDim.new(0, 4), PaddingTop = UDim.new(0, 4), Parent = heScroll })
|
||||
local HELP = {
|
||||
{ card = "cardCyan", icon = "🛠", title = "Upgrades", tab = "Upgrades",
|
||||
text = "Always active, even away from the machine. Luck — rarer ornaments, regen — more free shards, shredder — more shards from recycling, storage — more slots." },
|
||||
{ card = "cardViolet", icon = "✨", title = "Fusion", tab = "Fusion",
|
||||
text = Config.FUSION_COUNT .. " identical ornaments of one rarity + some shards = 1 “Fused” ornament one rarity higher. It's worth more than you put in, but it can't be fused again." },
|
||||
{ card = "cardOrange", icon = "🍀", title = "Boosters", tab = "Boosters",
|
||||
text = "Craft a booster with shards and put it in the generator slot. It multiplies the luck of one generation and is used up when you make an ornament." },
|
||||
}
|
||||
for i, h in HELP do
|
||||
local card = art(h.card, { LayoutOrder = i, ScaleType = Enum.ScaleType.Slice, SliceCenter = CARD_SLICE, ZIndex = 4, Parent = heScroll })
|
||||
label({ AnchorPoint = Vector2.new(0.5, 0), Position = UDim2.new(0.5, 0, 0, 44), Size = UDim2.fromOffset(120, 110), Text = h.icon, TextSize = 84, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 0)
|
||||
maxText(label({ Position = UDim2.fromOffset(24, 160), Size = UDim2.new(1, -48, 0, 50), Text = h.title, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center, ZIndex = 5, Parent = card }, 3), 42)
|
||||
maxText(label({ Position = UDim2.fromOffset(30, 218), Size = UDim2.new(1, -60, 0, 190), Text = h.text, TextScaled = true, TextWrapped = true, FontFace = BODY,
|
||||
TextColor3 = WHITE, TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, ZIndex = 5, Parent = card }, 1.5), 24)
|
||||
local go = pill(card, { Position = UDim2.fromOffset(62, 420), Size = UDim2.fromOffset(280, 70), ZIndex = 5, TextMax = 30 }, function() ch.showTab(h.tab) end)
|
||||
go.set("alt", "Open")
|
||||
end
|
||||
|
||||
---------------------------------------------------------------- refresh
|
||||
local function busy(key) return pending[key] and os.clock() - pending[key] < 2.5 end
|
||||
refresh = function()
|
||||
local shards = attr("Shards", 0)
|
||||
ch.setBalance(shards)
|
||||
local canUp = 0
|
||||
for id, c in upCards do
|
||||
local level = attr("Upg_" .. id, 0)
|
||||
local cost = Config.UpgradeCost(id, level)
|
||||
c.lvl.Text = "Lvl " .. level .. " / " .. c.u.Max
|
||||
for k, pip in c.pips do
|
||||
local filled = k <= level
|
||||
pip.BackgroundColor3 = filled and GOLD or Color3.new(0, 0, 0)
|
||||
pip.BackgroundTransparency = filled and 0 or 0.55
|
||||
pip.UIStroke.Color = filled and Color3.fromRGB(150, 90, 10) or WHITE
|
||||
end
|
||||
if cost then
|
||||
c.eff.Text = effectText(c.u, level) .. " → " .. effectText(c.u, level + 1)
|
||||
c.eff.TextColor3 = OK
|
||||
c.price.Text = fmt(cost)
|
||||
c.price.TextColor3 = shards >= cost and WHITE or WARN
|
||||
c.price.Parent.Visible = true
|
||||
if busy("Upg_" .. id) then c.btn.set("busy")
|
||||
elseif shards >= cost then c.btn.set("ready", "Upgrade"); canUp += 1
|
||||
else c.btn.set("off", "Need " .. fmt(cost - shards)) end
|
||||
else
|
||||
c.eff.Text = effectText(c.u, level) .. " · max"
|
||||
c.eff.TextColor3 = GOLD
|
||||
c.price.Parent.Visible = false
|
||||
c.btn.set("done", "Maxed")
|
||||
end
|
||||
end
|
||||
tabs.Upgrades.setBadge(canUp)
|
||||
local canBo = 0
|
||||
for id, c in boCards do
|
||||
local cost = Config.BOOSTER_COST[id]
|
||||
c.owned.Text = "you have: " .. attr("Booster_" .. id, 0)
|
||||
c.price.Text = fmt(cost)
|
||||
c.price.TextColor3 = shards >= cost and WHITE or WARN
|
||||
if busy("Booster_" .. id) then c.btn.set("busy")
|
||||
elseif shards >= cost then c.btn.set("ready", "Create"); canBo += 1
|
||||
else c.btn.set("off", "Need " .. fmt(cost - shards)) end
|
||||
end
|
||||
tabs.Boosters.setBadge(canBo)
|
||||
if ch.current() == "Fusion" then
|
||||
tabs.Fusion.setBadge(rebuildFusion())
|
||||
else
|
||||
local n = 0
|
||||
for _, g in fusionGroups() do
|
||||
if g.n >= Config.FUSION_COUNT and shards >= (Config.FUSION_COST[g.rarity.Id] or 0) then n += 1 end
|
||||
end
|
||||
tabs.Fusion.setBadge(n)
|
||||
end
|
||||
end
|
||||
|
||||
-- total "things you can do" for the HUD button (sum of the three tab badges), kept live even while the window
|
||||
-- is closed: ctx.setHudBadge(n) (the HUD badge animates "+N" when it grows)
|
||||
local function hudCount()
|
||||
if not ctx.setHudBadge then return end
|
||||
local shards, n = attr("Shards", 0), 0
|
||||
for _, u in Config.UPGRADES do
|
||||
local cost = Config.UpgradeCost(u.Id, attr("Upg_" .. u.Id, 0))
|
||||
if cost and shards >= cost then n += 1 end
|
||||
end
|
||||
for id in Config.BOOSTERS do
|
||||
if shards >= Config.BOOSTER_COST[id] then n += 1 end
|
||||
end
|
||||
for _, g in fusionGroups() do
|
||||
if g.n >= Config.FUSION_COUNT and shards >= (Config.FUSION_COST[g.rarity.Id] or 0) then n += 1 end
|
||||
end
|
||||
ctx.setHudBadge(n)
|
||||
end
|
||||
local hudQueued = false
|
||||
local function hudLater()
|
||||
if hudQueued then return end
|
||||
hudQueued = true
|
||||
task.delay(0.25, function() hudQueued = false; hudCount() end)
|
||||
end
|
||||
|
||||
-- server results: clear the busy state, flash the card, float "+1"
|
||||
local function watch(name, fn)
|
||||
player:GetAttributeChangedSignal(name):Connect(function()
|
||||
if fn then fn() end
|
||||
hudLater()
|
||||
if win.overlay.Visible then refresh() end
|
||||
end)
|
||||
end
|
||||
watch("Shards")
|
||||
for _, u in Config.UPGRADES do
|
||||
local key, prev = "Upg_" .. u.Id, attr("Upg_" .. u.Id, 0)
|
||||
watch(key, function()
|
||||
local v = attr(key, 0)
|
||||
if pending[key] then
|
||||
pending[key] = nil
|
||||
if v > prev and win.overlay.Visible then flash(upCards[u.Id].card); floatText(upCards[u.Id].card, "+1 level!") end
|
||||
end
|
||||
prev = v
|
||||
end)
|
||||
end
|
||||
for id in Config.BOOSTERS do
|
||||
local key, prev = "Booster_" .. id, attr("Booster_" .. id, 0)
|
||||
watch(key, function()
|
||||
local v = attr(key, 0)
|
||||
if pending[key] then
|
||||
pending[key] = nil
|
||||
if v > prev and win.overlay.Visible then flash(boCards[id].card); floatText(boCards[id].card, "+1 booster!") end
|
||||
end
|
||||
prev = v
|
||||
end)
|
||||
end
|
||||
task.spawn(function()
|
||||
local inv = player:WaitForChild("OrnamentInventory")
|
||||
local queued = false
|
||||
local function changed()
|
||||
if queued then return end
|
||||
queued = true
|
||||
task.delay(0.2, function()
|
||||
queued = false
|
||||
pending["Fuse"] = nil
|
||||
hudCount()
|
||||
if win.overlay.Visible then refresh() end
|
||||
end)
|
||||
end
|
||||
inv.ChildAdded:Connect(changed)
|
||||
inv.ChildRemoved:Connect(changed)
|
||||
for _, item in inv:GetChildren() do item:GetAttributeChangedSignal("OnTree"):Connect(changed) end
|
||||
inv.ChildAdded:Connect(function(item) item:GetAttributeChangedSignal("OnTree"):Connect(changed) end)
|
||||
changed()
|
||||
end)
|
||||
-- a request the server refused (it sends a toast) must not stay busy forever
|
||||
task.spawn(function()
|
||||
while panel.Parent do
|
||||
task.wait(0.5)
|
||||
local stale = false
|
||||
for k, t in pending do
|
||||
if os.clock() - t >= 2.5 then pending[k] = nil; stale = true end
|
||||
end
|
||||
if stale and win.overlay.Visible then refresh() end
|
||||
end
|
||||
end)
|
||||
|
||||
ch.showTab("Upgrades")
|
||||
---------------------------------------------------------------- "set collected" notification
|
||||
-- When a group (same toy + rarity, no variant, not on the tree — exactly what the server's FindFusable counts)
|
||||
-- reaches FUSION_COUNT, a big toast says so; clicking it opens the Fusion tab. Items that are already there when
|
||||
-- the player joins do not trigger it (armed after the inventory has been quiet for a moment).
|
||||
if ctx.toast then
|
||||
task.spawn(function()
|
||||
local inv = player:WaitForChild("OrnamentInventory")
|
||||
local counts, armed, queued = {}, false, false
|
||||
local quietAt = os.clock()
|
||||
local function recount()
|
||||
queued = false
|
||||
local now = {}
|
||||
for _, item in inv:GetChildren() do
|
||||
local toyId, rId = item:GetAttribute("Toy"), item:GetAttribute("Rarity")
|
||||
local r = rId and Config.RarityById[rId]
|
||||
if toyId and r and not item:GetAttribute("Variant") and not item:GetAttribute("OnTree")
|
||||
and Config.RARITIES[r.Index + 1] and Config.FUSION_COST[r.Id] then
|
||||
local key = toyId .. "|" .. rId
|
||||
now[key] = (now[key] or 0) + 1
|
||||
end
|
||||
end
|
||||
if armed then
|
||||
for key, n in now do
|
||||
if n >= Config.FUSION_COUNT and (counts[key] or 0) < Config.FUSION_COUNT then
|
||||
local toyId, rId = string.match(key, "^(.-)|(.*)$")
|
||||
local toy, r = Config.ToyById[toyId], Config.RarityById[rId]
|
||||
local nextR = Config.RARITIES[r.Index + 1]
|
||||
ctx.toast(string.format("✨ Set complete: %d × %s · %s!\nClick to fuse into “%s · Fused”",
|
||||
Config.FUSION_COUNT, toy and toy.Name or toyId, r.Name, nextR.Name), GOLD, true,
|
||||
function() if K.nav.Workshop then K.nav.Workshop("Fusion") end end)
|
||||
end
|
||||
end
|
||||
end
|
||||
counts = now
|
||||
end
|
||||
local function changed()
|
||||
quietAt = os.clock()
|
||||
if queued then return end
|
||||
queued = true
|
||||
task.delay(0.2, recount) -- several toys arrive at once: count once
|
||||
end
|
||||
local function watch(item) item:GetAttributeChangedSignal("OnTree"):Connect(changed) end
|
||||
for _, item in inv:GetChildren() do watch(item) end
|
||||
inv.ChildAdded:Connect(function(item) watch(item); changed() end)
|
||||
inv.ChildRemoved:Connect(changed)
|
||||
recount()
|
||||
while os.clock() - quietAt < 2.5 do task.wait(0.5) end
|
||||
recount()
|
||||
armed = true
|
||||
end)
|
||||
end
|
||||
|
||||
return {
|
||||
open = function() ch.setBalance(attr("Shards", 0), true); refresh() end,
|
||||
showTab = ch.showTab,
|
||||
}
|
||||
end
|
||||
|
||||
return W
|
||||
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 2.1 MiB |
@@ -0,0 +1,686 @@
|
||||
"Обычная" "Common"
|
||||
"Необычная" "Uncommon"
|
||||
"Редкая" "Rare"
|
||||
"Эпическая" "Epic"
|
||||
"Легендарная" "Legendary"
|
||||
"Мифическая" "Mythic"
|
||||
"Золотая" "Golden"
|
||||
"Сияющая" "Shiny"
|
||||
"Слитая" "Fused"
|
||||
"Удача x2" "Luck x2"
|
||||
"Удача x3" "Luck x3"
|
||||
"Шар" "Ball"
|
||||
"Колокольчик" "Bell"
|
||||
"Звезда" "Star"
|
||||
"Снежинка" "Snowflake"
|
||||
"Олень" "Reindeer"
|
||||
"Домик" "Cottage"
|
||||
"Удача генератора" "Generator Luck"
|
||||
"+8% к удаче каждой генерации" "+8% luck on every generation"
|
||||
"Реген осколков" "Shard Regen"
|
||||
"+6 к запасу регена и реген на 5% быстрее" "+6 regen cap and 5% faster regen"
|
||||
"Мощность шредера" "Shredder Power"
|
||||
"+5% осколков с переработки" "+5% shards from recycling"
|
||||
"Склад игрушек" "Toy Storage"
|
||||
"+50 мест в инвентаре" "+50 inventory slots"
|
||||
"Лавка Санты" "Santa's Stall"
|
||||
"Эльф-торговец" "Elf Trader"
|
||||
"Гном Пряник" "Gingerbread Gnome"
|
||||
"Снеговик Боб" "Bob the Snowman"
|
||||
"Лавка Снегурочки" "Snow Maiden's Stall"
|
||||
"Новогодняя ёлка" "Christmas Tree"
|
||||
"Высокая пушистая ёлка. Украшай её своими игрушками." "A tall fluffy tree. Decorate it with your ornaments."
|
||||
"Турник" "Pull-up Bar"
|
||||
"Опыт за каждое подтягивание, +1 осколок за 10 подряд. До 60 за подход, потом отдых 10 мин." "XP for every pull-up, +1 shard per 10 in a row. Up to 60 per set, then a 10 min rest."
|
||||
"Скамья со штангой" "Bench Press"
|
||||
"Скамья для жима и штанга с блинами." "A press bench and a loaded barbell."
|
||||
"Салют" "Fireworks"
|
||||
"Установка салюта. Подойди и запусти — салют увидят все." "A fireworks launcher. Walk up and launch it — everyone will see the show."
|
||||
"Гирлянда на ёлку" "Tree Garland"
|
||||
"Разноцветные огоньки. Обвей ёлку сам — кликай по ней точка за точкой." "Colorful lights. Wrap the tree yourself — click on it point by point."
|
||||
"Не помещается на участке" "Doesn't fit on the plot"
|
||||
"Мешает: " "Blocked by: "
|
||||
"Горсть осколков" "Handful of Shards"
|
||||
"Мешок осколков" "Bag of Shards"
|
||||
"+25% выгоднее" "+25% value"
|
||||
"Сундук осколков" "Chest of Shards"
|
||||
"+50% выгоднее" "+50% value"
|
||||
"Гора осколков" "Mountain of Shards"
|
||||
"лучшая цена" "best value"
|
||||
"3 × Удача x2" "3 × Luck x2"
|
||||
"3 × Удача x3" "3 × Luck x3"
|
||||
"СВОБОДНО" "FREE"
|
||||
"Участок: " "Plot: "
|
||||
"Игрушка снята с ёлки и лежит в инвентаре" "The ornament was taken off the tree and is in your inventory"
|
||||
"Подтягиваться" "Do pull-ups"
|
||||
"Подтягиваний: " "Pull-ups: "
|
||||
" опыта" " XP"
|
||||
" осколк" " shard"
|
||||
"а" ""
|
||||
"ов" "s"
|
||||
"Отдых после " "Rest after "
|
||||
" подтягиваний: ещё " " pull-ups: "
|
||||
"Спрыгнуть" "Jump off"
|
||||
"Подтягивания: 0 / " "Pull-ups: 0 / "
|
||||
"Подтягивания: " "Pull-ups: "
|
||||
" осколок за " " shard for "
|
||||
" подтягиваний подряд!" " pull-ups in a row!"
|
||||
"Подход окончен: " "Set complete: "
|
||||
" подтягиваний! Турник снова доступен через " " pull-ups! The bar is available again in "
|
||||
" мин" " min"
|
||||
"Это турник игрока " "This pull-up bar belongs to "
|
||||
"Запустить салют" "Launch fireworks"
|
||||
"Это салют игрока " "These fireworks belong to "
|
||||
"Салют перезаряжается: " "Fireworks recharging: "
|
||||
" с" "s"
|
||||
"Слишком часто" "Too fast"
|
||||
"Данные ещё загружаются" "Your data is still loading"
|
||||
"Куплено: " "Bought: "
|
||||
"! Жми «" "! Press “"
|
||||
"На ёлку" "On Tree"
|
||||
"Поставить" "Place"
|
||||
"Сначала купи в магазине" "Buy it in the shop first"
|
||||
"У тебя пока нет участка" "You don't have a plot yet"
|
||||
"Сначала поставь ёлку на участок" "Place a tree on your plot first"
|
||||
"Нужно хотя бы 2 точки на ёлке" "You need at least 2 points on the tree"
|
||||
"Точки должны быть на ёлке" "Points must be on the tree"
|
||||
"Гирлянда слишком длинная" "The garland is too long"
|
||||
" висит на ёлке" " is on the tree"
|
||||
" стоит на участке" " is on your plot"
|
||||
" снята и лежит в инвентаре" " was taken down and is in your inventory"
|
||||
" убран в инвентарь" " was moved to your inventory"
|
||||
"Игрушка не найдена" "Ornament not found"
|
||||
"Эта игрушка уже на ёлке" "This ornament is already on the tree"
|
||||
"Наведи на свою ёлку и кликни, чтобы повесить" "Point at your tree and click to hang it"
|
||||
"Сначала поставь ёлку на участок (Инвентарь)" "Place a tree on your plot first (Inventory)"
|
||||
"Подойди ближе к ёлке" "Get closer to the tree"
|
||||
"Игрушка на ёлке!" "Ornament is on the tree!"
|
||||
"данные ещё загружаются" "your data is still loading"
|
||||
"данные не загружены" "data not loaded"
|
||||
"рынок открывается с " "the market unlocks at level "
|
||||
"-го уровня" ""
|
||||
"Продажи на рынке: +" "Market sales: +"
|
||||
" осколков" " shards"
|
||||
"Продано на рынке: " "Sold on the market: "
|
||||
" за " " for "
|
||||
"Лот истёк, игрушка вернулась: " "Listing expired, ornament returned: "
|
||||
"Не больше " "No more than "
|
||||
" лотов одновременно" " listings at once"
|
||||
"Новые игрушки можно выставить через " "New ornaments can be listed in "
|
||||
"Цена от " "Price from "
|
||||
" до " " to "
|
||||
"Рынок временно недоступен, попробуй позже" "The market is temporarily unavailable, try again later"
|
||||
"Выставлено: " "Listed: "
|
||||
"Лот не найден" "Listing not found"
|
||||
"Рынок временно недоступен" "The market is temporarily unavailable"
|
||||
"Лот уже продан или истёк" "The listing was already sold or expired"
|
||||
"Лот снят, игрушка вернулась" "Listing removed, ornament returned"
|
||||
"Это твой лот" "This is your listing"
|
||||
"Не хватает осколков" "Not enough shards"
|
||||
"Склад полон" "Storage is full"
|
||||
"Этот лот уже купили, сняли или изменили" "This listing was already bought, removed or changed"
|
||||
"Рынок временно недоступен, осколки возвращены" "The market is temporarily unavailable, shards refunded"
|
||||
"Слишком часто, подожди секунду" "Too fast, wait a second"
|
||||
"Ошибка рынка, попробуй ещё раз" "Market error, try again"
|
||||
"Санта" "Santa"
|
||||
"Это станок игрока " "This machine belongs to "
|
||||
"У этого станка пока нет хозяина" "This machine has no owner yet"
|
||||
", бустер «" ", booster “"
|
||||
"Уровень " "Level "
|
||||
"Новая игрушка в пуле генератора: " "New ornament in the generator pool: "
|
||||
"Для узора нужно хотя бы " "The pattern needs at least "
|
||||
"Нужно минимум " "You need at least "
|
||||
" осколков в сетке генератора" " shards in the generator grid"
|
||||
"Инвентарь полон: переработай лишние игрушки в шредере" "Inventory is full: recycle extra ornaments in the shredder"
|
||||
"Выпала игрушка: " "You got: "
|
||||
" (гарант)" " (pity)"
|
||||
"🎉 У игрока " "🎉 "
|
||||
" выпала игрушка: " " got: "
|
||||
"Открыть генератор" "Open generator"
|
||||
"Генератор" "Generator"
|
||||
"Открыть шредер" "Open shredder"
|
||||
"Шредер" "Shredder"
|
||||
"Подойди ближе к генератору" "Get closer to the generator"
|
||||
"Генератор ещё работает, подожди пару секунд" "The generator is still working, wait a couple of seconds"
|
||||
"Новая запись в коллекции! +" "New collection entry! +"
|
||||
"Шредер ещё работает, подожди пару секунд" "The shredder is still working, wait a couple of seconds"
|
||||
"Переработано: " "Recycled: "
|
||||
": уровень " ": level "
|
||||
"Нужно " "You need "
|
||||
" одинаковых игрушек (без особых вариантов)" " identical ornaments (no special variants)"
|
||||
"Не хватает осколков: нужно " "Not enough shards: you need "
|
||||
"Слияние: " "Fusion: "
|
||||
" · Слитая!" " · Fused!"
|
||||
"Создан бустер «" "Booster crafted: “"
|
||||
"Игрок не найден на сервере" "Player not found on this server"
|
||||
"Укажи количество осколков" "Enter a shard amount"
|
||||
"Администратор выдал тебе " "An admin gave you "
|
||||
"Администратор забрал у тебя " "An admin took "
|
||||
"Выдано " "Given "
|
||||
"Забрано " "Taken "
|
||||
" осколков · " " shards · "
|
||||
"Укажи уровень" "Enter a level"
|
||||
"Администратор установил тебе уровень " "An admin set your level to "
|
||||
"Неизвестный бустер" "Unknown booster"
|
||||
"У игрока нет бустера «" "The player has no “"
|
||||
"Администратор выдал тебе бустер «" "An admin gave you a “"
|
||||
"Администратор забрал бустер «" "An admin took your “"
|
||||
"Обучение начнётся заново" "The tutorial will start over"
|
||||
"Туториал сброшен · " "Tutorial reset · "
|
||||
" (начнётся сразу)" " (starts now)"
|
||||
"Данные игрока не загружены" "Player data not loaded"
|
||||
"Твой прогресс сброшен администратором" "Your progress was reset by an admin"
|
||||
"Статистика сброшена · " "Stats reset · "
|
||||
"Туториал сброшен всем: онлайн — сразу, остальным — при следующем входе" "Tutorial reset for everyone: online players now, others on their next join"
|
||||
"DataStore недоступен: туториал сброшен только игрокам на этом сервере" "DataStore unavailable: tutorial reset only for players on this server"
|
||||
"Нет доступа" "Access denied"
|
||||
"Ошибка: " "Error: "
|
||||
"обмен открывается с " "trading unlocks at level "
|
||||
"не больше " "no more than "
|
||||
" обменов в час" " trades per hour"
|
||||
"подожди пару секунд после прошлого обмена" "wait a couple of seconds after your last trade"
|
||||
"Обмен не прошёл: " "Trade failed: "
|
||||
" игрушек" " ornaments"
|
||||
" и " " and "
|
||||
"ничего" "nothing"
|
||||
"Обмен завершён! Получено: " "Trade complete! Received: "
|
||||
"Ты уже в обмене" "You are already trading"
|
||||
"Обмен недоступен: " "Trade unavailable: "
|
||||
" уже в обмене" " is already trading"
|
||||
"У " ""
|
||||
" уже есть запрос, подожди" " already has a pending request, wait"
|
||||
"Запрос на обмен отправлен: " "Trade request sent: "
|
||||
"Запрос уже истёк" "The request has expired"
|
||||
" отклонил обмен" " declined the trade"
|
||||
"Обмен уже недоступен" "The trade is no longer available"
|
||||
"Эту игрушку пока нельзя обменять (новым игрушкам нужно " "This ornament can't be traded yet (new ornaments need "
|
||||
" мин)" " min)"
|
||||
" отменил обмен" " cancelled the trade"
|
||||
" вышел из игры" " left the game"
|
||||
"Твои данные ещё сохраняются на другом сервере. Зайди снова через минуту." "Your data is still being saved on another server. Please rejoin in a minute."
|
||||
"Неизвестное улучшение" "Unknown upgrade"
|
||||
"Уже максимальный уровень" "Already at max level"
|
||||
"Предложение больше не действительно" "The offer is no longer valid"
|
||||
": склад переполнится" ": storage would overflow"
|
||||
"Нет такого товара" "No such item"
|
||||
"Уже куплено" "Already bought"
|
||||
"Это место уже занято" "This spot is already taken"
|
||||
"Спасибо за покупку! " "Thanks for your purchase! "
|
||||
" уже у тебя" " is yours"
|
||||
"Генератор игрушек" "Ornament Generator"
|
||||
"Мастерская" "Workshop"
|
||||
"Обмен" "Trade"
|
||||
"Сначала заверши или отмени обмен" "Finish or cancel the trade first"
|
||||
"Рынок игрушек" "Ornament Market"
|
||||
"Рынок" "Market"
|
||||
"Магазин" "Shop"
|
||||
"Премиум-магазин" "Premium Shop"
|
||||
"Премиум" "Premium"
|
||||
"Генератор: E или клик" "Generator: E or click"
|
||||
"Инвентарь" "Inventory"
|
||||
"Повернуть" "Rotate"
|
||||
"Отмена" "Cancel"
|
||||
"Ставим: " "Placing: "
|
||||
"Нет связи" "No connection"
|
||||
"Готово" "Done"
|
||||
"Не получилось" "Failed"
|
||||
"Убрано" "Removed"
|
||||
"Сначала поставь ёлку на участок (Инвентарь → Предметы)" "Place a tree on your plot first (Inventory → Items)"
|
||||
"На ёлке нет свободных мест" "No free spots on the tree"
|
||||
"Наведи на свою ёлку — светлая точка покажет место" "Point at your tree — a glowing dot shows the spot"
|
||||
"Кликни, чтобы повесить игрушку на ёлку" "Click to hang the ornament on the tree"
|
||||
" д " "d "
|
||||
" ч" "h"
|
||||
" ч " "h "
|
||||
"Нет связи с рынком" "No connection to the market"
|
||||
"С " "Level "
|
||||
" уровня" "+"
|
||||
"Купить" "Buy"
|
||||
"Лоты игроков со всех серверов. Первый клик по «Купить» готовит покупку, второй — подтверждает." "Listings from players on all servers. The first click on “Buy” prepares the purchase, the second confirms it."
|
||||
"Продать" "Sell"
|
||||
"Налог " "Tax "
|
||||
"% с продажи. Осколки придут, даже если тебя не будет в игре." "% per sale. Shards arrive even if you're offline."
|
||||
"Мои лоты" "My Listings"
|
||||
"Лот живёт " "A listing lasts "
|
||||
" дня. Не продался — игрушка вернётся к тебе сама." " days. If it doesn't sell, the ornament comes back to you."
|
||||
"Как это работает" "How It Works"
|
||||
"Рынок общий для всех серверов — цены назначают сами игроки." "The market is shared by all servers — players set the prices."
|
||||
"РЫНОК" "MARKET"
|
||||
"Покупай и продавай\nигрушки всех серверов" "Buy and sell ornaments\nacross all servers"
|
||||
"Все игрушки" "All ornaments"
|
||||
"Все редкости" "All rarities"
|
||||
"Дешёвые" "Cheapest"
|
||||
"Дорогие" "Priciest"
|
||||
"Новые" "Newest"
|
||||
"Обновить" "Refresh"
|
||||
"продаёт " "seller: "
|
||||
"Куплено" "Bought"
|
||||
"Твой лот" "Your listing"
|
||||
"Нужно ещё " "Need "
|
||||
"Точно? " "Sure? "
|
||||
"Куплено!" "Bought!"
|
||||
"Загрузка…" "Loading…"
|
||||
"показано " "showing "
|
||||
" из " " of "
|
||||
" · рынок Studio" " · Studio market"
|
||||
"Таких лотов нет" "No matching listings"
|
||||
"Рынок пока пуст" "The market is empty"
|
||||
"Попробуй другую игрушку или редкость." "Try another ornament or rarity."
|
||||
"Никто ещё ничего не продаёт — выставь свою игрушку первым!" "Nobody is selling yet — be the first to list an ornament!"
|
||||
"Сбросить фильтры" "Reset filters"
|
||||
"Продать игрушку" "Sell an ornament"
|
||||
"Твои игрушки" "Your ornaments"
|
||||
"Выбери игрушку" "Pick an ornament"
|
||||
"Нажми на игрушку слева, потом назначь цену — лот увидят игроки на всех серверах." "Click an ornament on the left, then set a price — players on all servers will see the listing."
|
||||
"Цена лота" "Listing price"
|
||||
"цена" "price"
|
||||
"Мин." "Min"
|
||||
"Получишь " "You get "
|
||||
" после налога " " after "
|
||||
"Впиши цену числом" "Enter the price as a number"
|
||||
"Лотов: " "Listings: "
|
||||
" · лот живёт " " · lasts "
|
||||
" дня · виден на всех серверах" " days · visible on all servers"
|
||||
"Все " "All "
|
||||
" лотов заняты" " listing slots are used"
|
||||
"Укажи цену" "Enter a price"
|
||||
"Цена до " "Max price "
|
||||
"Выставить за " "List for "
|
||||
"Выставлено" "Listed"
|
||||
"Выставлено!" "Listed!"
|
||||
"В шредере: " "Shredder value: "
|
||||
"\nмин. цена: " "\nmin price: "
|
||||
" шт." " pcs"
|
||||
" на ёлке" " on the tree"
|
||||
"Нечего продавать" "Nothing to sell"
|
||||
"Создай игрушки в генераторе. Игрушки с ёлки не продаются — сначала сними их." "Make ornaments in the generator. Ornaments on the tree can't be sold — take them down first."
|
||||
"Проданные лоты закрываются сами — осколки приходят автоматически" "Sold listings close on their own — shards arrive automatically"
|
||||
"Ты ещё ничего не выставил" "You haven't listed anything yet"
|
||||
"Выставь игрушку — и её увидят игроки на всех серверах." "List an ornament and players on all servers will see it."
|
||||
"осталось " "left: "
|
||||
"Игрушка вернулась" "Ornament returned"
|
||||
"Снять с продажи" "Remove listing"
|
||||
"Здесь лоты игроков со всех серверов. Фильтруй по игрушке и редкости. Первый клик по «Купить» готовит покупку, второй — подтверждает." "Listings from players on all servers. Filter by ornament and rarity. The first click on “Buy” prepares the purchase, the second confirms it."
|
||||
"Выбери игрушку и назначь цену — не ниже её ценности в шредере. Новые игрушки можно выставить через " "Pick an ornament and set a price — no lower than its shredder value. New ornaments can be listed "
|
||||
" мин после создания." " min after they are made."
|
||||
"% с продажи. Лот живёт " "% per sale. A listing lasts "
|
||||
" дня, потом игрушка вернётся. Осколки придут, даже если тебя нет в игре. До " " days, then the ornament comes back. Shards arrive even if you're offline. Up to "
|
||||
" лотов сразу." " listings at once."
|
||||
"Открыть" "Open"
|
||||
"🔒 Покупать и продавать можно с " "🔒 Buying and selling unlocks at level "
|
||||
"-го уровня — смотреть можно уже сейчас." " — you can browse right now."
|
||||
"Игроки" "Players"
|
||||
"Обмен открывается с " "Trading unlocks at level "
|
||||
"-го уровня у обоих игроков." " for both players."
|
||||
"Сделка" "Deal"
|
||||
"Любое изменение снимает «Готов» у обоих — так никто не подменит игрушку в последний момент." "Any change clears “Ready” for both players — so nobody can swap an ornament at the last moment."
|
||||
"% берётся только с переданных осколков, игрушки идут без налога." "% applies only to shards sent; ornaments are tax-free."
|
||||
"ОБМЕН" "TRADE"
|
||||
"Меняйся игрушками\nс игроками сервера" "Trade ornaments\nwith players on this server"
|
||||
"подтвердил" "confirmed"
|
||||
"готов" "ready"
|
||||
"не готов" "not ready"
|
||||
" · уровень " " · level "
|
||||
"Запрос отправлен: " "Request sent: "
|
||||
"Запрос отправлен" "Request sent"
|
||||
"У игрока ур. " "Player is level "
|
||||
"Предложить обмен" "Offer a trade"
|
||||
"На сервере больше никого нет" "Nobody else is on this server"
|
||||
"Позови друга — обмен работает между игроками на одном сервере." "Invite a friend — trading works between players on the same server."
|
||||
"Сейчас нет обмена" "No active trade"
|
||||
"Выбери игрока во вкладке «Игроки» и предложи обмен — или прими чужой запрос." "Pick a player in the “Players” tab and offer a trade — or accept someone's request."
|
||||
"Выбрать игрока" "Pick a player"
|
||||
"Ты отдаёшь" "You give"
|
||||
"Нажми на свою игрушку внизу, чтобы положить её сюда" "Click one of your ornaments below to put it here"
|
||||
"Осколки" "Shards"
|
||||
"Задать" "Set"
|
||||
"Твои игрушки — нажми, чтобы добавить" "Your ornaments — click to add"
|
||||
"Пока ничего не положил" "Nothing added yet"
|
||||
"Отменить" "Cancel"
|
||||
"Подтверждение через " "Confirm in "
|
||||
"Ждём, пока " "Waiting for "
|
||||
" подтвердит" " to confirm"
|
||||
"Всё готово — подтверждай!" "All set — confirm!"
|
||||
" нажмёт «Готов»" " to press “Ready”"
|
||||
"Проверь предложения и нажми «Готов»" "Check both offers and press “Ready”"
|
||||
"ценность " "value "
|
||||
" отдаёт" " gives"
|
||||
"НОВОЕ" "NEW"
|
||||
"дойдёт " "arrives: "
|
||||
"% · у тебя " "% · you have "
|
||||
"у тебя " "you have "
|
||||
" осколков тебе (после налога)" " shards to you (after tax)"
|
||||
"осколков не предлагает" "offers no shards"
|
||||
"Новые игрушки можно обменять через " "New ornaments can be traded in "
|
||||
" игрушек в обмене" " ornaments per trade"
|
||||
"Внимание: ты отдаёшь намного больше, чем получаешь!" "Warning: you're giving much more than you get!"
|
||||
"Ты получаешь намного больше — проверь, что всё честно." "You're getting much more — make sure it's fair."
|
||||
"Готов" "Ready"
|
||||
"Не готов" "Not ready"
|
||||
"Подтверждено" "Confirmed"
|
||||
"Подтвердить" "Confirm"
|
||||
"Через " "In "
|
||||
"Сначала «Готов»" "Press “Ready” first"
|
||||
"1. Пригласи" "1. Invite"
|
||||
"Выбери игрока и предложи обмен. Нужен " "Pick a player and offer a trade. Both need level "
|
||||
"-й уровень у обоих. Новые игрушки можно обменять через " ". New ornaments can be traded "
|
||||
" мин." " min after they are made."
|
||||
"2. Положи" "2. Add"
|
||||
"До " "Up to "
|
||||
" игрушек и осколки (налог " " ornaments and shards (tax "
|
||||
"%). Нажми на свою игрушку, чтобы добавить, и на добавленную — чтобы убрать." "%). Click your ornament to add it, click an added one to remove it."
|
||||
"3. Подтверди" "3. Confirm"
|
||||
"Оба жмут «Готов», через " "Both press “Ready”, then after "
|
||||
" с — «Подтвердить». Любое изменение снимает готовность у обоих." "s — “Confirm”. Any change clears “Ready” for both."
|
||||
"🔒 Обмен откроется с " "🔒 Trading unlocks at level "
|
||||
"-го уровня — сейчас у тебя " " — you are level "
|
||||
"-й." "."
|
||||
"Принять" "Accept"
|
||||
"Отклонить" "Decline"
|
||||
" (ур. " " (lvl "
|
||||
") предлагает обмен" ") wants to trade"
|
||||
"Игрушки" "Ornaments"
|
||||
"«В руку» — и кликни по светлой точке на своей ёлке, чтобы повесить игрушку." "“Hold” it, then click a glowing dot on your tree to hang the ornament."
|
||||
"Предметы" "Items"
|
||||
"«Поставить»: клик — поставить, R — повернуть, Esc — отмена." "“Place”: click to place, R to rotate, Esc to cancel."
|
||||
"Бустеры" "Boosters"
|
||||
"Бустеры кладут в слот генератора перед созданием игрушки." "Put boosters in the generator slot before making an ornament."
|
||||
"Всё, что лежит в инвентаре, сохраняется вместе с прогрессом." "Everything in your inventory is saved with your progress."
|
||||
"ИНВЕНТАРЬ" "INVENTORY"
|
||||
"Твои игрушки, предметы\nи бустеры" "Your ornaments, items\nand boosters"
|
||||
"Все" "All"
|
||||
"В инвентаре" "In inventory"
|
||||
"На ёлке" "On the tree"
|
||||
" шт. · на ёлке: " " pcs · on the tree: "
|
||||
" · склад: " " · storage: "
|
||||
"На ёлке пока пусто" "The tree is empty"
|
||||
"Игрушек пока нет" "No ornaments yet"
|
||||
"Возьми игрушку в руку и кликни по светлой точке на ёлке." "Hold an ornament and click a glowing dot on the tree."
|
||||
"Создай игрушки в генераторе — они появятся здесь." "Make ornaments in the generator — they'll show up here."
|
||||
"висит на ёлке" "on the tree"
|
||||
"в инвентаре · " "in inventory · "
|
||||
" оск." " shards"
|
||||
"Снята!" "Taken down!"
|
||||
"Снять с ёлки" "Take down"
|
||||
"В руку" "Hold"
|
||||
"…и ещё " "…and "
|
||||
"ещё не куплено" "not bought yet"
|
||||
"Цена в магазине: " "Shop price: "
|
||||
" осколков." " shards."
|
||||
"В магазин" "To Shop"
|
||||
"Можно обвить ёлку заново или снять гирлянду." "You can rewrap the tree or take the garland down."
|
||||
"Перевесить" "Rehang"
|
||||
"Снять" "Take down"
|
||||
"лежит в инвентаре" "in inventory"
|
||||
"Кликай по ёлке точка за точкой — гирлянда пойдёт, как ты её проведёшь." "Click the tree point by point — the garland follows your path."
|
||||
"Обвить ёлку" "Wrap the tree"
|
||||
"стоит на участке" "on your plot"
|
||||
"Можно передвинуть или убрать обратно в инвентарь." "You can move it or put it back in your inventory."
|
||||
"Переставить" "Move"
|
||||
"Убрать" "Store"
|
||||
"Выбери место на своём участке." "Pick a spot on your plot."
|
||||
"положи в слот генератора — удача одной генерации x" "put it in the generator slot — one generation gets luck x"
|
||||
"Создать ещё" "Craft more"
|
||||
"За Robux" "For Robux"
|
||||
"«В руку» — игрушка окажется у тебя в руке. Подойди к своей ёлке и кликни по светлой точке, чтобы повесить." "“Hold” puts the ornament in your hand. Walk up to your tree and click a glowing dot to hang it."
|
||||
"Купленное в магазине ставится на твой участок. Клик — поставить, R — повернуть, Esc — отмена." "Things you buy in the shop go on your plot. Click to place, R to rotate, Esc to cancel."
|
||||
"Бустеры создаются в мастерской или покупаются за Robux. Положи бустер в слот генератора." "Boosters are crafted in the Workshop or bought for Robux. Put a booster in the generator slot."
|
||||
"Создать" "Create"
|
||||
"Узор из осколков похож на игрушку — шанс получить именно её выше." "If your shard pattern looks like an ornament, you're more likely to get that one."
|
||||
"Шансы" "Odds"
|
||||
"Больше осколков и бустер — выше удача и шанс редких игрушек." "More shards and a booster mean more luck and better odds for rare ornaments."
|
||||
"Гарант: редкая игрушка выпадет не позже, чем через указанное число попыток." "Pity: a rare ornament is guaranteed within the shown number of tries."
|
||||
"ГЕНЕРАТОР" "GENERATOR"
|
||||
"Создавай игрушки\nиз осколков" "Make ornaments\nfrom shards"
|
||||
"Узор из осколков" "Shard pattern"
|
||||
"Нет осколков — они копятся сами со временем" "No shards — they build up over time"
|
||||
"Клик по клетке — положить или убрать осколок" "Click a cell to add or remove a shard"
|
||||
"Бустер" "Booster"
|
||||
"Бустеров «" "No “"
|
||||
"» нет — создай их в Мастерской" "” boosters — craft them in the Workshop"
|
||||
"Подойди к своему генератору" "Go to your generator"
|
||||
"Что выпадет" "Possible drops"
|
||||
"Шанс редкости" "Rarity odds"
|
||||
"Гарант — защита от неудачи" "Pity — protection from bad luck"
|
||||
"Каждая генерация без нужной редкости приближает гарант. Когда шкала заполнится — редкая игрушка выпадет точно." "Every generation without the rarity fills the pity bar. When it's full, a rare ornament is guaranteed."
|
||||
" или лучше" " or better"
|
||||
"1. Узор" "1. Pattern"
|
||||
"К сетке" "To Grid"
|
||||
"Положи в сетку от " "Put "
|
||||
" осколков. Чем больше — тем выше удача. Узор, похожий на игрушку, повышает шанс именно её." " shards in the grid. More shards mean more luck. A pattern that looks like an ornament raises the odds for that one."
|
||||
"2. Бустер" "2. Booster"
|
||||
"Бустер в слоте умножает удачу одной генерации. Бустеры создаются в Мастерской или покупаются в Премиуме." "A booster in the slot multiplies the luck of one generation. Boosters are crafted in the Workshop or bought in Premium."
|
||||
"3. Создай" "3. Create"
|
||||
"Нажми «Создать» — осколки уйдут в станок, а через пару секунд появится игрушка. Гарант не даст долго оставаться без редких." "Press “Create” — the shards go into the machine, and an ornament appears a couple of seconds later. Pity makes sure you won't go long without rares."
|
||||
"Вложено: " "Shards in: "
|
||||
" в слоте.\nНажми на круг, чтобы снять." " in the slot.\nClick the circle to remove it."
|
||||
"Выбери бустер ниже — он усилит одну генерацию." "Pick a booster below — it boosts one generation."
|
||||
"Положи осколки в сетку" "Put shards in the grid"
|
||||
"минимум " "min "
|
||||
", максимум " ", max "
|
||||
"Удача x%.2f" "Luck x%.2f"
|
||||
"легендарная или лучше: " "legendary or better: "
|
||||
"Мало осколков" "Not enough shards"
|
||||
"Добавь ещё " "Add "
|
||||
"Создать · " "Create · "
|
||||
"Автоузор" "Auto Pattern"
|
||||
"Очистить" "Clear"
|
||||
"🔒 ур. " "🔒 lvl "
|
||||
"узор точный" "exact pattern"
|
||||
"узор %d%%" "pattern %d%%"
|
||||
"удача x%.2f" "luck x%.2f"
|
||||
"удача x1 (без осколков)" "luck x1 (no shards)"
|
||||
"максимум через " "at most in "
|
||||
"Улучшения" "Upgrades"
|
||||
"Совет: «Удача генератора» окупается быстрее всего — она работает в каждой генерации." "Tip: “Generator Luck” pays off fastest — it works on every generation."
|
||||
"Слияние" "Fusion"
|
||||
" одинаковых игрушек + осколки = 1 «Слитая» игрушка на редкость выше — она дороже вложенного." " identical ornaments + shards = 1 “Fused” ornament one rarity higher — worth more than you put in."
|
||||
"Бустер кладут в слот генератора: он тратится при создании игрушки. Лучше всего — на 16 осколков." "A booster goes in the generator slot and is used up when you make an ornament. Best with 16 shards."
|
||||
"Мастерская открыта всегда — кнопка «Мастерская» слева на экране." "The Workshop is always open — the “Workshop” button on the left of the screen."
|
||||
"МАСТЕРСКАЯ" "WORKSHOP"
|
||||
"Улучшай генератор,\nсливай и создавай" "Upgrade the generator,\nfuse and craft"
|
||||
"запас %d · +1 за %.1f с" "cap %d · +1 per %.1fs"
|
||||
"переработка x%.2f" "recycling x%.2f"
|
||||
" мест" " slots"
|
||||
"удача одной генерации x" "one generation luck x"
|
||||
"Пока нечего сливать" "Nothing to fuse yet"
|
||||
"Собери " "Collect "
|
||||
" одинаковых игрушек одной редкости в генераторе — и сливай их в более редкую." " identical ornaments of one rarity in the generator — then fuse them into a rarer one."
|
||||
" · Слитая" " · Fused"
|
||||
"есть " "have "
|
||||
" · можно слить!" " · ready to fuse!"
|
||||
" · нужно ещё " " · need "
|
||||
" · стоит " " · costs "
|
||||
" (вложено " " (put in "
|
||||
"Слить" "Fuse"
|
||||
"Работают всегда, даже вдали от станка. Удача — более редкие игрушки, реген — больше бесплатных осколков, шредер — больше осколков с переработки, склад — больше мест." "Always active, even away from the machine. Luck — rarer ornaments, regen — more free shards, shredder — more shards from recycling, storage — more slots."
|
||||
" одинаковых игрушек одной редкости + немного осколков = 1 «Слитая» игрушка на редкость выше. Она стоит больше вложенного, но слить её ещё раз нельзя." " identical ornaments of one rarity + some shards = 1 “Fused” ornament one rarity higher. It's worth more than you put in, but it can't be fused again."
|
||||
"Создай бустер за осколки и положи его в слот генератора. Он умножит удачу одной генерации и потратится при создании игрушки." "Craft a booster with shards and put it in the generator slot. It multiplies the luck of one generation and is used up when you make an ornament."
|
||||
"ур. " "Lvl "
|
||||
"Улучшить" "Upgrade"
|
||||
" · предел" " · max"
|
||||
"Максимум" "Maxed"
|
||||
"у тебя: " "you have: "
|
||||
"+1 уровень!" "+1 level!"
|
||||
"+1 бустер!" "+1 booster!"
|
||||
"✨ Набор собран: %d × %s · %s!\nНажми — слить в «%s · Слитая»" "✨ Set complete: %d × %s · %s!\nClick to fuse into “%s · Fused”"
|
||||
"Переработка" "Recycle"
|
||||
"+ одинаковых игрушек за раз — бонус +" "+ identical ornaments at once — bonus +"
|
||||
"% осколков." "% shards."
|
||||
"Ценность" "Value"
|
||||
"Особые игрушки (золотые, сияющие) стоят в несколько раз дороже." "Special ornaments (golden, shiny) are worth several times more."
|
||||
"Игрушки на ёлке шредер не трогает — сначала сними их." "The shredder doesn't touch ornaments on the tree — take them down first."
|
||||
"ШРЕДЕР" "SHREDDER"
|
||||
"Лишние игрушки —\nв осколки" "Turn extra ornaments\ninto shards"
|
||||
"Пока нет игрушек" "No ornaments yet"
|
||||
"Создай их в генераторе, а лишние приноси сюда." "Make them in the generator and bring extras here."
|
||||
"Выбрано" "Selected"
|
||||
"Получишь" "You get"
|
||||
"Подойди к своему шредеру" "Go to your shredder"
|
||||
"За раз можно до " "You can recycle up to "
|
||||
"Осколков за игрушку" "Shards per ornament"
|
||||
"по редкости, до множителей вида и игрушки" "by rarity, before variant and ornament multipliers"
|
||||
"Множители" "Multipliers"
|
||||
" игрушка" " ornament"
|
||||
"+ одинаковых за раз" "+ identical at once"
|
||||
"Улучшение шредера" "Shredder upgrade"
|
||||
"1. Выбери" "1. Select"
|
||||
"К игрушкам" "To Ornaments"
|
||||
"Нажимай на игрушки или используй «Выбрать всё» / «Обычные». За раз — до " "Click ornaments or use “Select all” / “Common”. Up to "
|
||||
" игрушек." " ornaments at once."
|
||||
"2. Переработай" "2. Recycle"
|
||||
"Игрушки превращаются в осколки. Для редких и особых шредер спросит подтверждение — случайно не потеряешь." "Ornaments turn into shards. For rare and special ones the shredder asks to confirm — so you won't lose them by accident."
|
||||
"3. Улучши" "3. Upgrade"
|
||||
"Улучшение шредера в Мастерской даёт больше осколков с каждой игрушки." "The shredder upgrade in the Workshop gives more shards from every ornament."
|
||||
"это максимум за раз (" "that's the max at once ("
|
||||
"Бонус +" "Bonus +"
|
||||
"% за пачку: " "% for a batch: "
|
||||
"Нажимай на игрушки слева, чтобы выбрать" "Click ornaments on the left to select them"
|
||||
"В выборе есть легендарные, мифические или особые игрушки!" "Your selection has legendary, mythic or special ornaments!"
|
||||
"Выбрать всё" "Select all"
|
||||
"Обычные" "Common"
|
||||
"Снять выбор" "Deselect"
|
||||
"Выбери игрушки" "Select ornaments"
|
||||
"Шредер работает" "Shredder working"
|
||||
"Точно? Нажми ещё раз" "Sure? Click again"
|
||||
"Переработать · " "Recycle · "
|
||||
"Украшай её своими игрушками" "Decorate it with your ornaments"
|
||||
"Опыт, +1 осколок за 10 подряд, до 60 за подход" "XP, +1 shard per 10 in a row, up to 60 per set"
|
||||
"Уголок для тренировок" "A workout corner"
|
||||
"Салют увидит весь сервер" "The whole server sees the show"
|
||||
"Обвей ёлку огоньками" "Wrap your tree in lights"
|
||||
"Все товары" "All items"
|
||||
"Покупки появляются на твоём участке и остаются навсегда." "Purchases appear on your plot and stay forever."
|
||||
"Украшения" "Decorations"
|
||||
"Ёлка — главное украшение: на неё вешаются игрушки из генератора." "The tree is the main decoration: you hang generator ornaments on it."
|
||||
"Развлечения" "Activities"
|
||||
"Тренажёры дают опыт — так быстрее открываются рынок и обмен." "Workout gear gives XP — that unlocks the market and trading faster."
|
||||
"Купленное можно переставлять и убирать в инвентарь сколько угодно." "You can move bought items or store them in your inventory any time."
|
||||
"МАГАЗИН" "SHOP"
|
||||
"Украшения и развлечения\nдля твоего участка" "Decorations and activities\nfor your plot"
|
||||
"Нет связи с магазином" "No connection to the shop"
|
||||
"Покупай" "Buy"
|
||||
"К товарам" "To Items"
|
||||
"Всё оплачивается осколками. Каждую вещь покупаешь один раз — она твоя навсегда." "Everything costs shards. You buy each item once — it's yours forever."
|
||||
"Ставь на участок" "Place on your plot"
|
||||
"Купленное лежит в инвентаре. «Поставить» — выбери место: клик ставит, R поворачивает, Esc отменяет." "Bought items are in your inventory. “Place” — pick a spot: click places, R rotates, Esc cancels."
|
||||
"Наряжай ёлку" "Decorate the tree"
|
||||
"Мои игрушки" "My Ornaments"
|
||||
"Поставь ёлку, возьми игрушку в руку через инвентарь и кликни по светлой точке на ёлке." "Place a tree, hold an ornament from your inventory and click a glowing dot on the tree."
|
||||
"куплено · лежит в инвентаре" "bought · in inventory"
|
||||
"можно купить" "available"
|
||||
"не хватает осколков" "not enough shards"
|
||||
"Чем больше набор, тем выгоднее каждый осколок." "The bigger the pack, the better the value per shard."
|
||||
"Бустер кладут в слот генератора — он умножает удачу одной генерации." "A booster goes in the generator slot — it multiplies the luck of one generation."
|
||||
"Покупка за Robux: Roblox сам покажет окно подтверждения." "Robux purchase: Roblox shows its own confirmation window."
|
||||
"ПРЕМИУМ" "PREMIUM"
|
||||
"Осколки и бустеры\nза Robux" "Shards and boosters\nfor Robux"
|
||||
"Скоро" "Soon"
|
||||
"осколков · на " "shards · "
|
||||
"% больше за R$" "% more per R$"
|
||||
"осколков" "shards"
|
||||
" бустера · удача одной генерации x" " boosters · one generation luck x"
|
||||
"Безопасно" "Safe"
|
||||
"К осколкам" "To Shards"
|
||||
"Оплата идёт через Roblox: перед списанием Robux он сам покажет окно подтверждения." "Payment goes through Roblox: it shows its own confirmation window before charging Robux."
|
||||
"Сразу" "Instant"
|
||||
"Осколки и бустеры приходят мгновенно и сохраняются вместе с прогрессом." "Shards and boosters arrive instantly and are saved with your progress."
|
||||
"К бустерам" "To Boosters"
|
||||
"Бустер кладут в слот генератора. Он умножает удачу одной генерации и тратится при создании игрушки." "A booster goes in the generator slot. It multiplies the luck of one generation and is used up when you make an ornament."
|
||||
" бустера" " boosters"
|
||||
"Назад" "Back"
|
||||
"Кликай по ёлке: первая точка — начало гирлянды" "Click the tree: the first point starts the garland"
|
||||
"Кликай дальше — гирлянда пойдёт за курсором" "Keep clicking — the garland follows your cursor"
|
||||
"Точек %d · длина %d / %d. Готово — Enter, назад — Backspace" "Points %d · length %d / %d. Done — Enter, undo — Backspace"
|
||||
"Больше точек нельзя — нажми «Готово»" "No more points — press “Done”"
|
||||
"Провод закончился — нажми «Готово» или убери точку" "Out of wire — press “Done” or remove a point"
|
||||
"Поставь хотя бы 2 точки на ёлке" "Place at least 2 points on the tree"
|
||||
"Кликай по своей ёлке" "Click on your tree"
|
||||
"Уровень 1" "Level 1"
|
||||
"Опыт дают генерация, слияние и тренажёры. Новые уровни открывают игрушки, рынок и обмен." "You get XP from generating, fusing and workout gear. New levels unlock ornaments, the market and trading."
|
||||
"Осколки копятся сами: +1 каждые %d с, пока их меньше %d. Больше — переработкой игрушек в шредере." "Shards build up on their own: +1 every %ds while you have fewer than %d. Get more by recycling ornaments in the shredder."
|
||||
"максимум" "max"
|
||||
"Новый уровень!" "Level up!"
|
||||
"реген на паузе: больше " "regen paused: more than "
|
||||
"запас полон · " "cap full · "
|
||||
"+1 через %d:%02d · до %d" "+1 in %d:%02d · up to %d"
|
||||
"Вложено: %d / 16" "Shards in: %d / 16"
|
||||
"Генератор работает…" "Generator working…"
|
||||
"Недостаточно осколков" "Not enough shards"
|
||||
" выбран\nНажми на слот, чтобы снять." " selected\nClick the slot to remove it."
|
||||
"Выбери бустер ниже.\nОн усилит одну генерацию." "Pick a booster below.\nIt boosts one generation."
|
||||
"нажми на кнопку «Открыть» у станка" "press the “Open” button at the machine"
|
||||
"нажми E" "press E"
|
||||
"Пропустить обучение" "Skip tutorial"
|
||||
"ОБУЧЕНИЕ · шаг " "TUTORIAL · step "
|
||||
"ОБУЧЕНИЕ" "TUTORIAL"
|
||||
"Дальше" "Next"
|
||||
"<font size=\"32\" color=\"#FFCD46\"><b>Привет! 🎄</b></font>\nЗдесь ты создаёшь ёлочные игрушки из волшебных осколков, собираешь редкие и украшаешь свой участок.\n\nДавай я покажу, как всё устроено — это займёт пару минут." "<font size=\"32\" color=\"#FFCD46\"><b>Hi there! 🎄</b></font>\nHere you make Christmas ornaments from magic shards, collect rare ones and decorate your plot.\n\nLet me show you how it all works — it only takes a couple of minutes."
|
||||
"Поехали!" "Let's go!"
|
||||
"Пропустить" "Skip"
|
||||
"Это твои <font color=\"#9FE0FF\"><b>осколки 💎</b></font> — главная валюта игры.\nИз них генератор создаёт игрушки, за них покупаются вещи в магазине.\n\nПока осколков мало, они копятся сами — полоска под числом показывает, когда придёт следующий." "These are your <font color=\"#9FE0FF\"><b>shards 💎</b></font> — the main currency of the game.\nThe generator turns them into ornaments, and you spend them in the shop.\n\nWhile you're low on shards, they build up on their own — the bar under the number shows when the next one arrives."
|
||||
"А это твой <font color=\"#FFCD46\"><b>уровень</b></font>. Опыт дают генерация, слияние и тренажёры.\nНовые уровни открывают новые игрушки, рынок и обмен." "And this is your <font color=\"#FFCD46\"><b>level</b></font>. You get XP from generating, fusing and workout gear.\nNew levels unlock new ornaments, the market and trading."
|
||||
"Сейчас нам нужен генератор — закрой это окно." "Right now we need the generator — close this window."
|
||||
"Ты у генератора! Теперь " "You're at the generator! Now "
|
||||
"\n(или просто нажми на сам генератор)" "\n(or just click the generator itself)"
|
||||
"Иди к своему <font color=\"#FFCD46\"><b>генератору</b></font> — по светящимся стрелкам на земле" "Go to your <font color=\"#FFCD46\"><b>generator</b></font> — follow the glowing arrows on the ground"
|
||||
"Открой вкладку «Создать»." "Open the “Create” tab."
|
||||
"Это <b>сетка узора</b>. Каждая клетка — один осколок.\nЧтобы создать игрушку, нужно положить минимум <font color=\"#FFCD46\"><b>" "This is the <b>pattern grid</b>. Each cell is one shard.\nTo make an ornament, put in at least <font color=\"#FFCD46\"><b>"
|
||||
"</b></font> осколков. Больше осколков — выше удача!" "</b></font> shards. More shards mean more luck!"
|
||||
"Здесь видно, <b>какие игрушки могут выпасть</b> и с каким шансом.\nЕсли узор похож на игрушку — шанс получить именно её растёт." "Here you can see <b>which ornaments can drop</b> and their odds.\nIf the pattern looks like an ornament, the odds for that one go up."
|
||||
"<b>Бустеры</b> умножают удачу одной генерации. Их создают в Мастерской — пока можно без них." "<b>Boosters</b> multiply the luck of one generation. They're crafted in the Workshop — you can skip them for now."
|
||||
"Самый простой способ — нажми <font color=\"#9FE0FF\"><b>«Автоузор»</b></font>: генератор сам выложит лучший узор." "The easiest way — press <font color=\"#9FE0FF\"><b>“Auto Pattern”</b></font>: the generator lays out the best pattern for you."
|
||||
"Отлично, узор готов! Теперь нажми <font color=\"#FFCD46\"><b>«Создать»</b></font> ✨" "Great, the pattern is ready! Now press <font color=\"#FFCD46\"><b>“Create”</b></font> ✨"
|
||||
"Смотри — генератор создаёт игрушку! ✨" "Look — the generator is making an ornament! ✨"
|
||||
"<font size=\"32\" color=\"#FFCD46\"><b>Ура, твоя первая игрушка! 🎉</b></font>\n<b>" "<font size=\"32\" color=\"#FFCD46\"><b>Hooray, your first ornament! 🎉</b></font>\n<b>"
|
||||
"Игрушка" "Ornament"
|
||||
"</b></font>\n\nВсе игрушки хранятся в <b>Инвентаре</b> — их можно повесить на ёлку, продать на рынке или обменять.\nА лишние превращаются обратно в осколки в <b>шредере</b>. Пойдём, покажу!" "</b></font>\n\nAll ornaments are kept in your <b>Inventory</b> — you can hang them on your tree, sell them on the market or trade them.\nExtras turn back into shards in the <b>shredder</b>. Come on, I'll show you!"
|
||||
"Пойдём" "Let's go"
|
||||
"Сейчас нам нужен шредер — закрой это окно." "Now we need the shredder — close this window."
|
||||
"Ты у шредера! Теперь " "You're at the shredder! Now "
|
||||
"\n(или нажми на сам шредер)" "\n(or click the shredder itself)"
|
||||
"Теперь иди к <font color=\"#7CF0A0\"><b>шредеру</b></font> — это вторая половина станка" "Now go to the <font color=\"#7CF0A0\"><b>shredder</b></font> — it's the other half of the machine"
|
||||
"Открой вкладку «Переработка»." "Open the “Recycle” tab."
|
||||
"Здесь все твои игрушки. Шредер превращает их обратно в <font color=\"#9FE0FF\"><b>осколки</b></font>.\nРедкие игрушки дают больше осколков." "Here are all your ornaments. The shredder turns them back into <font color=\"#9FE0FF\"><b>shards</b></font>.\nRare ornaments give more shards."
|
||||
"Нажми на игрушку, чтобы <b>выбрать</b> её." "Click an ornament to <b>select</b> it."
|
||||
"Справа видно, сколько осколков ты получишь.\n\nНажми <font color=\"#FFCD46\"><b>«Переработать»</b></font>!" "On the right you can see how many shards you'll get.\n\nPress <font color=\"#FFCD46\"><b>“Recycle”</b></font>!"
|
||||
"Шредер перерабатывает игрушку… ♻️" "The shredder is recycling the ornament… ♻️"
|
||||
" осколков</b></font> вернулись на баланс! 💎\n" " shards</b></font> are back in your balance! 💎\n"
|
||||
"Так и устроена игра: создаёшь игрушки, оставляешь лучшие, а лишние перерабатываешь в осколки для новых попыток." "That's the game loop: make ornaments, keep the best ones and recycle the extras into shards for new tries."
|
||||
"Закрой это окно." "Close this window."
|
||||
"Последнее — <font color=\"#FF8A8A\"><b>Магазин</b></font>. Нажми на кнопку магазина." "One last thing — the <font color=\"#FF8A8A\"><b>Shop</b></font>. Press the shop button."
|
||||
"За осколки здесь покупаются <b>украшения для участка</b>: ёлка, гирлянды, тренажёры и другое.\nКупленное ставится на участок кнопкой «Поставить», а игрушки из инвентаря можно повесить на свою ёлку 🎄" "Here you spend shards on <b>decorations for your plot</b>: a tree, garlands, workout gear and more.\nPlace what you buy with the “Place” button, and hang ornaments from your inventory on your tree 🎄"
|
||||
"Закрой магазин — и можно играть!" "Close the shop and start playing!"
|
||||
"<font size=\"32\" color=\"#FFCD46\"><b>Обучение пройдено! ⭐</b></font>\nТеперь ты знаешь главное. Генерируй игрушки, собирай редкие, улучшай станок в <b>Мастерской</b> и украшай свою ёлку.\n\nУдачи и с Новым годом! 🎄" "<font size=\"32\" color=\"#FFCD46\"><b>Tutorial complete! ⭐</b></font>\nNow you know the basics. Generate ornaments, collect rare ones, upgrade your machine in the <b>Workshop</b> and decorate your tree.\n\nGood luck and Happy New Year! 🎄"
|
||||
"Играть!" "Play!"
|
||||
"🛠 Админ" "🛠 Admin"
|
||||
"🛠 Админ-панель" "🛠 Admin Panel"
|
||||
"Игроки на сервере" "Players on server"
|
||||
"сколько" "amount"
|
||||
"Нет ответа сервера" "No response from server"
|
||||
"Впиши количество осколков" "Enter a shard amount"
|
||||
"Выдать" "Give"
|
||||
"Забрать" "Take"
|
||||
"Уровень" "Level"
|
||||
"Впиши уровень от 1 до " "Enter a level from 1 to "
|
||||
"Сброс" "Reset"
|
||||
"Сбросить туториал" "Reset tutorial"
|
||||
"Сбросить статистику" "Reset stats"
|
||||
"Статистика: уровень, осколки, игрушки, улучшения, бустеры, украшения участка, лоты на рынке. Покупки за Robux остаются." "Stats: level, shards, ornaments, upgrades, boosters, plot decorations, market listings. Robux purchases are kept."
|
||||
"Для всех игроков" "For all players"
|
||||
"Сбросить туториал ВСЕМ" "Reset tutorial for EVERYONE"
|
||||
" (ты)" " (you)"
|
||||
" оск. · туториал: " " shards · tutorial: "
|
||||
"пройден" "done"
|
||||
"нет" "no"
|
||||
"данные загружаются…" "loading data…"
|
||||
" · осколков " " · shards "
|
||||
" · игрушек " " · ornaments "
|
||||
"\nТуториал: " "\nTutorial: "
|
||||
"не пройден" "not done"
|
||||
"Данные игрока ещё загружаются" "Player data is still loading"
|
||||
"Закрыть" "Close"
|
||||
"Украшай своими игрушками" "Decorate it with your ornaments"
|
||||
"Опыт за подтягивания, +1 осколок за 10 подряд. До 60 за подход, потом отдых 10 мин" "XP for pull-ups, +1 shard per 10 in a row. Up to 60 per set, then a 10 min rest"
|
||||
"Зажги праздник для всего сервера" "Light up the party for the whole server"
|
||||
"В инвентаре ✓" "In inventory ✓"
|
||||
@@ -0,0 +1,25 @@
|
||||
# Новогодний магазин — графические компоненты
|
||||
|
||||
`shop-landing-reference.png` — исходный рендер страницы с текстами.
|
||||
`components/` — 22 отдельных PNG с альфа-каналом, без надписей.
|
||||
`atlases/` — два исходных листа компонентов.
|
||||
`manifest.json` — имена и размеры PNG.
|
||||
|
||||
Компоненты пересозданы по рендеру, поэтому не являются точной послойной копией исходной картинки. Вокруг элементов сохранены прозрачные поля; у светящихся элементов есть полупрозрачное свечение.
|
||||
|
||||
## Сборка в Roblox Studio
|
||||
|
||||
1. Импортируйте PNG из `components` через Asset Manager и назначьте полученные asset ID свойству Image у ImageLabel / ImageButton.
|
||||
2. Используйте ScreenGui → Frame → ScrollingFrame. Фон страницы задайте тёмно-бирюзовым цветом Frame. Панель — `panel_main`, верхний баннер — `banner_hero`, иллюстрация справа — `hero_tree_gifts`.
|
||||
3. Категории: `tab_green` и `tab_selected`. Баланс: `balance_blue` + `icon_crystal`. Закрытие: `button_close`, знак × добавьте отдельным TextLabel.
|
||||
4. Карточки: `card_green`, `card_cyan`, `card_violet`, `card_orange`. Поверх каждой разместите соответствующий `product_*`, затем TextLabel с названием, описанием и ценой. Внизу — `button_disabled` или `button_gold`.
|
||||
5. У изображений задайте BackgroundTransparency = 1, ScaleType = Fit. Сохраняйте пропорции через UIAspectRatioConstraint. Декоративные рамки не рассчитаны на произвольное растяжение; для них пока не настроен SliceCenter.
|
||||
6. Все надписи, цены и количество недостающих осколков создавайте средствами Roblox. В PNG текста нет. Состояние кнопки и списание валюты реализуются отдельно, проверка покупки — на сервере.
|
||||
|
||||
Исходный каталог: ёлка — 400, турник — 150, скамья со штангой — 250, салют — 200 осколков. Значения не запечены в графику.
|
||||
|
||||
## Дополнительный декор
|
||||
|
||||
`decor_gift`, `decor_holly`, `decor_garland`, `logo_ornament` — отдельные элементы для шапки и краёв страницы.
|
||||
|
||||
Это графический набор для сборки интерфейса, не готовый ScreenGui. ID загруженных изображений в наборе отсутствуют.
|
||||
|
After Width: | Height: | Size: 607 KiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 111 KiB |
|
After Width: | Height: | Size: 95 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 184 KiB |
|
After Width: | Height: | Size: 197 KiB |
|
After Width: | Height: | Size: 185 KiB |
|
After Width: | Height: | Size: 183 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 122 KiB |
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 645 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 541 KiB |
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 526 KiB |
|
After Width: | Height: | Size: 546 KiB |
|
After Width: | Height: | Size: 508 KiB |
|
After Width: | Height: | Size: 504 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 64 KiB |
@@ -0,0 +1,134 @@
|
||||
[
|
||||
{
|
||||
"file": "components/panel_main.png",
|
||||
"width": 313,
|
||||
"name": "panel_main",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/banner_hero.png",
|
||||
"width": 314,
|
||||
"name": "banner_hero",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/tab_green.png",
|
||||
"width": 313,
|
||||
"name": "tab_green",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/balance_blue.png",
|
||||
"width": 314,
|
||||
"name": "balance_blue",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/card_green.png",
|
||||
"width": 313,
|
||||
"name": "card_green",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/card_cyan.png",
|
||||
"width": 314,
|
||||
"name": "card_cyan",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/card_violet.png",
|
||||
"width": 313,
|
||||
"name": "card_violet",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/card_orange.png",
|
||||
"width": 314,
|
||||
"name": "card_orange",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/button_disabled.png",
|
||||
"width": 313,
|
||||
"name": "button_disabled",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/tab_selected.png",
|
||||
"width": 314,
|
||||
"name": "tab_selected",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/button_gold.png",
|
||||
"width": 313,
|
||||
"name": "button_gold",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/button_close.png",
|
||||
"width": 314,
|
||||
"name": "button_close",
|
||||
"height": 313
|
||||
},
|
||||
{
|
||||
"file": "components/icon_crystal.png",
|
||||
"width": 313,
|
||||
"name": "icon_crystal",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/decor_gift.png",
|
||||
"width": 314,
|
||||
"name": "decor_gift",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/decor_holly.png",
|
||||
"width": 313,
|
||||
"name": "decor_holly",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/decor_garland.png",
|
||||
"width": 314,
|
||||
"name": "decor_garland",
|
||||
"height": 314
|
||||
},
|
||||
{
|
||||
"file": "components/product_tree.png",
|
||||
"width": 512,
|
||||
"name": "product_tree",
|
||||
"height": 512
|
||||
},
|
||||
{
|
||||
"file": "components/product_pullup.png",
|
||||
"width": 512,
|
||||
"name": "product_pullup",
|
||||
"height": 512
|
||||
},
|
||||
{
|
||||
"file": "components/product_bench.png",
|
||||
"width": 512,
|
||||
"name": "product_bench",
|
||||
"height": 512
|
||||
},
|
||||
{
|
||||
"file": "components/product_fireworks.png",
|
||||
"width": 512,
|
||||
"name": "product_fireworks",
|
||||
"height": 512
|
||||
},
|
||||
{
|
||||
"file": "components/hero_tree_gifts.png",
|
||||
"width": 512,
|
||||
"name": "hero_tree_gifts",
|
||||
"height": 512
|
||||
},
|
||||
{
|
||||
"file": "components/logo_ornament.png",
|
||||
"width": 512,
|
||||
"name": "logo_ornament",
|
||||
"height": 512
|
||||
}
|
||||
]
|
||||
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 41 KiB |
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"_note": "Image asset IDs of the shop components (group Axion Games Studio 779665335) + opaque bounds in the source PNG (ImageRectOffset/Size for cropping). button_close was uploaded as ui_btn_close - check it visually.",
|
||||
"panel_main": { "id": "rbxassetid://138527541920438", "size": [313, 313], "rect": [18, 42, 278, 234] },
|
||||
"banner_hero": { "id": "rbxassetid://103499479509351", "size": [314, 313], "rect": [10, 74, 294, 166] },
|
||||
"tab_green": { "id": "rbxassetid://93987797017793", "size": [313, 313], "rect": [16, 114, 280, 94] },
|
||||
"tab_selected": { "id": "rbxassetid://138508596098174", "size": [314, 313], "rect": [18, 108, 280, 102] },
|
||||
"balance_blue": { "id": "rbxassetid://111888989174975", "size": [314, 313], "rect": [18, 114, 278, 94] },
|
||||
"icon_crystal": { "id": "rbxassetid://105804941618750", "size": [313, 314], "rect": [54, 56, 206, 210] },
|
||||
"button_close": { "id": "rbxassetid://84624445293238", "size": [314, 313], "rect": [56, 42, 202, 216], "uploaded_as": "ui_btn_close" },
|
||||
"button_gold": { "id": "rbxassetid://131564766133063", "size": [313, 313], "rect": [16, 108, 280, 102] },
|
||||
"button_disabled": { "id": "rbxassetid://89653402754634", "size": [313, 313], "rect": [16, 108, 280, 102] },
|
||||
"card_green": { "id": "rbxassetid://105142745227171", "size": [313, 314], "rect": [16, 22, 280, 272] },
|
||||
"card_cyan": { "id": "rbxassetid://116968687145512", "size": [314, 314], "rect": [18, 22, 280, 272] },
|
||||
"card_violet": { "id": "rbxassetid://103872013133887", "size": [313, 314], "rect": [16, 22, 282, 272] },
|
||||
"card_orange": { "id": "rbxassetid://125846279529125", "size": [314, 314], "rect": [18, 22, 280, 272] },
|
||||
"product_tree": { "id": "rbxassetid://103785076834354", "size": [512, 512] },
|
||||
"product_pullup": { "id": "rbxassetid://103992671287296", "size": [512, 512] },
|
||||
"product_bench": { "id": "rbxassetid://83102967647787", "size": [512, 512] },
|
||||
"product_fireworks": { "id": "rbxassetid://102801089134457", "size": [512, 512] },
|
||||
"hero_tree_gifts": { "id": "rbxassetid://87171044845655", "size": [512, 512] },
|
||||
"logo_ornament": { "id": "rbxassetid://83951342221309", "size": [512, 512] },
|
||||
"decor_gift": { "id": "rbxassetid://85573436333424", "size": [314, 314] },
|
||||
"decor_holly": { "id": "rbxassetid://96646166091621", "size": [313, 314] },
|
||||
"decor_garland": { "id": "rbxassetid://133428323657868", "size": [314, 314] }
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 1.8 MiB |
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"_note": "Group images (Axion Games Studio 779665335). Templates are 1448 x 1086.",
|
||||
"inventory_bg": "rbxassetid://133163187725665",
|
||||
"market_bg": "rbxassetid://104365529018018",
|
||||
"premium_shop_bg": "rbxassetid://133734122560497",
|
||||
"trade_bg": "rbxassetid://113021404006859",
|
||||
"workshop_upgrades_bg": "rbxassetid://96976290741467",
|
||||
"workshop_boosters_bg": "rbxassetid://95007095222440",
|
||||
"pill_purple": "rbxassetid://117350842514434",
|
||||
"generator_bg": "rbxassetid://85887804948940",
|
||||
"shredder_bg": "rbxassetid://110267441206876",
|
||||
"_note2": "generator_bg / shredder_bg are 1536 x 1024"
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 1.7 MiB |