Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Commit

Permalink
Fixing issues revealed by icon debug verb.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Feb 2, 2019
1 parent bae1a5c commit 4d463a0
Show file tree
Hide file tree
Showing 69 changed files with 246 additions and 389 deletions.
129 changes: 117 additions & 12 deletions code/_helpers/debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,141 @@
var/list/broken_items = list()
var/list/found_states_for_icons = list()

// Overlays, etc. that should not be considered 'unused'.
var/list/reserved_states = list(
'icons/obj/clothing/obj_under.dmi' = list(
"jumpsuit_stripe",
"jumpsuit_d",
"jumpsuit_d_stripe",
"jumpsuit_d_collar",
"jumpsuit_collar"
)
)
// Items that are unsafe to spawn with no loc, or without additional specialized args.
// These are usually intermediary types not intended to be spawned, or internal types
// that are meant to make up a component of some other object.
var/list/skip_types = list(
/obj/item,
/obj/item/weapon,
/obj/item/weapon/engine,
/obj/item/toy,
/obj/item/toy/desk,
/obj/item/trash,
/obj/item/device,
/obj/item/device/tankassemblyproxy,
/obj/item/device/assembly,
/obj/item/robot_rack,
/obj/item/rig_module,
/obj/item/instrument,
/obj/item/device/synthesized_instrument,
/obj/item/weapon/reagent_containers/pill/pouch_pill,
/obj/item/weapon/storage,
/obj/item/weapon/gun/energy/gun/secure/mounted,
/obj/item/proxy_debug,
/obj/item/weapon/storage/fancy,
/obj/item/ai_verbs,
/obj/item/rig_module/device,
/obj/item/voice_changer,
/obj/item/seeds,
/obj/item/seeds/cutting,
/obj/item/weapon/grown,
/obj/item/weapon/contraband,
/obj/item/weapon/grenade/flashbang/cluster, // These both should not be on here, but
/obj/item/weapon/grenade/flashbang/clusterbang/segment, // rewriting them now is out of scope.
/obj/item/organ,
/obj/item/organ/internal,
/obj/item/organ/internal/augment,
/obj/item/organ/internal/augment/active,
/obj/item/organ/internal/augment/active/simple,
/obj/item/sign,
/obj/item/weapon/holo,
/obj/item/assembly,
/obj/item/weapon/stock_parts,
/obj/item/weapon/stock_parts/subspace,
/obj/item/weapon/melee,
/obj/item/weapon/melee/energy,
/obj/item/weapon/material,
/obj/item/weapon/material/kitchen/utensil,
/obj/item/weapon/material/kitchen,
/obj/item/weapon/material/shrapnel,
/obj/item/weapon/material/twohanded,
/obj/item/weapon/material/lock_construct,
/obj/item/weapon/flame,
/obj/item/trash/cigbutt,
/obj/item/weapon/toy,
/obj/item/weapon/computer_hardware,
/obj/item/weapon/module,
/obj/item/rig_module,
/obj/item/weapon/glass_extra,
/obj/item/weapon/storage/secure,
/obj/item/weapon/reagent_containers,
/obj/item/weapon/reagent_containers/glass,
/obj/item/weapon/reagent_containers/food,
/obj/item/weapon/reagent_containers/food/snacks,
/obj/item/weapon/reagent_containers/food/snacks/variable,
/obj/item/weapon/reagent_containers/food/snacks/old,
/obj/item/weapon/reagent_containers/food/drinks,
/obj/item/weapon/contraband,
/obj/item/weapon/grenade/flashbang/cluster, // These both should not be on here, but
/obj/item/weapon/grenade/flashbang/clusterbang/segment // rewriting them now is out of scope.
/obj/item/weapon/reagent_containers/food/snacks/human,
/obj/item/weapon/reagent_containers/food/snacks/pie,
/obj/item/weapon/reagent_containers/food/snacks/fruit_slice,
/obj/item/weapon/reagent_containers/food/snacks/slice,
/obj/item/weapon/reagent_containers/food/snacks/sliceable,
/obj/item/weapon/reagent_containers/food/snacks/sliceable/pizza,
/obj/item/weapon/reagent_containers/food/drinks/cans,
/obj/item/weapon/reagent_containers/food/drinks/bottle,
/obj/item/weapon/reagent_containers/food/drinks/bottle/small,
/obj/item/clothing,
/obj/item/clothing/under,
/obj/item/clothing/under/lower,
/obj/item/clothing/under/upper,
/obj/item/clothing/head,
/obj/item/clothing/suit,
/obj/item/clothing/suit/storage,
/obj/item/clothing/suit/storage/hooded,
/obj/item/clothing/suit/storage/toggle,
/obj/item/clothing/glasses,
/obj/item/clothing/glasses/hud,
/obj/item/clothing/gloves,
/obj/item/clothing/ears,
/obj/item/clothing/ring,
/obj/item/clothing/mask,
/obj/item/clothing/mask/smokable,
/obj/item/clothing/mask/smokable/ecig,
/obj/item/clothing/mask/chewable,
/obj/item/weapon/shield,
/obj/item/weapon/tank,
/obj/item/weapon/rig,
/obj/item/weapon/forensics,
/obj/item/weapon/sample,
/obj/item/weapon/spacecash/bundle,
/obj/item/weapon/light,
/obj/item/stack,
/obj/item/stack/medical,
/obj/item/stack/medical/advanced,
/obj/item/stack/tile,
/obj/item/stack/flag,
/obj/item/inflatable,
/obj/item/underwear,
/obj/item/underwear/socks,
/obj/item/underwear/top,
/obj/item/underwear/bottom,
/obj/item/underwear/undershirt
)

