Merge pull request #15808 from Putnam3145/rep-investment

Allows setting antags to "low" (if antag rep is on)
This commit is contained in:
silicons
2022-08-31 15:09:27 -07:00
committed by GitHub
8 changed files with 41 additions and 55 deletions

View File

@@ -1005,11 +1005,9 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += "<font color=red><b>You are banned from antagonist roles.</b></font>"
src.be_special = list()
dat += "<b>DISABLE ALL ANTAGONISM</b> <a href='?_src_=prefs;preference=disable_antag'>[(toggles & NO_ANTAG) ? "YES" : "NO"]</a><br>"
for (var/i in GLOB.special_roles)
if(i == ROLE_NO_ANTAGONISM)
dat += "<b>DISABLE ALL ANTAGONISM</b> <a href='?_src_=prefs;preference=be_special;be_special_type=[i]'>[(i in be_special) ? "YES" : "NO"]</a><br>"
continue
if(jobban_isbanned(user, i))
dat += "<b>Be [capitalize(i)]:</b> <a href='?_src_=prefs;jobbancheck=[i]'>BANNED</a><br>"
else
@@ -1022,7 +1020,15 @@ GLOBAL_LIST_EMPTY(preferences_datums)
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>"
var/enabled_text = ""
if(i in be_special)
if(be_special[i] >= 1)
enabled_text = "Enabled"
else
enabled_text = "Low"
else
enabled_text = "Disabled"
dat += "<b>Be [capitalize(i)]:</b> <a href='?_src_=prefs;preference=be_special;be_special_type=[i]'>[enabled_text]</a><br>"
dat += "<b>Midround Antagonist:</b> <a href='?_src_=prefs;preference=allow_midround_antag'>[(toggles & MIDROUND_ANTAG) ? "Enabled" : "Disabled"]</a><br>"
dat += "<br>"
@@ -2936,12 +2942,19 @@ GLOBAL_LIST_EMPTY(preferences_datums)
deadmin ^= DEADMIN_POSITION_SILICON
//
if("disable_antag")
toggles ^= NO_ANTAG
if("be_special")
var/be_special_type = href_list["be_special_type"]
if(be_special_type in be_special)
be_special -= be_special_type
if(be_special[be_special_type] >= 1)
be_special -= be_special_type
else
be_special[be_special_type] = 1
else
be_special += be_special_type
be_special[be_special_type] = 0
if("name")
be_random_name = !be_random_name

View File

@@ -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 55
#define SAVEFILE_VERSION_MAX 56
/*
SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn
@@ -42,14 +42,20 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
//if your savefile is 3 months out of date, then 'tough shit'.
/datum/preferences/proc/update_preferences(current_version, savefile/S)
if(current_version < 55) //Bitflag toggles don't set their defaults when they're added, always defaulting to off instead.
toggles |= SOUND_BARK
if(current_version < 46) //If you remove this, remove force_reset_keybindings() too.
force_reset_keybindings_direct(TRUE)
addtimer(CALLBACK(src, .proc/force_reset_keybindings), 30) //No mob available when this is run, timer allows user choice.
if(current_version < 30)
outline_enabled = TRUE
outline_color = COLOR_THEME_MIDNIGHT
if(current_version < 46) //If you remove this, remove force_reset_keybindings() too.
force_reset_keybindings_direct(TRUE)
addtimer(CALLBACK(src, .proc/force_reset_keybindings), 30) //No mob available when this is run, timer allows user choice.
if(current_version < 55) //Bitflag toggles don't set their defaults when they're added, always defaulting to off instead.
toggles |= SOUND_BARK
if(current_version < 56)
if("NO_ANTAGS" in be_special)
toggles |= NO_ANTAG
be_special -= "NO_ANTAGS"
for(var/be_special_type in be_special)
be_special[be_special_type] = 1
/datum/preferences/proc/update_character(current_version, savefile/S)
if(current_version < 19)