From f626df9d1db880835e0c658b29ad34b1cfa920eb Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 13 Dec 2023 00:08:58 -0300 Subject: [PATCH 1/6] push --- code/_onclick/hud/radial.dm | 2 +- code/game/objects/effects/countdown.dm | 2 +- code/game/objects/items/stacks/stack.dm | 16 ++++++++++++++++ code/game/objects/items/stacks/tickets.dm | 2 +- code/modules/power/cable.dm | 2 +- .../xenobiology/crossbreeding/_status_effects.dm | 2 +- .../modules/eventmaps/Spookystation/JTGSZwork.dm | 8 ++++---- 7 files changed, 25 insertions(+), 9 deletions(-) diff --git a/code/_onclick/hud/radial.dm b/code/_onclick/hud/radial.dm index 60a78e5ff3..7ddcd1c9f0 100644 --- a/code/_onclick/hud/radial.dm +++ b/code/_onclick/hud/radial.dm @@ -261,7 +261,7 @@ GLOBAL_LIST_EMPTY(radial_menus) //Blank menu_holder = image(icon='icons/effects/effects.dmi',loc=anchor,icon_state="nothing",layer = ABOVE_HUD_LAYER) menu_holder.plane = ABOVE_HUD_PLANE - menu_holder.appearance_flags |= KEEP_APART|NO_CLIENT_COLOR|RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM + menu_holder.appearance_flags |= APPEARANCE_UI_IGNORE_ALPHA | KEEP_APART menu_holder.vis_contents += elements + close_button current_user.images += menu_holder diff --git a/code/game/objects/effects/countdown.dm b/code/game/objects/effects/countdown.dm index a416766b1b..d846ecdaec 100644 --- a/code/game/objects/effects/countdown.dm +++ b/code/game/objects/effects/countdown.dm @@ -9,7 +9,7 @@ anchored = TRUE layer = GHOST_LAYER color = "#ff0000" // text color - appearance_flags = NO_CLIENT_COLOR | RESET_ALPHA | RESET_COLOR | RESET_TRANSFORM + appearance_flags = APPEARANCE_UI_IGNORE_ALPHA vis_flags = VIS_INHERIT_ID var/text_size = 3 // larger values clip when the displayed text is larger than 2 digits. var/started = FALSE diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index b2cd0f481b..8f5983b548 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -132,6 +132,14 @@ else icon_state = "[initial(icon_state)]_3" +/obj/item/stack/update_overlays() + . = ..() + if(isturf(loc)) + return + var/mutable_appearance/number = mutable_appearance(appearance_flags = APPEARANCE_UI_IGNORE_ALPHA) + number.maptext = MAPTEXT(get_amount()) + . += number + /obj/item/stack/examine(mob/user) . = ..() if (is_cyborg) @@ -151,6 +159,14 @@ . += "There is [get_amount()] in the stack." . += "Alt-click to take a custom amount." +/obj/item/stack/equipped(mob/user, slot) + . = ..() + update_icon() + +/obj/item/stack/dropped(mob/user, slot) + . = ..() + update_icon() + /obj/item/stack/proc/get_amount() if(is_cyborg) . = round(source?.energy / cost) diff --git a/code/game/objects/items/stacks/tickets.dm b/code/game/objects/items/stacks/tickets.dm index 22cb895277..df040a89c7 100644 --- a/code/game/objects/items/stacks/tickets.dm +++ b/code/game/objects/items/stacks/tickets.dm @@ -11,7 +11,7 @@ . = ..() update_icon() -/obj/item/stack/arcadeticket/update_icon() +/obj/item/stack/arcadeticket/update_icon_state() var/amount = get_amount() if((amount >= 12) && (amount > 0)) icon_state = "arcade-ticket_4" diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index d45b5ad9e1..d513b5bc07 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -572,7 +572,7 @@ By design, d1 is the smallest direction and d2 is the highest return ..() -/obj/item/stack/cable_coil/update_icon() +/obj/item/stack/cable_coil/update_icon_state() icon_state = "[initial(item_state)][amount < 3 ? amount : ""]" name = "cable [amount < 3 ? "piece" : "coil"]" diff --git a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm index 1c7951a2d6..429f556989 100644 --- a/code/modules/research/xenobiology/crossbreeding/_status_effects.dm +++ b/code/modules/research/xenobiology/crossbreeding/_status_effects.dm @@ -554,7 +554,7 @@ if(sheets.len > 0) var/obj/item/stack/sheet/S = pick(sheets) - S.amount++ + S.add(1) // Dare var edit directly again and i'll strangle you. to_chat(owner, "[linked_extract] adds a layer of slime to [S], which metamorphosizes into another sheet of material!") return ..() diff --git a/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm b/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm index a2ccc319d0..9ea5a679fd 100644 --- a/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm +++ b/modular_citadel/code/modules/eventmaps/Spookystation/JTGSZwork.dm @@ -1081,9 +1081,9 @@ GLOBAL_LIST_INIT(hay_recipes, list ( \ attack_verb = list("tickled", "poked", "whipped") hitsound = 'sound/weapons/grenadelaunch.ogg' -/obj/item/stack/sheet/hay/Initialize(mapload, new_amount, merge = TRUE) - recipes = GLOB.hay_recipes - return ..() +/obj/item/stack/sheet/hay/get_main_recipes() + . = ..() + . += GLOB.hay_recipes /obj/item/stack/sheet/hay/fifty amount = 50 @@ -1098,7 +1098,7 @@ GLOBAL_LIST_INIT(hay_recipes, list ( \ amount = 5 -/obj/item/stack/sheet/hay/update_icon() +/obj/item/stack/sheet/hay/update_icon_state() var/amount = get_amount() if((amount <= 4) && (amount > 0)) icon_state = "hay[amount]" From c182a337fe571b81d17e03d6e3bce099918094e9 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 13 Dec 2023 00:24:57 -0300 Subject: [PATCH 2/6] poosh --- code/modules/unit_tests/merge_type.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/unit_tests/merge_type.dm b/code/modules/unit_tests/merge_type.dm index 1aed82e6a3..c8db1c8562 100644 --- a/code/modules/unit_tests/merge_type.dm +++ b/code/modules/unit_tests/merge_type.dm @@ -1,6 +1,7 @@ /datum/unit_test/merge_type/Run() var/list/blacklist = list(/obj/item/stack/sheet, /obj/item/stack/sheet/mineral, + /obj/item/stack/sheet/rglass/cyborg, /obj/item/stack/ore, /obj/item/stack/spacecash, // /obj/item/stack/license_plates, From 606ffd5b1e64f0fc895506f73d9c3db3801c5ee4 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 13 Dec 2023 12:52:50 -0300 Subject: [PATCH 3/6] just get rid of these issues already --- code/modules/unit_tests/merge_type.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/modules/unit_tests/merge_type.dm b/code/modules/unit_tests/merge_type.dm index c8db1c8562..4a750cd130 100644 --- a/code/modules/unit_tests/merge_type.dm +++ b/code/modules/unit_tests/merge_type.dm @@ -1,7 +1,6 @@ /datum/unit_test/merge_type/Run() var/list/blacklist = list(/obj/item/stack/sheet, /obj/item/stack/sheet/mineral, - /obj/item/stack/sheet/rglass/cyborg, /obj/item/stack/ore, /obj/item/stack/spacecash, // /obj/item/stack/license_plates, @@ -11,6 +10,8 @@ var/list/paths = subtypesof(/obj/item/stack) - blacklist for(var/stackpath in paths) + if(initial(stackpath.is_cyborg)) + continue var/obj/item/stack/stack = new stackpath if(!stack.merge_type) Fail("([stack]) lacks set merge_type variable!") From 35723b9bd79c0607da5b3a68e42050403fa62745 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 13 Dec 2023 12:55:33 -0300 Subject: [PATCH 4/6] field access... --- code/modules/unit_tests/merge_type.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/unit_tests/merge_type.dm b/code/modules/unit_tests/merge_type.dm index 4a750cd130..373ffa2b66 100644 --- a/code/modules/unit_tests/merge_type.dm +++ b/code/modules/unit_tests/merge_type.dm @@ -9,7 +9,7 @@ var/list/paths = subtypesof(/obj/item/stack) - blacklist - for(var/stackpath in paths) + for(var/obj/item/stack/stackpath as anything in paths) if(initial(stackpath.is_cyborg)) continue var/obj/item/stack/stack = new stackpath From 7533d51ae4d88ad34878d28e877d6b9720988000 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Wed, 13 Dec 2023 13:07:10 -0300 Subject: [PATCH 5/6] is_cyborg --- code/game/objects/items/stacks/medical.dm | 4 ++-- code/game/objects/items/stacks/rods.dm | 2 +- code/game/objects/items/stacks/sheets/glass.dm | 3 ++- code/game/objects/items/stacks/sheets/sheet_types.dm | 2 +- code/game/objects/items/stacks/tiles/tile_types.dm | 2 +- code/modules/power/cable.dm | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 15bd521834..6b9d1e8018 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -216,7 +216,7 @@ /obj/item/stack/medical/gauze/cyborg custom_materials = null - is_cyborg = 1 + is_cyborg = TRUE cost = 250 /obj/item/stack/medical/suture @@ -440,7 +440,7 @@ /obj/item/stack/medical/bone_gel/cyborg custom_materials = null - is_cyborg = 1 + is_cyborg = TRUE cost = 250 /obj/item/stack/medical/aloe diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 08f0a6fb7f..6a0ed45e30 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -76,7 +76,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \ /obj/item/stack/rods/cyborg custom_materials = null - is_cyborg = 1 + is_cyborg = TRUE cost = 250 /obj/item/stack/rods/cyborg/ComponentInitialize() diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index bea05f6ef1..1eb49f350c 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -51,7 +51,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \ /obj/item/stack/sheet/glass/cyborg custom_materials = null - is_cyborg = 1 + is_cyborg = TRUE cost = 500 /obj/item/stack/sheet/glass/fifty @@ -178,6 +178,7 @@ GLOBAL_LIST_INIT(reinforced_glass_recipes, list ( \ /obj/item/stack/sheet/rglass/cyborg custom_materials = null + is_cyborg = TRUE var/datum/robot_energy_storage/glasource var/metcost = 250 var/glacost = 500 diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 43ed3b9213..ae04c44f43 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -163,7 +163,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \ /obj/item/stack/sheet/metal/cyborg custom_materials = null - is_cyborg = 1 + is_cyborg = TRUE cost = 500 /obj/item/stack/sheet/metal/get_main_recipes() diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 588e066a41..836ef04f31 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -535,7 +535,7 @@ /obj/item/stack/tile/plasteel/cyborg custom_materials = null // All other Borg versions of items have no Metal or Glass - RR - is_cyborg = 1 + is_cyborg = TRUE cost = 125 /obj/item/stack/tile/material diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index d513b5bc07..725482117b 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -515,7 +515,7 @@ By design, d1 is the smallest direction and d2 is the highest used_skills = list(/datum/skill/level/job/wiring) /obj/item/stack/cable_coil/cyborg - is_cyborg = 1 + is_cyborg = TRUE custom_materials = null cost = 1 From 272879367f13db93d4d4b2b8a586e90c7e0e3908 Mon Sep 17 00:00:00 2001 From: SandPoot Date: Sat, 30 Dec 2023 00:31:57 -0300 Subject: [PATCH 6/6] solution for numerical display bags --- code/datums/components/storage/concrete/stack.dm | 2 +- code/game/objects/items/stacks/stack.dm | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/code/datums/components/storage/concrete/stack.dm b/code/datums/components/storage/concrete/stack.dm index d7b118cee4..1e57d2da3a 100644 --- a/code/datums/components/storage/concrete/stack.dm +++ b/code/datums/components/storage/concrete/stack.dm @@ -63,7 +63,7 @@ if(!istype(I) || QDELETED(I)) //We're specialized stack storage, just ignore non stacks. continue if(!.[I.merge_type]) - .[I.merge_type] = new /datum/numbered_display(I, I.amount) + .[I.merge_type] = new /datum/numbered_display(I, I.amount, src) else var/datum/numbered_display/ND = .[I.merge_type] ND.number += I.amount diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 8f5983b548..0f04e1a6e7 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -136,6 +136,8 @@ . = ..() if(isturf(loc)) return + if(locate(/atom/movable/screen/storage/item_holder) in vis_locs) // It's being handled by the storage we're in, forget about it. + return var/mutable_appearance/number = mutable_appearance(appearance_flags = APPEARANCE_UI_IGNORE_ALPHA) number.maptext = MAPTEXT(get_amount()) . += number @@ -507,7 +509,11 @@ F.forceMove(user.drop_location()) add_fingerprint(user) F.add_fingerprint(user) - zero_amount() + if(!zero_amount()) + var/atom/movable/screen/storage/item_holder/holder = locate(/atom/movable/screen/storage/item_holder) in vis_locs + if(holder.master && istype(holder.master, /datum/component/storage/concrete)) + var/datum/component/storage/concrete/storage = holder.master + storage.refresh_mob_views() /obj/item/stack/attackby(obj/item/W, mob/user, params) if(can_merge(W))