mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-08-23 21:26:30 +01:00
Ports character setup subsystem from Bay
This commit is contained in:
@@ -77,6 +77,7 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
|
||||
#define FIRE_PRIORITY_VOTE 9
|
||||
#define FIRE_PRIORITY_AI 10
|
||||
#define FIRE_PRIORITY_GARBAGE 15
|
||||
#define FIRE_PRIORITY_CHARSETUP 25
|
||||
#define FIRE_PRIORITY_AIRFLOW 30
|
||||
#define FIRE_PRIORITY_AIR 35
|
||||
#define FIRE_PRIORITY_OBJ 40
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
SUBSYSTEM_DEF(character_setup)
|
||||
name = "Character Setup"
|
||||
init_order = INIT_ORDER_DEFAULT
|
||||
priority = FIRE_PRIORITY_CHARSETUP
|
||||
flags = SS_BACKGROUND
|
||||
wait = 1 SECOND
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
var/list/prefs_awaiting_setup = list()
|
||||
var/list/preferences_datums = list()
|
||||
var/list/newplayers_requiring_init = list()
|
||||
|
||||
var/list/save_queue = list()
|
||||
/*
|
||||
/datum/controller/subsystem/character_setup/Initialize()
|
||||
while(prefs_awaiting_setup.len)
|
||||
var/datum/preferences/prefs = prefs_awaiting_setup[prefs_awaiting_setup.len]
|
||||
prefs_awaiting_setup.len--
|
||||
prefs.setup()
|
||||
while(newplayers_requiring_init.len)
|
||||
var/mob/new_player/new_player = newplayers_requiring_init[newplayers_requiring_init.len]
|
||||
newplayers_requiring_init.len--
|
||||
new_player.deferred_login()
|
||||
. = ..()
|
||||
*/ //Might be useful if we ever switch to Bay prefs.
|
||||
/datum/controller/subsystem/character_setup/fire(resumed = FALSE)
|
||||
while(save_queue.len)
|
||||
var/datum/preferences/prefs = save_queue[save_queue.len]
|
||||
save_queue.len--
|
||||
|
||||
if(!QDELETED(prefs))
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/character_setup/proc/queue_preferences_save(var/datum/preferences/prefs)
|
||||
save_queue |= prefs
|
||||
@@ -15,7 +15,7 @@
|
||||
return
|
||||
|
||||
prefs.ignored_players |= key_to_ignore
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
usr << "<span class='notice'>Now ignoring <b>[key_to_ignore]</b>.</span>"
|
||||
|
||||
/client/verb/unignore(key_to_unignore as text)
|
||||
@@ -31,7 +31,7 @@
|
||||
usr << "<span class='warning'>[key_to_unignore] isn't being ignored.</span>"
|
||||
return
|
||||
prefs.ignored_players -= key_to_unignore
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
usr << "<span class='notice'>Reverted ignore on <b>[key_to_unignore]</b>.</span>"
|
||||
|
||||
/mob/proc/is_key_ignored(var/key_to_check)
|
||||
|
||||
@@ -580,7 +580,7 @@ var/list/admin_verbs_event_manager = list(
|
||||
prefs.ooccolor = input(src, "Please select your OOC colour.", "OOC colour") as color
|
||||
else if(response == "Reset to default")
|
||||
prefs.ooccolor = initial(prefs.ooccolor)
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","OC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear all mob speech as a ghost.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TGEars") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] see all emotes as a ghost.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TGVision") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear all radios as a ghost.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TGRadio") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear dead chat as a ghost.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TDeadChat") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(/datum/client_preference/show_ooc)) ? "now" : "no longer"] hear global out of character chat.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear local out of character chat.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TLOOC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] have the speech indicator.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TTIND") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] receive noise from admin messages.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TAHelp") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear music in the lobby.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TLobMusic") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -145,7 +145,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear MIDIs from admins.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TAMidis") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear ambient noise.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TAmbience") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -175,7 +175,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear weather sounds.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TWeatherSounds") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] hear a hum from the supermatter.")
|
||||
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TSupermatterHum") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
if(!role_flag) return
|
||||
|
||||
prefs.be_special ^= role_flag
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
to_chat(src,"You will [(prefs.be_special & role_flag) ? "now" : "no longer"] be considered for [role] events (where possible).")
|
||||
|
||||
@@ -216,7 +216,7 @@
|
||||
|
||||
var/pref_path = /datum/client_preference/safefiring
|
||||
toggle_preference(pref_path)
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
to_chat(src,"You will now use [(is_preference_enabled(/datum/client_preference/safefiring)) ? "safe" : "dangerous"] firearms firing.")
|
||||
|
||||
@@ -229,7 +229,7 @@
|
||||
|
||||
var/pref_path = /datum/client_preference/mob_tooltips
|
||||
toggle_preference(pref_path)
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
to_chat(src,"You will now [(is_preference_enabled(/datum/client_preference/mob_tooltips)) ? "see" : "not see"] mob tooltips.")
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
|
||||
var/pref_path = /datum/client_preference/instrument_toggle
|
||||
toggle_preference(pref_path)
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
to_chat(src, "You will now [(is_preference_enabled(/datum/client_preference/instrument_toggle)) ? "hear" : "not hear"] instruments being played.")
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
if(check_rights(R_ADMIN|R_DEBUG))
|
||||
toggle_preference(pref_path)
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] receive debug logs.")
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -276,6 +276,6 @@
|
||||
if(check_rights(R_ADMIN|R_MOD))
|
||||
toggle_preference(pref_path)
|
||||
to_chat(src,"You will [ (is_preference_enabled(pref_path)) ? "now" : "no longer"] receive attack logs.")
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
|
||||
feedback_add_details("admin_verb","TBeSpecial") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -77,5 +77,5 @@ var/global/list/all_tooltip_styles = list(
|
||||
prefs.UI_style = UI_style_new
|
||||
prefs.UI_style_alpha = UI_style_alpha_new
|
||||
prefs.UI_style_color = UI_style_color_new
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
usr << "UI was saved"
|
||||
|
||||
@@ -423,7 +423,7 @@
|
||||
src << browse('html/changelog.html', "window=changes;size=675x650")
|
||||
if(prefs.lastchangelog != changelog_hash)
|
||||
prefs.lastchangelog = changelog_hash
|
||||
prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(prefs)
|
||||
winset(src, "rpane.changelog", "background-color=none;font-style=;")
|
||||
|
||||
/mob/verb/observe()
|
||||
|
||||
@@ -303,7 +303,7 @@
|
||||
var/savefile/F = get_server_news()
|
||||
if(F)
|
||||
client.prefs.lastnews = md5(F["body"])
|
||||
client.prefs.save_preferences()
|
||||
SScharacter_setup.queue_preferences_save(client.prefs)
|
||||
|
||||
var/dat = "<html><body><center>"
|
||||
dat += "<h1>[F["title"]]</h1>"
|
||||
|
||||
@@ -193,6 +193,7 @@
|
||||
#include "code\controllers\subsystems\air.dm"
|
||||
#include "code\controllers\subsystems\airflow.dm"
|
||||
#include "code\controllers\subsystems\atoms.dm"
|
||||
#include "code\controllers\subsystems\character_setup.dm"
|
||||
#include "code\controllers\subsystems\circuits.dm"
|
||||
#include "code\controllers\subsystems\events.dm"
|
||||
#include "code\controllers\subsystems\garbage.dm"
|
||||
|
||||
Reference in New Issue
Block a user