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

Missing icons unit test expansion #7659

Merged
merged 35 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
da4378d
Initial implementation: missing icons now instantiates items and shar…
Drulikar Nov 21, 2024
606be5c
missing icons expansion and further fixes
Drulikar Nov 23, 2024
d197f24
Rename NO_SNOW_TYPE to NO_GAMEMODE_SKIN
Drulikar Nov 23, 2024
9e35a93
Silence sentry landmark in testing
Drulikar Nov 23, 2024
a586255
fix abstract marine jacket
Drulikar Nov 23, 2024
69f1af0
group missing icon warnings
Drulikar Nov 23, 2024
ade9dee
Try endgroup for warnings?
Drulikar Nov 24, 2024
55cd045
More simple mob fixes for weakrefs
Drulikar Nov 24, 2024
36ac719
Add warning support to unit tests
Drulikar Nov 24, 2024
4908353
fix compile error w/ testing
Drulikar Nov 24, 2024
deae900
fix pred gear naming issues
Drulikar Nov 24, 2024
b2c3c13
Lizards use walk_away which I guess just causes false positives
Drulikar Nov 24, 2024
404bdd1
Perform basic missing icon testing for c&d ignored object paths
Drulikar Nov 24, 2024
98329eb
No lizard spawner either please
Drulikar Nov 24, 2024
514738a
Merge branch 'master' into missing_icons_expansion
Drulikar Nov 24, 2024
a537933
Rename update path script
Drulikar Nov 24, 2024
cf5ce2c
For now, don't annotate missing icon warnings
Drulikar Nov 24, 2024
ea1e01d
Fix pipes going invisible and not re-connecting when re-anchored
Drulikar Nov 24, 2024
8872388
Overlay/underlay testing!
Drulikar Nov 26, 2024
cddeb48
Add pistol belt testing
Drulikar Nov 26, 2024
42bdf4b
Restore spike launcher overlays
Drulikar Nov 26, 2024
4f6c130
Add unlocked overlay for locking satchel
Drulikar Nov 26, 2024
3cfe8f4
fix blackmarket scanner overlay
Drulikar Nov 26, 2024
4a5c998
More belt fixes
Drulikar Nov 26, 2024
2b455e0
various fixes
Drulikar Nov 27, 2024
9e45ec3
predators now use random skin color on admin spawn
Drulikar Nov 27, 2024
dfff855
Refactor out uses_skin_color for HAS_SKIN_COLOR flag
Drulikar Nov 27, 2024
0820b2c
more fixes
Drulikar Nov 27, 2024
2853cf4
Fix plants and weird beach icon path
Drulikar Nov 27, 2024
105a78c
final wall fixes?
Drulikar Nov 27, 2024
3056516
Minor cleanup
Drulikar Nov 27, 2024
9838792
Merge remote-tracking branch 'upstream/master' into missing_icons_exp…
Drulikar Nov 27, 2024
f6209fb
Fixup maps in TGM format
Drulikar Nov 27, 2024
c1bc011
Another honking gun
Drulikar Nov 27, 2024
e6fb0e0
Rename robot gibs like others
Drulikar Nov 27, 2024
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
4 changes: 2 additions & 2 deletions code/__DEFINES/equipment.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#define ITEM_UNCATCHABLE (1<<9)
/// Used for nonstandard marine clothing to ignore 'specialty' var.
#define NO_NAME_OVERRIDE (1<<10)
/// Used for armors or uniforms that don't have a snow/desert/etc icon state set via select_gamemode_skin (not all item types currently perform this test though).
#define NO_SNOW_TYPE (1<<11)
/// Used for armors or uniforms that don't have a snow/desert/etc icon state set via select_gamemode_skin.
#define NO_GAMEMODE_SKIN (1<<11)

