From 31a89ff320fa5b1755b6cab8f47263850bbd12ca Mon Sep 17 00:00:00 2001 From: AnturK Date: Sat, 19 Dec 2015 15:39:19 +0100 Subject: [PATCH] Makes inquisitiveness client preference --- code/_onclick/observer.dm | 14 +------------- code/modules/client/preferences.dm | 1 + code/modules/client/preferences_savefile.dm | 2 ++ code/modules/client/preferences_toggles.dm | 12 ++++++++++++ 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm index 199d09a1588..c6ccee3352f 100644 --- a/code/_onclick/observer.dm +++ b/code/_onclick/observer.dm @@ -1,15 +1,3 @@ -/client/var/inquisitive_ghost = 1 -/mob/dead/observer/verb/toggle_inquisition() // warning: unexpected inquisition - set name = "Toggle Inquisitiveness" - set desc = "Sets whether your ghost examines everything on click by default" - set category = "Ghost" - if(!client) return - client.inquisitive_ghost = !client.inquisitive_ghost - if(client.inquisitive_ghost) - src << "You will now examine everything you click on." - else - src << "You will no longer examine things you click on." - /mob/dead/observer/DblClickOn(var/atom/A, var/params) if(client.buildmode) build_click(src, client.buildmode, params, A) @@ -57,7 +45,7 @@ if(user.client) if(check_rights(R_ADMIN, 0)) attack_ai(user) - if(user.client.inquisitive_ghost) + if(user.client.prefs.inquisitive_ghost) user.examinate(src) return diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 6ecd2f7f27f..ab0bd232b9b 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -33,6 +33,7 @@ var/list/preferences_datums = list() var/ghost_form = "ghost" var/ghost_orbit = GHOST_ORBIT_CIRCLE var/ghost_hud = 1 + var/inquisitive_ghost = 1 var/allow_midround_antag = 1 var/preferred_map = null diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 728bdd65a2c..b6a823ea3fc 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -182,6 +182,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["preferred_map"] >> preferred_map S["ignoring"] >> ignoring S["ghost_hud"] >> ghost_hud + S["inquisitive_ghost"] >> inquisitive_ghost //try to fix any outdated data if necessary if(needs_update >= 0) @@ -222,6 +223,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["preferred_map"] << preferred_map S["ignoring"] << ignoring S["ghost_hud"] << ghost_hud + S["inquisitive_ghost"] << inquisitive_ghost return 1 diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index c09b28f4d5f..4ac9a20fe8c 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -264,3 +264,15 @@ var/global/list/ghost_orbits = list(GHOST_ORBIT_CIRCLE,GHOST_ORBIT_TRIANGLE,GHOS prefs.save_preferences() if(istype(mob,/mob/dead/observer)) mob.hud_used.ghost_hud() + +/client/verb/toggle_inquisition() // warning: unexpected inquisition + set name = "Toggle Inquisitiveness" + set desc = "Sets whether your ghost examines everything on click by default" + set category = "Preferences" + + prefs.inquisitive_ghost = !prefs.inquisitive_ghost + prefs.save_preferences() + if(prefs.inquisitive_ghost) + src << "You will now examine everything you click on." + else + src << "You will no longer examine things you click on." \ No newline at end of file