mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-05 23:11:52 +00:00
Fix more things
This commit is contained in:
@@ -419,14 +419,14 @@ datum/preferences
|
||||
id = text2num(query.item[1])
|
||||
name = query.item[2]
|
||||
if (id == current_character)
|
||||
dat += "<b><a href='?_src_=prefs;preference=changeslot;num=[id];'>[name]</a></b><br>"
|
||||
dat += "<b><a href='?src=\ref[src];changeslot=[id];'>[name]</a></b><br>"
|
||||
else
|
||||
dat += "<a href='?_src_=prefs;preference=changeslot;num=[id];'>[name]</a><br>"
|
||||
dat += "<a href='?src=\ref[src];changeslot=[id];'>[name]</a><br>"
|
||||
|
||||
dat += "<hr>"
|
||||
dat += "<b>[query.RowCount()]/[config.character_slots] slots used</b><br>"
|
||||
if (query.RowCount() < config.character_slots)
|
||||
dat += "<a href='byond://?_src_=prefs;preference=new_character_sql;'>New Character</a>"
|
||||
dat += "<a href='byond://?src=\ref[src];preference=new_character_sql;'>New Character</a>"
|
||||
else
|
||||
dat += "<strike>New Character</strike>"
|
||||
|
||||
|
||||
@@ -7,54 +7,90 @@
|
||||
savefile_version = SAVEFILE_VERSION_MAX
|
||||
|
||||
/datum/preferences/proc/load_preferences()
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/"
|
||||
var/savefile/S
|
||||
if (!config.sql_saves)
|
||||
if (!path)
|
||||
return 0
|
||||
if (!fexists(path))
|
||||
return 0
|
||||
S = new /savefile(path)
|
||||
if (!S)
|
||||
return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["version"] >> savefile_version
|
||||
|
||||
S["version"] >> savefile_version
|
||||
player_setup.load_preferences(S)
|
||||
loaded_preferences = S
|
||||
|
||||
if (!config.sql_saves)
|
||||
loaded_preferences = S
|
||||
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_preferences()
|
||||
if(!path) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/"
|
||||
var/savefile/S
|
||||
if (!config.sql_saves)
|
||||
if(!path)
|
||||
return 0
|
||||
S = new /savefile(path)
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = "/"
|
||||
|
||||
S["version"] << SAVEFILE_VERSION_MAX
|
||||
|
||||
S["version"] << SAVEFILE_VERSION_MAX
|
||||
player_setup.save_preferences(S)
|
||||
loaded_preferences = S
|
||||
|
||||
if (!config.sql_saves)
|
||||
loaded_preferences = S
|
||||
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/load_character(slot)
|
||||
if(!path) return 0
|
||||
if(!fexists(path)) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
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]"
|
||||
var/savefile/S
|
||||
if (!config.sql_saves)
|
||||
if (!path)
|
||||
return 0
|
||||
if (!fexists(path))
|
||||
return 0
|
||||
S = new /savefile(path)
|
||||
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]"
|
||||
else
|
||||
current_character = slot
|
||||
|
||||
player_setup.load_character(S)
|
||||
loaded_character = S
|
||||
|
||||
if (!config.sql_saves)
|
||||
loaded_character = S
|
||||
|
||||
return 1
|
||||
|
||||
/datum/preferences/proc/save_character()
|
||||
if(!path) return 0
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(!S) return 0
|
||||
S.cd = "/character[default_slot]"
|
||||
var/savefile/S
|
||||
if (!config.sql_saves)
|
||||
if(!path)
|
||||
return 0
|
||||
S = new /savefile(path)
|
||||
if(!S)
|
||||
return 0
|
||||
S.cd = "/character[default_slot]"
|
||||
|
||||
S["version"] << SAVEFILE_VERSION_MAX
|
||||
|
||||
S["version"] << SAVEFILE_VERSION_MAX
|
||||
player_setup.save_character(S)
|
||||
loaded_character = S
|
||||
|
||||
if (!config.sql_saves)
|
||||
loaded_character = S
|
||||
|
||||
return S
|
||||
|
||||
/datum/preferences/proc/sanitize_preferences()
|
||||
|
||||
Reference in New Issue
Block a user