TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

Add support for old targetid hint system

Open wgetJane opened this issue 2 years ago • 1 comments

Currently, hovering over entities that have a ENT.TargetIDHint table will not show a targetid at all

Here's how the values of the table are used by vanilla TTT (name, hint, fmt) https://github.com/Facepunch/garrysmod/blob/5aeba7596237c2af72108867cf0565b7f263e23d/garrysmod/gamemodes/terrortown/gamemode/cl_targetid.lua#L323

Note that if this is implemented, this should be removed from the c4 entity (leftover unused code): https://github.com/TTT-2/TTT2/blob/55760bcadb45f6c2618da2f4b0a4579bda2f893f/gamemodes/terrortown/entities/entities/ttt_c4/shared.lua#L27

wgetJane avatar Apr 19 '22 07:04 wgetJane

Seems pretty simple to implement since the targetid title can be derived from the "name" value, while the subtitle can be derived from the "hint" and "fmt" function if present

Not sure what the icon should be though, doesn't seem like there's a "generic" icon, maybe it shouldn't have an icon at all

wgetJane avatar Apr 19 '22 07:04 wgetJane

this appears to be implemented?

https://github.com/TTT-2/TTT2/blob/0c245a6e89c8020faff316a6fe99d61fd338760c/lua/ttt2/libraries/targetid.lua#L448-L456

Maybe I can't read very well.

EntranceJew avatar Dec 18 '23 07:12 EntranceJew

Yes, but just last week I noticed the issue wget had. In vanilla TTT TargetIDHint can be used for all entities, I changed that witout a reason to only support players and ragdolls.

I reverted that change in this (open) PR: https://github.com/TTT-2/TTT2/pull/1198

TimGoll avatar Dec 18 '23 11:12 TimGoll