// Types that should be skipped along with all descendants.
var/list/skip_types_and_subtypes = list(
/obj/item/proxy_debug,
/obj/item/weapon/gun, // Uses a lot of overlays.
/obj/item/weapon/hand,
/obj/item/weapon/storage/internal,
/obj/item/weapon/robot_module,
/obj/item/device/radio/borg,
/obj/item/device/radio/announcer,
/obj/item/device/uplink
/obj/item/device/uplink,
/obj/item/grab,
/obj/item/borg,
/obj/item/weapon/holder,
/obj/item/weapon/stool,
/obj/item/modular_computer, // They break the proc via NanoUI.
/obj/item/organ/external // Too specialized for this to easily cope with.
)

for(var/thing in skip_types_and_subtypes)
Expand All @@ -60,11 +167,7 @@
found_states_for_icons[check_icon] = list()
found_states_for_icons[check_icon] |= check_icon_state

var/check_mob_state
if(istype(checking, /obj/item/clothing))
var/obj/item/clothing/clothes = checking
check_mob_state = clothes.item_state

var/check_mob_state = checking.item_state
if(!check_mob_state && check_icon_state)
check_mob_state = check_icon_state

Expand Down Expand Up @@ -113,8 +216,10 @@
var/list/check_states = icon_states(check_icon)
for(var/state in found_states_for_icons[check_icon])
check_states -= state
if(reserved_states[check_icon])
check_states -= reserved_states[check_icon]
if(LAZYLEN(check_states))
lines += "[check_icon]:<br>- [jointext(check_states, "<br>- ")]"
lines += "<br>[check_icon]:<br>- [jointext(check_states, "<br>- ")]"
lines += "<br>Done."

var/save_path = "data/item_icon_debug.txt"
Expand Down
2 changes: 1 addition & 1 deletion code/_macros.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

#define isCrowbar(A) istype(A, /obj/item/weapon/crowbar)

#define isPlunger(A) istype(A, /obj/item/clothing/mask/plunger) || istype(A, /obj/item/device/plunger/robot)
#define isPlunger(A) istype(A, /obj/item/clothing/mask/plunger) || istype(A, /obj/item/device/plunger_robot)

#define sequential_id(key) uniqueness_repository.Generate(/datum/uniqueness_generator/id_sequential, key)

Expand Down
2 changes: 1 addition & 1 deletion code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
var/throw_range = 7
var/moved_recently = 0
var/mob/pulledby = null
var/item_state = null // Used to specify the item state for the on-mob overlays.
var/item_state = "empty" // Used to specify the item state for the on-mob overlays.
var/does_spin = TRUE // Does the atom spin when thrown (of course it does :P)

/atom/movable/Destroy()
Expand Down
2 changes: 0 additions & 2 deletions code/game/objects/items/devices/radio/electropack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
if(!user.unEquip(W) || !user.unEquip(src))
return
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit( user )
A.icon = 'icons/obj/assemblies.dmi'

W.forceMove(A)
W.master = A
A.part1 = W
Expand Down
55 changes: 0 additions & 55 deletions code/game/objects/items/devices/radio/headset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@
syndie = 1
ks1type = /obj/item/device/encryptionkey/syndicate

/obj/item/device/radio/headset/syndicate/alt
icon_state = "syndie_headset"
item_state = "syndie_headset"

