diff --git a/code/controllers/subsystems/job.dm b/code/controllers/subsystems/job.dm index 0ec1b53e373..4db9b5a10e7 100644 --- a/code/controllers/subsystems/job.dm +++ b/code/controllers/subsystems/job.dm @@ -771,7 +771,7 @@ SUBSYSTEM_DEF(jobs) log_loadout("EIS/([H]): [items.len] items.") var/obj/item/storage/B = locate() in H if (B) - for (var/thing in items) + for(var/thing in items) to_chat(H, SPAN_NOTICE("Placing \the [thing] in your [B.name]!")) var/datum/gear/G = GLOB.gear_datums[thing] var/metadata @@ -782,7 +782,8 @@ SUBSYSTEM_DEF(jobs) metadata = list() G.spawn_item(B, metadata, H) log_loadout("EIS/([H]): placed [thing] in [B].") - + for(var/obj/item/I in B.contents) + I.in_storage = TRUE else to_chat(H, SPAN_DANGER("Failed to locate a storage object on your mob, either you spawned with no arms and no backpack or this is a bug.")) log_loadout("EIS/([H]): unable to equip; no storage.") diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index 9ec35412b33..bc37272235d 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -34,7 +34,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca shoes = /obj/item/clothing/shoes/laceup/brown head = /obj/item/clothing/head/caphat/scc glasses = /obj/item/clothing/glasses/sunglasses - id = /obj/item/card/id/scc/gold/captain + id = /obj/item/card/id/gold headset = /obj/item/device/radio/headset/heads/captain bowman = /obj/item/device/radio/headset/heads/captain/alt @@ -117,7 +117,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca head = /obj/item/clothing/head/caphat/xo uniform = /obj/item/clothing/under/rank/xo shoes = /obj/item/clothing/shoes/laceup/brown - id = /obj/item/card/id/scc/silver + id = /obj/item/card/id/silver headset = /obj/item/device/radio/headset/heads/xo bowman = /obj/item/device/radio/headset/heads/xo/alt @@ -169,7 +169,7 @@ GLOBAL_DATUM_INIT(captain_announcement, /datum/announcement/minor, new(do_newsca head = /obj/item/clothing/head/caphat/bridge_crew uniform = /obj/item/clothing/under/rank/bridge_crew shoes = /obj/item/clothing/shoes/laceup - id = /obj/item/card/id/scc/bridge + id = /obj/item/card/id/silver headset = /obj/item/device/radio/headset/headset_com bowman = /obj/item/device/radio/headset/headset_com/alt diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index c207ec51cb8..eda95e2d7b1 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -368,7 +368,7 @@ uniform = /obj/item/clothing/under/rank/operations_manager shoes = /obj/item/clothing/shoes/sneakers/brown - id = /obj/item/card/id/scc/silver + id = /obj/item/card/id/silver l_hand = /obj/item/clipboard glasses = /obj/item/clothing/glasses/sunglasses diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index c9e3f50ab28..72cbc876a6d 100644 --- a/code/game/jobs/job/engineering.dm +++ b/code/game/jobs/job/engineering.dm @@ -40,7 +40,7 @@ uniform = /obj/item/clothing/under/rank/chief_engineer head = /obj/item/clothing/head/hardhat/white belt = /obj/item/storage/belt/utility/ce - id = /obj/item/card/id/scc/silver + id = /obj/item/card/id/silver shoes = null r_pocket = /obj/item/device/t_scanner diff --git a/code/game/jobs/job/hra.dm b/code/game/jobs/job/hra.dm index ddc9b50dd2c..fed103e82fb 100644 --- a/code/game/jobs/job/hra.dm +++ b/code/game/jobs/job/hra.dm @@ -48,9 +48,7 @@ l_pocket = /obj/item/reagent_containers/spray/pepper r_pocket = /obj/item/device/taperecorder/cciaa l_hand = /obj/item/storage/lockbox/cciaa - id = /obj/item/card/id/scc/gold - - + id = /obj/item/card/id/gold backpack_contents = list( /obj/item/modular_computer/laptop/preset/command = 1, diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index 3fca603208b..489118bea2f 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -39,7 +39,7 @@ suit = /obj/item/clothing/suit/storage/toggle/labcoat/cmo suit_store = /obj/item/device/flashlight/pen shoes = /obj/item/clothing/shoes/sneakers/brown - id = /obj/item/card/id/scc/silver + id = /obj/item/card/id/silver l_hand = /obj/item/storage/firstaid/adv headset = /obj/item/device/radio/headset/heads/cmo diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index e80a1b888b4..e83fb3711c3 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -41,7 +41,7 @@ uniform = /obj/item/clothing/under/rank/research_director suit = /obj/item/clothing/suit/storage/toggle/labcoat/science shoes = /obj/item/clothing/shoes/sneakers/brown - id = /obj/item/card/id/scc/silver + id = /obj/item/card/id/silver l_hand = /obj/item/clipboard headset = /obj/item/device/radio/headset/heads/rd diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index 44f9fc93f3b..c80d7ebc0a2 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -40,7 +40,7 @@ uniform = /obj/item/clothing/under/rank/head_of_security head = /obj/item/clothing/head/hos - id = /obj/item/card/id/scc/silver + id = /obj/item/card/id/silver shoes = null glasses = /obj/item/clothing/glasses/sunglasses/sechud/head diff --git a/code/game/objects/items/weapons/cards_ids.dm b/code/game/objects/items/weapons/cards_ids.dm index 0130de6c6a8..c391ff424b0 100644 --- a/code/game/objects/items/weapons/cards_ids.dm +++ b/code/game/objects/items/weapons/cards_ids.dm @@ -26,6 +26,29 @@ drop_sound = 'sound/items/drop/card.ogg' pickup_sound = 'sound/items/pickup/card.ogg' +/obj/item/card/Initialize() + . = ..() + update_icon() + +/obj/item/card/pickup(mob/user) + ..() + update_icon() + +/obj/item/card/dropped(mob/user) + ..() + update_icon() + +/obj/item/card/attack_hand() + ..() + update_icon() + +/obj/item/card/update_icon() + var/matrix/tf = matrix() + if(istype(loc, /obj/item/storage)) + tf.Turn(-90) //Vertical for storing compactly + tf.Translate(-1, 0) //Could do this with pixel_x but let's just update the appearance once. + transform = tf + /obj/item/card/data name = "data disk" desc = "A disk of data." @@ -391,32 +414,12 @@ access = get_all_station_access() | get_all_centcom_access() ..() -// SCC ID cards - -/obj/item/card/id/scc - desc = "A high-tech holocard displaying the credentials of a SCC employee." - icon_state = "bridge_card" - -/obj/item/card/id/scc/bridge - desc = "A high-tech holocard displaying the lowly credentials of a SCC bridge crewman." - icon_state = "bridge_card" - -/obj/item/card/id/scc/silver - desc = "A high-tech holocard displaying the credentials of a SCC command member." - icon_state = "command_card" - -/obj/item/card/id/scc/gold - desc = "A high-tech holocard displaying the intimidating credentials of a SCC employee." - icon_state = "captain_card" - -/obj/item/card/id/scc/gold/captain - desc = "A high-tech holocard displaying the commanding credentials of a SCC captain." - icon_state = "captain_card" - /obj/item/card/id/captains_spare name = "captain's spare identification card" desc = "A captain's spare identification card." - icon_state = "captain_card" + icon_state = "gold" + item_state = "gold_id" + overlay_state = "gold" registered_name = "Captain" assignment = "Captain" @@ -478,12 +481,15 @@ /obj/item/card/id/ccia name = "\improper CentCom. Internal Affairs identification card" - desc = "A high-tech holocard displaying the blood-chilling credentials of an Internal Affairs agent." + desc = "A synthleather ID displaying the blood-chilling credentials of an Internal Affairs agent." icon_state = "ccia" overlay_state = "ccia" drop_sound = /singleton/sound_category/generic_drop_sound pickup_sound = /singleton/sound_category/generic_pickup_sound +/obj/item/card/id/ccia/update_icon() + return + /obj/item/card/id/ccia/id_flash(var/mob/user) var/add_text = "Done with prejudice and professionalism, [user.get_pronoun("he")] means business." var/blind_add_text = "Done with prejudice and professionalism, you mean business." @@ -557,6 +563,9 @@ icon_state = "pmc_card" overlay_state = "pmc_card" +/obj/item/card/distress/ap_eridani/update_icon() + return + /obj/item/card/id/distress/ap_eridani/New() access = get_distress_access() ..() @@ -591,6 +600,9 @@ icon_state = "idris_card" overlay_state = "idris_card" +/obj/item/card/id/idris/update_icon() + return + /obj/item/card/id/idris/sec icon_state = "idrissec_card" overlay_state = "idrissec_card" @@ -601,18 +613,27 @@ icon_state = "iru_card" overlay_state = "iru_card" +/obj/item/card/id/iru/update_icon() + return + /obj/item/card/id/pmc name = "\improper PMCG identification card" desc = "A high-tech holobadge, identifying the owner as a contractor from one of the many PMCs from the Private Military Contracting Group." icon_state = "pmc_card" overlay_state = "pmc_card" +/obj/item/card/id/pmc/update_icon() + return + /obj/item/card/id/zeng_hu name = "\improper Zeng-Hu Pharmaceuticals identification card" desc = "A synthleather card, belonging to one of the highly skilled members of Zeng-Hu." icon_state = "zhu_card" overlay_state = "zhu_card" +/obj/item/card/zeng_hu/update_icon() + return + /obj/item/card/id/hephaestus name = "\improper Hephaestus Industries identification card" desc = "A metal-backed card, belonging to the powerful Hephaestus Industries." diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index f51d4f53ef9..c7a453bcb95 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -357,11 +357,11 @@ /obj/item/storage/proc/slot_orient_objs(var/rows, var/cols, var/list/obj/item/display_contents) var/cx = 4 var/cy = 2+rows - src.boxes.screen_loc = "4:16,2:16 to [4+cols]:16,[2+rows]:16" + src.boxes.screen_loc = "4:12,2:16 to [4+cols]:16,[2+rows]:16" if(display_contents_with_number) for(var/datum/numbered_display/ND in display_contents) - ND.sample_object.screen_loc = "[cx]:16,[cy]:16" + ND.sample_object.screen_loc = "[cx]:12,[cy]:16" ND.sample_object.maptext = SMALL_FONTS(7, "[(ND.number > 1)? "[ND.number]" : ""]") ND.sample_object.hud_layerise() if(display_contents_initials) @@ -377,14 +377,14 @@ cy-- else for(var/obj/O in contents) - O.screen_loc = "[cx]:16,[cy]:16" + O.screen_loc = "[cx]:12,[cy]:16" O.maptext = "" O.hud_layerise() cx++ if (cx > (4+cols)) cx = 4 cy-- - closer.screen_loc = "[4+cols+1]:16,2:16" + closer.screen_loc = "[4+cols+1]:12,2:16" /obj/item/storage/proc/handle_name_initials(var/sample_name) var/name_initials = "" @@ -395,32 +395,33 @@ /obj/item/storage/proc/space_orient_objs(list/obj/item/display_contents, defer_overlays = FALSE) - // Don't touch these numbers. This works on literal pixel measurements. Unless you want to fix this shit. - var/baseline_max_storage_space = DEFAULT_BACKPACK_STORAGE //should be equal to default backpack capacity + // Don't touch these numbers. This works on literal pixel measurements. Unless you want to fix this shit or change the sprites. var/storage_cap_width = 2 //length of sprite for start and end of the box representing total storage space var/stored_cap_width = 4 //length of sprite for start and end of the box representing the stored item - var/storage_width = min(round(DEFAULT_BACKPACK_STORAGE*8*max_storage_space/baseline_max_storage_space ,1) , DEFAULT_BACKPACK_STORAGE*10) //length of sprite for the box representing total storage space + var/storage_width = (1+stored_cap_width*2)*max_storage_space - 1 //length of sprite for the box representing total storage space, -1px. because no spacing on left for first item. storage_start.ClearOverlays() var/matrix/M = matrix() - M.Scale((storage_width-storage_cap_width*2+11)/32,1) + M.Scale(storage_width / 32,1) storage_continue.transform = M - storage_start.screen_loc = "4:16,2:16" - storage_continue.screen_loc = "4:[round(storage_cap_width+(storage_width-storage_cap_width*2)/2+6)],2:16" - storage_end.screen_loc = "4:[27+storage_width-storage_cap_width],2:16" + storage_start.screen_loc = "4:12,2:16" + storage_continue.screen_loc = "4:[12 - 16 + round((storage_width + storage_cap_width*2) / 2, 1)],2:16" // -16 to center the sprite, since we're 32x32 + storage_end.screen_loc = "4:[12 + storage_cap_width + storage_width],2:16" var/startpoint = 0 - var/endpoint = 1 + var/stored_width = 0 + var/endpoint = 0 - storage_cap_width - 1 storage_start.vis_contents = list() QDEL_LIST(storage_screens) storage_screens = list() for(var/obj/item/O in contents) - startpoint = endpoint + 1 - endpoint = startpoint + storage_width * O.get_storage_cost()/max_storage_space + startpoint = endpoint + stored_cap_width + 1 + stored_width = (9*O.get_storage_cost()-9) + endpoint = startpoint + stored_width + stored_cap_width var/atom/movable/screen/storage/background/stored_start = new /atom/movable/screen/storage/background(null, O, "stored_start") var/matrix/M_start = matrix() @@ -429,26 +430,26 @@ var/atom/movable/screen/storage/background/stored_continue = new /atom/movable/screen/storage/background(null, O, "stored_continue") var/matrix/M_continue = matrix() - M_continue.Scale((endpoint-startpoint-stored_cap_width*2)/32,1) - M_continue.Translate(startpoint+stored_cap_width+(endpoint-startpoint-stored_cap_width*2)/2 - 16,0) + M_continue.Scale(stored_width / 32, 1) + M_continue.Translate(startpoint - 16 + ((stored_width + stored_cap_width*2) / 2), 0) // -16 to center the sprite, since we're 32x32 stored_continue.transform = M_continue var/atom/movable/screen/storage/background/stored_end = new /atom/movable/screen/storage/background(null, O, "stored_end") var/matrix/M_end = matrix() - M_end.Translate(endpoint-stored_cap_width, 0) + M_end.Translate(endpoint, 0) stored_end.transform = M_end storage_screens += list(stored_start, stored_continue, stored_end) storage_start.add_vis_contents(list(stored_start, stored_continue, stored_end)) - O.screen_loc = "4:[round((startpoint+endpoint)/2)],2:16" + O.screen_loc = "4:[startpoint + round(stored_width/2)],2:16" O.maptext = "" O.hud_layerise() if (!defer_overlays) storage_start.UpdateOverlays() - closer.screen_loc = "4:[storage_width+27],2:16" + closer.screen_loc = "4:[12+storage_width+storage_cap_width*2],2:16" return /datum/numbered_display @@ -829,6 +830,9 @@ fill() + for(var/obj/item/I in contents) + I.in_storage = TRUE + if(!allow_quick_empty) verbs -= /obj/item/storage/verb/quick_empty diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index cea66904cb5..efa282696c8 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -156,6 +156,7 @@ if(build_from_parts) color = pick(color_options) AddOverlays(overlay_image(icon, "[initial(icon_state)]_[worn_overlay]", flags=RESET_COLOR)) + update_icon() /obj/item/wirecutters/update_icon() var/matrix/tf = matrix() diff --git a/code/modules/client/preferences_toggles.dm b/code/modules/client/preferences_toggles.dm index d7d0f82aae6..5bda4ac9659 100644 --- a/code/modules/client/preferences_toggles.dm +++ b/code/modules/client/preferences_toggles.dm @@ -181,4 +181,4 @@ prefs.toggles_secondary ^= HIDE_ITEM_TOOLTIPS prefs.save_preferences() - to_chat(src, SPAN_NOTICE("Item outlines are now [prefs.toggles_secondary & HIDE_ITEM_TOOLTIPS ? "disabled" : "enabled"].")) + to_chat(src, SPAN_NOTICE("Item tooltips are now [prefs.toggles_secondary & HIDE_ITEM_TOOLTIPS ? "disabled" : "enabled"].")) diff --git a/code/modules/projectiles/pins.dm b/code/modules/projectiles/pins.dm index ee03c771a8c..6d09a777696 100644 --- a/code/modules/projectiles/pins.dm +++ b/code/modules/projectiles/pins.dm @@ -29,11 +29,30 @@ Firing pins as a rule can't be removed without replacing them, blame a really sh .=..() if(istype(loc, /obj/item/gun)) gun = loc + update_icon() + +/obj/item/device/firing_pin/pickup(mob/user) + ..() + update_icon() + +/obj/item/device/firing_pin/dropped(mob/user) + ..() + update_icon() + +/obj/item/device/firing_pin/attack_hand() + ..() + update_icon() + +/obj/item/firing_pin/update_icon() + var/matrix/tf = matrix() + if(istype(loc, /obj/item/storage)) + tf.Turn(-90) //Vertical for storing compactly + tf.Translate(-1, 0) //Could do this with pixel_x but let's just update the appearance once. + transform = tf /obj/item/device/firing_pin/proc/examine_info() // Part of what allows people to see what firing mode their wireless control pin is in. Returns nothing here if there's no wireless-control firing pin. return - /obj/item/device/firing_pin/afterattack(atom/target, mob/user, proximity_flag) if(proximity_flag) if(istype(target, /obj/item/gun)) diff --git a/html/changelogs/wezzy_Storage-Fixes2.yml b/html/changelogs/wezzy_Storage-Fixes2.yml new file mode 100644 index 00000000000..de2b06462cf --- /dev/null +++ b/html/changelogs/wezzy_Storage-Fixes2.yml @@ -0,0 +1,61 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Wowzewow (Wezzy) + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixes storage box alignment and storage space UI to use better maths." + - qol: "Tweaks IDs, IDs and firing pins now rotate 90 degrees when in storage for easier clickability." + - bugfix: "Fixes Item Tooltip toggle message." + - bugfix: "Fixes roundstart items in storage not showing item outlines." diff --git a/icons/obj/card.dmi b/icons/obj/card.dmi index 525630da183..466da046c5a 100644 Binary files a/icons/obj/card.dmi and b/icons/obj/card.dmi differ