diff --git a/code/__DEFINES/greyscale_guns.dm b/code/__DEFINES/greyscale_guns.dm deleted file mode 100644 index e9210970526aa..0000000000000 --- a/code/__DEFINES/greyscale_guns.dm +++ /dev/null @@ -1,27 +0,0 @@ -#define GUN_ICONSTATE_LOADED "loaded" -#define GUN_ICONSTATE_UNLOADED "unloaded" -#define GUN_ICONSTATE_UNRACKED "unracked" - - -#define GUN_PALETTE_TAN "#3F382E#61574A#978872" -#define GUN_PALETTE_RED "#531D1D#8A3D3D#9F5547" -#define GUN_PALETTE_DARK_RED "#361E1E#532F36#65373F" -#define GUN_PALETTE_PINK "#4B2641#7E4970#915477" -#define GUN_PALETTE_SILVER "#686868#8F8F8F#C1C1C1" -#define GUN_PALETTE_DRAB "#363021#444732#665F44" -#define GUN_PALETTE_BLACK "#121212#272727#393939" -#define GUN_PALETTE_BROWN "#3D321F#4E3B32#5F4C3A" -#define GUN_PALETTE_BLUE "#27262C#363942#5C6164" - - -#define GUN_PALETTE_LIST list( \ - "Tan" = GUN_PALETTE_TAN, \ - "Red" = GUN_PALETTE_RED, \ - "Dark Red" = GUN_PALETTE_DARK_RED, \ - "Pink" = GUN_PALETTE_PINK, \ - "Silver" = GUN_PALETTE_SILVER, \ - "Drab" = GUN_PALETTE_DRAB, \ - "Black" = GUN_PALETTE_BLACK, \ - "Brown" = GUN_PALETTE_BROWN, \ - "Gun Metal Blue" = GUN_PALETTE_BLUE, \ -) diff --git a/code/controllers/subsystem/greyscale.dm b/code/controllers/subsystem/greyscale.dm index a4544c66057ff..de933bb8e276f 100644 --- a/code/controllers/subsystem/greyscale.dm +++ b/code/controllers/subsystem/greyscale.dm @@ -28,17 +28,6 @@ SUBSYSTEM_DEF(greyscale) cache_list(helmet.colorable_colors, helmet.greyscale_config) qdel(helmet) - for(var/obj/item/weapon/gun/gun_type AS in subtypesof(/obj/item/weapon/gun)) - if(!initial(gun_type.greyscale_config)) - continue - var/obj/item/weapon/gun/gun = new gun_type() - cache_list(gun.colorable_colors, gun.greyscale_config) - for(var/key in gun.item_icons) - if(!ispath(gun.item_icons[key], /datum/greyscale_config)) - continue - cache_list(gun.colorable_colors, gun.item_icons[key]) - qdel(gun) - return ..() ///Proc built to handle cacheing the nested lists of armor colors found in code/modules/clothing/modular_armor diff --git a/code/datums/greyscale/greyscale_configs.dm b/code/datums/greyscale/greyscale_configs.dm index ccafdb19995d3..beed282c3a2d2 100644 --- a/code/datums/greyscale/greyscale_configs.dm +++ b/code/datums/greyscale/greyscale_configs.dm @@ -244,119 +244,6 @@ json_config = 'code/datums/greyscale/json_configs/projectiles.json' icon_file = 'icons/obj/items/projectiles.dmi' - - -///Guns -//AR-12 -/datum/greyscale_config/gun - icon_file = 'icons/Marine/gun_greyscale/t12/t12.dmi' - json_config = 'code/datums/greyscale/json_configs/gun.json' - -/datum/greyscale_config/gun/worn - icon_file = 'icons/Marine/gun_greyscale/t12/back.dmi' - json_config = 'code/datums/greyscale/json_configs/gun_worn.json' - -/datum/greyscale_config/gun/worn/suit - icon_file = 'icons/Marine/gun_greyscale/t12/suit.dmi' - -/datum/greyscale_config/gun/worn/l_hand - icon_file = 'icons/Marine/gun_greyscale/t12/left_hand.dmi' - json_config = 'code/datums/greyscale/json_configs/gun_held.json' - -/datum/greyscale_config/gun/worn/r_hand - icon_file = 'icons/Marine/gun_greyscale/t12/right_hand.dmi' - json_config = 'code/datums/greyscale/json_configs/gun_held.json' - -//AR-18 - -/datum/greyscale_config/gun/t18 - icon_file = 'icons/Marine/gun_greyscale/t18/t18.dmi' - -/datum/greyscale_config/gun/worn/t18 - icon_file = 'icons/Marine/gun_greyscale/t18/back.dmi' - -/datum/greyscale_config/gun/worn/suit/t18 - icon_file = 'icons/Marine/gun_greyscale/t18/suit.dmi' - -/datum/greyscale_config/gun/worn/l_hand/t18 - icon_file = 'icons/Marine/gun_greyscale/t18/left_hand.dmi' - -/datum/greyscale_config/gun/worn/r_hand/t18 - icon_file = 'icons/Marine/gun_greyscale/t18/right_hand.dmi' - -//MG-42 -/datum/greyscale_config/gun/t42 - icon_file = 'icons/Marine/gun_greyscale/t42/t42.dmi' - -/datum/greyscale_config/gun/worn/t42 - icon_file = 'icons/Marine/gun_greyscale/t42/back.dmi' - -/datum/greyscale_config/gun/worn/suit/t42 - icon_file = 'icons/Marine/gun_greyscale/t42/suit.dmi' - -/datum/greyscale_config/gun/worn/l_hand/t42 - icon_file = 'icons/Marine/gun_greyscale/t42/left_hand.dmi' - -/datum/greyscale_config/gun/worn/r_hand/t42 - icon_file = 'icons/Marine/gun_greyscale/t42/right_hand.dmi' - -//P-14 - -/datum/greyscale_config/gun/t14 - icon_file = 'icons/Marine/gun_greyscale/t14/t14.dmi' - json_config = 'code/datums/greyscale/json_configs/gun_with_belt.json' - -/datum/greyscale_config/gun/t14/l_hand - icon_file = 'icons/Marine/gun_greyscale/t14/left_hand.dmi' - json_config = 'code/datums/greyscale/json_configs/gun_held.json' - -/datum/greyscale_config/gun/t14/r_hand - icon_file = 'icons/Marine/gun_greyscale/t14/right_hand.dmi' - json_config = 'code/datums/greyscale/json_configs/gun_held.json' - - -//SMG-90 - -/datum/greyscale_config/gun/t90 - icon_file = 'icons/Marine/gun_greyscale/t90/t90.dmi' - -/datum/greyscale_config/gun/worn/t90 - icon_file = 'icons/Marine/gun_greyscale/t90/back.dmi' - -/datum/greyscale_config/gun/worn/suit/t90 - icon_file = 'icons/Marine/gun_greyscale/t90/suit.dmi' - -/datum/greyscale_config/gun/worn/l_hand/t90 - icon_file = 'icons/Marine/gun_greyscale/t90/left_hand.dmi' - -/datum/greyscale_config/gun/worn/r_hand/t90 - icon_file = 'icons/Marine/gun_greyscale/t90/right_hand.dmi' - -//SG-35 - -/datum/greyscale_config/gun/t35 - icon_file = 'icons/Marine/gun_greyscale/t35/t35.dmi' - -/datum/greyscale_config/gun/worn/t35 - icon_file = 'icons/Marine/gun_greyscale/t35/back.dmi' - -/datum/greyscale_config/gun/worn/suit/t35 - icon_file = 'icons/Marine/gun_greyscale/t35/suit.dmi' - -/datum/greyscale_config/gun/worn/l_hand/t35 - icon_file = 'icons/Marine/gun_greyscale/t35/left_hand.dmi' - -/datum/greyscale_config/gun/worn/r_hand/t35 - icon_file = 'icons/Marine/gun_greyscale/t35/right_hand.dmi' - - - - -///Gun attachments -/datum/greyscale_config/gun_attachment - icon_file = 'icons/Marine/gun_attachments_greyscale/t35_stock.dmi' - json_config = 'code/datums/greyscale/json_configs/gun_attachment.json' - /* * MECHS */ diff --git a/code/datums/greyscale/json_configs/gun.json b/code/datums/greyscale/json_configs/gun.json deleted file mode 100644 index a96a87bbbbcd2..0000000000000 --- a/code/datums/greyscale/json_configs/gun.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "loaded": [ - { - "type": "icon_state", - "icon_state": "gun_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_uncolored", - "blend_mode": "overlay" - } - ], - "unloaded" : [ - { - "type": "icon_state", - "icon_state": "gun_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_uncolored_e", - "blend_mode": "overlay" - } - ], - "unracked" : [ - { - "type": "icon_state", - "icon_state": "gun_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_uncolored_u", - "blend_mode": "overlay" - } - ] - -} diff --git a/code/datums/greyscale/json_configs/gun_attachment.json b/code/datums/greyscale/json_configs/gun_attachment.json deleted file mode 100644 index 772fdc503a29e..0000000000000 --- a/code/datums/greyscale/json_configs/gun_attachment.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "": [ - { - "type": "icon_state", - "icon_state": "color_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "color_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "color_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "uncolored", - "blend_mode": "overlay" - } - ] -} diff --git a/code/datums/greyscale/json_configs/gun_held.json b/code/datums/greyscale/json_configs/gun_held.json deleted file mode 100644 index e6e97857a75e6..0000000000000 --- a/code/datums/greyscale/json_configs/gun_held.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "": [ - { - "type": "icon_state", - "icon_state": "mob_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "mob_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "mob_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "mob_uncolored", - "blend_mode": "overlay" - } - ], - "wielded": [ - { - "type": "icon_state", - "icon_state": "mob_1_w", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "mob_2_w", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "mob_3_w", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "mob_uncolored_w", - "blend_mode": "overlay" - } - ] -} diff --git a/code/datums/greyscale/json_configs/gun_with_belt.json b/code/datums/greyscale/json_configs/gun_with_belt.json deleted file mode 100644 index 165773011c4e5..0000000000000 --- a/code/datums/greyscale/json_configs/gun_with_belt.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "loaded": [ - { - "type": "icon_state", - "icon_state": "gun_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_uncolored", - "blend_mode": "overlay" - } - ], - "unloaded" : [ - { - "type": "icon_state", - "icon_state": "gun_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_uncolored_e", - "blend_mode": "overlay" - } - ], - "unracked" : [ - { - "type": "icon_state", - "icon_state": "gun_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_uncolored_u", - "blend_mode": "overlay" - } - ], - "belt" : [ - { - "type": "icon_state", - "icon_state": "gun_belt_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_belt_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_belt_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_belt_uncolored", - "blend_mode": "overlay" - } - ], - "belt_empty" : [ - { - "type": "icon_state", - "icon_state": "gun_belt_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "gun_belt_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "gun_belt_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "gun_belt_uncolored_e", - "blend_mode": "overlay" - } - ] - - -} diff --git a/code/datums/greyscale/json_configs/gun_worn.json b/code/datums/greyscale/json_configs/gun_worn.json deleted file mode 100644 index 321154fc82726..0000000000000 --- a/code/datums/greyscale/json_configs/gun_worn.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "": [ - { - "type": "icon_state", - "icon_state": "mob_1", - "blend_mode": "overlay", - "color_ids": [ 1 ] - }, - { - "type": "icon_state", - "icon_state": "mob_2", - "blend_mode": "overlay", - "color_ids": [ 2 ] - }, - { - "type": "icon_state", - "icon_state": "mob_3", - "blend_mode": "overlay", - "color_ids": [ 3 ] - }, - { - "type": "icon_state", - "icon_state": "mob_uncolored", - "blend_mode": "overlay" - } - ] -} diff --git a/code/datums/loadout/item_representation/_item_representation.dm b/code/datums/loadout/item_representation/_item_representation.dm index b768a73013fa6..9c3819a604e98 100644 --- a/code/datums/loadout/item_representation/_item_representation.dm +++ b/code/datums/loadout/item_representation/_item_representation.dm @@ -8,16 +8,11 @@ var/obj/item/item_type /// If it's allowed to bypass the vendor check var/bypass_vendor_check = FALSE - /// If the item is able to be greyscaled, saves the colors - var/greyscale_colors /datum/item_representation/New(obj/item/item_to_copy) if(!item_to_copy) return item_type = item_to_copy.type - if(!item_to_copy.greyscale_config) - return - greyscale_colors = item_to_copy.greyscale_colors /** * This will attempt to instantiate an object. @@ -36,11 +31,6 @@ to_chat(user, span_warning("[item_type] in your loadout is an invalid item, it has probably been changed or removed.")) return var/obj/item/item = new item_type(master) - - if(greyscale_colors) - item.set_greyscale_colors(greyscale_colors) - item.update_icon() - return item /** @@ -48,11 +38,7 @@ */ /datum/item_representation/proc/get_tgui_data() var/list/tgui_data = list() - var/icon/icon_to_convert - if(greyscale_colors) - icon_to_convert = icon(SSgreyscale.GetColoredIconByType(initial(item_type.greyscale_config), greyscale_colors), initial(item_type.icon_state), dir = SOUTH) - else - icon_to_convert = icon(initial(item_type.icon), initial(item_type.icon_state), SOUTH) + var/icon/icon_to_convert = icon(initial(item_type.icon), initial(item_type.icon_state), SOUTH) tgui_data["icons"] = list(list( "icon" = icon2base64(icon_to_convert), "translateX" = NO_OFFSET, diff --git a/code/datums/loadout/item_representation/armor_representation.dm b/code/datums/loadout/item_representation/armor_representation.dm index dc83fbc6f9f68..184e54143e14a 100644 --- a/code/datums/loadout/item_representation/armor_representation.dm +++ b/code/datums/loadout/item_representation/armor_representation.dm @@ -130,13 +130,25 @@ * This is only able to representate items of type /obj/item/armor_module/armor */ /datum/item_representation/armor_module/colored + ///The color of that armor module + var/greyscale_colors /datum/item_representation/armor_module/colored/New(obj/item/item_to_copy) if(!item_to_copy) return if(!ismodulararmorarmorpiece(item_to_copy)) CRASH("/datum/item_representation/armor_module created from an item that is not a jaeger armor piece") - return ..() + ..() + greyscale_colors = item_to_copy.greyscale_colors + +/datum/item_representation/armor_module/colored/instantiate_object(datum/loadout_seller/seller, master = null, mob/living/user) + . = ..() + if(!.) + return + var/obj/item/armor_module/armor/armor = . + if(greyscale_colors) + armor.set_greyscale_colors(greyscale_colors) + armor.update_icon() /datum/item_representation/armor_module/storage ///Storage repressentation of storage modules. diff --git a/code/datums/loadout/item_representation/helmet_representation.dm b/code/datums/loadout/item_representation/helmet_representation.dm index 50aa66ae9f8e7..6c2e636047f66 100644 --- a/code/datums/loadout/item_representation/helmet_representation.dm +++ b/code/datums/loadout/item_representation/helmet_representation.dm @@ -3,6 +3,8 @@ * This is only able to representate items of type /obj/item/clothing/head/modular */ /datum/item_representation/modular_helmet + ///The color of the helmet + var/greyscale_colors ///The attachments installed. var/list/datum/item_representation/armor_module/attachments = list() ///Icon_state suffix for the saved icon_state varient. @@ -24,6 +26,7 @@ attachments += new /datum/item_representation/armor_module/storage(helmet_to_copy.attachments_by_slot[key]) continue attachments += new /datum/item_representation/armor_module(helmet_to_copy.attachments_by_slot[key]) + greyscale_colors = helmet_to_copy.greyscale_colors /datum/item_representation/modular_helmet/instantiate_object(datum/loadout_seller/seller, master = null, mob/living/user) . = ..() @@ -33,6 +36,8 @@ modular_helmet.current_variant = (current_variant in modular_helmet.icon_state_variants) ? current_variant : initial(modular_helmet.current_variant) for(var/datum/item_representation/armor_module/armor_attachement AS in attachments) armor_attachement.install_on_armor(seller, modular_helmet, user) + if(greyscale_colors) + modular_helmet.set_greyscale_colors(greyscale_colors) modular_helmet.update_icon() /datum/item_representation/modular_helmet/get_tgui_data() diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index bfc08f66faa21..e1693f576b661 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -1219,16 +1219,14 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out. return icon_override //2: species-specific sprite sheets. - var/icon = LAZYACCESS(sprite_sheets, species_type) - if(icon && !inhands) - return icon + . = LAZYACCESS(sprite_sheets, species_type) + if(. && !inhands) + return //3: slot-specific sprite sheets - icon = LAZYACCESS(item_icons, slot_name) - if(ispath(icon, /datum/greyscale_config)) - return SSgreyscale.GetColoredIconByType(icon, greyscale_colors) - if(icon) - return icon + . = LAZYACCESS(item_icons, slot_name) + if(.) + return //5: provided default_icon if(default_icon) diff --git a/code/game/objects/items/storage/belt.dm b/code/game/objects/items/storage/belt.dm index 83ee6274ed35a..4cf45426ee3c6 100644 --- a/code/game/objects/items/storage/belt.dm +++ b/code/game/objects/items/storage/belt.dm @@ -685,10 +685,7 @@ sure that we don't have to do any extra calculations. */ playsound(src,drawSound, 15, 1) - if(current_gun.greyscale_config && current_gun.greyscale_colors) - gun_underlay = image(SSgreyscale.GetColoredIconByType(current_gun.greyscale_config, current_gun.greyscale_colors), current_gun.rounds ? "belt" : "belt_empty") - else - gun_underlay = image(icon, src, current_gun.icon_state) + gun_underlay = image(icon, src, current_gun.icon_state) icon_state += "_g" item_state = icon_state underlays += gun_underlay diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 0a65b387f1157..cb3934dca245e 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -30,12 +30,6 @@ inaccurate. Don't worry if force is ever negative, it won't runtime. ///Determines the amount of pixels to move the icon state for the overlay. in the y direction var/pixel_shift_y = 16 - - greyscale_config = null - greyscale_colors = GUN_PALETTE_TAN - ///List of palettes a greyscaled attachment is allowed to use for its furniture - var/list/colorable_colors = GUN_PALETTE_LIST - flags_atom = CONDUCT materials = list(/datum/material/metal = 100) w_class = WEIGHT_CLASS_SMALL @@ -146,28 +140,6 @@ inaccurate. Don't worry if force is ever negative, it won't runtime. . = ..() AddElement(/datum/element/attachment, slot, icon, .proc/on_attach, .proc/on_detach, .proc/activate, .proc/can_attach, pixel_shift_x, pixel_shift_y, flags_attach_features, attach_delay, detach_delay, attach_skill, attach_skill_upper_threshold, attach_sound) -/obj/item/attachable/attackby(obj/item/I, mob/user, params) - . = ..() - if(!istype(I, /obj/item/facepaint)) - return - if(isnull(greyscale_config)) - to_chat(user, span_warning("[src] cannot be colored.")) - return - var/obj/item/facepaint/paint = I - if(paint.uses < 1) - balloon_alert(user, "\the [paint] is out of color!") - return - - var/new_color = tgui_input_list(user, "Pick a color", "Pick color", colorable_colors) - new_color = colorable_colors[new_color] - - if(!new_color || !do_after(user, 1 SECONDS, TRUE, src, BUSY_ICON_GENERIC)) - return - - set_greyscale_colors(new_color) - paint.uses-- - update_icon() - ///Called when the attachment is attached to something. If it is a gun it will update the guns stats. /obj/item/attachable/proc/on_attach(attaching_item, mob/user) @@ -1006,13 +978,12 @@ inaccurate. Don't worry if force is ever negative, it won't runtime. /obj/item/attachable/stock/t35stock name = "\improper SH-35 stock" desc = "A non-standard heavy stock for the SH-35 shotgun. Less quick and more cumbersome than the standard issue stakeout, but reduces recoil and improves accuracy. Allegedly makes a pretty good club in a fight too." - flags_attach_features = ATTACH_REMOVABLE|ATTACH_SAME_ICON + flags_attach_features = ATTACH_REMOVABLE wield_delay_mod = 0.2 SECONDS icon_state = "t35stock" accuracy_mod = 0.15 recoil_mod = -3 scatter_mod = -2 - greyscale_config = /datum/greyscale_config/gun_attachment /obj/item/attachable/stock/t39stock name = "\improper SH-39 stock" diff --git a/code/modules/projectiles/gun_helpers.dm b/code/modules/projectiles/gun_helpers.dm index c3beb6aacf22d..4a1ab6a25cd92 100644 --- a/code/modules/projectiles/gun_helpers.dm +++ b/code/modules/projectiles/gun_helpers.dm @@ -26,29 +26,6 @@ /obj/item/weapon/gun/attackby(obj/item/I, mob/user, params) . = ..() - if(istype(I, /obj/item/facepaint)) - if(isnull(greyscale_config)) - to_chat(user, span_warning("[src] cannot be colored.")) - return - var/obj/item/facepaint/paint = I - if(paint.uses < 1) - balloon_alert(user, "\the [paint] is out of color!") - return - - var/new_color = tgui_input_list(user, "Pick a color", "Pick color", colorable_colors) - new_color = colorable_colors[new_color] - - if(!new_color || !do_after(user, 1 SECONDS, TRUE, master_gun ? master_gun : src, BUSY_ICON_GENERIC)) - return - - set_greyscale_colors(new_color) - paint.uses-- - update_icon() - master_gun?.update_icon() - if(ishuman(loc)) - var/mob/living/carbon/human/holder = loc - holder.regenerate_icons() - return if(user.get_inactive_held_item() != src || istype(I, /obj/item/attachable) || isgun(I)) return reload(I, user) diff --git a/code/modules/projectiles/gun_system.dm b/code/modules/projectiles/gun_system.dm index 087d8a6bd62bd..6b7ec38ab35c1 100644 --- a/code/modules/projectiles/gun_system.dm +++ b/code/modules/projectiles/gun_system.dm @@ -22,14 +22,6 @@ light_range = 0 light_color = COLOR_WHITE -/* - * Greyscale vars -*/ - greyscale_config = null - greyscale_colors = GUN_PALETTE_TAN - ///List of palettes a greyscaled gun is allowed to use for its furniture - var/list/colorable_colors = GUN_PALETTE_LIST - /* * Muzzle Vars */ @@ -469,13 +461,13 @@ if(CHECK_BITFIELD(reciever_flags, AMMO_RECIEVER_TOGGLES_OPEN) && !CHECK_BITFIELD(reciever_flags, AMMO_RECIEVER_CLOSED)) icon_state = base_gun_icon + "_o" else if(CHECK_BITFIELD(reciever_flags, AMMO_RECIEVER_REQUIRES_UNIQUE_ACTION) && !in_chamber && length(chamber_items)) - icon_state = !greyscale_config ? base_gun_icon + "_u" : GUN_ICONSTATE_UNRACKED + icon_state = base_gun_icon + "_u" else if((!length(chamber_items) && max_chamber_items) || !rounds) - icon_state = !greyscale_config ? base_gun_icon + "_e" : GUN_ICONSTATE_UNLOADED + icon_state = base_gun_icon + "_e" else if(current_chamber_position <= length(chamber_items) && chamber_items[current_chamber_position] && chamber_items[current_chamber_position].loc != src) icon_state = base_gun_icon + "_l" else - icon_state = !greyscale_config ? base_gun_icon : GUN_ICONSTATE_LOADED + icon_state = base_gun_icon //manages the overlays for the gun - separate from attachment overlays /obj/item/weapon/gun/update_overlays() @@ -500,19 +492,13 @@ /obj/item/weapon/gun/update_item_state() if(!CHECK_BITFIELD(flags_gun_features, GUN_SHOWS_AMMO_REMAINING)) - if(CHECK_BITFIELD(flags_item, WIELDED)) - item_state = !greyscale_config ? "[base_gun_icon]_w" : "wielded" - else - item_state = !greyscale_config ? base_gun_icon : "" + item_state = "[base_gun_icon][flags_item & WIELDED ? "_w" : ""]" return //If the gun has item states that show how much ammo is remaining var/current_state = item_state var/cell_charge = (!length(chamber_items) || rounds <= 0) ? 0 : CEILING((rounds / max((length(chamber_items) ? max_rounds : max_shells), 1)) * 100, 25) - if(CHECK_BITFIELD(flags_item, WIELDED)) - item_state = !greyscale_config ? "[initial(icon_state)]_[cell_charge]_w" : "wielded" - else - item_state = !greyscale_config ? "[initial(icon_state)]_[cell_charge]" : "" + item_state = "[initial(icon_state)]_[cell_charge][flags_item & WIELDED ? "_w" : ""]" if(current_state != item_state && ishuman(gun_user)) var/mob/living/carbon/human/human_user = gun_user if(src == human_user.l_hand) diff --git a/code/modules/projectiles/guns/pistols.dm b/code/modules/projectiles/guns/pistols.dm index 7e498eb1eefdb..defa44dd12596 100644 --- a/code/modules/projectiles/guns/pistols.dm +++ b/code/modules/projectiles/guns/pistols.dm @@ -46,12 +46,8 @@ name = "\improper P-14 pistol" desc = "The P-14, produced by Terran Armories. A reliable sidearm that loads 9x19mm Parabellum Auto munitions. Capable of mounting a limited amount of attachments, and firing at a respectable rate of fire, often as fast as you can pull the trigger. Takes 14-round 9mm magazines." icon = 'icons/Marine/gun64.dmi' - icon_state = GUN_ICONSTATE_LOADED + icon_state = "tp14" item_state = "tp14" - item_icons = list( - slot_l_hand_str = /datum/greyscale_config/gun/t14/l_hand, - slot_r_hand_str = /datum/greyscale_config/gun/t14/r_hand, - ) caliber = CALIBER_9X19 //codex max_shells = 21 //codex fire_sound = 'sound/weapons/guns/fire/tp14.ogg' @@ -70,8 +66,6 @@ upper_akimbo_accuracy = 5 lower_akimbo_accuracy = 4 - greyscale_config = /datum/greyscale_config/gun/t14 - //------------------------------------------------------- //PP-7 Plasma Pistol /obj/item/weapon/gun/pistol/plasma_pistol diff --git a/code/modules/projectiles/guns/rifles.dm b/code/modules/projectiles/guns/rifles.dm index a667561ff2b1f..8c05984e92844 100644 --- a/code/modules/projectiles/guns/rifles.dm +++ b/code/modules/projectiles/guns/rifles.dm @@ -29,14 +29,8 @@ name = "\improper AR-18 Kauser carbine" desc = "The Kauser and Hoch AR-18 carbine is one of the standard rifles used by the TerraGov Marine Corps. It's commonly used by people who prefer greater mobility in combat, like scouts and other light infantry. Uses 10x24mm caseless ammunition." icon = 'icons/Marine/gun64.dmi' - icon_state = GUN_ICONSTATE_LOADED + icon_state = "t18" item_state = "t18" - item_icons = list( - slot_l_hand_str = /datum/greyscale_config/gun/worn/l_hand/t18, - slot_r_hand_str = /datum/greyscale_config/gun/worn/r_hand/t18, - slot_back_str = /datum/greyscale_config/gun/worn/t18, - slot_s_store_str = /datum/greyscale_config/gun/worn/suit/t18, - ) fire_sound = "gun_t12" dry_fire_sound = 'sound/weapons/guns/fire/m41a_empty.ogg' unload_sound = 'sound/weapons/guns/interact/t18_unload.ogg' @@ -93,8 +87,6 @@ damage_falloff_mult = 0.9 movement_acc_penalty_mult = 4 - greyscale_config = /datum/greyscale_config/gun/t18 - /obj/item/weapon/gun/rifle/standard_carbine/pointman starting_attachment_types = list(/obj/item/attachable/lasersight, /obj/item/attachable/flashlight) @@ -117,14 +109,8 @@ name = "\improper AR-12 K&H assault rifle" desc = "The Keckler and Hoch AR-12 assault rifle used to be the TerraGov Marine Corps standard issue rifle before the AR-18 carbine replaced it. It is, however, still used widely despite that. The gun itself is very good at being used in most situations however it suffers in engagements at close quarters and is relatively hard to shoulder than some others. It uses 10x24mm caseless ammunition." icon = 'icons/marine/gun64.dmi' - icon_state = GUN_ICONSTATE_LOADED + icon_state = "t12" item_state = "t12" - item_icons = list( - slot_l_hand_str = /datum/greyscale_config/gun/worn/l_hand, - slot_r_hand_str = /datum/greyscale_config/gun/worn/r_hand, - slot_back_str = /datum/greyscale_config/gun/worn, - slot_s_store_str = /datum/greyscale_config/gun/worn/suit, - ) fire_sound = "gun_t12" dry_fire_sound = 'sound/weapons/guns/fire/m41a_empty.ogg' unload_sound = 'sound/weapons/guns/interact/t18_unload.ogg' @@ -181,7 +167,6 @@ damage_falloff_mult = 0.5 placed_overlay_iconstate = "t12" - greyscale_config = /datum/greyscale_config/gun /obj/item/weapon/gun/rifle/standard_assaultrifle/rifleman starting_attachment_types = list(/obj/item/attachable/reddot, /obj/item/attachable/extended_barrel, /obj/item/weapon/gun/grenade_launcher/underslung) @@ -685,10 +670,10 @@ desc = "The Kauser MG-42 is the TGMC's current standard non-IFF-capable LMG. It's known for its ability to lay down heavy fire support very well. It is generally used when someone wants to hold a position or provide fire support. It uses 10x24mm ammunition." icon = 'icons/Marine/gun64.dmi' item_icons = list( - slot_l_hand_str = /datum/greyscale_config/gun/worn/l_hand/t42, - slot_r_hand_str = /datum/greyscale_config/gun/worn/r_hand/t42, - slot_back_str = /datum/greyscale_config/gun/worn/t42, - slot_s_store_str = /datum/greyscale_config/gun/worn/suit/t42, + slot_l_hand_str = 'icons/mob/items_lefthand_64.dmi', + slot_r_hand_str = 'icons/mob/items_righthand_64.dmi', + slot_back_str = 'icons/mob/items_back_64.dmi', + slot_s_store_str = 'icons/mob/items_suit_slot_64.dmi', ) worn_x_dimension = 64 @@ -696,7 +681,7 @@ inhand_x_dimension = 64 inhand_y_dimension = 32 - icon_state = GUN_ICONSTATE_LOADED + icon_state = "t42" item_state = "t42" caliber = CALIBER_10X24_CASELESS //codex max_shells = 120 //codex @@ -748,8 +733,6 @@ scatter = 2 scatter_unwielded = 80 - greyscale_config = /datum/greyscale_config/gun/t42 - //------------------------------------------------------- //MG-60 General Purpose Machine Gun diff --git a/code/modules/projectiles/guns/shotguns.dm b/code/modules/projectiles/guns/shotguns.dm index 333de3dcb1b8e..102c3da498e95 100644 --- a/code/modules/projectiles/guns/shotguns.dm +++ b/code/modules/projectiles/guns/shotguns.dm @@ -603,14 +603,8 @@ desc = "The Terran Armories SH-35 is the shotgun used by the TerraGov Marine Corps. It's used as a close quarters tool when someone wants something more suited for close range than most people, or as an odd sidearm on your back for emergencies. Uses 12 gauge shells.\nRequires a pump, which is the Unique Action key." icon = 'icons/Marine/gun64.dmi' flags_equip_slot = ITEM_SLOT_BACK - icon_state = GUN_ICONSTATE_LOADED + icon_state = "t35" item_state = "t35" - item_icons = list( - slot_l_hand_str = /datum/greyscale_config/gun/worn/l_hand/t35, - slot_r_hand_str = /datum/greyscale_config/gun/worn/r_hand/t35, - slot_back_str = /datum/greyscale_config/gun/worn/t35, - slot_s_store_str = /datum/greyscale_config/gun/worn/suit/t35, - ) cock_animation = "t35_pump" default_ammo_type = /datum/ammo/bullet/shotgun/buckshot fire_sound = 'sound/weapons/guns/fire/t35.ogg' @@ -645,7 +639,6 @@ cock_delay = 14 placed_overlay_iconstate = "t35" - greyscale_config = /datum/greyscale_config/gun/t35 //buckshot variants /obj/item/weapon/gun/shotgun/pump/t35/pointman diff --git a/code/modules/projectiles/guns/smgs.dm b/code/modules/projectiles/guns/smgs.dm index f0af47e3cce63..980571493b42e 100644 --- a/code/modules/projectiles/guns/smgs.dm +++ b/code/modules/projectiles/guns/smgs.dm @@ -90,14 +90,8 @@ desc = "The SMG-90 is the TerraGov Marine Corps standard issue SMG. Its known for it's compact size and ease of use inside the field. It's usually carried by troops who want a lightweight firearm to rush with. It uses 10x20mm caseless rounds." icon = 'icons/Marine/gun64.dmi' fire_sound = 'sound/weapons/guns/fire/t90.ogg' - icon_state = GUN_ICONSTATE_LOADED + icon_state = "t90" item_state = "t90" - item_icons = list( - slot_l_hand_str = /datum/greyscale_config/gun/worn/l_hand/t90, - slot_r_hand_str = /datum/greyscale_config/gun/worn/r_hand/t90, - slot_back_str = /datum/greyscale_config/gun/worn/t90, - slot_s_store_str = /datum/greyscale_config/gun/worn/suit/t90, - ) caliber = CALIBER_10X20_CASELESS //codex max_shells = 50 //codex flags_equip_slot = ITEM_SLOT_BACK @@ -138,7 +132,7 @@ lower_akimbo_accuracy = 2 placed_overlay_iconstate = "t90" - greyscale_config = /datum/greyscale_config/gun/t90 + /obj/item/weapon/gun/smg/standard_smg/breacher starting_attachment_types = list(/obj/item/attachable/magnetic_harness) diff --git a/icons/Marine/gun_attachments_greyscale/t35_stock.dmi b/icons/Marine/gun_attachments_greyscale/t35_stock.dmi deleted file mode 100644 index 6b4fda7cf3926..0000000000000 Binary files a/icons/Marine/gun_attachments_greyscale/t35_stock.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t12/back.dmi b/icons/Marine/gun_greyscale/t12/back.dmi deleted file mode 100644 index c7754c5519c7b..0000000000000 Binary files a/icons/Marine/gun_greyscale/t12/back.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t12/left_hand.dmi b/icons/Marine/gun_greyscale/t12/left_hand.dmi deleted file mode 100644 index 70ffbb878041d..0000000000000 Binary files a/icons/Marine/gun_greyscale/t12/left_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t12/right_hand.dmi b/icons/Marine/gun_greyscale/t12/right_hand.dmi deleted file mode 100644 index b54fb7bb0fc89..0000000000000 Binary files a/icons/Marine/gun_greyscale/t12/right_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t12/suit.dmi b/icons/Marine/gun_greyscale/t12/suit.dmi deleted file mode 100644 index 11255c381cc38..0000000000000 Binary files a/icons/Marine/gun_greyscale/t12/suit.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t12/t12.dmi b/icons/Marine/gun_greyscale/t12/t12.dmi deleted file mode 100644 index 23d551f54d63c..0000000000000 Binary files a/icons/Marine/gun_greyscale/t12/t12.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t14/left_hand.dmi b/icons/Marine/gun_greyscale/t14/left_hand.dmi deleted file mode 100644 index 3de1f9c769d45..0000000000000 Binary files a/icons/Marine/gun_greyscale/t14/left_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t14/right_hand.dmi b/icons/Marine/gun_greyscale/t14/right_hand.dmi deleted file mode 100644 index 1d84e73fc4f05..0000000000000 Binary files a/icons/Marine/gun_greyscale/t14/right_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t14/t14.dmi b/icons/Marine/gun_greyscale/t14/t14.dmi deleted file mode 100644 index 1d7bd0d3693d3..0000000000000 Binary files a/icons/Marine/gun_greyscale/t14/t14.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t18/back.dmi b/icons/Marine/gun_greyscale/t18/back.dmi deleted file mode 100644 index ef33bc82c037e..0000000000000 Binary files a/icons/Marine/gun_greyscale/t18/back.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t18/left_hand.dmi b/icons/Marine/gun_greyscale/t18/left_hand.dmi deleted file mode 100644 index bba38739ed7d0..0000000000000 Binary files a/icons/Marine/gun_greyscale/t18/left_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t18/right_hand.dmi b/icons/Marine/gun_greyscale/t18/right_hand.dmi deleted file mode 100644 index b523446cd42bd..0000000000000 Binary files a/icons/Marine/gun_greyscale/t18/right_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t18/suit.dmi b/icons/Marine/gun_greyscale/t18/suit.dmi deleted file mode 100644 index b87f085b67bd4..0000000000000 Binary files a/icons/Marine/gun_greyscale/t18/suit.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t18/t18.dmi b/icons/Marine/gun_greyscale/t18/t18.dmi deleted file mode 100644 index 147c2bb4eff36..0000000000000 Binary files a/icons/Marine/gun_greyscale/t18/t18.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t35/back.dmi b/icons/Marine/gun_greyscale/t35/back.dmi deleted file mode 100644 index f1481e279a638..0000000000000 Binary files a/icons/Marine/gun_greyscale/t35/back.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t35/left_hand.dmi b/icons/Marine/gun_greyscale/t35/left_hand.dmi deleted file mode 100644 index 04a9dd5f194a9..0000000000000 Binary files a/icons/Marine/gun_greyscale/t35/left_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t35/right_hand.dmi b/icons/Marine/gun_greyscale/t35/right_hand.dmi deleted file mode 100644 index 99252d840095b..0000000000000 Binary files a/icons/Marine/gun_greyscale/t35/right_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t35/suit.dmi b/icons/Marine/gun_greyscale/t35/suit.dmi deleted file mode 100644 index 2121b663330d8..0000000000000 Binary files a/icons/Marine/gun_greyscale/t35/suit.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t35/t35.dmi b/icons/Marine/gun_greyscale/t35/t35.dmi deleted file mode 100644 index d1ce8f9f0563a..0000000000000 Binary files a/icons/Marine/gun_greyscale/t35/t35.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t42/back.dmi b/icons/Marine/gun_greyscale/t42/back.dmi deleted file mode 100644 index 2f6edc427c59e..0000000000000 Binary files a/icons/Marine/gun_greyscale/t42/back.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t42/left_hand.dmi b/icons/Marine/gun_greyscale/t42/left_hand.dmi deleted file mode 100644 index 00d0749134219..0000000000000 Binary files a/icons/Marine/gun_greyscale/t42/left_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t42/right_hand.dmi b/icons/Marine/gun_greyscale/t42/right_hand.dmi deleted file mode 100644 index f6b3c5594fa08..0000000000000 Binary files a/icons/Marine/gun_greyscale/t42/right_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t42/suit.dmi b/icons/Marine/gun_greyscale/t42/suit.dmi deleted file mode 100644 index c715f44252135..0000000000000 Binary files a/icons/Marine/gun_greyscale/t42/suit.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t42/t42.dmi b/icons/Marine/gun_greyscale/t42/t42.dmi deleted file mode 100644 index 8fc0fcb9088c2..0000000000000 Binary files a/icons/Marine/gun_greyscale/t42/t42.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t90/back.dmi b/icons/Marine/gun_greyscale/t90/back.dmi deleted file mode 100644 index 4ca00a952a581..0000000000000 Binary files a/icons/Marine/gun_greyscale/t90/back.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t90/left_hand.dmi b/icons/Marine/gun_greyscale/t90/left_hand.dmi deleted file mode 100644 index 0f8f488eab689..0000000000000 Binary files a/icons/Marine/gun_greyscale/t90/left_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t90/right_hand.dmi b/icons/Marine/gun_greyscale/t90/right_hand.dmi deleted file mode 100644 index 98b335f33854d..0000000000000 Binary files a/icons/Marine/gun_greyscale/t90/right_hand.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t90/suit.dmi b/icons/Marine/gun_greyscale/t90/suit.dmi deleted file mode 100644 index d279526b87183..0000000000000 Binary files a/icons/Marine/gun_greyscale/t90/suit.dmi and /dev/null differ diff --git a/icons/Marine/gun_greyscale/t90/t90.dmi b/icons/Marine/gun_greyscale/t90/t90.dmi deleted file mode 100644 index 611e97b646eaf..0000000000000 Binary files a/icons/Marine/gun_greyscale/t90/t90.dmi and /dev/null differ diff --git a/icons/Marine/marine-weapons.dmi b/icons/Marine/marine-weapons.dmi index b6532d18bd6c6..e221e7e2c52ae 100644 Binary files a/icons/Marine/marine-weapons.dmi and b/icons/Marine/marine-weapons.dmi differ diff --git a/icons/mob/items_back_64.dmi b/icons/mob/items_back_64.dmi new file mode 100644 index 0000000000000..4338bc63c5688 Binary files /dev/null and b/icons/mob/items_back_64.dmi differ diff --git a/icons/mob/items_lefthand_64.dmi b/icons/mob/items_lefthand_64.dmi new file mode 100644 index 0000000000000..7d810b1140325 Binary files /dev/null and b/icons/mob/items_lefthand_64.dmi differ diff --git a/icons/mob/items_righthand_64.dmi b/icons/mob/items_righthand_64.dmi new file mode 100644 index 0000000000000..b4b04568021ba Binary files /dev/null and b/icons/mob/items_righthand_64.dmi differ diff --git a/icons/mob/items_suit_slot_64.dmi b/icons/mob/items_suit_slot_64.dmi new file mode 100644 index 0000000000000..6231a151dd43f Binary files /dev/null and b/icons/mob/items_suit_slot_64.dmi differ diff --git a/icons/obj/clothing/belts.dmi b/icons/obj/clothing/belts.dmi index 84b104589d86b..393ca00f643d3 100644 Binary files a/icons/obj/clothing/belts.dmi and b/icons/obj/clothing/belts.dmi differ diff --git a/tgmc.dme b/tgmc.dme index b3c83a032b64e..c2819a6994a1d 100644 --- a/tgmc.dme +++ b/tgmc.dme @@ -53,7 +53,6 @@ #include "code\__DEFINES\flags.dm" #include "code\__DEFINES\foam.dm" #include "code\__DEFINES\footsteps.dm" -#include "code\__DEFINES\greyscale_guns.dm" #include "code\__DEFINES\implants.dm" #include "code\__DEFINES\instruments.dm" #include "code\__DEFINES\interaction.dm" diff --git a/tools/hyperscale_converter/converter.py b/tools/hyperscale_converter/converter.py index 924e177e156a9..2b97e02f0eaab 100644 --- a/tools/hyperscale_converter/converter.py +++ b/tools/hyperscale_converter/converter.py @@ -1,19 +1,13 @@ from operator import setitem import PIL as pillow from PIL import Image -from PIL import PngImagePlugin -from pathlib import Path import os parentPath = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) #gets the TGMC directory path = input("File path of .dmi (Relative to the repository directory): ") full_path = os.path.join(parentPath, path).replace('\\', '/') try : - image = PngImagePlugin.PngImageFile - image = PngImagePlugin.PngImageFile(full_path) - - metadata = image.info["Description"] - image = image.convert("L") + image = Image.open(full_path).convert("L") except FileNotFoundError : print("File not found.") exit @@ -22,7 +16,7 @@ for x in range(image.size[0]): for y in range(image.size[1]): pixel = image.getpixel((x,y)) - if pixel == 192 or pixel == 0 : continue + if pixel == 192 : continue newset = list() newset.append((x,y)) if pixel in layers.keys() : @@ -42,10 +36,5 @@ pixel = pixelList[i] pixelmap[pixel[0], pixel[1]] = 255 newpath = (os.path.dirname(__file__) + "\\output\\" + str(key) + ".png").replace('\\', '/') - newImage.info.update({"Description":metadata}) - info = PngImagePlugin.PngInfo() - info.add_text("Description", metadata, True) - PngImagePlugin.PngImageFile.save(newImage, newpath, save_all=True, pnginfo=info) - p = Path(newpath) - p.rename(p.with_suffix('.dmi')) + newImage.save(newpath) print("Successfully split file into " + str(len(layers.keys())) + " sprites.")