mob/proc
close_menu(){for(var/obj/text/O in client.screen)del O;for(var/obj/back/O in client.screen)del O}
TOSP(var/textonscreen){text1=list();for(var/a=1,a<=length(textonscreen),a++){text1+=copytext(textonscreen,a,a+1)}}
textonscreenbackground(var/XC1,YC1,XC2,YC2)
for(var/XC=XC1,XC<=XC2,XC++)
for(var/YC=YC1,YC<=YC2,YC++){var/obj/back/b=new(client);
if(XC==XC1)b.icon_state="l";if(XC==XC2)b.icon_state="r";if(YC==YC1)b.icon_state="b";
if(YC==YC2)b.icon_state="t";if(XC==XC1&&YC==YC1)b.icon_state="ll";
if(XC==XC2&&YC==YC2)b.icon_state="ur";if(XC==XC1&&YC==YC2)b.icon_state="ul";
if(XC==XC2&&YC==YC1)b.icon_state="lr";b.screen_loc="[XC],[YC]"}
textonscreenTEXT(var/XC1,XC2,YC1,YC2,T)
var{XC=XC1;YC=YC1}TOSP(T)
for(var/Y in text1){var/obj/text/C=new(client);
if(XC==round(XC)&&YC==round(YC)) C.screen_loc="[XC],[YC]";else if(XC!=round(XC)&&YC==round(YC))C.screen_loc="[XC-0.5]:16,[YC]";else if(XC==round(XC)&&YC!=round(YC))C.screen_loc="[XC],[YC-0.5]:+16";
else if(XC!=round(XC)&&YC!=round(YC))C.screen_loc="[XC-0.5]:16,[YC-0.5]:+16";C.icon_state="[Y]";
sleep(1) // Important. If you wish for the text to sleep leave it, otherwise remove sleep(1)!
XC+=0.5
if(XC==XC2)
XC=XC1;YC-=0.5
if(YC==YC2-0.5)break}
mob/var/text1
obj
back
icon='Background.dmi'
layer=MOB_LAYER+4
New(client/C)
..()
C.screen+=src // something with this
text
icon='Text.dmi'
layer=MOB_LAYER+5
New(client/C)
..()
C.screen+=src // something with this
runtime error: Cannot read null.screen
proc name: New (/obj/back/New)
source file: Message Box.dm,26
usr: Flame Sage (/mob)
src: the back (/obj/back)
call stack:
the back (/obj/back): New(null)
TrainerNPC1 (/mob/NPC/TrainerNPC1): textonscreenbackground(1, 1, 13, 5)
TrainerNPC1 (/mob/NPC/TrainerNPC1): Action()
Flame Sage (/client): Center()
runtime error: Cannot read null.screen
proc name: New (/obj/back/New)
source file: Message Box.dm,26
runtime error: Cannot read null.screen
And it goes on and on and on.