Merge pull request #14513 from Seris02/slotswitch

sets the default selection in slot select menu to current char
This commit is contained in:
Casey
2023-02-19 14:21:23 -05:00
committed by CHOMPStation2
parent a6491b8d6f
commit 13382ef200

View File

@@ -413,6 +413,7 @@ var/list/preferences_datums = list()
var/name var/name
var/nickname //vorestation edit - This set appends nicknames to the save slot var/nickname //vorestation edit - This set appends nicknames to the save slot
var/list/charlist = list() var/list/charlist = list()
var/default //VOREStation edit
for(var/i=1, i<= config.character_slots, i++) for(var/i=1, i<= config.character_slots, i++)
S.cd = "/character[i]" S.cd = "/character[i]"
S["real_name"] >> name S["real_name"] >> name
@@ -423,10 +424,12 @@ var/list/preferences_datums = list()
name = "►[i] - [name]" name = "►[i] - [name]"
else else
name = "[i] - [name]" name = "[i] - [name]"
if (i == default_slot) //VOREStation edit
default = "[name][nickname ? " ([nickname])" : ""]"
charlist["[name][nickname ? " ([nickname])" : ""]"] = i charlist["[name][nickname ? " ([nickname])" : ""]"] = i
selecting_slots = TRUE selecting_slots = TRUE
var/choice = tgui_input_list(user, "Select a character to load:", "Load Slot", charlist) var/choice = tgui_input_list(user, "Select a character to load:", "Load Slot", charlist, default)
selecting_slots = FALSE selecting_slots = FALSE
if(!choice) if(!choice)
return return