Adds the character directory

The character directory is accessible via the verb in the OOC tab. It displays the flavor text and OOC notes of every active player in a fancy little menu
This commit is contained in:
deathride58
2018-08-15 05:19:12 -04:00
parent 84a3d824de
commit 1d4ce2502d
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
/client/verb/show_character_directory()
set name = "Character Directory"
set category = "OOC"
set desc = "Shows a listing of all active characters, along with their associated OOC notes, flavor text, and more."
if(mob.next_move >= world.time) //This is primarily to stop malicious users from trying to lag the server by spamming this verb
return
mob.next_move = world.time + 10
var/html = "<script> function togglesection(targetsection) { var targettext = document.getElementById(targetsection); if (targettext.style.display === 'none') { targettext.style.display = ''; } else { targettext.style.display = 'none'; } } </script>"
var/curID = 0
for(var/client/C in clients)
if(ishuman(C.mob))
curID++
var/mob/living/carbon/human/H = C.mob
html += "<div class='block'>"
html += "<h3 class='uiContent highlight' style='font-size:16px'>[H.real_name]</h3><br>"
if(H.flavor_texts["general"])
html += "<a onclick='togglesection(\"[H.real_name] [curID] flavor\")'>Flavor text</a>"
html += "<p class='uiContent' style='display:none' id='[H.real_name] [curID] flavor'>[H.flavor_texts["general"]]</p>"
if(H.ooc_notes)
html += "<a onclick='togglesection(\"[H.real_name] [curID] ooc\")'>OOC notes</a>"
html += "<p class='uiContent' style='display:none' id='[H.real_name] [curID] ooc'>[H.ooc_notes]</p>"
html += "</div>"
if(!curID)
html += "<p class='uiContent'>404: Station not found</p>"
var/datum/browser/popup = new(mob, "chardir", "Character Directory", 640, 480)
popup.set_content(html)
popup.open()

View File

@@ -1294,6 +1294,7 @@
#include "code\game\turfs\unsimulated\sky_vr.dm" #include "code\game\turfs\unsimulated\sky_vr.dm"
#include "code\game\turfs\unsimulated\walls.dm" #include "code\game\turfs\unsimulated\walls.dm"
#include "code\game\verbs\advanced_who.dm" #include "code\game\verbs\advanced_who.dm"
#include "code\game\verbs\character_directory.dm"
#include "code\game\verbs\ignore.dm" #include "code\game\verbs\ignore.dm"
#include "code\game\verbs\ooc.dm" #include "code\game\verbs\ooc.dm"
#include "code\game\verbs\suicide.dm" #include "code\game\verbs\suicide.dm"