mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-21 03:59:59 +01:00
More things use trait huds over raw hud management (#93084)
This commit is contained in:
@@ -178,6 +178,7 @@
|
||||
#include "holder_loving.dm"
|
||||
#include "holidays.dm"
|
||||
#include "holofan_placement.dm"
|
||||
#include "huds.dm"
|
||||
#include "hulk.dm"
|
||||
#include "human_through_recycler.dm"
|
||||
#include "hunger_curse.dm"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
/// Tests huds are applied and removed correctly when relevant traits are added/removed
|
||||
/datum/unit_test/huds
|
||||
|
||||
/datum/unit_test/huds/Run()
|
||||
var/datum/atom_hud/testhud = GLOB.huds[GLOB.trait_to_hud[TRAIT_SECURITY_HUD]]
|
||||
var/mob/living/carbon/human/consistent/dummy = allocate(__IMPLIED_TYPE__)
|
||||
|
||||
ADD_TRAIT(dummy, TRAIT_SECURITY_HUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!!testhud.hud_users_all_z_levels[dummy], "HUD not applied when trait of HUD was added")
|
||||
|
||||
ADD_TRAIT(dummy, TRAIT_BLOCK_SECHUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!testhud.hud_users_all_z_levels[dummy], "HUD not removed when trait blocking HUD was added")
|
||||
|
||||
REMOVE_TRAIT(dummy, TRAIT_BLOCK_SECHUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!!testhud.hud_users_all_z_levels[dummy], "HUD not reapplied when trait blocking HUD was removed")
|
||||
|
||||
REMOVE_TRAIT(dummy, TRAIT_SECURITY_HUD, TRAIT_SOURCE_UNIT_TESTS)
|
||||
TEST_ASSERT(!testhud.hud_users_all_z_levels[dummy], "HUD not removed when trait of HUD was removed")
|
||||
Reference in New Issue
Block a user