Skip to content

Commit

Permalink
Enable pride pins
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorenon committed Oct 28, 2024
1 parent d97e202 commit cd68f9a
Show file tree
Hide file tree
Showing 11 changed files with 113 additions and 18 deletions.
1 change: 1 addition & 0 deletions code/__DEFINES/traits/monkestation/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
#define TRAIT_LOUD_ASS "loud_ass"
#define TRAIT_MINING_CALLOUTS "miner_callouts"
#define TRAIT_PARANOIA "paranoia"
#define TRAIT_PRIDE_PIN "pride_pin"
#define TRAIT_STABLE_ASS "stable_ass"
#define TRAIT_STOWAWAY "stowaway"
#define TRAIT_UNSTABLE_ASS "unstable_ass"
Expand Down
41 changes: 25 additions & 16 deletions code/datums/quirks/neutral_quirks/pride_pin.dm
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
// /datum/quirk/item_quirk/pride_pin
// name = "Pride Pin"
// desc = "Show off your pride with this changing pride pin!"
// icon = FA_ICON_RAINBOW
// value = 0
// gain_text = span_notice("You feel fruity.")
// lose_text = span_danger("You feel only slightly less fruity than before.")
// medical_record_text = "Patient appears to be fruity."
/datum/quirk/item_quirk/pride_pin
name = "Pride Pin"
desc = "Show off your pride with this changing pride pin!"
icon = FA_ICON_RAINBOW
value = 0
//MONKESTATION EDIT START
mob_trait = TRAIT_PRIDE_PIN
quirk_flags = QUIRK_CHANGES_APPEARANCE
gain_text = span_notice("You feel proud to be queer.")
lose_text = span_danger("You decide to repress your feelings.")
//MONKESTATION EDIT END

// /datum/quirk/item_quirk/pride_pin/add_unique(client/client_source)
// var/obj/item/clothing/accessory/pride/pin = new(get_turf(quirk_holder))
/datum/quirk/item_quirk/pride_pin/add_unique(client/client_source)
var/obj/item/clothing/accessory/pride/pin = new(get_turf(quirk_holder))

// var/pride_choice = client_source?.prefs?.read_preference(/datum/preference/choiced/pride_pin) || assoc_to_keys(GLOB.pride_pin_reskins)[1]
// var/pride_reskin = GLOB.pride_pin_reskins[pride_choice]
var/pride_choice = client_source?.prefs?.read_preference(/datum/preference/choiced/pride_pin) || assoc_to_keys(GLOB.pride_pin_reskins)[1]
var/pride_reskin = GLOB.pride_pin_reskins[pride_choice]

// pin.current_skin = pride_choice
// pin.icon_state = pride_reskin

// give_item_to_holder(pin, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS))
pin.current_skin = pride_choice
pin.icon_state = pride_reskin
//MONKESTATION EDIT START
var/mob/living/carbon/human/H = quirk_holder
if (istype(H))
var/obj/item/clothing/under/U = H.w_uniform
if(U && U.attach_accessory(pin))
return
//MONKESTATION EDIT END
give_item_to_holder(pin, list(LOCATION_BACKPACK = ITEM_SLOT_BACKPACK, LOCATION_HANDS = ITEM_SLOT_HANDS))
16 changes: 16 additions & 0 deletions code/modules/client/preferences/pride_pin.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/datum/preference/choiced/pride_pin
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_key = "pride_pin"
savefile_identifier = PREFERENCE_CHARACTER

/datum/preference/choiced/pride_pin/init_possible_values()
return assoc_to_keys(GLOB.pride_pin_reskins)

/datum/preference/choiced/pride_pin/is_accessible(datum/preferences/preferences)
if (!..(preferences))
return FALSE

return "Pride Pin" in preferences.all_quirks

/datum/preference/choiced/pride_pin/apply_to_human(mob/living/carbon/human/target, value)
return
5 changes: 4 additions & 1 deletion code/modules/clothing/under/_under.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
//make the sensor mode favor higher levels, except coords.
sensor_mode = pick(SENSOR_VITALS, SENSOR_VITALS, SENSOR_VITALS, SENSOR_LIVING, SENSOR_LIVING, SENSOR_COORDS, SENSOR_COORDS, SENSOR_OFF)
register_context()
AddElement(/datum/element/update_icon_updates_onmob, flags = ITEM_SLOT_ICLOTHING|ITEM_SLOT_OCLOTHING, body = TRUE)
// MONKESTATION EDIT START
// AddElement(/datum/element/update_icon_updates_onmob, flags = ITEM_SLOT_ICLOTHING|ITEM_SLOT_OCLOTHING, body = TRUE) - original
AddElement(/datum/element/update_icon_updates_onmob, flags = ITEM_SLOT_ICLOTHING|ITEM_SLOT_OCLOTHING|ITEM_SLOT_NECK, body = TRUE)
// MONKESTATION EDIT END

/obj/item/clothing/under/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = NONE
Expand Down
5 changes: 4 additions & 1 deletion code/modules/clothing/under/accessories/_accessories.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@
SIGNAL_HANDLER

