Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HUD: Show name of spectated player in old TTT HUD #1673

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ All notable changes to TTT2 will be documented here. Inspired by [keep a changel
- Updated Turkish localization (by @NovaDiablox)
- Updated targetID to use `Vehicle:GetDriver` instead of the `ttt_driver` NWEntity (by @Histalek)
- Updated Russian and English localization files (by @Satton2)
- Updated old TTT HUD to show name of spectated player (by @somefnfplayerlol)

## [v0.14.0b](https://github.com/TTT-2/TTT2/tree/v0.14.0b) (2024-09-20)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,12 @@ if CLIENT then
local hastewidth = self.hastewidth
local bg_colors = self.bg_colors
local round_y = y + height - self.bgheight
local screenwidth = ScrW()

height = self.bgheight

-- move up a little on low resolutions to allow space for spectator hints
if ScrW() < 1000 then
if screenwidth < 1000 then
round_y = round_y - 15
end

Expand Down Expand Up @@ -303,6 +304,20 @@ if CLIENT then
COLOR_WHITE,
TEXT_ALIGN_CENTER
)

-- Draw name of spectated player
local tgt = client:GetObserverTarget()
if IsValid(tgt) and tgt:IsPlayer() then
self:ShadowedText(
tgt:Nick(),
"TimeLeft",
screenwidth / 2,
margin,
COLOR_WHITE,
TEXT_ALIGN_CENTER,
TEXT_ALIGN_TOP
)
end
end
end
end
Loading