mirror of
https://github.com/KabKebab/GS13.git
synced 2026-07-15 01:46:41 +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
|
||||
|
||||
Reference in New Issue
Block a user