Skip to content

Commit

Permalink
fixing wing/tail previews & antennae regression
Browse files Browse the repository at this point in the history
  • Loading branch information
CliffracerX committed Sep 19, 2024
1 parent a094a67 commit 7fa92cc
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
29 changes: 29 additions & 0 deletions modular_doppler/modular_customization/preferences/antennae.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,32 @@

/datum/preference/choiced/moth_antennae/create_default_value()
return /datum/sprite_accessory/moth_antennae/none::name



/// Overwrite lives here
// Moth antennae have their own bespoke RGB code.
/datum/bodypart_overlay/mutant/antennae/color_image(image/overlay, draw_layer, obj/item/bodypart/limb)
if(limb == null)
return ..()
if(limb.owner == null)
return ..()
var/color_intended = COLOR_WHITE

var/tcol_1 = limb.owner.dna.features["moth_antennae_1"]
var/tcol_2 = limb.owner.dna.features["moth_antennae_2"]
var/tcol_3 = limb.owner.dna.features["moth_antennae_3"]
if(tcol_1 && tcol_2 && tcol_3)
//this is beyond ugly but it works
var/r1 = hex2num(copytext(tcol_1, 2, 4)) / 255.0
var/g1 = hex2num(copytext(tcol_1, 4, 6)) / 255.0
var/b1 = hex2num(copytext(tcol_1, 6, 8)) / 255.0
var/r2 = hex2num(copytext(tcol_2, 2, 4)) / 255.0
var/g2 = hex2num(copytext(tcol_2, 4, 6)) / 255.0
var/b2 = hex2num(copytext(tcol_2, 6, 8)) / 255.0
var/r3 = hex2num(copytext(tcol_3, 2, 4)) / 255.0
var/g3 = hex2num(copytext(tcol_3, 4, 6)) / 255.0
var/b3 = hex2num(copytext(tcol_3, 6, 8)) / 255.0
color_intended = list(r1,g1,b1, r2,g2,b2, r3,g3,b3)
overlay.color = color_intended
return overlay
29 changes: 28 additions & 1 deletion modular_doppler/modular_customization/preferences/tail.dm
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,10 @@
var/datum/sprite_accessory/chosen_tail = SSaccessories.tails_list_humanoid[value]
return generate_back_icon(chosen_tail, "tail")

#define WIDTH_WINGS_FILE 45
#define HEIGHT_WINGS_FILE 34
#define WIDTH_BIGTAILS_FILE 64
#define HEIGHT_BIGTAILS_FILE 32

/// Proc to gen that icon
// We don't wanna copy paste this
Expand All @@ -488,16 +492,39 @@
markings_icon_2.Blend(COLOR_VIBRANT_LIME, ICON_MULTIPLY)
var/icon/markings_icon_3 = icon(sprite_accessory.icon, "m_[key]_[sprite_accessory.icon_state]_BEHIND_3", NORTH)
markings_icon_3.Blend(COLOR_BLUE, ICON_MULTIPLY)
// A couple icon files use this plus-size setup; autocrop to generate better icons where possible
if(markings_icon_1.Width() == WIDTH_WINGS_FILE && markings_icon_1.Height() == HEIGHT_WINGS_FILE)
markings_icon_1.Crop(8, 2, 39, 33)
markings_icon_2.Crop(8, 2, 39, 33)
markings_icon_3.Crop(8, 2, 39, 33)
if(markings_icon_1.Width() == WIDTH_BIGTAILS_FILE && markings_icon_1.Height() == HEIGHT_BIGTAILS_FILE) // Plus-size tail files are simpler
markings_icon_1.Crop(17, 1, 48, 32)
markings_icon_2.Crop(17, 1, 48, 32)
markings_icon_3.Crop(17, 1, 48, 32)
// finally apply icons
markings_icon_1.Blend(final_icon, ICON_OVERLAY)
markings_icon_2.Blend(final_icon, ICON_OVERLAY)
markings_icon_3.Blend(final_icon, ICON_OVERLAY)
final_icon.Blend(markings_icon_1, ICON_OVERLAY)
final_icon.Blend(markings_icon_2, ICON_OVERLAY)
final_icon.Blend(markings_icon_3, ICON_OVERLAY)
// front breaker
/// == front breaker ==
var/icon/markings_icon_1_f = icon(sprite_accessory.icon, "m_[key]_[sprite_accessory.icon_state]_FRONT", NORTH)
markings_icon_1_f.Blend(COLOR_RED, ICON_MULTIPLY)
var/icon/markings_icon_2_f = icon(sprite_accessory.icon, "m_[key]_[sprite_accessory.icon_state]_FRONT_2", NORTH)
markings_icon_2_f.Blend(COLOR_VIBRANT_LIME, ICON_MULTIPLY)
var/icon/markings_icon_3_f = icon(sprite_accessory.icon, "m_[key]_[sprite_accessory.icon_state]_FRONT_3", NORTH)
markings_icon_3_f.Blend(COLOR_BLUE, ICON_MULTIPLY)
// A couple icon files use this plus-size setup; autocrop to generate better icons where possible
if(markings_icon_1_f.Width() == WIDTH_WINGS_FILE && markings_icon_1_f.Height() == HEIGHT_WINGS_FILE)
markings_icon_1_f.Crop(8, 2, 39, 33)
markings_icon_2_f.Crop(8, 2, 39, 33)
markings_icon_3_f.Crop(8, 2, 39, 33)
else if(markings_icon_1_f.Width() == WIDTH_BIGTAILS_FILE && markings_icon_1_f.Height() == HEIGHT_BIGTAILS_FILE) // Plus-size tail files are simpler
markings_icon_1_f.Crop(17, 1, 48, 32)
markings_icon_2_f.Crop(17, 1, 48, 32)
markings_icon_3_f.Crop(17, 1, 48, 32)
// finally apply icons
final_icon.Blend(markings_icon_1_f, ICON_OVERLAY)
final_icon.Blend(markings_icon_2_f, ICON_OVERLAY)
final_icon.Blend(markings_icon_3_f, ICON_OVERLAY)
Expand Down
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6677,6 +6677,7 @@
#include "modular_doppler\modular_customization\preferences\snout.dm"
#include "modular_doppler\modular_customization\preferences\tail.dm"
#include "modular_doppler\modular_customization\preferences\wings.dm"
#include "modular_doppler\modular_customization\tri_color\antennae.dm"
#include "modular_doppler\modular_customization\tri_color\body_marking_lizard.dm"
#include "modular_doppler\modular_customization\tri_color\body_marking_moth.dm"
#include "modular_doppler\modular_customization\tri_color\cap.dm"
Expand Down

0 comments on commit 7fa92cc

Please sign in to comment.