diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index dacb340d12a..d3ec7ad7bef 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -234,7 +234,6 @@ var/list/preferences_datums = list() if(!get_mob_by_key(client_ckey)) to_chat(user, "No mob exists for the given client!") - close_load_dialog(user) return if(!char_render_holders) @@ -343,11 +342,6 @@ var/list/preferences_datums = list() if(!IsGuestKey(usr.key)) open_load_dialog(usr) return 1 - else if(href_list["changeslot"]) - load_character(text2num(href_list["changeslot"])) - attempt_vr(client.prefs_vr,"load_vore","") //VOREStation Edit - sanitize_preferences() - close_load_dialog(usr) else if(href_list["resetslot"]) if("No" == tgui_alert(usr, "This will reset the current slot. Continue?", "Reset current slot?", list("No", "Yes"))) return 0 @@ -359,10 +353,6 @@ var/list/preferences_datums = list() if(!IsGuestKey(usr.key)) open_copy_dialog(usr) return 1 - else if(href_list["overwrite"]) - overwrite_character(text2num(href_list["overwrite"])) - sanitize_preferences() - close_load_dialog(usr) else if(href_list["close"]) // User closed preferences window, cleanup anything we need to. clear_character_previews() @@ -401,53 +391,70 @@ var/list/preferences_datums = list() character.descriptors[entry] = body_descriptors[entry] /datum/preferences/proc/open_load_dialog(mob/user) - var/dat = "" - dat += "
" - var/savefile/S = new /savefile(path) - if(S) - dat += "Select a character slot to load
" - var/name - var/nickname //vorestation edit - This set appends nicknames to the save slot - for(var/i=1, i<= config.character_slots, i++) - S.cd = "/character[i]" - S["real_name"] >> name - S["nickname"] >> nickname //vorestation edit - if(!name) name = "Character[i]" - if(i==default_slot) - name = "[name]" - dat += "[name][nickname ? " ([nickname])" : ""]
" //vorestation edit + if(!S) + error("Somehow missing savefile path?! [path]") + return - dat += "
" - dat += "
" - //user << browse(dat, "window=saves;size=300x390") - panel = new(user, "Character Slots", "Character Slots", 300, 390, src) - panel.set_content(dat) - panel.open() + var/name + var/nickname //vorestation edit - This set appends nicknames to the save slot + var/list/charlist = list() + for(var/i=1, i<= config.character_slots, i++) + S.cd = "/character[i]" + S["real_name"] >> name + S["nickname"] >> nickname //vorestation edit + if(!name) + name = "[i] - \[Unused Slot\]" + else if(i == default_slot) + name = "►[i] - [name]" + else + name = "[i] - [name]" + charlist["[name][nickname ? " ([nickname])" : ""]"] = i -/datum/preferences/proc/close_load_dialog(mob/user) - //user << browse(null, "window=saves") - panel.close() + var/choice = tgui_input_list(user, "Select a character to load:", "Load Slot", charlist) + if(!choice) + return + + var/slotnum = charlist[choice] + if(!slotnum) + error("Player picked [choice] slot to load, but that wasn't one we sent.") + return + + load_character(slotnum) + attempt_vr(user.client?.prefs_vr,"load_vore","") //VOREStation Edit + sanitize_preferences() + ShowChoices(user) /datum/preferences/proc/open_copy_dialog(mob/user) - var/dat = "" - dat += "
" - var/savefile/S = new /savefile(path) - if(S) - dat += "Select a character slot to overwrite
" - dat += "You will then need to save to confirm
" - var/name - for(var/i=1, i<= config.character_slots, i++) - S.cd = "/character[i]" - S["real_name"] >> name - if(!name) name = "Character[i]" - if(i==default_slot) - name = "[name]" - dat += "[name]
" + if(!S) + error("Somehow missing savefile path?! [path]") + return - dat += "
" - dat += "
" - panel = new(user, "Character Slots", "Character Slots", 300, 390, src) - panel.set_content(dat) - panel.open() + var/name + var/nickname //vorestation edit - This set appends nicknames to the save slot + var/list/charlist = list() + for(var/i=1, i<= config.character_slots, i++) + S.cd = "/character[i]" + S["real_name"] >> name + S["nickname"] >> nickname //vorestation edit + if(!name) + name = "[i] - \[Unused Slot\]" + if(i == default_slot) + name = "►[i] - [name]" + else + name = "[i] - [name]" + charlist["[name][nickname ? " ([nickname])" : ""]"] = i + + var/choice = tgui_input_list(user, "Select a character to COPY TO:", "Copy Slot", charlist) + if(!choice) + return + + var/slotnum = charlist[choice] + if(!slotnum) + error("Player picked [choice] slot to copy to, but that wasn't one we sent.") + return + + overwrite_character(slotnum) + sanitize_preferences() + ShowChoices(user) diff --git a/config/example/config.txt b/config/example/config.txt index 4f9320331e8..d155d6cd148 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -338,7 +338,7 @@ ALLOW_CULT_GHOSTWRITER REQ_CULT_GHOSTWRITER 6 ## Sets the number of available character slots -CHARACTER_SLOTS 35 +CHARACTER_SLOTS 50 ## Sets the number of loadout slots per character #LOADOUT_SLOTS 3