mob/LoggingIn/verb
DeleteChar()
set hidden = 1
var _name = usr.client.LoadSome_name(usr._saveSlot, FALSE)
switch(alert("Are you sure you want to delete [_name]?","Delete Character","Yes, I'm sure.","No, don't delete."))
if("Yes, I'm sure.")
var/confirm = input("To confirm deletion, please type \"DELETE\" (case sensitive).","Confirm Deletion") as null|text
if(confirm == "DELETE")
var/firstletter=copytext(usr.ckey, 1, 2)
var/savefile/F = new("Saves/[firstletter]/[usr.ckey].sav")
F.cd = "/[ckey]"
F.dir.Remove("slot_[usr._saveSlot]")
for(var/i = usr._saveSlot, i<=5, i++)
var/firstletter=copytext(src.ckey, 1, 2)
var/savefile/F = new("Saves/[firstletter]/[src.ckey].sav")
F.cd = "/[ckey]/slot_[i]/"
//RELEVANT PART
//Rename the CD as slot[i-1]
//Re-loads the interface.
usr.LoadSlots()
Problem description:
I included it all here to show how I'm naming directories within save files etc.
In the above, I've defined the location of the current directory ("F.cd"), and I simply want to rename it. e.g. slot_4 becomes slot_3.
I don't know of a rename() proc, so I can't think of a way to do it without calling Load and Save procs a bunch of times... That seems clunky as hell.
(Note I know the code can be cleaned up a bit, e.g. making firstletter a proc.)