Files
Bubberstation/code/modules/client/preferences/ghost.dm
SkyratBot 124ddd7cca [MIRROR] tgui Preferences Menu + total rewrite of the preferences backend (#8153)
* tgui Preferences Menu + total rewrite of the preferences backend

* nah, we dont need to ping those people

* trying to remove the funny stuff

* unmodularizing this

* prefs reset

* this may need to be reverted, who knows

* okay, this part

* perhaps

* EEEEEEEEE

* unsanitary

* E

* Stage 1 + loadout system

* more fixes

* E

* I mean, it launches?

* More fixes and reorganisation

* E

* customisation code is spaget.

* disable ERP prefs

* Update erp_preferences.dm

* Update erp_preferences.dm

* E

* Slowly getting there

* It may be time for help :)

* tri...colors... help

* preferences now pass preferences

* Update dna.dm

* Fuck this man

* missing savefile return, set_species works, removed dumb stuff from updateappearance

* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8199

* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8224

* https://github.com/tgstation/tgstation/pull/61519

* https://github.com/Skyrat-SS13/Skyrat-tg/pull/8278

* e

* le butonAZARAK HELLO

* hhh

* Proper recognition where it's due, MrMelbert!

* EEEE

* examine block

* Better gen hit sounds from whitedream

* final loadout touches, more bug fixes im sure to come

* i said there would be bugfixes

* Update LoadoutManager.js

* Missing preferences in the html menu

* LIVE TESTING PHASE BABY

* Update LoadoutManager.js

* EEE

* LAUNCH TEST FIRE

* Update job.dm

* Update new_player.dm

* 50gb DAY ONE PATCH

* EEE

* Update preferences.dm

* buggle fixes

* Update examine.dm

* >LOOC starts on

Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
Co-authored-by: jjpark-kb <55967837+jjpark-kb@users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
Co-authored-by: Azarak <azarak10@gmail.com>
2021-09-23 00:40:37 +01:00

179 lines
5.0 KiB
Plaintext

/// Determines what accessories your ghost will look like they have.
/datum/preference/choiced/ghost_accessories
savefile_key = "ghost_accs"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
/datum/preference/choiced/ghost_accessories/init_possible_values()
return list(GHOST_ACCS_NONE, GHOST_ACCS_DIR, GHOST_ACCS_FULL)
/datum/preference/choiced/ghost_accessories/create_default_value()
return GHOST_ACCS_DEFAULT_OPTION
/datum/preference/choiced/ghost_accessories/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
ghost.ghost_accs = value
ghost.update_appearance()
/datum/preference/choiced/ghost_accessories/deserialize(input, datum/preferences/preferences)
// Old ghost preferences used to be 1/50/100.
// Whoever did that wasted an entire day of my time trying to get those sent
// properly, so I'm going to buck them.
if (isnum(input))
switch (input)
if (1)
input = GHOST_ACCS_NONE
if (50)
input = GHOST_ACCS_DIR
if (100)
input = GHOST_ACCS_FULL
return ..(input)
/// Determines the appearance of your ghost to others, when you are a BYOND member
/datum/preference/choiced/ghost_form
savefile_key = "ghost_form"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
should_generate_icons = TRUE
var/static/list/ghost_forms = list(
"catghost" = "Cat",
"ghost" = "Default",
"ghost_black" = "Black",
"ghost_blazeit" = "Blaze it",
"ghost_blue" = "Blue",
"ghost_camo" = "Camo",
"ghost_cyan" = "Cyan",
"ghost_dblue" = "Dark blue",
"ghost_dcyan" = "Dark cyan",
"ghost_dgreen" = "Dark green",
"ghost_dpink" = "Dark pink",
"ghost_dred" = "Dark red",
"ghost_dyellow" = "Dark yellow",
"ghost_fire" = "Fire",
"ghost_funkypurp" = "Funky purple",
"ghost_green" = "Green",
"ghost_grey" = "Grey",
"ghost_mellow" = "Mellow",
"ghost_pink" = "Pink",
"ghost_pinksherbert" = "Pink Sherbert",
"ghost_purpleswirl" = "Purple Swirl",
"ghost_rainbow" = "Rainbow",
"ghost_red" = "Red",
"ghost_yellow" = "Yellow",
"ghostian2" = "Ian",
"ghostking" = "King",
"skeleghost" = "Skeleton",
)
/datum/preference/choiced/ghost_form/init_possible_values()
var/list/values = list()
for (var/ghost_form in ghost_forms)
values[ghost_form] = icon('icons/mob/mob.dmi', ghost_form)
return values
/datum/preference/choiced/ghost_form/create_default_value()
return "ghost"
/datum/preference/choiced/ghost_form/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
if (!client.is_content_unlocked())
return
ghost.update_icon(ALL, value)
/datum/preference/choiced/ghost_form/compile_constant_data()
var/list/data = ..()
data[CHOICED_PREFERENCE_DISPLAY_NAMES] = ghost_forms
return data
/// Toggles the HUD for ghosts
/datum/preference/toggle/ghost_hud
savefile_key = "ghost_hud"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
/datum/preference/toggle/ghost_hud/apply_to_client(client/client, value)
if (isobserver(client?.mob))
client?.mob.hud_used?.show_hud()
/// Determines what ghosts orbiting look like to you.
/datum/preference/choiced/ghost_orbit
savefile_key = "ghost_orbit"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
/datum/preference/choiced/ghost_orbit/init_possible_values()
return list(
GHOST_ORBIT_CIRCLE,
GHOST_ORBIT_TRIANGLE,
GHOST_ORBIT_SQUARE,
GHOST_ORBIT_HEXAGON,
GHOST_ORBIT_PENTAGON,
)
/datum/preference/choiced/ghost_orbit/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
if (!client.is_content_unlocked())
return
ghost.ghost_orbit = value
/// Determines how to show other ghosts
/datum/preference/choiced/ghost_others
savefile_key = "ghost_others"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES
/datum/preference/choiced/ghost_others/init_possible_values()
return list(
GHOST_OTHERS_SIMPLE,
GHOST_OTHERS_DEFAULT_SPRITE,
GHOST_OTHERS_THEIR_SETTING,
)
/datum/preference/choiced/ghost_others/create_default_value()
return GHOST_OTHERS_DEFAULT_OPTION
/datum/preference/choiced/ghost_others/apply_to_client(client/client, value)
var/mob/dead/observer/ghost = client.mob
if (!istype(ghost))
return
ghost.update_sight()
/datum/preference/choiced/ghost_others/deserialize(input, datum/preferences/preferences)
// Old ghost preferences used to be 1/50/100.
// Whoever did that wasted an entire day of my time trying to get those sent
// properly, so I'm going to buck them.
if (isnum(input))
switch (input)
if (1)
input = GHOST_OTHERS_SIMPLE
if (50)
input = GHOST_OTHERS_DEFAULT_SPRITE
if (100)
input = GHOST_OTHERS_THEIR_SETTING
return ..(input, preferences)
/// Whether or not ghosts can examine things by clicking on them.
/datum/preference/toggle/inquisitive_ghost
savefile_key = "inquisitive_ghost"
savefile_identifier = PREFERENCE_PLAYER
category = PREFERENCE_CATEGORY_GAME_PREFERENCES