Skip to content

Commit

Permalink
added spectator info to body search
Browse files Browse the repository at this point in the history
  • Loading branch information
TimGoll committed Oct 17, 2023
1 parent 53597de commit 5dac50e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 18 additions & 1 deletion gamemodes/terrortown/gamemode/client/cl_search.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
-- Body search popup
-- @section body_search_manager

-- cache global functions
local net = net
local pairs = pairs
local util = util
local IsValid = IsValid
local hook = hook

-- cache materials
local materialCredits = Material("vgui/ttt/icon_credits_transparent")
local materialRoleUnknown = Material("vgui/ttt/tid/tid_big_role_not_known")
local materialPlayerIconUnknown = Material("vgui/ttt/b-draw/icon_avatar_default")
Expand Down Expand Up @@ -189,7 +191,22 @@ function SEARCHSCRN:Show(data)
contentAreaScroll:Dock(RIGHT)

-- POPULATE WITH SPECIAL INFORMATION
if GetConVar("ttt2_inspect_confirm_mode"):GetInt() == 0 and not bodysearch.IsConfirmed(data.ragOwner) then
if client:IsSpec() then
-- a spectator can see all information, but not interact with the UI
self:MakeInfoItem(contentAreaScroll, "sepc_search_info", {
text = {
title = {
body = "search_title_spec",
params = nil
},
text = {{
body = "search_spec",
params = nil
}}
},
colorBox = COLOR_SLATEGRAY
}, 62)
elseif GetConVar("ttt2_inspect_confirm_mode"):GetInt() == 0 and not bodysearch.IsConfirmed(data.ragOwner) then
-- a detective can only be called AFTER a body was confirmed
self:MakeInfoItem(contentAreaScroll, "policingrole_call_confirm", {
text = {
Expand Down
3 changes: 3 additions & 0 deletions lua/terrortown/lang/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1958,6 +1958,8 @@ The corpse can only be confirmed by a public policing role. Report the body to l
L.search_policingrole_confirm_disabled_2 = [[
The corpse can only be confirmed by a public policing role. Report the body to let them know!
You can see the information in here after they confirmed it.]]
L.search_spec = [[
As a spectator you are able to see all information of a corpse, but unable to interact with the UI.]]

L.search_title_words = "Victim's last words"
L.search_title_c4 = "Defusion mishap"
Expand All @@ -1981,6 +1983,7 @@ L.search_title_credits = "{credits} Equipment credit(s)"
L.search_title_water = "Water level {level}"
L.search_title_policingrole_report_confirm = "Confirm to report death"
L.search_title_policingrole_confirm_disabled = "Report corpse"
L.search_title_spec = "You are spectator"

L.target_credits_on_confirm = "Confirm to receive unspent credits"
L.target_credits_on_search = "Search to receive unspent credits"
Expand Down

0 comments on commit 5dac50e

Please sign in to comment.