proc
checkmacpos(skillname,mob/M)
for(var/i=1,i<=17,i++)
if(M.maclist[i]==skillname)
return(i)
mob
var
list
maclist[17]
skills = new/list()
verb
MacroSkill(N as num)
set hidden = 1
if(maclist[N])
call(maclist[N])(src)
obj
Skills
Click()
call(text2path("[src.type]/proc/Tech"))(usr)
MouseDrop(obj/O,srcLoc,OLoc,srcControl,OControl,params)
var/list/P = params2list(params)
var/obj/Btn = text2path("[src.type]/proc/Tech")
var/pos = ButtonPlacement(P["screen-loc"], Btn, usr)
if(checkmacpos(text2path("[src.type]/proc/Tech"),usr))
if(!pos && srcControl!="window1.info1") //REPLACE WITH NAME OF INTERFACE INFO PANEL
Btn=src
else if(pos)
Btn=src
else
return
else if(pos)
Btn=new Btn
if(pos)
if(O.screen_loc==pos && Btn.screen_loc && O.type in typesof(/obj/Skills))
O.screen_loc=Btn.screen_loc
else if(O.screen_loc==pos && O.type in typesof(/obj/Skills))
usr.client.screen-=O
Btn.screen_loc = pos
usr.client.screen+=Btn
else if(Btn)
usr.maclist[checkmacpos(Btn,usr)] = null
usr.client.screen-=Btn
proc
ButtonPlacement(btnloc, skillname,mob/M as mob)
var/num1 = copytext(btnloc,1,findtext(btnloc,":"))
var/middlenum = findtext(btnloc,",")
var/num2 = copytext(btnloc,middlenum,findtext(btnloc,":",middlenum))
if(num2!=",2")return
if(text2num(num1)<1 || text2num(num1)>17) return//FOR SCREEN LOC, 2 & 10 is the in between spaces for skill btns
var/prevmacloc = checkmacpos(skillname,M)
var/macpos = text2num(num1) //FOR SCREEN LOC, change -1 to whatever distance it needs to be
if(M.maclist[macpos] && prevmacloc)
M.maclist[prevmacloc]=M.maclist[macpos]
else if(prevmacloc)
M.maclist[prevmacloc]=null
M.maclist[macpos]=skillname
return "[num1][num2]"
Problem description:
Well, what I basicly want is, when a player logs out and logs in again, the skills that they placed on the hotbar and logged out with, are still on the hotbar in the exact same position. So basicly a savesystem for this. But I wasn't able to figure it out myself. Can anyone help me?