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

[MIRROR] Linen Plant Bags! - Adds a primitive reskin of the plant bag, makes it the default when crafted by Icewalkers #2307

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
69 changes: 69 additions & 0 deletions modular_nova/modules/primitive_cooking_additions/code/plant_bag.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#define RESKIN_LINEN "Linen"

/obj/item/storage/bag/plants
uses_advanced_reskins = TRUE
unique_reskin = list(
"Original" = list(
RESKIN_ICON = 'icons/obj/service/hydroponics/equipment.dmi',
RESKIN_ICON_STATE = "plantbag",
RESKIN_WORN_ICON = 'icons/mob/clothing/belt.dmi',
RESKIN_WORN_ICON_STATE = "plantbag",
),
RESKIN_LINEN = list(
RESKIN_ICON = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag.dmi',
RESKIN_ICON_STATE = "plantbag_primitive",
RESKIN_WORN_ICON = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag_worn.dmi',
RESKIN_WORN_ICON_STATE = "plantbag_primitive",
),
)


// This is so the linen reskin shows properly in the suit storage.
/obj/item/storage/bag/plants/build_worn_icon(default_layer, default_icon_file, isinhands, female_uniform, override_state, override_file, use_height_offset, mutant_styles)
if(default_layer == SUIT_STORE_LAYER && current_skin == RESKIN_LINEN)
override_file = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag_worn_mirror.dmi'

return ..()


/// Simple helper to reskin this item into its primitive variant.
/obj/item/storage/bag/plants/proc/make_primitive()
current_skin = RESKIN_LINEN

icon = unique_reskin[current_skin][RESKIN_ICON]
icon_state = unique_reskin[current_skin][RESKIN_ICON_STATE]
worn_icon = unique_reskin[current_skin][RESKIN_WORN_ICON]
worn_icon_state = unique_reskin[current_skin][RESKIN_WORN_ICON_STATE]

update_appearance()


/// A helper for the primitive variant, for mappers.
/obj/item/storage/bag/plants/primitive
current_skin = RESKIN_LINEN // Just so it displays properly when in suit storage
uses_advanced_reskins = FALSE
unique_reskin = null
icon = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag.dmi'
icon_state = "plantbag_primitive"
worn_icon = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag_worn.dmi'
worn_icon_state = "plantbag_primitive"


/obj/item/stack/sheet/cloth/on_item_crafted(mob/builder, atom/created)
if(!istype(created, /obj/item/storage/bag/plants))
return

if(!isprimitivedemihuman(builder) && !isashwalker(builder))
return

var/obj/item/storage/bag/plants/bag = created

bag.make_primitive()


/obj/item/storage/bag/plants/portaseeder
uses_advanced_reskins = FALSE
unique_reskin = null


#undef RESKIN_LINEN
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -7937,6 +7937,7 @@
#include "modular_nova\modules\primitive_cooking_additions\code\cookware.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\cutting_board.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\millstone.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\plant_bag.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\stone_griddle.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\stone_oven.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\stone_stove.dm"
Expand Down
Loading