Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toggleable visibility of armor modules #810

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ede43be
ASRS without acces (for SDMM)
CheBokJam Nov 28, 2024
4482f4d
Merge branch 'master' of https://github.com/CheBokJam/Unga-MarinesTestxd
CheBokJam Nov 28, 2024
90bb0fc
Merge branch 'master' of https://github.com/CheBokJam/Unga-MarinesTestxd
CheBokJam Nov 28, 2024
2254c9a
Undo ASRS
CheBokJam Nov 29, 2024
e550f3c
Merge branch 'master' of https://github.com/CheBokJam/Unga-MarinesTestxd
CheBokJam Dec 4, 2024
3119f9a
Merge branch 'PMC-Unga-Marines:master' into master
CheBokJam Dec 5, 2024
a0f740e
Initial release xd
CheBokJam Dec 12, 2024
e9837e3
Sprite fixes on attach/detach
CheBokJam Dec 12, 2024
6a96564
Fix of N5 issue
CheBokJam Dec 13, 2024
449d979
Kilt layer change
CheBokJam Dec 13, 2024
d4bde68
Fixeki
CheBokJam Dec 19, 2024
8969b8b
Better code
CheBokJam Dec 19, 2024
cc5680b
Better code 2
CheBokJam Dec 20, 2024
fb8f663
Fixek 2
CheBokJam Dec 20, 2024
a366f87
Save hidden module in loadout
CheBokJam Dec 21, 2024
433368b
Colorable iff module with bugs
CheBokJam Dec 24, 2024
d3918b0
Try to fix shit box
CheBokJam Dec 26, 2024
20bc975
Shit code fix for box overlay instead of normal module
CheBokJam Dec 26, 2024
51d154d
First wave of colorable modules (easy ones) and coloring on right click
CheBokJam Dec 26, 2024
e0b3661
A lil bit of cleaning and sorting
CheBokJam Dec 26, 2024
a22e735
Merge branch 'master' into Armor-icons
CheBokJam Dec 26, 2024
202341d
Further cleaning and sorting
CheBokJam Dec 26, 2024
e197512
Ahem
CheBokJam Dec 26, 2024
6ba7443
AHEM
CheBokJam Dec 26, 2024
2cfc84d
Deleting of not really necessary item_state's
CheBokJam Dec 27, 2024
c44244d
Moving extra procs from subtype and cleaning my shitcode
CheBokJam Dec 27, 2024
67ce20d
Further cleaning
CheBokJam Dec 27, 2024
aba448d
1
CheBokJam Dec 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/attachments.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#define ATTACH_NO_HANDS (1<<5)
#define ATTACH_BYPASS_ALLOWED_LIST (1<<6)
#define ATTACH_DIFFERENT_MOB_ICON_STATE (1<<7)
#define ATTACH_CANNOT_BE_HIDDEN (1<<8)
#define ATTACH_IS_HIDDEN (1<<9)

