mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] new form and unignore qol (#7972)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
This commit is contained in:
@@ -18,21 +18,29 @@
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
to_chat(usr, "<span class='notice'>Now ignoring <b>[key_to_ignore]</b>.</span>")
|
||||
|
||||
/client/verb/unignore(key_to_unignore as text)
|
||||
/client/verb/unignore()
|
||||
set name = "Unignore"
|
||||
set category = "OOC"
|
||||
set desc = "Reverts your ignoring of a specific player."
|
||||
|
||||
if(!prefs)
|
||||
to_chat(usr, "<span class='warning'>Preferences not found.</span>")
|
||||
return
|
||||
|
||||
if(!prefs.ignored_players?.len)
|
||||
to_chat(usr, "<span class='warning'>You aren't ignoring any players.</span>")
|
||||
return
|
||||
|
||||
var/key_to_unignore = tgui_input_list(usr, "Ignored players", "Unignore", prefs.ignored_players)
|
||||
if(!key_to_unignore)
|
||||
return
|
||||
key_to_unignore = ckey(sanitize(key_to_unignore))
|
||||
if(prefs && prefs.ignored_players)
|
||||
if(!(key_to_unignore in prefs.ignored_players))
|
||||
to_chat(usr, "<span class='warning'>[key_to_unignore] isn't being ignored.</span>")
|
||||
return
|
||||
prefs.ignored_players -= key_to_unignore
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
to_chat(usr, "<span class='notice'>Reverted ignore on <b>[key_to_unignore]</b>.</span>")
|
||||
if(!(key_to_unignore in prefs.ignored_players))
|
||||
to_chat(usr, "<span class='warning'>[key_to_unignore] isn't being ignored.</span>")
|
||||
return
|
||||
prefs.ignored_players -= key_to_unignore
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
to_chat(usr, "<span class='notice'>Reverted ignore on <b>[key_to_unignore]</b>.</span>")
|
||||
|
||||
/mob/proc/is_key_ignored(var/key_to_check)
|
||||
if(client)
|
||||
@@ -45,4 +53,4 @@
|
||||
if(GLOB.directory[key_to_check] in GLOB.admins) // This is here so this is only evaluated if someone is actually being blocked.
|
||||
return 0
|
||||
return 1
|
||||
return 0
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user