Spawn and context menus are easy enough. ULX menu...not so much. I'd have to edit the actual ULX Menu function, I think. No es bueno.
Actually, with SVN new hook, no, you shouldn't have to change ULX at all.
Would take some testing and tweaking, but, every(?) ULib command called now calls a hook.
ULibCommandCalledIn line 9 (as of latest svn of this posting) of addons\ulx\lua\ulx\modules\sh\menus.lua , a Ulib command is called.
ULib.clientRPC( calling_ply, "ulx.showMainMenu" )It would take some research to determine if a ULib command is executed when a menu is CLOSED, but in theory you could use our hook to monitor menu openings (and hopefully, closing)
Basically, in logic (not actual lua)
/addons/youraddon/ulx/modules/sh/youraddon.lua
function myfunction(calling_ply, command, table)
if command = clientRPC then
find in table "ulx.showmainmenu"
if found, do your code for showing they're in menu
check for close menu command, do code to close/stop your indicator (Closing may not be clientRPC.)
if not do nothing
return <NOTHING, just plain return or it will stop our code>
end
hook.Add("ULibCommandCalled","mysearch", myfunction)
I actually like KnowledgeJunkie's ideas for indicating mode of player.
I occasionally visit a server that shows gears turning/rising no matter what mode the player is in.
Though it's pretty cool, it doesn't tell me a thing if they can't see my text chat because they're in spawn menu or another menu.