//gun attachment slot defines
#define ATTACHMENT_SLOT_RAIL "rail"
Expand Down
12 changes: 6 additions & 6 deletions code/__DEFINES/loadout.dm
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ GLOBAL_LIST_INIT(marine_clothes_listed_products, list(
/obj/item/storage/pouch/pistol = list(CAT_POU, "Sidearm pouch", 0,"black"),
/obj/effect/vendor_bundle/mimir = list(CAT_ARMMOD, "Mimir Resistance set", 0,"black"),
/obj/effect/vendor_bundle/tyr = list(CAT_ARMMOD, "Mark 1 Tyr extra armor set", 0,"black"),
/obj/item/armor_module/module/ballistic_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/hod_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/better_shoulder_lamp = list(CAT_ARMMOD, "Baldur light armor module", 0,"black"),
/obj/effect/vendor_bundle/vali = list(CAT_ARMMOD, "Vali chemical enhancement set", 0,"black"),
/obj/item/armor_module/module/eshield = list(CAT_ARMMOD, "Svalinn Energy Shield System", 0 , "black"),
Expand Down Expand Up @@ -617,7 +617,7 @@ GLOBAL_LIST_INIT(robot_clothes_listed_products, list(
/obj/item/storage/pouch/pistol = list(CAT_POU, "Sidearm pouch", 0,"black"),
/obj/effect/vendor_bundle/mimir = list(CAT_ARMMOD, "Mimir Resistance set", 0,"black"),
/obj/effect/vendor_bundle/tyr = list(CAT_ARMMOD, "Mark 1 Tyr extra armor set", 0,"black"),
/obj/item/armor_module/module/ballistic_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/hod_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/better_shoulder_lamp = list(CAT_ARMMOD, "Baldur light armor module", 0,"black"),
/obj/item/armor_module/module/eshield = list(CAT_ARMMOD, "Svalinn Energy Shield System", 0 , "black"),
))
Expand Down Expand Up @@ -680,7 +680,7 @@ GLOBAL_LIST_INIT(engineer_clothes_listed_products, list(
/obj/item/storage/pouch/magazine/pistol/large = list(CAT_POU, "Pistol magazine pouch", 0, "black"),
/obj/item/storage/pouch/pistol = list(CAT_POU, "Sidearm pouch", 0, "black"),
/obj/effect/vendor_bundle/mimir = list(CAT_ARMMOD, "Mimir Resistance set", 0,"black"),
/obj/item/armor_module/module/ballistic_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/hod_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/effect/vendor_bundle/tyr = list(CAT_ARMMOD, "Mark 1 Tyr extra armor set", 0,"black"),
/obj/item/armor_module/module/better_shoulder_lamp = list(CAT_ARMMOD, "Baldur light armor module", 0,"black"),
/obj/effect/vendor_bundle/vali = list(CAT_ARMMOD, "Vali chemical enhancement set", 0,"black"),
Expand Down Expand Up @@ -737,7 +737,7 @@ GLOBAL_LIST_INIT(medic_clothes_listed_products, list(
/obj/item/storage/pouch/medkit/medic = list(CAT_POU, "Medkit pouch", 0, "orange"),
/obj/item/storage/pouch/medkit/t312/medic = list(CAT_POU, "Medkit pouch for EMB", 0, "orange"),
/obj/effect/vendor_bundle/mimir = list(CAT_ARMMOD, "Mimir Resistance set", 0,"black"),
/obj/item/armor_module/module/ballistic_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/hod_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/effect/vendor_bundle/tyr = list(CAT_ARMMOD, "Mark 1 Tyr extra armor set", 0,"black"),
/obj/item/armor_module/module/better_shoulder_lamp = list(CAT_ARMMOD, "Baldur light armor module", 0,"black"),
/obj/effect/vendor_bundle/vali = list(CAT_ARMMOD, "Vali chemical enhancement set", 0,"black"),
Expand Down Expand Up @@ -866,7 +866,7 @@ GLOBAL_LIST_INIT(leader_clothes_listed_products, list(
/obj/item/storage/pouch/explosive = list(CAT_POU, "Explosive pouch", 0, "black"),
/obj/effect/vendor_bundle/mimir = list(CAT_ARMMOD, "Mimir Resistance set", 0,"black"),
/obj/effect/vendor_bundle/tyr = list(CAT_ARMMOD, "Mark 1 Tyr extra armor set", 0,"black"),
/obj/item/armor_module/module/ballistic_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/hod_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/better_shoulder_lamp = list(CAT_ARMMOD, "Baldur light armor module", 0,"black"),
/obj/effect/vendor_bundle/vali = list(CAT_ARMMOD, "Vali chemical enhancement set", 0,"black"),
/obj/item/armor_module/module/eshield = list(CAT_ARMMOD, "Arrowhead Energy Shield System", 0 , "black"),
Expand Down Expand Up @@ -1048,7 +1048,7 @@ GLOBAL_LIST_INIT(commander_clothes_listed_products, list(
/obj/effect/vendor_bundle/tyr/two = list(CAT_ARMMOD, "Tyr extra armor set", 0,"black"),
/obj/effect/vendor_bundle/mimir/two = list(CAT_ARMMOD, "Mimir extra armor set", 0,"black"),
/obj/item/armor_module/module/valkyrie_autodoc = list(CAT_ARMMOD, "Valkyrie Automedical Armor System", 0 ,"black"),
/obj/item/armor_module/module/ballistic_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/hod_armor = list(CAT_ARMMOD, "Hod Accident Prevention Plating", 0,"black"),
/obj/item/armor_module/module/better_shoulder_lamp = list(CAT_ARMMOD, "Baldur light armor module", 0,"black"),
/obj/effect/vendor_bundle/vali = list(CAT_ARMMOD, "Vali chemical enhancement set", 0,"black"),
/obj/item/armor_module/module/eshield = list(CAT_ARMMOD, "Svalinn Energy Shield System", 0 , "black"),
Expand Down
18 changes: 9 additions & 9 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -429,15 +429,15 @@ GLOBAL_LIST_INIT(xenoupgradetiers, list(XENO_UPGRADE_BASETYPE, XENO_UPGRADE_INVA
#define GLOVES_LAYER 21
#define BELT_LAYER 20
#define GLASSES_LAYER 19
#define SUIT_LAYER 18 //Possible make this an overlay of somethign required to wear a belt?
#define HAIR_LAYER 17 //TODO: make part of head layer?
#define EARS_LAYER 16
#define FACEMASK_LAYER 15
#define GOGGLES_LAYER 14 //For putting Ballistic goggles and potentially other things above masks
#define HEAD_LAYER 13
#define COLLAR_LAYER 12
#define SUIT_STORE_LAYER 11
#define KAMA_LAYER 10
#define KAMA_LAYER 18
#define SUIT_LAYER 17 //Possible make this an overlay of somethign required to wear a belt?
#define HAIR_LAYER 16 //TODO: make part of head layer?
#define EARS_LAYER 15
#define FACEMASK_LAYER 14
#define GOGGLES_LAYER 13 //For putting Ballistic goggles and potentially other things above masks
#define HEAD_LAYER 12
#define COLLAR_LAYER 11
#define SUIT_STORE_LAYER 10
#define BACK_LAYER 9
#define CAPE_LAYER 8
#define HANDCUFF_LAYER 7
Expand Down
4 changes: 2 additions & 2 deletions code/__DEFINES/modular_armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#define COLOR_WHEEL "Color Wheel"
#define PRESET_COLORS "Preset Colors"
#define VARIANTS "Variant"
//RUTGMC ADDITION
#define HAIR_CONCEALING_CHANGE "Hair Concealing"
#define MODULE_VISIBILITY_TOGGLE "Toggle Module Visibility"

#define COLOR_WHEEL_ALLOWED (1<<0)
#define PRESET_COLORS_ALLOWED (1<<1)
#define ICON_STATE_VARIANTS_ALLOWED (1<<2)
//RUTGMC ADDITION
#define HAIR_CONCEALING_CHANGE_ALLOWED (1<<3)
#define MODULE_VISIBILITY_TOGGLE_ALLOWED (1<<4)


#define JUNGLE_VARIANT "jungle"
Expand Down
13 changes: 11 additions & 2 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,14 @@ GLOBAL_LIST_INIT(bitfields, list(
"AMMO_PASS_THROUGH_MOVABLE" = AMMO_PASS_THROUGH_MOVABLE,
"AMMO_PASS_THROUGH_MOB" = AMMO_PASS_THROUGH_MOB,
"AMMO_SOUND_PITCH" = AMMO_SOUND_PITCH,
"AMMO_SENTRY" = AMMO_SENTRY,
"AMMO_SENTRY" = AMMO_SENTRY
),
"colorable_allowed" = list(
"COLOR_WHEEL_ALLOWED" = COLOR_WHEEL_ALLOWED,
"PRESET_COLORS_ALLOWED" = PRESET_COLORS_ALLOWED,
"ICON_STATE_VARIANTS_ALLOWED" = ICON_STATE_VARIANTS_ALLOWED,
"HAIR_CONCEALING_CHANGE_ALLOWED" = HAIR_CONCEALING_CHANGE_ALLOWED,
"MODULE_VISIBILITY_TOGGLE_ALLOWED" = MODULE_VISIBILITY_TOGGLE_ALLOWED
),
"flags_attach_features" = list(
"ATTACH_REMOVABLE" = ATTACH_REMOVABLE,
Expand All @@ -450,7 +457,9 @@ GLOBAL_LIST_INIT(bitfields, list(
"ATTACH_SEPERATE_MOB_OVERLAY" = ATTACH_SEPERATE_MOB_OVERLAY,
"ATTACH_NO_HANDS" = ATTACH_NO_HANDS,
"ATTACH_BYPASS_ALLOWED_LIST" = ATTACH_BYPASS_ALLOWED_LIST,
"ATTACH_DIFFERENT_MOB_ICON_STATE" = ATTACH_DIFFERENT_MOB_ICON_STATE
"ATTACH_DIFFERENT_MOB_ICON_STATE" = ATTACH_DIFFERENT_MOB_ICON_STATE,
"ATTACH_CANNOT_BE_HIDDEN" = ATTACH_CANNOT_BE_HIDDEN,
"ATTACH_IS_HIDDEN" = ATTACH_IS_HIDDEN
),
"flags_barrier" = list(
"HANDLE_BARRIER_CHANCE" = HANDLE_BARRIER_CHANCE,
Expand Down
3 changes: 2 additions & 1 deletion code/datums/components/attachment_handler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@
else
suffix = "_m"
else
icon = attachment_data[OVERLAY_ICON]
if(!istype(attachment, /obj/item/armor_module/module))
icon = attachment_data[OVERLAY_ICON]
suffix = attachment.icon == icon ? "_a" : ""
var/mutable_appearance/new_overlay = mutable_appearance(icon, icon_state + suffix, -attachment_data[ATTACHMENT_LAYER])
if(CHECK_BITFIELD(attachment_data[FLAGS_ATTACH_FEATURES], ATTACH_SAME_ICON))
Expand Down
5 changes: 5 additions & 0 deletions code/datums/greyscale/_greyscale_config.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@
icon_bundle.Insert(generated_icon, icon_state)
icon_bundle = fcopy_rsc(icon_bundle)
icon_cache[key] = icon_bundle
/* //////////////////////DEBUG//////////////////////
if(istype(src, /datum/greyscale_config/modules))
var/filename = "tmp/test_module_spitesheet.dmi"
fcopy(icon(icon_bundle), filename)
*/
return icon(icon_bundle)

/// Internal recursive proc to handle nested layer groups
Expand Down
5 changes: 5 additions & 0 deletions code/datums/greyscale/greyscale_configs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -359,3 +359,8 @@

/datum/greyscale_config/xenonaut/helm/mk1
icon_file = 'icons/mob/modular/xenonauten_mk1.dmi'

///Armor modules
/datum/greyscale_config/modules
icon_file = 'icons/mob/modular/modular_armor_modules.dmi'
json_config = 'code/datums/greyscale/json_configs/modules.json'
99 changes: 99 additions & 0 deletions code/datums/greyscale/json_configs/modules.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
{
"mod_ff": [
{
"type":"icon_state",
"icon_state": "mod_ff",
"blend_mode": "add"
}
],
"mod_ff_a": [
{
"type": "hyperscale",
"icon_state": "mod_ff_a"
}
],
"mod_armor": [
{
"type":"icon_state",
"icon_state": "mod_armor",
"blend_mode": "add"
}
],
"mod_armor_a": [
{
"type": "hyperscale",
"icon_state": "mod_armor_a"
}
],
"mod_armor_lower": [
{
"type":"icon_state",
"icon_state": "mod_armor_lower",
"blend_mode": "add"
}
],
"mod_armor_lower_a": [
{
"type": "hyperscale",
"icon_state": "mod_armor_lower_a"
}
],
"mod_ff_head": [
{
"type":"icon_state",
"icon_state": "mod_ff_head",
"blend_mode": "add"
}
],
"mod_ff_head_a": [
{
"type": "hyperscale",
"icon_state": "mod_ff_head_a"
}
],
"tyr_head": [
{
"type":"icon_state",
"icon_state": "tyr_head",
"blend_mode": "add"
}
],
"tyr_head_a": [
{
"type": "hyperscale",
"icon_state": "tyr_head_a"
}
],
"tyr_head_xn_a": [
{
"type": "hyperscale",
"icon_state": "tyr_head_xn_a"
}
],
"welding_head": [
{
"type":"icon_state",
"icon_state": "welding_head",
"blend_mode": "add"
}
],
"welding_head_active": [
{
"type":"icon_state",
"icon_state": "welding_head_active",
"blend_mode": "add"
}
],
"welding_head_a": [
{
"type": "hyperscale",
"icon_state": "welding_head_a"
}
],
"welding_head_active_a": [
{
"type": "hyperscale",
"icon_state": "welding_head_active_a"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
/datum/item_representation/armor_module
///List of attachments on the armor.
var/list/datum/item_representation/armor_module/attachments = list()
///Flag for hiding modules
var/module_is_hided = FALSE

/datum/item_representation/armor_module/New(obj/item/item_to_copy)
if(!item_to_copy)
Expand All @@ -160,6 +162,9 @@
CRASH("/datum/item_representation/armor_module created from an item that is not a jaeger module")
..()
var/obj/item/armor_module/module_to_copy = item_to_copy
if(CHECK_BITFIELD(module_to_copy.flags_attach_features, ATTACH_IS_HIDDEN))
module_is_hided = TRUE

for(var/key in module_to_copy.attachments_by_slot)
if(!isitem(module_to_copy.attachments_by_slot[key]))
continue
Expand Down Expand Up @@ -191,6 +196,10 @@
qdel(module)
return
SEND_SIGNAL(thing_to_install_on, COMSIG_LOADOUT_VENDOR_VENDED_ARMOR_ATTACHMENT, module)
if(module_is_hided)
module.base_icon = module.icon_state
module.icon_state = null
module.flags_attach_features |= ATTACH_IS_HIDDEN

/datum/item_representation/armor_module/storage
///Storage repressentation of storage modules.
Expand Down
21 changes: 21 additions & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,8 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
selection_list += VARIANTS
if(colorable_allowed & HAIR_CONCEALING_CHANGE_ALLOWED)
selection_list += HAIR_CONCEALING_CHANGE
if(colorable_allowed & MODULE_VISIBILITY_TOGGLE_ALLOWED)
selection_list += MODULE_VISIBILITY_TOGGLE

var/selection
if(length(selection_list) == 1)
Expand Down Expand Up @@ -1421,6 +1423,25 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
current_hair_concealment = concealment_variant
switch_hair_concealment_flags(user)

if(MODULE_VISIBILITY_TOGGLE)
///Init armor var so we can call attachments_by_slot[] proc
var/obj/item/clothing/armor = src
///Module we want to hide
var/obj/item/armor_module/module_to_hide
for(var/attachment_slot in armor.attachments_by_slot)
if(istype(armor.attachments_by_slot[attachment_slot], /obj/item/armor_module/module))
module_to_hide = armor.attachments_by_slot[attachment_slot]
break
if(CHECK_BITFIELD(module_to_hide.flags_attach_features, ATTACH_IS_HIDDEN))
module_to_hide.icon_state = module_to_hide.base_icon
module_to_hide.flags_attach_features &= ~ATTACH_IS_HIDDEN
update_icon()
return
module_to_hide.icon_state = null
module_to_hide.flags_attach_features |= ATTACH_IS_HIDDEN
update_icon()
return

if(!new_color || !do_after(user, 1 SECONDS, NONE, src, BUSY_ICON_GENERIC))
return

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/machinery/vending/marine_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@
/obj/item/armor_module/module/mimir_environment_protection/mark1 = -1,
/obj/item/armor_module/module/mimir_environment_protection/mimir_helmet/mark1 = -1,
/obj/item/armor_module/module/tyr_extra_armor/mark1 = -1,
/obj/item/armor_module/module/ballistic_armor = -1,
/obj/item/armor_module/module/hod_armor = -1,
/obj/item/armor_module/module/hod_head = -1,
/obj/item/armor_module/module/better_shoulder_lamp = -1,
/obj/item/armor_module/module/pluto = -1,
Expand Down
Loading
Loading