Диковинки: вкладка коллекции и плашка поимки

This commit is contained in:
heyshawtyy committed 2026-11-14 15:44:25 +05:00
1 parent a78bdc46fe
commit 087e9b0d9b
2 files changed
+108

No files matched your search

@@ -2337,6 +2337,21 @@ if RunService:IsStudio() then
end end
elseif op == "action" then elseif op == "action" then
onRemote(player, a, b, c) onRemote(player, a, b, c)
elseif op == "curio" then
-- поменять поле диковинки (chance, cond) на время проверки: Config.CurioById[a][b] = c
local def = Config.CurioById[a]
if def then
def[b] = c
end
return def ~= nil
elseif op == "roll" then
-- ручная поимка в мире a (perfect = b): rollFish → grantFish, как настоящая; возвращает id
local data = profiles[player]
local fish = data and rollFish(player, data, a, 1, { manual = true, perfect = b, bait = c })
if fish then
grantFish(player, data, fish, { perfect = b, misses = 0 })
return fish.id, fish.curio
end
elseif op == "xp" then elseif op == "xp" then
-- опыт как за поимку (проверка наград за уровень) -- опыт как за поимку (проверка наград за уровень)
local data = profiles[player] local data = profiles[player]
@@ -455,6 +455,27 @@ function H.placeToasts(cardShown)
TweenService:Create(toasts, TweenInfo.new(0.3, Enum.EasingStyle.Quad), { Position = UDim2.new(0.5, 0, 0, y) }):Play() TweenService:Create(toasts, TweenInfo.new(0.3, Enum.EasingStyle.Quad), { Position = UDim2.new(0.5, 0, 0, y) }):Play()
end end
-- диковинка: золотая лента «✨ Диковинка!» над карточкой улова и пульсирующее сияние рамки
function H.curioFx(on)
if not H.curioBadge then
local b = new("Frame", { Name = "CurioBadge", Size = UDim2.fromOffset(0, 34), AutomaticSize = Enum.AutomaticSize.X, AnchorPoint = Vector2.new(0.5, 0.5),
Position = UDim2.new(0.5, 0, 0, -4), BackgroundColor3 = WHITE, ZIndex = 30, Visible = false, Parent = catchCard },
{ corner(6), gradient(C.goldBright, Color3.fromRGB(196, 128, 48), 90), stroke(C.ink, 2, 0),
new("UIPadding", { PaddingLeft = UDim.new(0, 16), PaddingRight = UDim.new(0, 16) }) })
text({ Size = UDim2.fromScale(0, 1), AutomaticSize = Enum.AutomaticSize.X, Font = TITLE, TextSize = 20, TextXAlignment = Enum.TextXAlignment.Center,
TextColor3 = C.ink, Text = "✨ Диковинка!", ZIndex = 31, Parent = b })
local glow = new("Frame", { Name = "CurioGlow", Size = UDim2.new(1, 24, 1, 24), Position = UDim2.fromOffset(-12, -12), BackgroundColor3 = C.goldBright,
BackgroundTransparency = 0.6, ZIndex = 0, Visible = false, Parent = catchCard }, { corner(18) })
H.curioBadge, H.curioGlow = b, glow
TweenService:Create(glow, TweenInfo.new(0.8, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut, -1, true), { BackgroundTransparency = 0.9 }):Play()
end
H.curioBadge.Visible, H.curioGlow.Visible = on == true, on == true
if on then
catchStroke.Color = C.goldBright
popIn(H.curioBadge, 0.3)
end
end
local function showCatch(fish, extra) local function showCatch(fish, extra)
catchToken += 1 catchToken += 1
local my = catchToken local my = catchToken
@@ -466,6 +487,7 @@ local function showCatch(fish, extra)
catchGrad.Color = ColorSequence.new(r.color:Lerp(C.bg, 0.55), C.bg) catchGrad.Color = ColorSequence.new(r.color:Lerp(C.bg, 0.55), C.bg)
catchHeader.Text = extra and extra.new and "🆕 НОВЫЙ ВИД! В коллекцию" or (extra and extra.record and "🏆 НОВЫЙ РЕКОРД!" or "ПОЙМАНА РЫБА") catchHeader.Text = extra and extra.new and "🆕 НОВЫЙ ВИД! В коллекцию" or (extra and extra.record and "🏆 НОВЫЙ РЕКОРД!" or "ПОЙМАНА РЫБА")
catchHeader.TextColor3 = (extra and (extra.new or extra.record)) and C.gold or C.muted catchHeader.TextColor3 = (extra and (extra.new or extra.record)) and C.gold or C.muted
H.curioFx(fish.curio)
catchName.Text = fish.name catchName.Text = fish.name
catchName.TextColor3 = r.color catchName.TextColor3 = r.color
catchInfo.Text = ("<font color=\"%s\">%s</font>%s · %.2f кг"):format( catchInfo.Text = ("<font color=\"%s\">%s</font>%s · %.2f кг"):format(
@@ -1205,11 +1227,74 @@ local function rewardButton(parent, state, label, onClick)
}, state == "ready" and onClick or nil) }, state == "ready" and onClick or nil)
end end
-- «✨ Диковинки»: пойманные — превью и рекорд, обычные непойманные — силуэт и загадка на пергаменте,
-- секретные непойманные — «???». Мастерство миров их не учитывает
function H.renderCurios()
local total, got = #Config.Curios, 0
for _, c in ipairs(Config.Curios) do
if discovered[c.id] then
got += 1
end
end
local head = new("Frame", { Size = UDim2.new(1, -4, 0, 64), BackgroundColor3 = WHITE, LayoutOrder = 0, Parent = dexList },
{ corner(10), stroke(C.gold, 2, 0.1), gradient(Color3.fromRGB(96, 70, 30), Color3.fromRGB(52, 36, 22), 90) })
text({ Size = UDim2.new(1, -24, 0, 26), Position = UDim2.fromOffset(14, 6), Font = TITLE, TextSize = 20, RichText = true,
Text = ("✨ Диковинки — поймано <font color=\"#FFD45A\">%d / %d</font>"):format(got, total), Parent = head })
local _, setBar = Theme.bar(head, { Size = UDim2.new(1, -28, 0, 12), Position = UDim2.fromOffset(14, 40) }, C.goldBright)
setBar(got / math.max(1, total))
local ITALIC = Font.new("rbxasset://fonts/families/Merriweather.json", Enum.FontWeight.Regular, Enum.FontStyle.Italic)
for wi, w in ipairs(Config.Worlds) do
local list = {}
for _, c in ipairs(Config.Curios) do
if c.world == w.id then
table.insert(list, c)
end
end
if #list > 0 then
Theme.section(dexList, wi * 2 - 1, w.icon .. " " .. w.name, "fish")
local grid = new("Frame", { Size = UDim2.new(1, -4, 0, 0), AutomaticSize = Enum.AutomaticSize.Y, BackgroundTransparency = 1, LayoutOrder = wi * 2, Parent = dexList },
{ new("UIGridLayout", { CellSize = UDim2.fromOffset(150, 190), CellPadding = UDim2.fromOffset(8, 8), SortOrder = Enum.SortOrder.LayoutOrder }) })
for i, c in ipairs(list) do
local rec = discovered[c.id]
local r = Config.Rarities[c.rarity] or Config.Rarities.Common
if rec then
local card = fishCard(grid, i, r.color)
viewport(new("Frame", { Size = UDim2.new(1, -12, 0, 90), Position = UDim2.fromOffset(6, 6), BackgroundTransparency = 1, Parent = card }),
Models.buildFish(c.id, nil, 1, true), VIEW.fish, 0.72)
text({ Size = UDim2.new(1, -10, 0, 22), Position = UDim2.fromOffset(5, 98), Font = TITLE, TextScaled = true, TextXAlignment = Enum.TextXAlignment.Center,
TextColor3 = r.color, Text = c.name, TextStrokeColor3 = C.ink, TextStrokeTransparency = 0.3, Parent = card })
text({ Size = UDim2.new(1, -10, 0, 50), Position = UDim2.fromOffset(5, 124), Font = BODY2, TextSize = 13, TextXAlignment = Enum.TextXAlignment.Center,
TextColor3 = C.muted, TextWrapped = true, Text = ("Поймано: %d\nРекорд: %.2f кг"):format(rec.count or 1, rec.best or 0), Parent = card })
elseif c.secret then
local card = new("Frame", { BackgroundColor3 = WHITE, LayoutOrder = i, Parent = grid },
{ corner(10), stroke(C.goldDark, 2, 0), gradient(Color3.fromRGB(40, 30, 50), Color3.fromRGB(16, 12, 20), 90) })
text({ Size = UDim2.new(1, 0, 0, 80), Position = UDim2.fromOffset(0, 40), Font = TITLE, TextSize = 52, TextXAlignment = Enum.TextXAlignment.Center,
TextColor3 = C.goldDark, Text = "???", Parent = card })
text({ Size = UDim2.new(1, 0, 0, 24), Position = UDim2.fromOffset(0, 128), Font = TITLE, TextSize = 17, TextXAlignment = Enum.TextXAlignment.Center,
TextColor3 = C.muted, Text = "Секрет", Parent = card })
else
local card = new("Frame", { BackgroundColor3 = Color3.fromRGB(226, 208, 168), LayoutOrder = i, Parent = grid }, { corner(10), stroke(C.goldDark, 2, 0) })
Theme.skin(card, "parchment", { keepStroke = true })
viewport(new("Frame", { Size = UDim2.new(1, -16, 0, 78), Position = UDim2.fromOffset(8, 8), BackgroundTransparency = 1, Parent = card }),
silhouette(Models.buildFish(c.id, nil, 1, true)), VIEW.fish, 0.72)
local h = text({ Size = UDim2.new(1, -18, 0, 96), Position = UDim2.fromOffset(9, 88), TextSize = 13, TextWrapped = true,
TextXAlignment = Enum.TextXAlignment.Center, TextYAlignment = Enum.TextYAlignment.Top, TextColor3 = C.ink, Text = "«" .. (c.hint or "?") .. "»", Parent = card })
h.FontFace = ITALIC
end
end
end
end
end
local function renderDex() local function renderDex()
clear(dexList) clear(dexList)
for id, b in pairs(dexTabButtons) do for id, b in pairs(dexTabButtons) do
b.BackgroundColor3 = (id == dexWorld) and C.purple or C.panel2 b.BackgroundColor3 = (id == dexWorld) and C.purple or C.panel2
end end
if dexWorld == "Curios" then
H.renderCurios()
return
end
local world = Config.Find(Config.Worlds, dexWorld) local world = Config.Find(Config.Worlds, dexWorld)
local all = Config.Zones[dexWorld].fish local all = Config.Zones[dexWorld].fish
local found = 0 local found = 0
@@ -1302,6 +1387,10 @@ for i, w in ipairs(Config.Worlds) do
end) end)
end end
end end
dexTabButtons.Curios = btn({ Size = UDim2.new(0, 170, 1, 0), Text = "✨ Диковинки", TextSize = 15, BackgroundColor3 = C.panel2, LayoutOrder = 99, Parent = dexTabs }, function()
dexWorld = "Curios"
renderDex()
end)
-- только в Studio, для снимков окон: атрибут игрока DevFakeBag = N подставляет N рыб в сумку -- только в Studio, для снимков окон: атрибут игрока DevFakeBag = N подставляет N рыб в сумку
-- и отмечает их пойманными в коллекции (на сервер ничего не уходит, в игре не работает) -- и отмечает их пойманными в коллекции (на сервер ничего не уходит, в игре не работает)
@@ -1722,6 +1811,10 @@ sideButton(6, "⚙", "Звук", nil, Color3.fromRGB(150, 120, 80), function()
end) end)
Theme.kit.bagWin = bagWin -- кнопка «Рюкзак» внизу справа (HudBar.client.lua) Theme.kit.bagWin = bagWin -- кнопка «Рюкзак» внизу справа (HudBar.client.lua)
Theme.kit.windows = { bag = bagWin, worlds = worldsWin, quests = questWin, donate = robuxWin, sound = settingsWin, shop = shopWin } Theme.kit.windows = { bag = bagWin, worlds = worldsWin, quests = questWin, donate = robuxWin, sound = settingsWin, shop = shopWin }
Theme.kit.windows.curios = { open = function() -- для снимков в Studio: DevOpen = "curios"
dexWorld = "Curios"
bagWin.open("dex")
end }
-- только в Studio, для снимков: атрибут DevOpen = "окно" или "окно:вкладка" открывает окно (guild добавляет GuildClient) -- только в Studio, для снимков: атрибут DevOpen = "окно" или "окно:вкладка" открывает окно (guild добавляет GuildClient)
player:GetAttributeChangedSignal("DevOpen"):Connect(function() player:GetAttributeChangedSignal("DevOpen"):Connect(function()
local v = RunService:IsStudio() and player:GetAttribute("DevOpen") local v = RunService:IsStudio() and player:GetAttribute("DevOpen")