Adds a preference to have an intent check for guns (#3653)

what title says
This commit is contained in:
chaoko99
2017-12-17 01:37:16 -08:00
committed by Erki
parent 81e8d371de
commit c0ee47579d
11 changed files with 99 additions and 30 deletions
@@ -10,7 +10,7 @@
S["motd_hash"] >> pref.motd_hash
S["memo_hash"] >> pref.memo_hash
S["parallax_speed"] >> pref.parallax_speed
S["parallax_toggles"] >> pref.parallax_togs
S["toggles_secondary"] >> pref.toggles_secondary
/datum/category_item/player_setup_item/player_global/settings/save_preferences(var/savefile/S)
S["lastchangelog"] << pref.lastchangelog
@@ -20,7 +20,7 @@
S["motd_hash"] << pref.motd_hash
S["memo_hash"] << pref.memo_hash
S["parallax_speed"] << pref.parallax_speed
S["parallax_toggles"] << pref.parallax_togs
S["toggles_secondary"] << pref.toggles_secondary
/datum/category_item/player_setup_item/player_global/settings/gather_load_query()
return list(
@@ -32,9 +32,9 @@
"asfx_togs",
"lastmotd" = "motd_hash",
"lastmemo" = "memo_hash",
"parallax_toggles" = "parallax_togs",
"toggles_secondary" = "toggles_secondary",
"parallax_speed"
),
),
"args" = list("ckey")
)
)
@@ -66,7 +66,7 @@
"asfx_togs" = pref.asfx_togs,
"lastmotd" = pref.motd_hash,
"lastmemo" = pref.memo_hash,
"parallax_toggles" = pref.parallax_togs,
"toggles_secondary" = pref.toggles_secondary,
"parallax_speed" = pref.parallax_speed
)
@@ -81,7 +81,7 @@
pref.motd_hash = sanitize_text(pref.motd_hash, initial(pref.motd_hash))
pref.memo_hash = sanitize_text(pref.memo_hash, initial(pref.memo_hash))
pref.parallax_speed = sanitize_integer(text2num(pref.parallax_speed), 1, 10, initial(pref.parallax_speed))
pref.parallax_togs = sanitize_integer(text2num(pref.parallax_togs), 0, 65535, initial(pref.parallax_togs))
pref.toggles_secondary = sanitize_integer(text2num(pref.toggles_secondary), 0, 65535, initial(pref.toggles_secondary))
/datum/category_item/player_setup_item/player_global/settings/content(mob/user)
var/list/dat = list(
@@ -90,10 +90,10 @@
"<b>Ghost ears:</b> <a href='?src=\ref[src];toggle=[CHAT_GHOSTEARS]'><b>[(pref.toggles & CHAT_GHOSTEARS) ? "All Speech" : "Nearest Creatures"]</b></a><br>",
"<b>Ghost sight:</b> <a href='?src=\ref[src];toggle=[CHAT_GHOSTSIGHT]'><b>[(pref.toggles & CHAT_GHOSTSIGHT) ? "All Emotes" : "Nearest Creatures"]</b></a><br>",
"<b>Ghost radio:</b> <a href='?src=\ref[src];toggle=[CHAT_GHOSTRADIO]'><b>[(pref.toggles & CHAT_GHOSTRADIO) ? "All Chatter" : "Nearest Speakers"]</b></a><br>",
"<b>Space Parallax:</b> <a href='?src=\ref[src];paratoggle=[PARALLAX_SPACE]'><b>[(pref.parallax_togs & PARALLAX_SPACE) ? "Yes" : "No"]</b></a><br>",
"<b>Space Dust:</b> <a href='?src=\ref[src];paratoggle=[PARALLAX_DUST]'><b>[(pref.parallax_togs & PARALLAX_DUST) ? "Yes" : "No"]</b></a><br>",
"<b>Progress Bars:</b> <a href='?src=\ref[src];paratoggle=[PROGRESS_BARS]'><b>[(pref.parallax_togs & PROGRESS_BARS) ? "Yes" : "No"]</b></a><br>",
"<b>Static Space:</b> <a href='?src=\ref[src];paratoggle=[PARALLAX_IS_STATIC]'><b>[(pref.parallax_togs & PARALLAX_IS_STATIC) ? "Yes" : "No"]</b></a><br>"
"<b>Space Parallax:</b> <a href='?src=\ref[src];paratoggle=[PARALLAX_SPACE]'><b>[(pref.toggles_secondary & PARALLAX_SPACE) ? "Yes" : "No"]</b></a><br>",
"<b>Space Dust:</b> <a href='?src=\ref[src];paratoggle=[PARALLAX_DUST]'><b>[(pref.toggles_secondary & PARALLAX_DUST) ? "Yes" : "No"]</b></a><br>",
"<b>Progress Bars:</b> <a href='?src=\ref[src];paratoggle=[PROGRESS_BARS]'><b>[(pref.toggles_secondary & PROGRESS_BARS) ? "Yes" : "No"]</b></a><br>",
"<b>Static Space:</b> <a href='?src=\ref[src];paratoggle=[PARALLAX_IS_STATIC]'><b>[(pref.toggles_secondary & PARALLAX_IS_STATIC) ? "Yes" : "No"]</b></a><br>"
)
. = dat.Join()
@@ -111,7 +111,7 @@
if(href_list["paratoggle"])
var/flag = text2num(href_list["paratoggle"])
pref.parallax_togs ^= flag
pref.toggles_secondary ^= flag
return TOPIC_REFRESH
return ..()
+3 -1
View File
@@ -126,7 +126,7 @@ datum/preferences
// SPAAAACE
var/parallax_speed = 2
var/parallax_togs = PARALLAX_SPACE | PARALLAX_DUST | PROGRESS_BARS
var/toggles_secondary = PARALLAX_SPACE | PARALLAX_DUST | PROGRESS_BARS
var/list/pai = list() // A list for holding pAI related data.
@@ -142,6 +142,8 @@ datum/preferences
var/dress_mob = TRUE
/datum/preferences/New(client/C)
new_setup()
+21 -10
View File
@@ -1,4 +1,5 @@
//toggles
/client/verb/toggle_ghost_ears()
set name = "Show/Hide GhostEars"
set category = "Preferences"
@@ -150,13 +151,13 @@
set name = "Show/Hide Space Parallax"
set category = "Preferences"
set desc = "Toggles space parallax effects."
prefs.parallax_togs ^= PARALLAX_SPACE
prefs.toggles_secondary ^= PARALLAX_SPACE
prefs.save_preferences()
if (prefs.parallax_togs & PARALLAX_SPACE)
if (prefs.toggles_secondary & PARALLAX_SPACE)
src << "You will now see space parallax effects."
else
src << "You will no longer see space parallax effects."
if (mob.hud_used)
mob.hud_used.update_parallax()
@@ -165,13 +166,13 @@
set name = "Show/Hide Space Dust"
set category = "Preferences"
set desc = "Toggles space parallax dust."
prefs.parallax_togs ^= PARALLAX_DUST
prefs.toggles_secondary ^= PARALLAX_DUST
prefs.save_preferences()
if (prefs.parallax_togs & PARALLAX_DUST)
if (prefs.toggles_secondary & PARALLAX_DUST)
src << "You will now see space parallax dust effects."
else
src << "You will no longer see space parallax dust effects."
if (mob.hud_used)
mob.hud_used.update_parallax()
@@ -195,9 +196,9 @@
set category = "Preferences"
set desc = "Toggles progress bars on slow actions."
prefs.parallax_togs ^= PROGRESS_BARS
prefs.toggles_secondary ^= PROGRESS_BARS
prefs.save_preferences()
if (prefs.parallax_togs & PROGRESS_BARS)
if (prefs.toggles_secondary & PROGRESS_BARS)
src << "You will now see progress bars on delayed actions."
else
src << "You will no longer see progress bars on delayed actions."
@@ -207,10 +208,20 @@
set category = "Preferences"
set desc = "Toggles movement of parallax space."
prefs.parallax_togs ^= PARALLAX_IS_STATIC
prefs.toggles_secondary ^= PARALLAX_IS_STATIC
prefs.save_preferences()
if (prefs.parallax_togs & PARALLAX_IS_STATIC)
if (prefs.toggles_secondary & PARALLAX_IS_STATIC)
src << "Space will no longer move."
else
src << "Space will now move."
/client/verb/toggle_safety_check()
set name = "Toggle Gun Safety Check"
set category = "Preferences"
set desc = "Toggles firing guns on intents other than help."
prefs.toggles_secondary ^= SAFETY_CHECK //Held in Parallax because we don't want to deal with an SQL migration right now.
prefs.save_preferences()
src << "You will [(prefs.toggles_secondary & SAFETY_CHECK) ? "no longer" : "now"] fire your weapon on intents other than harm."