mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-22 12:47:16 +01:00
[MIRROR] adds spoiler function to statpanel (#10515)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
co-authored by
Kashargul
parent
b737759f85
commit
f95f69638e
+13
-2
@@ -517,8 +517,19 @@
|
||||
src << browse(null, t1)
|
||||
|
||||
if(href_list["flavor_more"])
|
||||
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", name, replacetext(flavor_text, "\n", "<BR>")), text("window=[];size=500x200", name))
|
||||
onclose(usr, "[name]")
|
||||
var/examine_text = splittext(flavor_text, "||")
|
||||
var/index = 0
|
||||
var/rendered_text = ""
|
||||
for(var/part in examine_text)
|
||||
if(index % 2)
|
||||
rendered_text += span_spoiler("[part]")
|
||||
else
|
||||
rendered_text += "[part]"
|
||||
index++
|
||||
examine_text = replacetext(rendered_text, "\n", "<BR>")
|
||||
var/datum/browser/popup = new(usr, "[name]", "[name]", 500, 300, src)
|
||||
popup.set_content(examine_text)
|
||||
popup.open()
|
||||
if(href_list["flavor_change"])
|
||||
update_flavor_text()
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user