Polish One Life mini-rounds and spectating

This commit is contained in:
Leshyi committed 2026-11-30 00:03:48 +05:00
1 parent 0c949fadf0
commit ebe8db5359
12 files changed
+175 -17

No files matched your search

+21 -5
View File
@@ -161,6 +161,8 @@ siegeBar.BackgroundColor3 = Color3.fromRGB(34, 45, 65)
siegeBar.BorderSizePixel = 0
siegeBar.Visible = false
siegeBar.Parent = objective
local lifeBoard = UI.label(objective,"OneLifeBoard","",UDim2.fromOffset(15,90),UDim2.new(1,-30,0,25),17,UI.Gold)
lifeBoard.Visible=false
local dominationChips = Instance.new("Frame")
dominationChips.Name = "DominationChips"
dominationChips.Position = UDim2.fromOffset(15, 88)
@@ -458,6 +460,7 @@ local function refreshObjective()
objective.Visible = visible
siegeBar.Visible, siegeSteps.Visible, siegeChip.Visible = false, false, false
dominationChips.Visible = false
lifeBoard.Visible = false
if visible then
local rule = Rules.get(match:GetAttribute("Ruleset"))
local accent = if player:GetAttribute("ArenaTeam") == "Orange" then orange else blue
@@ -512,6 +515,16 @@ local function refreshObjective()
siegeChip.TextColor3 = if zone == "Inside" then UI.Mint else UI.Gold
end
end
if rule.id == "OneLife" then
local function dots(points: number): string
local n=math.clamp(math.floor(points),0,3)
return string.rep("●",n)..string.rep("○",3-n)
end
lifeBoard.Visible=true
lifeBoard.Text=string.format(HunterStrings.lifeHints.alive,(match:GetAttribute("MiniAliveBlue") :: number?) or 0,
(match:GetAttribute("MiniAliveOrange") :: number?) or 0)
.." "..dots((match:GetAttribute("BlueScore") :: number?) or 0).." / "..dots((match:GetAttribute("OrangeScore") :: number?) or 0)
end
if rule.id == "Domination" then
dominationChips.Visible = true
for key, slot in domSlots do
@@ -540,7 +553,7 @@ local function refreshObjective()
objectiveStatus.Visible = text ~= ""
objectiveStatus.Text = text
objectiveStatus.TextColor3 = accent:Lerp(ink, .3)
local height = if siegeBar.Visible then 145 elseif dominationChips.Visible then 133 elseif objectiveStatus.Visible then 88 else 62
local height = if siegeBar.Visible then 145 elseif dominationChips.Visible then 133 elseif lifeBoard.Visible then 120 elseif objectiveStatus.Visible then 88 else 62
if height ~= objective.Size.Y.Offset then
objective.Size = UDim2.fromOffset(widthOfCard, height)
needsLayout = true
@@ -1081,11 +1094,14 @@ local function updateClock()
local arenaMode = currentMode()
local inArena = player:GetAttribute("InArena") == true
if seconds == lastSecond and phase == lastPhase and stage == lastStage and team == lastTeam and arenaMode == lastMode and inArena == lastInArena then return end
local counting = inArena and stage == "Countdown" and introSeconds > 0
local nextMini = match:GetAttribute("MiniRoundNextAt")
local miniBeat = if typeof(nextMini)=="number" then math.ceil(nextMini-workspace:GetServerTimeNow()) else 0
local beat = if stage=="Countdown" then introSeconds elseif miniBeat>0 and miniBeat<=3 then miniBeat else 0
local counting = inArena and beat > 0
local hadCountdown = countdown.Visible
if counting then
if not hadCountdown or introSeconds ~= lastIntroBeat then showCountdownBeat(introSeconds) end
lastIntroBeat = introSeconds
if not hadCountdown or beat ~= lastIntroBeat then showCountdownBeat(beat) end
lastIntroBeat = beat
elseif countdown.Visible then
countdown.Visible = false
clearCountdownBeat()
@@ -1094,7 +1110,7 @@ local function updateClock()
lastSecond, lastPhase, lastTeam, lastMode, lastInArena = seconds, phase, team, arenaMode, inArena
lastStage = stage
local rule = Rules.get(activeState():GetAttribute("Ruleset"))
if inArena and (rule.id == "Siege" or rule.id == "Domination") then refreshObjective() end
if inArena and (rule.id == "Siege" or rule.id == "Domination" or rule.id == "OneLife") then refreshObjective() end
mode.Visible = true
mode.Text = if intro then RoundStrings.untilStart elseif stage == "RoleSwap" then RoundStrings.swap elseif phase == "Vote" then "ГОЛОСОВАНИЕ" elseif phase == "Reveal" then "ДО НАЧАЛА РАУНДА"
elseif phase == "Break" then (if activeState():GetAttribute("AllowModeChange") == false then "ДО НАЧАЛА РАУНДА" else "ДО ГОЛОСОВАНИЯ")