accessory_dropped(source, user)
user.update_clothing(ITEM_SLOT_ICLOTHING|ITEM_SLOT_OCLOTHING)
// MONKESTATION EDIT START
// user.update_clothing(ITEM_SLOT_ICLOTHING|ITEM_SLOT_OCLOTHING) - original
user.update_clothing(ITEM_SLOT_ICLOTHING|ITEM_SLOT_OCLOTHING|ITEM_SLOT_NECK)
// MONKESTATION EDIT END

/// Called when the uniform this accessory is pinned to is equipped in a valid slot
/obj/item/clothing/accessory/proc/accessory_equipped(obj/item/clothing/under/clothes, mob/living/user)
Expand Down
1 change: 1 addition & 0 deletions code/modules/vending/clothesmate.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"name" = "Accessories",
"icon" = "glasses",
"products" = list(
/obj/item/clothing/accessory/pride = 15,
/obj/item/clothing/accessory/waistcoat = 4,
/obj/item/clothing/suit/toggle/suspenders = 4,
/obj/item/clothing/neck/tie/horrible = 3,
Expand Down
43 changes: 43 additions & 0 deletions monkestation/code/modules/clothing/neck/_neck.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/obj/item/clothing/neck
var/cover_accessories = TRUE

/obj/item/clothing/neck/Initialize(mapload)
. = ..()
register_context()

/obj/item/clothing/neck/alt_click_secondary(mob/user)
. = ..()
if(.)
return
if(!can_use(user))
return
cover_accessories = !cover_accessories
if(cover_accessories)
to_chat(usr, span_notice("You adjust [src] to cover accessories."))
else
to_chat(usr, span_notice("You adjust [src] to show accessories."))

user.update_clothing(ITEM_SLOT_NECK)
update_appearance()

/obj/item/clothing/neck/add_context(atom/source, list/context, obj/item/held_item, mob/living/user)
. = ..()
context[SCREENTIP_CONTEXT_ALT_RMB] = "[cover_accessories ? "Uncover" : "Cover"] accessories"
return CONTEXTUAL_SCREENTIP_SET

/obj/item/clothing/neck/worn_overlays(mutable_appearance/standing, isinhands = FALSE)
. = ..()
if(isinhands)
return
if(cover_accessories)
return
var/mob/living/carbon/human/wearer = loc
if(!ishuman(wearer) || !wearer.w_uniform)
return
var/obj/item/clothing/under/undershirt = wearer.w_uniform
if(!istype(undershirt) || !LAZYLEN(undershirt.attached_accessories))
return

var/obj/item/clothing/accessory/displayed = undershirt.attached_accessories[1]
if(displayed.above_suit)
. += undershirt.accessory_overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/obj/item/clothing/accessory/pride/accessory_equipped(obj/item/clothing/under/clothes, mob/living/user)
if(HAS_TRAIT(user, TRAIT_PRIDE_PIN))
user.add_mood_event("pride_pin", /datum/mood_event/pride_pin)

/obj/item/clothing/accessory/pride/accessory_dropped(obj/item/clothing/under/clothes, mob/living/user)
user.clear_mood_event("pride_pin")
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
description = "Glory to the hunt."
mood_change = 10
hidden = TRUE

/datum/mood_event/pride_pin
description = "I love showing off my pride pin!"
mood_change = 1
3 changes: 3 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -3432,6 +3432,7 @@
#include "code\modules\cargo\exports\gear.dm"
#include "code\modules\cargo\exports\large_objects.dm"
#include "code\modules\cargo\exports\lavaland.dm"
#include "code\modules\client\preferences\pride_pin.dm"
#include "code\modules\cargo\exports\manifest.dm"
#include "code\modules\cargo\exports\materials.dm"
#include "code\modules\cargo\exports\organs.dm"
Expand Down Expand Up @@ -6934,6 +6935,7 @@
#include "monkestation\code\modules\cargo\crates\imports.dm"
#include "monkestation\code\modules\cargo\crates\large.dm"
#include "monkestation\code\modules\cargo\crates\livestock.dm"
#include "monkestation\code\modules\clothing\neck\_neck.dm"
#include "monkestation\code\modules\cargo\crates\materials.dm"
#include "monkestation\code\modules\cargo\crates\medical.dm"
#include "monkestation\code\modules\cargo\crates\organic.dm"
Expand All @@ -6958,6 +6960,7 @@
#include "monkestation\code\modules\cassettes\machines\dj_station.dm"
#include "monkestation\code\modules\cassettes\machines\portable_mixer.dm"
#include "monkestation\code\modules\cassettes\machines\postbox.dm"
#include "monkestation\code\modules\clothing\under\accessories\badges.dm"
#include "monkestation\code\modules\cassettes\machines\radio_mic.dm"
#include "monkestation\code\modules\cassettes\machines\stationary_mixer.dm"
#include "monkestation\code\modules\cassettes\machines\media\__base_machine.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { FeatureChoiced, FeatureDropdownInput } from '../base';

export const pride_pin: FeatureChoiced = {
name: 'Pride Pin',
component: FeatureDropdownInput,
};

0 comments on commit cd68f9a

Please sign in to comment.