Centralize Hunter interface strings and verify mobile HUD

This commit is contained in:
Leshyi committed 2026-11-30 01:35:03 +05:00
1 parent 16a359d4af
commit c88c3501b3
21 files changed
+752 -336

No files matched your search

+60 -58
View File
@@ -1,4 +1,6 @@
--!strict
local Text = require(game:GetService("ReplicatedStorage"):WaitForChild("Hunter"):WaitForChild("Strings") :: ModuleScript).interface.HostedArenaHud
local GuiService = game:GetService("GuiService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
@@ -87,18 +89,18 @@ local function makeList(parent: Instance, name: string, position: UDim2, size: U
return scroll
end
local launch = button(gui, "OpenArenaCreator", if hosted then "‹ В ОБЩЕЕ ЛОББИ" else "+ СОЗДАТЬ АРЕНУ",
local launch = button(gui, "OpenArenaCreator", if hosted then Text.vObscheeLobbi else Text.sozdatArenu,
UDim2.new(1, -24, 1, -42), UDim2.fromOffset(264, 52), violet, true)
launch.AnchorPoint = Vector2.new(1, 1)
launch.Modal = true
local browser = UI.plate(gui, "PublicArenas", UDim2.new(1, -24, 1, -104), UDim2.fromOffset(264, 432), UI.Blue, dark)
browser.AnchorPoint = Vector2.new(1, 1)
local browserTitle = leftLabel(browser, "Heading", if hosted then "АРЕНА СЕССИИ" else "ПУБЛИЧНЫЕ АРЕНЫ", 13, 7, 173, 34, 16, UI.Ink)
local browserTitle = leftLabel(browser, "Heading", if hosted then Text.arenaSessii else Text.publichnyeAreny, 13, 7, 173, 34, 16, UI.Ink)
browserTitle.FontFace = UI.Display
local ownerLabel = leftLabel(browser, "Owner", "", 13, 38, 237, 21, 12, UI.Muted)
ownerLabel.Visible = hosted
local refreshDirectory = button(browser, "Refresh", "ОБНОВИТЬ", UDim2.fromOffset(191, 9), UDim2.fromOffset(61, 31), UI.Blue)
local refreshDirectory = button(browser, "Refresh", Text.obnovit, UDim2.fromOffset(191, 9), UDim2.fromOffset(61, 31), UI.Blue)
refreshDirectory.TextSize = 10
refreshDirectory.Visible = not hosted and not localPreview
local listTop = if hosted then 64 else 47
@@ -106,7 +108,7 @@ local cardHeight, moreHeight = 184, 37
local browserChrome = listTop + 10
local contentHeight = cardHeight
local arenaList = makeList(browser, "List", UDim2.fromOffset(10, listTop), UDim2.new(0, 244, 1, -browserChrome), UI.Blue)
local moreArenas = button(arenaList, "More", "ПОКАЗАТЬ ЕЩЁ", UDim2.new(), UDim2.new(1, -13, 0, moreHeight), UI.Blue)
local moreArenas = button(arenaList, "More", Text.pokazatEschyo, UDim2.new(), UDim2.new(1, -13, 0, moreHeight), UI.Blue)
moreArenas.Visible = false
local shade = UI.frame("CreatorShade", gui, UDim2.fromScale(0, 0), UDim2.fromScale(1, 1), Color3.fromRGB(5, 10, 20))
@@ -131,14 +133,14 @@ end
shade:GetPropertyChangedSignal("AbsoluteSize"):Connect(fit)
fit()
local header = leftLabel(panel, "Title", "СОЗДАНИЕ АРЕНЫ", 26, 15, 520, 45, 31, UI.Ink)
local header = leftLabel(panel, "Title", Text.sozdanieAreny, 26, 15, 520, 45, 31, UI.Ink)
header.FontFace = UI.Display
local close = button(panel, "Close", "×", UDim2.fromOffset(568, 19), UDim2.fromOffset(48, 37), UI.Orange)
close.TextSize, close.Modal = 23, true
local public = button(panel, "Public", "ПУБЛИЧНАЯ", UDim2.fromOffset(26, 74), UDim2.fromOffset(284, 44), UI.Blue)
local private = button(panel, "Private", "ПРИВАТНАЯ", UDim2.fromOffset(322, 74), UDim2.fromOffset(294, 44), violet)
local public = button(panel, "Public", Text.publichnaya, UDim2.fromOffset(26, 74), UDim2.fromOffset(284, 44), UI.Blue)
local private = button(panel, "Private", Text.privatnaya, UDim2.fromOffset(322, 74), UDim2.fromOffset(294, 44), violet)
local explanation = leftLabel(panel, "Description", "", 26, 129, 590, 28, 14, UI.Muted)
local modesHeading = leftLabel(panel, "ModesHeading", "СТАРТОВЫЙ РЕЖИМ", 26, 154, 590, 25, 15, UI.Ink)
local modesHeading = leftLabel(panel, "ModesHeading", Text.startovyyRezhim, 26, 154, 590, 25, 15, UI.Ink)
modesHeading.FontFace = UI.Display
local modeChoices = UI.frame("InitialModeChoices", panel, UDim2.fromOffset(26, 184), UDim2.fromOffset(590, 174), dark)
modeChoices.BackgroundTransparency = 1
@@ -153,7 +155,7 @@ for index, rule in Rules.All do
modeCards[rule.id] = card
end
local modeDescription = leftLabel(panel, "ModeDescription", "", 26, 361, 590, 24, 13, UI.Muted)
local changeLabel = leftLabel(panel, "ModeChangeHeading", "Разрешить смену режимов", 26, 391, 375, 22, 16, UI.Ink)
local changeLabel = leftLabel(panel, "ModeChangeHeading", Text.razreshitSmenuRezhimov, 26, 391, 375, 22, 16, UI.Ink)
changeLabel.FontFace = UI.Display
local changeHint = leftLabel(panel, "ModeChangeHint", "", 26, 413, 375, 20, 12, UI.Muted)
local changeToggle = button(panel, "AllowModeChange", "", UDim2.fromOffset(430, 391), UDim2.fromOffset(186, 41), UI.Mint, true)
@@ -171,7 +173,7 @@ detailsTitle.FontFace = UI.Display
local detailsClose = button(detailsPanel, "Close", "×", UDim2.fromOffset(568, 19), UDim2.fromOffset(48, 37), UI.Orange)
detailsClose.TextSize, detailsClose.Modal = 23, true
local detailsStatus = leftLabel(detailsPanel, "Status", "", 26, 357, 590, 32, 14, UI.Muted)
local connect = button(detailsPanel, "Connect", "ПОДКЛЮЧИТЬСЯ ›", UDim2.fromOffset(26, 397), UDim2.fromOffset(590, 43), UI.Blue, true)
local connect = button(detailsPanel, "Connect", Text.podklyuchitSya, UDim2.fromOffset(26, 397), UDim2.fromOffset(590, 43), UI.Blue, true)
local function teamColumn(name: string, text: string, x: number, accent: Color3)
local body = UI.plate(detailsPanel, name, UDim2.fromOffset(x + 144.5, 212), UDim2.fromOffset(289, 274), accent, dark:Lerp(accent, .08))
@@ -191,7 +193,7 @@ local function teamColumn(name: string, text: string, x: number, accent: Color3)
heading.FontFace = UI.Display
local count = UI.label(body, "Count", "", UDim2.fromOffset(188, 8), UDim2.fromOffset(86, 31), 14, UI.Ink)
local scroll = makeList(body, "Players", UDim2.fromOffset(9, 47), UDim2.fromOffset(271, 177), accent)
local marker = UI.label(body, "ChoiceLabel", "ВЫБРАТЬ", UDim2.fromOffset(9, 232), UDim2.fromOffset(271, 32), 13, accent)
local marker = UI.label(body, "ChoiceLabel", Text.vybrat, UDim2.fromOffset(9, 232), UDim2.fromOffset(271, 32), 13, accent)
marker.FontFace = UI.Display
local dimmer = UI.frame("SelectionDimmer", body, UDim2.fromScale(0, 0), UDim2.fromScale(1, 1), dark)
dimmer.BackgroundTransparency, dimmer.ZIndex = 1, 3
@@ -204,8 +206,8 @@ local function teamColumn(name: string, text: string, x: number, accent: Color3)
zoom = zoom, glow = glow, shine = shine, border = border, dimmer = dimmer, hit = hit, marker = marker,
hovered = false, focused = false, pressed = false, feedbackTween = nil :: Tween?}
end
local blueTeam = teamColumn("Blue", "СИНИЕ", 26, UI.Blue)
local orangeTeam = teamColumn("Orange", "ОРАНЖЕВЫЕ", 327, UI.Orange)
local blueTeam = teamColumn("Blue", Text.sinie, 26, UI.Blue)
local orangeTeam = teamColumn("Orange", Text.oranzhevye, 327, UI.Orange)
type TeamColumn = typeof(blueTeam)
local teamColumns: {[Side]: TeamColumn} = {Blue = blueTeam, Orange = orangeTeam}
shade:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
@@ -220,15 +222,15 @@ noticeText.TextWrapped = true
local invitation = UI.plate(gui, "ArenaInvitation", UDim2.fromOffset(24, 163), UDim2.fromOffset(354, 166), violet, dark)
invitation.Visible = false
UI.contour(invitation, violet)
local inviteTitle = leftLabel(invitation, "Title", "ПРИГЛАШЕНИЕ НА АРЕНУ", 14, 7, 282, 27, 17, UI.Ink)
local inviteTitle = leftLabel(invitation, "Title", Text.priglashenieNaArenu, 14, 7, 282, 27, 17, UI.Ink)
inviteTitle.FontFace = UI.Display
local inviteTimer = UI.label(invitation, "Timer", "", UDim2.fromOffset(297, 7), UDim2.fromOffset(44, 27), 14, violet)
local portrait = UI.portrait(invitation, UDim2.fromOffset(15, 43), 51, violet)
portrait.Name = "CreatorPortrait"
local hostLabel = leftLabel(invitation, "CreatorName", "", 78, 42, 261, 24, 17, UI.Ink)
local hostAccount = leftLabel(invitation, "CreatorAccount", "", 78, 67, 261, 22, 13, UI.Muted)
local accept = button(invitation, "Accept", "ПРИНЯТЬ [Y]", UDim2.fromOffset(14, 109), UDim2.fromOffset(156, 41), UI.Mint, true)
local decline = button(invitation, "Decline", "ОТКЛОНИТЬ [U]", UDim2.fromOffset(181, 109), UDim2.fromOffset(159, 41), violet)
local accept = button(invitation, "Accept", Text.prinyatY, UDim2.fromOffset(14, 109), UDim2.fromOffset(156, 41), UI.Mint, true)
local decline = button(invitation, "Decline", Text.otklonitU, UDim2.fromOffset(181, 109), UDim2.fromOffset(159, 41), violet)
local isPrivate = false
local roundOptions: Hosting.RoundOptions = {initialMode = Rules.Default, allowModeChange = true}
@@ -339,7 +341,7 @@ local function refreshSelection()
changeToggle.Interactable = not busy
local count = 0
for _ in selected do count += 1 end
selectionCount.Text = string.format("ВЫБРАНО %d / %d", count, Hosting.MaxPlayers - 1)
selectionCount.Text = string.format(Text.vybranoDD, count, Hosting.MaxPlayers - 1)
for id, row in rows do
local active = selected[id] == true
row.button.BackgroundColor3 = dark:Lerp(violet, if active then .45 else .15)
@@ -374,9 +376,9 @@ local function request(actionName: string, data: any?, extra: (Side | Hosting.Ro
detailsClose.Interactable = true
resetTeamReveal()
if shade.Visible then
local message = "Ответ задержался. Попробуйте снова."
local message = Text.otvetZaderzhalsyaPoprobuyteSnova
if arena then joinNote, detailsStatus.Text = message, message else status.Text = message end
else showNotice("Ответ задержался. Попробуйте снова.") end
else showNotice(Text.otvetZaderzhalsyaPoprobuyteSnova) end
end)
end
@@ -424,16 +426,16 @@ local function updatePanel()
private.BackgroundColor3 = dark:Lerp(violet, if isPrivate then .58 else .17)
selectionCount.Visible, list.Visible = showPlayers, showPlayers
modeDescription.Text = Rules.get(roundOptions.initialMode).detail
changeToggle.Text = if roundOptions.allowModeChange then "ВКЛЮЧЕНО" else "ВЫКЛЮЧЕНО"
changeToggle.Text = if roundOptions.allowModeChange then Text.vklyucheno else Text.vyklyucheno
changeToggle.BackgroundColor3 = if roundOptions.allowModeChange then UI.Mint else dark:Lerp(UI.Muted, .23)
changeToggle.TextColor3 = if roundOptions.allowModeChange then dark else UI.Ink
changeHint.Text = if roundOptions.allowModeChange then "Голосование после раунда" else "Один режим на все раунды"
explanation.Text = if showPlayers then "Выберите игроков с этого сервера и отправьте приглашения."
elseif isPrivate then "На сервере пока нет других игроков."
elseif localPreview then "В локальном тесте публичная арена доступна игрокам этого сеанса Studio."
else "Любой игрок сможет подключиться через список публичных арен."
action.Text = if party then "ОТМЕНИТЬ ПРИГЛАШЕНИЯ"
elseif isPrivate then "ОТПРАВИТЬ ПРИГЛАШЕНИЯ" else "СОЗДАТЬ АРЕНУ"
changeHint.Text = if roundOptions.allowModeChange then Text.golosovaniePosleRaunda else Text.odinRezhimNaVse
explanation.Text = if showPlayers then Text.vyberiteIgrokovSEtogo
elseif isPrivate then Text.naServerePokaNet
elseif localPreview then Text.vLokalNomTeste
else Text.lyuboyIgrokSmozhetPodklyuchit
action.Text = if party then Text.otmenitPriglasheniya
elseif isPrivate then Text.otpravitPriglasheniya else Text.sozdatArenu2
refreshSelection()
end
@@ -522,7 +524,7 @@ local function renderTeam(column: TeamColumn, members: {Hosting.Member})
column.count.Text = string.format("%d / %d", #members, Hosting.MaxPlayers // 2)
clearList(column.scroll)
if #members == 0 then
leftLabel(column.scroll, "Empty", "Пока никого", 8, 0, 249, 34, 14, UI.Muted)
leftLabel(column.scroll, "Empty", Text.pokaNikogo, 8, 0, 249, 34, 14, UI.Muted)
return
end
for index, member in members do
@@ -553,28 +555,28 @@ local function redrawDetails(now: number)
local teamIssue = if side == "Blue" then blueIssue else orangeIssue
team.hit.Interactable = ready and teamIssue == nil
if not team.hit.Interactable then team.pressed = false end
team.marker.Text = if confirmedSide == side then "ВАША КОМАНДА"
elseif teamIssue == "Full" then "НЕТ МЕСТ" elseif teamIssue == "Balance" then "БАЛАНС КОМАНД"
elseif preferredSide == side then "ВЫБРАНО" else "ВЫБРАТЬ"
team.marker.Text = if confirmedSide == side then Text.vashaKomanda
elseif teamIssue == "Full" then Text.netMest elseif teamIssue == "Balance" then Text.balansKomand
elseif preferredSide == side then Text.vybrano else Text.vybrat
team.marker.TextColor3 = if teamIssue then UI.Muted else team.accent
showTeamFeedback(team, side)
end
connect.Interactable = ready and preferredSide ~= nil and issue == nil
detailsClose.Interactable = not sending
connect.Text = if confirmedSide then "ВХОД НА АРЕНУ…"
elseif sending and localMode then "ПРОВЕРЯЕМ КОМАНДУ…"
elseif preferredSide == "Blue" then "ПОДКЛЮЧИТЬСЯ ЗА СИНИХ ›"
elseif preferredSide == "Orange" then "ПОДКЛЮЧИТЬСЯ ЗА ОРАНЖЕВЫХ ›" else "ПОДКЛЮЧИТЬСЯ ›"
connect.Text = if confirmedSide then Text.vkhodNaArenu
elseif sending and localMode then Text.proveryaemKomandu
elseif preferredSide == "Blue" then Text.podklyuchitSyaZaSinikh
elseif preferredSide == "Orange" then Text.podklyuchitSyaZaOranzhevykh else Text.podklyuchitSya
local accent = if preferredSide == "Orange" then UI.Orange else UI.Blue
connect.BackgroundColor3 = if connect.Interactable then accent else dark:Lerp(UI.Muted, .18)
connect.TextColor3 = if connect.Interactable then dark else UI.Muted
detailsStatus.Text = joinNote or (if confirmedSide == "Blue" then "ВЫ В КОМАНДЕ СИНИХ"
elseif confirmedSide == "Orange" then "ВЫ В КОМАНДЕ ОРАНЖЕВЫХ"
elseif sending then "Подключаемся…"
elseif not data then "Загружаем составы…" elseif full then "Арена заполнена."
elseif not isOpen then "Подключение откроется с началом раунда."
elseif preferredSide and issue then "Выбранная команда пока недоступна."
elseif not preferredSide then "Выберите команду." else "")
detailsStatus.Text = joinNote or (if confirmedSide == "Blue" then Text.vyVKomandeSinikh
elseif confirmedSide == "Orange" then Text.vyVKomandeOranzhevykh
elseif sending then Text.podklyuchaemsya
elseif not data then Text.zagruzhaemSostavy elseif full then Text.arenaZapolnena
elseif not isOpen then Text.podklyuchenieOtkroetsyaSNachalom
elseif preferredSide and issue then Text.vybrannayaKomandaPokaNedostupna
elseif not preferredSide then Text.vyberiteKomandu else "")
end
for side, team in teamColumns do
@@ -648,7 +650,7 @@ local function localChoice(ownerOverride: Player?): Choice
local mode = Modes.Procedural
local ownerId = remote:GetAttribute("LocalPublicOwnerUserId")
local owner = ownerOverride or (if typeof(ownerId) == "number" then Players:GetPlayerByUserId(ownerId) else nil)
return {id = mode, name = if owner then owner.DisplayName else "Динамическая арена",
return {id = mode, name = if owner then owner.DisplayName else Text.dinamicheskayaArena,
mode = mode, hostId = if owner then owner.UserId else nil, players = localTeams(mode).players,
ruleset = Rules.get(Modes.state(roundState, mode):GetAttribute("Ruleset")).id}
end
@@ -729,9 +731,9 @@ local function showInvite()
local invite = currentInvite
invitation.Visible = invite ~= nil and not transferring
if not invite then return end
inviteTitle.Text = if accepted then "ПРИГЛАШЕНИЕ ПРИНЯТО" else "ПРИГЛАШЕНИЕ НА АРЕНУ"
inviteTitle.Text = if accepted then Text.priglasheniePrinyato else Text.priglashenieNaArenu
accept.Visible = not accepted
decline.Text = if accepted then "ОТМЕНИТЬ [U]" else "ОТКЛОНИТЬ [U]"
decline.Text = if accepted then Text.otmenitU else Text.otklonitU
end
local function respond(agree: boolean)
@@ -751,7 +753,7 @@ local messageConnection = remote.OnClientEvent:Connect(function(event: string, d
if event == "Invite" then
local invite: Invite = data
currentInvite, accepted = invite, false
hostLabel.Text, hostAccount.Text = invite.hostName, "Создатель · @" .. invite.hostUsername
hostLabel.Text, hostAccount.Text = invite.hostName, Text.sozdatel .. invite.hostUsername
showAvatar(portrait, invite.hostId, invite.hostName)
showInvite()
elseif event == "Accepted" and currentInvite and currentInvite.id == data then
@@ -781,14 +783,14 @@ local messageConnection = remote.OnClientEvent:Connect(function(event: string, d
renderDirectory()
elseif event == "ListUnavailable" then
listingPending = false
if browser.Visible then showNotice("Список публичных арен временно недоступен.") end
if browser.Visible then showNotice(Text.spisokPublichnykhArenVremenno) end
elseif event == "PublicDetails" and arena and data.id == arena.id then
if not arenaDetails then joinNote = nil end
arenaDetails = data
redrawDetails(workspace:GetServerTimeNow())
elseif event == "DetailsUnavailable" and arena and data == arena.id then
arenaDetails = nil
joinNote = "Арена закрылась или составы временно недоступны."
joinNote = Text.arenaZakrylasIliSostavy
redrawDetails(workspace:GetServerTimeNow())
elseif event == "LocalPublicReady" then
sending = false
@@ -812,11 +814,11 @@ local messageConnection = remote.OnClientEvent:Connect(function(event: string, d
end)
local joinErrors: {[string]: string} = {
Full = "В выбранной команде нет мест.",
Balance = "Составы изменились. Подключитесь ещё раз.",
BetweenRounds = "Дождитесь начала следующего раунда.",
Spawning = "Персонаж ещё загружается. Попробуйте снова.",
AwaitingAdmission = "Проверяем доступ к арене. Попробуйте через секунду.",
Full = Text.vVybrannoyKomandeNet,
Balance = Text.sostavyIzmenilisPodklyuchitesEschyo,
BetweenRounds = Text.dozhditesNachalaSleduyuschegoRaunda,
Spawning = Text.personazhEschyoZagruzhaetsyaPoprobuyte,
AwaitingAdmission = Text.proveryaemDostupKArene,
}
local joinConnection = join.OnClientEvent:Connect(function(result: string, side: Side?)
if not sending or not arena or not arena.mode then return end
@@ -830,14 +832,14 @@ local joinConnection = join.OnClientEvent:Connect(function(result: string, side:
setOpen(false)
else
resetTeamReveal()
joinNote = joinErrors[result] or "Не удалось подключиться."
joinNote = joinErrors[result] or Text.neUdalosPodklyuchitSya
redrawDetails(workspace:GetServerTimeNow())
end
end)
local launcherConnection = roundHud:GetAttributeChangedSignal("LobbyAvailable"):Connect(refreshLaunch)
local function refreshOwner()
local name = remote:GetAttribute("OwnerName")
ownerLabel.Text = if typeof(name) == "string" then "Владелец · " .. name else ""
ownerLabel.Text = if typeof(name) == "string" then Text.vladelets .. name else ""
end
local ownerConnection = remote:GetAttributeChangedSignal("OwnerName"):Connect(refreshOwner)
local votingConnection = pg:GetAttributeChangedSignal("HunterVoting"):Connect(function()
@@ -850,13 +852,13 @@ local teamConnection = player:GetAttributeChangedSignal("ArenaTeam"):Connect(fun
end
end)
local function showFull()
if player:GetAttribute("HostedArenaFull") then showNotice("Арена заполнена. Можно вернуться в общее лобби.", true) end
if player:GetAttribute("HostedArenaFull") then showNotice(Text.arenaZapolnenaMozhnoVernut, true) end
end
local fullConnection = player:GetAttributeChangedSignal("HostedArenaFull"):Connect(showFull)
showFull()
local function showTeamNotice()
local issue = player:GetAttribute("HostedArenaTeamNotice")
if typeof(issue) == "string" then showNotice(joinErrors[issue] or "Выбранная команда недоступна.") end
if typeof(issue) == "string" then showNotice(joinErrors[issue] or Text.vybrannayaKomandaNedostupna) end
end
local arrivalTeamConnection = player:GetAttributeChangedSignal("HostedArenaTeamNotice"):Connect(showTeamNotice)
showTeamNotice()
@@ -900,7 +902,7 @@ local clock = RunService.Heartbeat:Connect(function()
local pending = party
if pending then
local left = math.max(0, math.ceil(pending.expires - now))
status.Text = string.format("Приняли %d · Ждём %d · %02d с", pending.accepted, pending.pending, left)
status.Text = string.format(Text.prinyaliDZhdyomD, pending.accepted, pending.pending, left)
if not shade.Visible then showNotice(status.Text, true) end
end
end)