Ports Bay's character resets

This commit is contained in:
Anewbe
2017-01-16 19:02:41 -06:00
parent 02ca0a046d
commit 5b1fc48712
4 changed files with 95 additions and 8 deletions
+9 -3
View File
@@ -1,4 +1,4 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:33
#define SAVE_RESET -1
var/list/preferences_datums = list()
@@ -197,7 +197,8 @@ datum/preferences
dat += "Slot - "
dat += "<a href='?src=\ref[src];load=1'>Load slot</a> - "
dat += "<a href='?src=\ref[src];save=1'>Save slot</a> - "
dat += "<a href='?src=\ref[src];reload=1'>Reload slot</a>"
dat += "<a href='?src=\ref[src];reload=1'>Reload slot</a> - "
dat += "<a href='?src=\ref[src];resetslot=1'>Reset slot</a>"
else
dat += "Please create an account to save your preferences."
@@ -246,6 +247,11 @@ datum/preferences
load_character(text2num(href_list["changeslot"]))
sanitize_preferences()
close_load_dialog(usr)
else if(href_list["resetslot"])
if("No" == alert("This will reset the current slot. Continue?", "Reset current slot?", "No", "Yes"))
return 0
load_character(SAVE_RESET)
sanitize_preferences()
else
return 0
@@ -262,7 +268,7 @@ datum/preferences
if(be_random_name)
real_name = random_name(identifying_gender,species)
// Ask the preferences datums to apply their own settings to the new mob
// Ask the preferences datums to apply their own settings to the new mob
player_setup.copy_to_mob(character)
if(icon_updates)
+14 -5
View File
@@ -67,11 +67,20 @@
if(!S) return 0
S.cd = "/"
if(!slot) slot = default_slot
slot = sanitize_integer(slot, 1, config.character_slots, initial(default_slot))
if(slot != default_slot)
default_slot = slot
S["default_slot"] << slot
S.cd = "/character[slot]"
if(slot != SAVE_RESET) // SAVE_RESET will reset the slot as though it does not exist, but keep the current slot for saving purposes.
slot = sanitize_integer(slot, 1, config.character_slots, initial(default_slot))
if(slot != default_slot)
default_slot = slot
S["default_slot"] << slot
else
S["default_slot"] << default_slot
if(slot != SAVE_RESET)
S.cd = "/character[slot]"
player_setup.load_character(S)
else
player_setup.load_character(S)
S.cd = "/character[default_slot]"
player_setup.load_character(S)
return 1