Polish Hot Point progress and guidance
This commit is contained in:
1 parent
d3648c485b
commit
522344e34b
9 files changed
+88
-16
No files matched your search
@@ -253,7 +253,7 @@ countdown.Visible = false
|
||||
local allyCapture = Color3.fromRGB(90, 247, 170)
|
||||
local enemyCapture = Color3.fromRGB(255, 79, 105)
|
||||
local captureHud = UI.plate(hudLayout, "HotPointCapture", UDim2.new(.5, 0, 0, 10), UDim2.fromOffset(384, 52), UI.Outline)
|
||||
captureHud.AnchorPoint, captureHud.Visible = Vector2.new(.5, 0), false
|
||||
captureHud.AnchorPoint, captureHud.Visible = Vector2.new(.5, 1), false
|
||||
local captureArc = UI.contour(captureHud, allyCapture)
|
||||
local captureLabel = UI.label(captureHud, "Status", "", UDim2.fromOffset(14, 5), UDim2.new(1, -77, 0, 24), 15, ink)
|
||||
captureLabel.FontFace = UI.Display
|
||||
@@ -265,7 +265,17 @@ local captureTrack = UI.element("ProgressBar", captureHud, UDim2.fromOffset(14,
|
||||
captureTrack.Name = "CaptureProgress"
|
||||
local captureFill = captureTrack:WaitForChild("Fill") :: Frame
|
||||
captureFill.Size = UDim2.fromScale(0, 1)
|
||||
UI.sheen(captureFill)
|
||||
captureFill.Visible = false
|
||||
local hotSegments: {Frame} = {}
|
||||
for i = 1, 10 do
|
||||
local segment = Instance.new("Frame")
|
||||
segment.Name = "CaptureSegment"
|
||||
segment.Position = UDim2.fromScale((i-1)/10, 0)
|
||||
segment.Size = UDim2.new(.1, -2, 1, 0)
|
||||
segment.BorderSizePixel = 0
|
||||
segment.Parent = captureTrack
|
||||
table.insert(hotSegments, segment)
|
||||
end
|
||||
local captureTween: Tween? = nil
|
||||
local captureTeam: string? = nil
|
||||
local capturePercent = 0
|
||||
@@ -388,9 +398,7 @@ local function fitHud()
|
||||
badge.killSize.MaxTextSize = if packed then 17 else 23
|
||||
end
|
||||
local bottom = top + (if rowCount > 0 then height * scoreScale.Scale else 0)
|
||||
local minimumTop = if countdown.Visible then 119 else 10
|
||||
local captureTop = if width >= 1200 then minimumTop else math.max(minimumTop, bottom + 8)
|
||||
captureHud.Position = UDim2.new(.5, 0, 0, captureTop)
|
||||
captureHud.Position = UDim2.new(.5, 0, 1, -83)
|
||||
captureHud.Size = UDim2.fromOffset(math.floor(math.min(384, width - 24)), 52)
|
||||
gui:SetAttribute("ContentBottom", if width >= 700 then 4 else bottom)
|
||||
end
|
||||
@@ -420,13 +428,17 @@ local function refreshCapture()
|
||||
local accent = if not side then UI.Gold elseif allied then allyCapture else enemyCapture
|
||||
captureHud.Visible = true
|
||||
captureLabel.Text = if phase == "Captured" then "ТОЧКА ЗАХВАЧЕНА · +1"
|
||||
elseif phase == "Contested" then "ТОЧКА ОСПАРИВАЕТСЯ"
|
||||
elseif phase == "UnderFire" then (if allied then "ВАШ ЗАХВАТ ТЕРЯЕТСЯ" else "ЗАХВАТ СОПЕРНИКОВ ПАДАЕТ")
|
||||
elseif allied then "ВАША КОМАНДА ЗАХВАТЫВАЕТ" else "СОПЕРНИКИ ЗАХВАТЫВАЮТ"
|
||||
elseif phase == "Contested" then HunterStrings.hotHints.contest
|
||||
elseif phase == "UnderFire" then HunterStrings.hotHints.underFire
|
||||
elseif allied then HunterStrings.hotHints.taking else "СОПЕРНИКИ ЗАХВАТЫВАЮТ"
|
||||
local percent = math.clamp((match:GetAttribute("HotPointProgress") :: number?) or 0, 0, 100)
|
||||
captureValue.Text, captureValue.TextColor3 = string.format("%d%%", percent), accent
|
||||
captureArc:SetAttribute("Accent", accent)
|
||||
captureFill.BackgroundColor3 = accent
|
||||
for i, segment in hotSegments do
|
||||
segment.BackgroundColor3 = accent
|
||||
segment.BackgroundTransparency = if percent >= i * 10 then 0 else .85
|
||||
end
|
||||
if percent == capturePercent and side == captureTeam then return end
|
||||
if captureTween then captureTween:Cancel() end
|
||||
local size = UDim2.fromScale(percent / 100, 1)
|
||||
|
||||
Reference in new issue
Block a user