mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-09 07:02:15 +01:00
Separate Antagonist Preferences for Characters
This commit is contained in:
@@ -289,6 +289,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "<a href='?_src_=prefs;preference=tab;tab=2' [current_tab == 2 ? "class='linkOn'" : ""]>Character Appearance</a>"
|
||||
dat += "<a href='?_src_=prefs;preference=tab;tab=3' [current_tab == 3 ? "class='linkOn'" : ""]>Loadout</a>"
|
||||
dat += "<a href='?_src_=prefs;preference=tab;tab=1' [current_tab == 1 ? "class='linkOn'" : ""]>Game Preferences</a>"
|
||||
dat += "<a href='?_src_=prefs;preference=tab;tab=4' [current_tab == 4 ? "class='linkOn'" : ""]>Antagonist Preferences</a>"
|
||||
|
||||
if(!path)
|
||||
dat += "<div class='notice'>Please create an account to save your preferences</div>"
|
||||
@@ -913,6 +914,24 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "</tr></table>"
|
||||
|
||||
if (1) // Game Preferences
|
||||
if(path)
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(S)
|
||||
dat += "<center>"
|
||||
var/name
|
||||
var/unspaced_slots = 0
|
||||
for(var/i=1, i<=max_save_slots, i++)
|
||||
unspaced_slots++
|
||||
if(unspaced_slots > 4)
|
||||
dat += "<br>"
|
||||
unspaced_slots = 0
|
||||
S.cd = "/character[i]"
|
||||
S["real_name"] >> name
|
||||
if(!name)
|
||||
name = "+"
|
||||
dat += "<a style='white-space:nowrap;' href='?_src_=prefs;preference=changeslot;num=[i];' [i == default_slot ? "class='linkOn'" : ""]>[name]</a> "
|
||||
dat += "</center>"
|
||||
|
||||
dat += "<table><tr><td width='340px' height='300px' valign='top'>"
|
||||
dat += "<h2>General Settings</h2>"
|
||||
dat += "<b>UI Style:</b> <a href='?_src_=prefs;task=input;preference=ui'>[UI_style]</a><br>"
|
||||
@@ -981,7 +1000,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
|
||||
if(jobban_isbanned(user, ROLE_SYNDICATE))
|
||||
dat += "<font color=red><b>You are banned from antagonist roles.</b></font>"
|
||||
src.be_special = list()
|
||||
be_special = list()
|
||||
|
||||
|
||||
for (var/i in GLOB.hyper_special_roles)
|
||||
@@ -1060,35 +1079,27 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
p_map += " (No longer exists)"
|
||||
if(CONFIG_GET(flag/allow_map_voting))
|
||||
dat += "<b>Preferred Map:</b> <a href='?_src_=prefs;preference=preferred_map;task=input'>[p_map]</a><br>"
|
||||
|
||||
dat += "</td><td width='300px' height='300px' valign='top'>"
|
||||
|
||||
dat += "<h2>Special Role Settings</h2>"
|
||||
|
||||
if(jobban_isbanned(user, ROLE_SYNDICATE))
|
||||
dat += "<font color=red><b>You are banned from antagonist roles.</b></font>"
|
||||
src.be_special = list()
|
||||
|
||||
|
||||
for (var/i in GLOB.special_roles)
|
||||
if(jobban_isbanned(user, i))
|
||||
dat += "<b>Be [capitalize(i)]:</b> <a href='?_src_=prefs;jobbancheck=[i]'>BANNED</a><br>"
|
||||
else
|
||||
var/days_remaining = null
|
||||
if(ispath(GLOB.special_roles[i]) && CONFIG_GET(flag/use_age_restriction_for_jobs)) //If it's a game mode antag, check if the player meets the minimum age
|
||||
var/mode_path = GLOB.special_roles[i]
|
||||
var/datum/game_mode/temp_mode = new mode_path
|
||||
days_remaining = temp_mode.get_remaining_days(user.client)
|
||||
|
||||
if(days_remaining)
|
||||
dat += "<b>Be [capitalize(i)]:</b> <font color=red> \[IN [days_remaining] DAYS]</font><br>"
|
||||
else
|
||||
dat += "<b>Be [capitalize(i)]:</b> <a href='?_src_=prefs;preference=be_special;be_special_type=[i]'>[(i in be_special) ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Midround Antagonist:</b> <a href='?_src_=prefs;preference=allow_midround_antag'>[(toggles & MIDROUND_ANTAG) ? "Enabled" : "Disabled"]</a><br>"
|
||||
|
||||
dat += "<br>"
|
||||
|
||||
if(3)
|
||||
if(3) //Item Loadout
|
||||
if(path)
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(S)
|
||||
dat += "<center>"
|
||||
var/name
|
||||
var/unspaced_slots = 0
|
||||
for(var/i=1, i<=max_save_slots, i++)
|
||||
unspaced_slots++
|
||||
if(unspaced_slots > 4)
|
||||
dat += "<br>"
|
||||
unspaced_slots = 0
|
||||
S.cd = "/character[i]"
|
||||
S["real_name"] >> name
|
||||
if(!name)
|
||||
name = "+"
|
||||
dat += "<a style='white-space:nowrap;' href='?_src_=prefs;preference=changeslot;num=[i];' [i == default_slot ? "class='linkOn'" : ""]>[name]</a> "
|
||||
dat += "</center>"
|
||||
|
||||
if(!gear_tab)
|
||||
gear_tab = GLOB.loadout_items[1]
|
||||
dat += "<table align='center' width='100%'>"
|
||||
@@ -1144,6 +1155,46 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
dat += "</td><td><font size=2><i>[gear.description]</i></font></td></tr>"
|
||||
dat += "</table>"
|
||||
|
||||
if(4) //Antag Preferences
|
||||
if(path)
|
||||
var/savefile/S = new /savefile(path)
|
||||
if(S)
|
||||
dat += "<center>"
|
||||
var/name
|
||||
var/unspaced_slots = 0
|
||||
for(var/i=1, i<=max_save_slots, i++)
|
||||
unspaced_slots++
|
||||
if(unspaced_slots > 4)
|
||||
dat += "<br>"
|
||||
unspaced_slots = 0
|
||||
S.cd = "/character[i]"
|
||||
S["real_name"] >> name
|
||||
if(!name)
|
||||
name = "+"
|
||||
dat += "<a style='white-space:nowrap;' href='?_src_=prefs;preference=changeslot;num=[i];' [i == default_slot ? "class='linkOn'" : ""]>[name]</a> "
|
||||
dat += "</center>"
|
||||
dat += "<table align='center' width='100%'>"
|
||||
dat += "<h1>Special Role Settings</h1>"
|
||||
if(jobban_isbanned(user, ROLE_SYNDICATE))
|
||||
dat += "<font color=red><h3><b>You are banned from antagonist roles.</b></h3></font>"
|
||||
be_special = list()
|
||||
|
||||
for (var/i in GLOB.special_roles)
|
||||
if(jobban_isbanned(user, i))
|
||||
dat += "<b>Be [capitalize(i)]:</b> <a href='?_src_=prefs;jobbancheck=[i]'>BANNED</a><br>"
|
||||
else
|
||||
var/days_remaining = null
|
||||
if(ispath(GLOB.special_roles[i]) && CONFIG_GET(flag/use_age_restriction_for_jobs)) //If it's a game mode antag, check if the player meets the minimum age
|
||||
var/mode_path = GLOB.special_roles[i]
|
||||
var/datum/game_mode/temp_mode = new mode_path
|
||||
days_remaining = temp_mode.get_remaining_days(user.client)
|
||||
|
||||
if(days_remaining)
|
||||
dat += "<b>Be [capitalize(i)]:</b> <font color=red> \[IN [days_remaining] DAYS]</font><br>"
|
||||
else
|
||||
dat += "<b>Be [capitalize(i)]:</b> <a href='?_src_=prefs;preference=be_special;be_special_type=[i]'>[(i in be_special) ? "Enabled" : "Disabled"]</a><br>"
|
||||
dat += "<b>Midround Antagonist:</b> <a href='?_src_=prefs;preference=allow_midround_antag'>[(toggles & MIDROUND_ANTAG) ? "Enabled" : "Disabled"]</a><br>"
|
||||
|
||||
dat += "<hr><center>"
|
||||
|
||||
if(!IsGuestKey(user.key))
|
||||
@@ -2504,9 +2555,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
if("be_special")
|
||||
var/be_special_type = href_list["be_special_type"]
|
||||
if(be_special_type in be_special)
|
||||
be_special -= be_special_type
|
||||
be_special -= list(be_special_type)
|
||||
else
|
||||
be_special += be_special_type
|
||||
be_special += list(be_special_type)
|
||||
|
||||
if("name")
|
||||
be_random_name = !be_random_name
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// You do not need to raise this if you are adding new values that have sane defaults.
|
||||
// Only raise this value when changing the meaning/format/name/layout of an existing value
|
||||
// where you would want the updater procs below to run
|
||||
#define SAVEFILE_VERSION_MAX 22
|
||||
#define SAVEFILE_VERSION_MAX 23
|
||||
|
||||
/*
|
||||
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
|
||||
@@ -44,6 +44,10 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
/datum/preferences/proc/update_preferences(current_version, savefile/S)
|
||||
if(current_version < 21)
|
||||
clientfps = 60
|
||||
if(current_version < 23)
|
||||
S["be_special"] >> be_special
|
||||
WRITE_FILE(S["be_special"], null)
|
||||
WRITE_FILE(S["special_roles"], be_special)
|
||||
return
|
||||
|
||||
/datum/preferences/proc/update_character(current_version, savefile/S)
|
||||
@@ -91,7 +95,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["tgui_lock"] >> tgui_lock
|
||||
S["buttons_locked"] >> buttons_locked
|
||||
S["windowflash"] >> windowflashing
|
||||
S["be_special"] >> be_special
|
||||
|
||||
|
||||
S["default_slot"] >> default_slot
|
||||
@@ -214,7 +217,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["tgui_lock"], tgui_lock)
|
||||
WRITE_FILE(S["buttons_locked"], buttons_locked)
|
||||
WRITE_FILE(S["windowflash"], windowflashing)
|
||||
WRITE_FILE(S["be_special"], be_special)
|
||||
WRITE_FILE(S["default_slot"], default_slot)
|
||||
WRITE_FILE(S["toggles"], toggles)
|
||||
WRITE_FILE(S["chat_toggles"], chat_toggles)
|
||||
@@ -362,6 +364,9 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
S["job_engsec_med"] >> job_engsec_med
|
||||
S["job_engsec_low"] >> job_engsec_low
|
||||
|
||||
//Antags
|
||||
S["special_roles"] >> be_special
|
||||
|
||||
//Quirks
|
||||
S["all_quirks"] >> all_quirks
|
||||
|
||||
@@ -585,22 +590,23 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
|
||||
WRITE_FILE(S["prefered_security_department"] , prefered_security_department)
|
||||
|
||||
//Jobs
|
||||
WRITE_FILE(S["joblessrole"] , joblessrole)
|
||||
WRITE_FILE(S["joblessrole"] , joblessrole)
|
||||
WRITE_FILE(S["job_civilian_high"] , job_civilian_high)
|
||||
WRITE_FILE(S["job_civilian_med"] , job_civilian_med)
|
||||
WRITE_FILE(S["job_civilian_low"] , job_civilian_low)
|
||||
WRITE_FILE(S["job_medsci_high"] , job_medsci_high)
|
||||
WRITE_FILE(S["job_medsci_high"] , job_medsci_high)
|
||||
WRITE_FILE(S["job_medsci_med"] , job_medsci_med)
|
||||
WRITE_FILE(S["job_medsci_low"] , job_medsci_low)
|
||||
WRITE_FILE(S["job_engsec_high"] , job_engsec_high)
|
||||
WRITE_FILE(S["job_engsec_high"] , job_engsec_high)
|
||||
WRITE_FILE(S["job_engsec_med"] , job_engsec_med)
|
||||
WRITE_FILE(S["job_engsec_low"] , job_engsec_low)
|
||||
//Record Flavor Text
|
||||
WRITE_FILE(S["security_records"] , security_records)
|
||||
WRITE_FILE(S["medical_records"] , medical_records)
|
||||
//hide c-key
|
||||
WRITE_FILE(S["hide_ckey"] , hide_ckey)
|
||||
//Quirks
|
||||
WRITE_FILE(S["security_records"] , security_records)
|
||||
WRITE_FILE(S["medical_records"] , medical_records)
|
||||
|
||||
//Misc.
|
||||
WRITE_FILE(S["special_roles"] , be_special) //Preferences don't load every character change
|
||||
WRITE_FILE(S["hide_ckey"] , hide_ckey)
|
||||
WRITE_FILE(S["all_quirks"] , all_quirks)
|
||||
|
||||
cit_character_pref_save(S)
|
||||
|
||||
Reference in New Issue
Block a user