/obj/item/device/radio/headset/syndicate/Initialize()
. = ..()
set_frequency(SYND_FREQ)
Expand All @@ -97,23 +93,13 @@
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/headset_sec

/obj/item/device/radio/headset/headset_sec/alt
name = "security bowman headset"
icon_state = "sec_headset_alt"
item_state = "sec_headset_alt"

/obj/item/device/radio/headset/headset_eng
name = "engineering radio headset"
desc = "When the engineers wish to chat like girls."
icon_state = "eng_headset"
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/headset_eng

/obj/item/device/radio/headset/headset_eng/alt
name = "engineering bowman headset"
icon_state = "eng_headset_alt"
item_state = "eng_headset_alt"

/obj/item/device/radio/headset/headset_rob
name = "robotics radio headset"
desc = "Made specifically for the roboticists who cannot decide between departments."
Expand All @@ -128,11 +114,6 @@
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/headset_med

/obj/item/device/radio/headset/headset_med/alt
name = "medical bowman headset"
icon_state = "med_headset_alt"
item_state = "med_headset_alt"

/obj/item/device/radio/headset/headset_sci
name = "science radio headset"
desc = "A sciency headset. Like usual."
Expand All @@ -154,27 +135,13 @@
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/headset_com

/obj/item/device/radio/headset/headset_com/alt
name = "command bowman headset"
desc = "A headset with a commanding channel."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
ks1type = /obj/item/device/encryptionkey/headset_com
max_keys = 3

/obj/item/device/radio/headset/heads/captain
name = "captain's headset"
desc = "The headset of the boss."
icon_state = "com_headset"
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/heads/captain

/obj/item/device/radio/headset/heads/captain/alt
name = "captain's bowman headset"
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
max_keys = 3

/obj/item/device/radio/headset/heads/ai_integrated //No need to care about icons, it should be hidden inside the AI anyway.
name = "\improper AI subspace transceiver"
desc = "Integrated AI radio transceiver."
Expand Down Expand Up @@ -215,23 +182,13 @@
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/heads/ce

/obj/item/device/radio/headset/heads/ce/alt
name = "chief engineer's bowman headset"
icon_state = "com_headset_alt"
item_state = "com_headset_alt"

/obj/item/device/radio/headset/heads/cmo
name = "chief medical officer's headset"
desc = "The headset of the highly trained medical chief."
icon_state = "com_headset"
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/heads/cmo

/obj/item/device/radio/headset/heads/cmo/alt
name = "chief medical officer's bowman headset"
icon_state = "com_headset_alt"
item_state = "com_headset_alt"

/obj/item/device/radio/headset/heads/hop
name = "head of personnel's headset"
desc = "The headset of the guy who will one day be captain."
Expand Down Expand Up @@ -267,25 +224,13 @@
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/headset_mining

/obj/item/device/radio/headset/headset_mining/alt
name = "mining bowman radio headset"
icon_state = "mine_headset_alt"
item_state = "mine_headset_alt"
max_keys = 3

/obj/item/device/radio/headset/headset_cargo
name = "supply radio headset"
desc = "A headset used by the box-pushers."
icon_state = "cargo_headset"
item_state = "headset"
ks1type = /obj/item/device/encryptionkey/headset_cargo

/obj/item/device/radio/headset/headset_cargo/alt
name = "supply bowman headset"
icon_state = "cargo_headset_alt"
item_state = "cargo_headset_alt"
max_keys = 3

/obj/item/device/radio/headset/entertainment
name = "actor's radio headset"
desc = "specially made to make you sound less cheesy."
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/plunger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
hitsound = 'sound/effects/plunger.ogg'
matter = list("steel" = 5000)

/obj/item/device/plunger/robot
/obj/item/device/plunger_robot
name = "plunger"
desc = "a plunger. It unclogs things."
icon_state = "plunger_black"
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/stacks/rods.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

place_grille(user, user.loc, src)

/obj/item/stack/rods/on_update_icon()
/obj/item/stack/material/rods/on_update_icon()
..()
if(amount == 1)
icon_state = "single-rod"
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/stacks/sheets/leather.dm
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/obj/item/stack/animalhide
icon_state = "sheet-hide"

/obj/item/stack/animalhide/human
name = "human skin"
desc = "The by-product of human farming."
singular_name = "human skin piece"
icon_state = "sheet-hide"

/obj/item/stack/animalhide/corgi
name = "corgi hide"
Expand Down
Loading

0 comments on commit 4d463a0

Please sign in to comment.