mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +01:00
[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>
This commit is contained in:
co-authored by
Mothblocks
jjpark-kb
Gandalf
Azarak
parent
a5bfc42228
commit
124ddd7cca
+20
-10
@@ -15,8 +15,12 @@
|
||||
///Convert the bitflag define into the actual layer define
|
||||
var/static/list/all_layers = list(EXTERNAL_FRONT, EXTERNAL_ADJACENT, EXTERNAL_BEHIND)
|
||||
|
||||
///Defines what kind of 'organ' we're looking at. Sprites have names like 'm_firemoth_mothwings'. 'mothwings' would then be preference
|
||||
var/preference = ""
|
||||
///Defines what kind of 'organ' we're looking at. Sprites have names like 'm_firemoth_mothwings'. 'mothwings' would then be feature_key
|
||||
var/feature_key = ""
|
||||
|
||||
/// The savefile_key of the preference this relates to. Used for the preferences UI.
|
||||
var/preference
|
||||
|
||||
///Sprite datum we use to draw on the bodypart
|
||||
var/datum/sprite_accessory/sprite_datum
|
||||
///Key of the icon states of all the sprite_datums for easy caching
|
||||
@@ -80,7 +84,7 @@
|
||||
return
|
||||
|
||||
var/gender = (body_type == FEMALE) ? "f" : "m"
|
||||
var/finished_icon_state = (sprite_datum.gender_specific ? gender : "m") + "_" + preference + "_" + sprite_datum.icon_state + mutant_bodyparts_layertext(image_layer)
|
||||
var/finished_icon_state = (sprite_datum.gender_specific ? gender : "m") + "_" + feature_key + "_" + sprite_datum.icon_state + mutant_bodyparts_layertext(image_layer)
|
||||
var/mutable_appearance/appearance = mutable_appearance(sprite_datum.icon, finished_icon_state, layer = -image_layer)
|
||||
appearance.dir = image_dir
|
||||
|
||||
@@ -93,14 +97,16 @@
|
||||
overlay_list += appearance
|
||||
|
||||
/obj/item/organ/external/proc/set_sprite(sprite_name)
|
||||
return
|
||||
/* SKYRAT EDIT REMOVAL
|
||||
sprite_datum = get_sprite_datum(sprite_name)
|
||||
cache_key = generate_icon_cache()
|
||||
*/
|
||||
|
||||
///Generate a unique key based on our sprites. So that if we've aleady drawn these sprites, they can be found in the cache and wont have to be drawn again (blessing and curse)
|
||||
/obj/item/organ/external/proc/generate_icon_cache()
|
||||
if(sprite_datum)
|
||||
return "[sprite_datum.icon_state]_[preference]"
|
||||
return
|
||||
return ""
|
||||
//return "[sprite_datum.icon_state]_[feature_key]" SKYRAT EDIT REMOVAL
|
||||
|
||||
/**This exists so sprite accessories can still be per-layer without having to include that layer's
|
||||
* number in their sprite name, which causes issues when those numbers change.
|
||||
@@ -153,7 +159,8 @@
|
||||
slot = ORGAN_SLOT_EXTERNAL_HORNS
|
||||
layers = EXTERNAL_ADJACENT
|
||||
|
||||
preference = "horns"
|
||||
feature_key = "horns"
|
||||
preference = "feature_lizard_horns"
|
||||
|
||||
/obj/item/organ/external/horns/can_draw_on_bodypart(mob/living/carbon/human/human)
|
||||
return TRUE
|
||||
@@ -168,7 +175,8 @@
|
||||
slot = ORGAN_SLOT_EXTERNAL_FRILLS
|
||||
layers = EXTERNAL_ADJACENT
|
||||
|
||||
preference = "frills"
|
||||
feature_key = "frills"
|
||||
preference = "feature_lizard_frills"
|
||||
|
||||
/obj/item/organ/external/frills/can_draw_on_bodypart(mob/living/carbon/human/human)
|
||||
if(!(human.head?.flags_inv & HIDEEARS))
|
||||
@@ -186,7 +194,8 @@
|
||||
slot = ORGAN_SLOT_EXTERNAL_SNOUT
|
||||
layers = EXTERNAL_ADJACENT
|
||||
|
||||
preference = "snout"
|
||||
feature_key = "snout"
|
||||
preference = "feature_lizard_snout"
|
||||
|
||||
/obj/item/organ/external/snout/can_draw_on_bodypart(mob/living/carbon/human/human)
|
||||
if(!(human.wear_mask?.flags_inv & HIDESNOUT) && !(human.head?.flags_inv & HIDESNOUT))
|
||||
@@ -203,7 +212,8 @@
|
||||
slot = ORGAN_SLOT_EXTERNAL_ANTENNAE
|
||||
layers = EXTERNAL_FRONT | EXTERNAL_BEHIND
|
||||
|
||||
preference = "moth_antennae"
|
||||
feature_key = "moth_antennae"
|
||||
preference = "feature_moth_antennae"
|
||||
|
||||
///Are we burned?
|
||||
var/burnt = FALSE
|
||||
|
||||
+7
-6
@@ -4,7 +4,7 @@
|
||||
slot = ORGAN_SLOT_EXTERNAL_WINGS
|
||||
layers = EXTERNAL_BEHIND | EXTERNAL_ADJACENT | EXTERNAL_FRONT
|
||||
|
||||
preference = "wings"
|
||||
feature_key = "wings"
|
||||
|
||||
/obj/item/organ/external/wings/can_draw_on_bodypart(mob/living/carbon/human/human)
|
||||
if(!human.wear_suit)
|
||||
@@ -21,9 +21,9 @@
|
||||
var/datum/action/innate/flight/fly
|
||||
|
||||
///The preference type for opened wings
|
||||
var/wings_open_preference = "wingsopen"
|
||||
var/wings_open_feature_key = "wingsopen"
|
||||
///The preference type for closed wings
|
||||
var/wings_closed_preference = "wings"
|
||||
var/wings_closed_feature_key = "wings"
|
||||
|
||||
///Are our wings open or closed?
|
||||
var/wings_open = FALSE
|
||||
@@ -118,7 +118,7 @@
|
||||
|
||||
///SPREAD OUR WINGS AND FLLLLLYYYYYY
|
||||
/obj/item/organ/external/wings/functional/proc/open_wings()
|
||||
preference = wings_open_preference
|
||||
feature_key = wings_open_feature_key
|
||||
wings_open = TRUE
|
||||
|
||||
cache_key = generate_icon_cache() //we've changed preference to open, so we only need to update the key and ask for an update to change our sprite
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
///close our wings
|
||||
/obj/item/organ/external/wings/functional/proc/close_wings()
|
||||
preference = wings_closed_preference
|
||||
feature_key = wings_closed_feature_key
|
||||
wings_open = FALSE
|
||||
|
||||
cache_key = generate_icon_cache()
|
||||
@@ -155,7 +155,8 @@
|
||||
|
||||
///Moth wings! They can flutter in low-grav and burn off in heat
|
||||
/obj/item/organ/external/wings/moth
|
||||
preference = "moth_wings"
|
||||
feature_key = "moth_wings"
|
||||
preference = "feature_moth_wings"
|
||||
layers = EXTERNAL_BEHIND | EXTERNAL_FRONT
|
||||
|
||||
//dna_block = DNA_MOTH_WINGS_BLOCK SKYRAT EDIT REMOVAL
|
||||
|
||||
@@ -34,6 +34,12 @@
|
||||
|
||||
var/failure_time = 0
|
||||
|
||||
// Players can look at prefs before atoms SS init, and without this
|
||||
// they would not be able to see external organs, such as moth wings.
|
||||
// This is also necessary because assets SS is before atoms, and so
|
||||
// any nonhumans created in that time would experience the same effect.
|
||||
INITIALIZE_IMMEDIATE(/obj/item/organ)
|
||||
|
||||
/obj/item/organ/Initialize()
|
||||
. = ..()
|
||||
if(organ_flags & ORGAN_EDIBLE)
|
||||
|
||||
Reference in New Issue
Block a user