Skip to content

Commit

Permalink
Make score tween hud show while spectating too
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiskster committed Sep 8, 2024
1 parent 387801b commit 1bb6504
Showing 1 changed file with 29 additions and 24 deletions.
53 changes: 29 additions & 24 deletions src/Lua/HUD/hud_score.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,25 @@ function PTSR.add_wts_score(player, mobj, score, delay, color)
color = color or SKINCOLOR_WHITE,
}

if player == consoleplayer then
local wts = SG_ObjectTracking(fakeV,player,camera,mobj)

if wts.onScreen then
x = wts.x
y = wts.y
s = wts.scale/2
if displayplayer and displayplayer.valid then
if player == displayplayer then
local wts = SG_ObjectTracking(fakeV,player,camera,mobj)

if wts.onScreen then
x = wts.x
y = wts.y
s = wts.scale/2
end

displayValues[#displayValues+1] = {
x = x,
y = y,
s = GO_TO_S,
tics = -delay,
score = score,
color = color or SKINCOLOR_WHITE
}
end
displayValues[#displayValues+1] = {
x = x,
y = y,
s = GO_TO_S,
tics = -delay,
score = score,
color = color or SKINCOLOR_WHITE
}
end
end

Expand All @@ -97,15 +100,17 @@ function PTSR.add_xy_score(player, x, y, score, delay, color)
tics = -delay,
color = color or SKINCOLOR_WHITE,
}
if player == consoleplayer then
displayValues[#displayValues+1] = {
x = x,
y = y,
s = GO_TO_S,
tics = -delay,
score = score,
color = color or SKINCOLOR_WHITE
}
if displayplayer and displayplayer.valid then
if player == displayplayer then
displayValues[#displayValues+1] = {
x = x,
y = y,
s = GO_TO_S,
tics = -delay,
score = score,
color = color or SKINCOLOR_WHITE
}
end
end
end

Expand Down

0 comments on commit 1bb6504

Please sign in to comment.