#define INVULNERABLE (1<<12)

Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ DEFINE_BITFIELD(flags_atom, list(
"RELAY_CLICK" = RELAY_CLICK,
"ITEM_UNCATCHABLE" = ITEM_UNCATCHABLE,
"NO_NAME_OVERRIDE" = NO_NAME_OVERRIDE,
"NO_SNOW_TYPE" = NO_SNOW_TYPE,
"NO_GAMEMODE_SKIN" = NO_GAMEMODE_SKIN,
"INVULNERABLE" = INVULNERABLE,
"CAN_BE_SYRINGED" = CAN_BE_SYRINGED,
"CAN_BE_DISPENSED_INTO" = CAN_BE_DISPENSED_INTO,
Expand Down
5 changes: 3 additions & 2 deletions code/datums/effects/xeno_strains/prae_acid_stacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@
if (!ishuman(affected_atom))
return ..()

var/mob/living/carbon/human/H = affected_atom
addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 3)
var/mob/living/carbon/human/human = affected_atom
if(!QDELETED(human))
addtimer(CALLBACK(human, TYPE_PROC_REF(/mob/living/carbon/human, update_xeno_hostile_hud)), 3)

return ..()

Expand Down
7 changes: 7 additions & 0 deletions code/game/machinery/camera/presets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@
status = FALSE
kick_viewers()

/obj/structure/machinery/camera/vehicle/update_icon()
. = ..()
if(stat & EMPED)
icon_state = "vehicle_cameraemp"
else
icon_state = "vehicle_camera"

// AUTONAME

/obj/structure/machinery/camera/autoname
Expand Down
1 change: 0 additions & 1 deletion code/game/machinery/doors/door.dm
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@

operating = TRUE
do_animate("opening")
icon_state = "door0"
set_opacity(FALSE)
if(length(filler_turfs))
change_filler_opacity(opacity)
Expand Down
10 changes: 0 additions & 10 deletions code/game/machinery/doors/multi_tile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,6 @@
req_access = null
req_one_access = list(ACCESS_CIVILIAN_PUBLIC)

/obj/structure/machinery/door/airlock/multi_tile/shuttle
name = "Shuttle Podlock"
icon = 'icons/obj/structures/doors/1x2blast_vert.dmi'
icon_state = "pdoor1"
opacity = TRUE
openspeed = 12
req_access = null
not_weldable = 1


// ALMAYER

/obj/structure/machinery/door/airlock/multi_tile/almayer
Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/kitchen/juicer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
. = ..()
beaker = new /obj/item/reagent_container/glass/beaker/large(src)

/obj/structure/machinery/juicer/Destroy()
QDEL_NULL(beaker)
return ..()

/obj/structure/machinery/juicer/update_icon()
icon_state = "juicer"+num2text(!QDELETED(beaker))
return
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/aliens.dm
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
if(isliving(atm)) //For extinguishing mobs on fire
var/mob/living/M = atm

if(M != cause_data.resolve_mob())
if(M != cause_data?.resolve_mob())
M.ExtinguishMob()

if(M.stat == DEAD) // NO. DAMAGING. DEAD. MOBS.
Expand Down Expand Up @@ -150,7 +150,7 @@

/obj/effect/xenomorph/spray/Crossed(AM as mob|obj)
..()
if(AM == cause_data.resolve_mob())
if(AM == cause_data?.resolve_mob())
return

if(isliving(AM))
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/decals/cleanable/blood/robots.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
random_icon_states = list("gibarm", "gibleg")

/obj/effect/decal/cleanable/blood/gibs/robot/up
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibup1","gibup1") //2:7 is close enough to 1:4
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7", "gibup", "gibup") //2:7 is close enough to 1:4

/obj/effect/decal/cleanable/blood/gibs/robot/down
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibdown1","gibdown1") //2:7 is close enough to 1:4
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7","gibdown","gibdown") //2:7 is close enough to 1:4

/obj/effect/decal/cleanable/blood/oil
name = "motor oil"
Expand Down
40 changes: 25 additions & 15 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,20 @@
/obj/item/proc/suicide_act(mob/user)
return

/*Global item proc for all of your unique item skin needs. Works with any
item, and will change the skin to whatever you specify here. You can also
manually override the icon with a unique skin if wanted, for the outlier
cases. Override_icon_state should be a list.*/
/**
* Global item proc for all of your unique item skin needs. Works with any
* item, and will change the skin to whatever you specify here. You can also
* manually override the icon with a unique skin if wanted, for the outlier
* cases. Override_icon_state should be a list. Generally requires NO_GAMEMODE_SKIN
* to not be set for changes to be applied.
*
* Returns whether changes were applied.
*/
/obj/item/proc/select_gamemode_skin(expected_type, list/override_icon_state, list/override_protection)
if(type != expected_type)
return
return FALSE
if(flags_atom & NO_GAMEMODE_SKIN)
return FALSE

var/new_icon_state
var/new_protection
Expand All @@ -254,19 +261,22 @@ cases. Override_icon_state should be a list.*/
new_icon_state = override_icon_state[SSmapping.configs[GROUND_MAP].map_name]
if(LAZYLEN(override_protection))
new_protection = override_protection[SSmapping.configs[GROUND_MAP].map_name]
switch(SSmapping.configs[GROUND_MAP].camouflage_type)
if("snow")
icon_state = new_icon_state ? new_icon_state : "s_" + icon_state
item_state = new_item_state ? new_item_state : "s_" + item_state
if("desert")
icon_state = new_icon_state ? new_icon_state : "d_" + icon_state
item_state = new_item_state ? new_item_state : "d_" + item_state
if("classic")
icon_state = new_icon_state ? new_icon_state : "c_" + icon_state
item_state = new_item_state ? new_item_state : "c_" + item_state
if(!isnull(icon_state) || new_icon_state || new_item_state)
switch(SSmapping.configs[GROUND_MAP].camouflage_type)
if("snow")
icon_state = new_icon_state ? new_icon_state : "s_" + icon_state
item_state = new_item_state ? new_item_state : "s_" + item_state
if("desert")
icon_state = new_icon_state ? new_icon_state : "d_" + icon_state
item_state = new_item_state ? new_item_state : "d_" + item_state
if("classic")
icon_state = new_icon_state ? new_icon_state : "c_" + icon_state
item_state = new_item_state ? new_item_state : "c_" + item_state
if(new_protection)
min_cold_protection_temperature = new_protection

return TRUE

/obj/item/get_examine_text(mob/user)
. = list()
var/size
Expand Down
8 changes: 2 additions & 6 deletions code/game/objects/items/devices/binoculars.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
throwforce = 5
throw_range = 15
throw_speed = SPEED_VERY_FAST
/// If FALSE won't change icon_state to a camo marine bino.
var/uses_camo = TRUE
var/tile_offset = 11
var/viewsize = 12
var/hvh_tile_offset = 6 //same as miniscopes
Expand All @@ -23,8 +21,6 @@

/obj/item/device/binoculars/Initialize()
. = ..()
if(!uses_camo)
return
select_gamemode_skin(type)

/obj/item/device/binoculars/attack_self(mob/user)
Expand Down Expand Up @@ -55,7 +51,7 @@
/obj/item/device/binoculars/civ
desc = "A pair of binoculars."
icon_state = "binoculars_civ"
uses_camo = FALSE
flags_atom = FPRINT|CONDUCT|NO_GAMEMODE_SKIN // same sprite for all gamemodes

//RANGEFINDER with ability to acquire coordinates
/obj/item/device/binoculars/range
Expand Down Expand Up @@ -516,7 +512,7 @@
icon_state = "designator_e"

//laser_con is to add you to the list of laser users.
flags_atom = FPRINT|CONDUCT
flags_atom = FPRINT|CONDUCT|NO_GAMEMODE_SKIN
force = 5
w_class = SIZE_SMALL
throwforce = 5
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/walkman.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
var/mob/living/carbon/human/H = loc
H.regenerate_icons()

/obj/item/device/walkman/get_mob_overlay(mob/user_mob, slot)
/obj/item/device/walkman/get_mob_overlay(mob/user_mob, slot, default_bodytype = "Default")
var/image/ret = ..()
if((slot == WEAR_L_EAR || slot == WEAR_R_EAR) && !paused)
var/image/I = overlay_image(ret.icon, "+music", color, RESET_COLOR)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/explosives/mine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
. = ..()
if(map_deployed)
deploy_mine(null)
else
cause_data = create_cause_data(initial(name))

/obj/item/explosive/mine/Destroy()
QDEL_NULL(tripwire)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/handcuffs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
throw_range = 5
matter = list("metal" = 500)

/obj/item/restraint/handcuffs/get_mob_overlay(mob/user_mob, slot)
/obj/item/restraint/handcuffs/get_mob_overlay(mob/user_mob, slot, default_bodytype = "Default")
var/image/ret = ..()

var/image/handcuffs = overlay_image('icons/mob/mob.dmi', "handcuff1", color, RESET_COLOR)
Expand Down
35 changes: 19 additions & 16 deletions code/game/objects/items/shards.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
var/source_sheet_type = /obj/item/stack/sheet/glass
var/shardsize
var/count = 1
/// Whether to add small/medium/large to the end of the icon_state on Initialize
var/random_size = TRUE
garbage = TRUE

/obj/item/shard/attack(mob/living/carbon/M, mob/living/carbon/user)
Expand All @@ -26,22 +28,21 @@

/obj/item/shard/Initialize()
. = ..()
shardsize = pick("large", "medium", "small")
switch(shardsize)
if("small")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
icon_state += shardsize
if("medium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
icon_state += shardsize
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
icon_state += shardsize


if(random_size)
shardsize = pick("large", "medium", "small")
switch(shardsize)
if("small")
pixel_x = rand(-12, 12)
pixel_y = rand(-12, 12)
icon_state += shardsize
if("medium")
pixel_x = rand(-8, 8)
pixel_y = rand(-8, 8)
icon_state += shardsize
if("large")
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
icon_state += shardsize

/obj/item/shard/attackby(obj/item/W, mob/user)
if ( iswelder(W))
Expand Down Expand Up @@ -237,6 +238,7 @@
desc = "Some shrapnel that used to be embedded underneath someone's skin."
icon_state = "small"
damage_on_move = 2
random_size = FALSE

/obj/item/shard/shrapnel/upp/bits
name = "tiny shrapnel"
Expand All @@ -251,6 +253,7 @@
matter = list("bone" = 50)
desc = "It looks like it came from a prehistoric animal."
damage_on_move = 0.6
random_size = FALSE

/obj/item/shard/shrapnel/bone_chips/human
name = "human bone fragments"
Expand Down
Loading
Loading