diff --git a/aurorastation.dme b/aurorastation.dme index 9a326b613d5..2e4e3eeed82 100644 --- a/aurorastation.dme +++ b/aurorastation.dme @@ -1603,6 +1603,7 @@ #include "code\modules\clothing\factions\portantillia.dm" #include "code\modules\clothing\factions\scc.dm" #include "code\modules\clothing\factions\vysoka.dm" +#include "code\modules\clothing\glasses\colorable.dm" #include "code\modules\clothing\glasses\glasses.dm" #include "code\modules\clothing\glasses\hud.dm" #include "code\modules\clothing\gloves\attackby.dm" diff --git a/code/_helpers/_global_objects.dm b/code/_helpers/_global_objects.dm index 4a77edce5fb..b42c2cfb17d 100644 --- a/code/_helpers/_global_objects.dm +++ b/code/_helpers/_global_objects.dm @@ -1,3 +1,4 @@ //Gear tweaks and underwear. var/datum/gear_tweak/color/gear_tweak_free_color_choice = new() +var/datum/gear_tweak/alpha/gear_tweak_alpha_choice = new() var/datum/category_collection/underwear/global_underwear = new() diff --git a/code/game/objects/items/items_icon.dm b/code/game/objects/items/items_icon.dm index 4f2c55aecae..8566e2bf9cf 100644 --- a/code/game/objects/items/items_icon.dm +++ b/code/game/objects/items/items_icon.dm @@ -31,6 +31,7 @@ var/list/mob_icon_icon_states = list() I.appearance = H.species.equip_overlays[image_key] return I var/image/I = overlay_image(mob_icon, mob_state, color, RESET_COLOR|RESET_ALPHA) + I.alpha = alpha if(alpha_mask) var/icon/mob_overlay_icon = new(mob_icon, mob_state) var/icon/mask = new(mob_icon, alpha_mask) diff --git a/code/modules/client/preference_setup/loadout/_defines.dm b/code/modules/client/preference_setup/loadout/_defines.dm index 75e69e22a1c..fc01db100c9 100644 --- a/code/modules/client/preference_setup/loadout/_defines.dm +++ b/code/modules/client/preference_setup/loadout/_defines.dm @@ -1,6 +1,7 @@ -#define GEAR_NO_SELECTION 0 -#define GEAR_HAS_COLOR_SELECTION 1 -#define GEAR_HAS_ADDITIONAL_COLOR_SELECTION 2 -#define GEAR_HAS_NAME_SELECTION 4 -#define GEAR_HAS_DESC_SELECTION 8 -#define GEAR_HAS_COLOR_ROTATION_SELECTION 16 \ No newline at end of file +#define GEAR_NO_SELECTION BITFLAG(0) +#define GEAR_HAS_COLOR_SELECTION BITFLAG(1) +#define GEAR_HAS_ALPHA_SELECTION BITFLAG(2) +#define GEAR_HAS_ADDITIONAL_COLOR_SELECTION BITFLAG(3) +#define GEAR_HAS_NAME_SELECTION BITFLAG(4) +#define GEAR_HAS_DESC_SELECTION BITFLAG(5) +#define GEAR_HAS_COLOR_ROTATION_SELECTION BITFLAG(6) diff --git a/code/modules/client/preference_setup/loadout/gear_tweaks.dm b/code/modules/client/preference_setup/loadout/gear_tweaks.dm index 99aedeff199..15cbf1656dd 100644 --- a/code/modules/client/preference_setup/loadout/gear_tweaks.dm +++ b/code/modules/client/preference_setup/loadout/gear_tweaks.dm @@ -46,6 +46,27 @@ Color adjustment return I.color = sanitize_hexcolor(metadata, I.color) +/* +Alpha adjustment +*/ + +/datum/gear_tweak/alpha/get_contents(var/metadata) + return "Alpha (0-255): [metadata]" + +/datum/gear_tweak/alpha/get_default() + return 255 + +/datum/gear_tweak/alpha/get_random() + return 255 + +/datum/gear_tweak/alpha/get_metadata(var/user, var/metadata, var/title = "Character Preference") + var/selected_alpha = input(user, "Choose a color.", title, metadata) as num|null + selected_alpha = Clamp(selected_alpha, 0, 255) + return selected_alpha + +/datum/gear_tweak/alpha/tweak_item(var/obj/item/item, var/metadata, var/mob/living/carbon/human/H) + item.alpha = metadata + /* Additional Color adjustment */ diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm index 644222d9f33..2bc6e2b75ea 100644 --- a/code/modules/client/preference_setup/loadout/loadout.dm +++ b/code/modules/client/preference_setup/loadout/loadout.dm @@ -388,6 +388,8 @@ var/list/gear_datums = list() description = initial(O.desc) if(flags & GEAR_HAS_COLOR_SELECTION) gear_tweaks += list(gear_tweak_free_color_choice) + if(flags & GEAR_HAS_ALPHA_SELECTION) + gear_tweaks += list(gear_tweak_alpha_choice) if(flags & GEAR_HAS_ADDITIONAL_COLOR_SELECTION) gear_tweaks += list(gear_tweak_additional_color) if(flags & GEAR_HAS_NAME_SELECTION) diff --git a/code/modules/client/preference_setup/loadout/loadout_eyes.dm b/code/modules/client/preference_setup/loadout/loadout_eyes.dm index 858affe1f08..afd6781bec7 100644 --- a/code/modules/client/preference_setup/loadout/loadout_eyes.dm +++ b/code/modules/client/preference_setup/loadout/loadout_eyes.dm @@ -161,3 +161,8 @@ goggles["goggles, medical (PMCG)"] = list(/obj/item/clothing/glasses/safety/goggles/medical/pmc, "Private Military Contracting Group") goggles["goggles, medical (Zeng-Hu)"] = list(/obj/item/clothing/glasses/safety/goggles/medical/zeng, "Zeng-Hu Pharmaceuticals") gear_tweaks += new /datum/gear_tweak/path/faction(goggles) + +/datum/gear/eyes/colorable + display_name = "colorable glasses" + path = /obj/item/clothing/glasses/colorable + flags = GEAR_HAS_COLOR_SELECTION | GEAR_HAS_ALPHA_SELECTION | GEAR_HAS_ADDITIONAL_COLOR_SELECTION diff --git a/code/modules/clothing/glasses/colorable.dm b/code/modules/clothing/glasses/colorable.dm new file mode 100644 index 00000000000..4cde56988a1 --- /dev/null +++ b/code/modules/clothing/glasses/colorable.dm @@ -0,0 +1,29 @@ +/obj/item/clothing/glasses/colorable + name = "colorable glasses" + desc = "These are glasses." + icon = 'icons/obj/item/clothing/eyes/colorable_glasses.dmi' + icon_state = "colorable_glasses" + item_state = "colorable_glasses" + icon_override = null + contained_sprite = TRUE + update_icon_on_init = TRUE + var/additional_color = COLOR_GRAY // The default color. + +/obj/item/clothing/glasses/colorable/update_icon() + cut_overlays() + var/image/frame = image(icon, null, "colorable_glasses_frame") + frame.appearance_flags = RESET_COLOR|RESET_ALPHA + frame.color = additional_color + add_overlay(frame) + +/obj/item/clothing/glasses/colorable/build_additional_parts(mob/living/carbon/human/H, mob_icon, slot) + var/image/image = ..() + if(slot == slot_glasses_str) + var/image/frame = image(mob_icon, null, "colorable_glasses_ey_frame") + frame.appearance_flags = RESET_COLOR|RESET_ALPHA + frame.color = additional_color + if(image) + image.add_overlay(frame) + else + image = frame + return image diff --git a/html/changelogs/geeves-cool_glasses.yml b/html/changelogs/geeves-cool_glasses.yml new file mode 100644 index 00000000000..1eb0b7936c0 --- /dev/null +++ b/html/changelogs/geeves-cool_glasses.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Added colorable glasses to the loadout." \ No newline at end of file diff --git a/icons/obj/item/clothing/eyes/colorable_glasses.dmi b/icons/obj/item/clothing/eyes/colorable_glasses.dmi new file mode 100644 index 00000000000..9211cfab652 Binary files /dev/null and b/icons/obj/item/clothing/eyes/colorable_glasses.dmi differ