From f4b37b41775f4704b5d99dc09b2d7e824040e6af Mon Sep 17 00:00:00 2001 From: Vi3trice <80771500+Vi3trice@users.noreply.github.com> Date: Thu, 21 Jul 2022 02:11:59 -0400 Subject: [PATCH] Port TG updating appearances (#17943) * Get pants that match or else you gonna look silly yo * Posters * Fix other hud elements * Rereviewed * Update shotglass.dm * Fix for new merged PRs * Typo * Coming across other stuff * Update theblob.dm * No takebacksies * smh i forget to leave a comment * Updated for the detgun and cards * Should have rerun langserver again * No longer plastic, more in scope * Damn you bluespace * Reverting turret logic, out of scope at this point * Tweak that part * Went over energy guns again, and fixed UI White's sprite sheet * Welding masks, glasses, and JUSTICE * Update portable_atmospherics.dm * Cleaning up, clearing things up * Review and suggestions * Update valve.dm * More tweaks * Missing character * Not distinct lightmasks, so they can be overlays * Update generator.dm * Add parameter so holodeck doesn't try to make a perfect copy * Update unsorted.dm * Spiders * Better fix for spiders, fix vamps too * Ghosts * Update telekinesis.dm * Cleaning up old procs * It's set up to not copy datums... Unless they're in a list * Donuts, duct tape, and detgun. D3VR coming to Early Access * Update procs that interact with doors so they call update_state instead * Forgot one spot, and actually might as well just force lock * Cleaning up other things... Sigh, and kitty ears * oops * Getting used to how it works * blinds * Going back to the suit obscuring thing, so it doesn't update all the time * Missed that from merging master * I made this PR and forgot about it * Fix runtimes in cards * Make things a bit more unified * Update update_icons.dm * yarn, really? * Update library_equipment.dm * Update shieldgen.dm * Every time Charlie merges something, I go back and see if I can improve things further * what's this? more? * Update misc_special.dm * wow, paper * Review * More reviews * To be sure, seems like being broken messed something sometimes * Brought airlocks closer to how TG works to iron out some stuff * Pizza and morgue * Doesn't seem to hurt, tried with holodeck * Revert "Doesn't seem to hurt, tried with holodeck" This reverts commit 158529302b3dd902229eb0d82dd7410f552cec90. * Icon conflict * Fix organ damage * Don't ask how. Why. It's like that on prod too. * Cutting down on things and updating from TG. * More flexible. Just in case the thing you stuck it on didn't destroy. * Hydro was one the things I touched earlier on, better rework it * Reviews * Cleaning up further, also bri'ish * Undo a change I did, and switch over to a more recent implementation * Update biogenerator.dm * Rolling back to old airlocks, but with new duct taped note * Functionally the same. I'd just rather not have the smoothing happen there * Went over APCs again * Fix welding helmet names in species files * Update airlock.dm * Update persistent_overlay.dm * Oh, topic --- code/__DEFINES/dcs/signals.dm | 26 ++- code/__DEFINES/flags.dm | 11 ++ code/__HELPERS/unsorted.dm | 6 +- code/_onclick/hud/action_button.dm | 10 +- code/_onclick/hud/alien.dm | 6 +- code/_onclick/hud/alien_larva.dm | 6 +- code/_onclick/hud/bot.dm | 3 +- code/_onclick/hud/human.dm | 6 +- code/_onclick/hud/other_mobs.dm | 3 +- code/_onclick/hud/robot.dm | 6 +- code/_onclick/hud/screen_objects.dm | 47 ++--- code/_onclick/telekinesis.dm | 11 +- code/datums/components/ducttape.dm | 6 +- code/datums/components/emissive_blocker.dm | 29 +++ code/datums/components/persistent_overlay.dm | 35 ++++ code/datums/spells/wizard.dm | 2 +- code/game/area/areas.dm | 6 +- code/game/area/areas/depot-areas.dm | 38 ++-- code/game/atoms.dm | 68 +++++++ code/game/atoms_movable.dm | 17 +- code/game/data_huds.dm | 8 +- code/game/dna/dna_modifier.dm | 12 +- code/game/dna/mutations/powers.dm | 2 +- .../gamemodes/blob/blobs/captured_nuke.dm | 7 +- code/game/gamemodes/blob/blobs/shield.dm | 39 +++- code/game/gamemodes/blob/theblob.dm | 57 ++++-- code/game/gamemodes/cult/cult_items.dm | 4 +- .../miniantags/abduction/abduction_gear.dm | 6 +- .../gamemodes/miniantags/abduction/gland.dm | 2 +- .../abduction/machinery/experiment.dm | 14 +- .../gamemodes/miniantags/guardian/guardian.dm | 3 +- .../miniantags/slaughter/slaughter.dm | 2 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 9 +- code/game/machinery/Beacon.dm | 8 +- code/game/machinery/PDApainter.dm | 16 +- code/game/machinery/Sleeper.dm | 17 +- code/game/machinery/adv_med.dm | 14 +- code/game/machinery/ai_slipper.dm | 4 +- code/game/machinery/camera/camera.dm | 10 +- code/game/machinery/camera/camera_assembly.dm | 6 +- code/game/machinery/cell_charger.dm | 30 +-- code/game/machinery/cloning.dm | 13 +- .../machinery/computer/HolodeckControl.dm | 10 +- code/game/machinery/computer/ai_core.dm | 16 +- code/game/machinery/computer/aifixer.dm | 34 ++-- code/game/machinery/computer/atmos_alert.dm | 2 +- code/game/machinery/computer/atmos_control.dm | 2 +- .../game/machinery/computer/buildandrepair.dm | 3 +- code/game/machinery/computer/computer.dm | 10 +- code/game/machinery/computer/message.dm | 4 +- code/game/machinery/computer/station_alert.dm | 4 +- code/game/machinery/dance_machine.dm | 6 +- code/game/machinery/defib_mount.dm | 22 +-- code/game/machinery/doors/airlock.dm | 16 +- code/game/machinery/doors/airlock_control.dm | 6 +- code/game/machinery/doors/brigdoors.dm | 12 +- code/game/machinery/doors/door.dm | 53 ++--- code/game/machinery/doors/firedoor.dm | 22 ++- code/game/machinery/doors/poddoor.dm | 2 +- code/game/machinery/doors/windowdoor.dm | 3 +- code/game/machinery/dye_generator.dm | 22 +-- .../airlock_controllers.dm | 2 +- .../embedded_controller_base.dm | 6 +- code/game/machinery/firealarm.dm | 25 ++- code/game/machinery/floodlight.dm | 26 +-- code/game/machinery/gameboard.dm | 4 +- code/game/machinery/hologram.dm | 8 +- code/game/machinery/holosign.dm | 6 +- code/game/machinery/iv_drip.dm | 19 +- code/game/machinery/lightswitch.dm | 21 +- code/game/machinery/magnet.dm | 17 +- code/game/machinery/navbeacon.dm | 18 +- code/game/machinery/portable_tag_turret.dm | 2 +- code/game/machinery/portable_turret.dm | 32 ++- code/game/machinery/recharger.dm | 12 +- code/game/machinery/rechargestation.dm | 12 +- code/game/machinery/recycler.dm | 21 +- code/game/machinery/requests_console.dm | 6 +- code/game/machinery/shieldgen.dm | 186 ++++++++---------- code/game/machinery/snow_machine.dm | 7 +- code/game/machinery/spaceheater.dm | 9 +- code/game/machinery/suit_storage_unit.dm | 48 ++--- code/game/machinery/syndicatebomb.dm | 12 +- code/game/machinery/tcomms/_base.dm | 15 +- code/game/machinery/teleporter.dm | 28 +-- code/game/machinery/transformer.dm | 16 +- code/game/machinery/turret_control.dm | 7 +- code/game/machinery/vending.dm | 24 +-- code/game/machinery/washing_machine.dm | 14 +- code/game/mecha/equipment/tools/work_tools.dm | 4 +- code/game/mecha/mech_bay.dm | 2 +- code/game/mecha/working/ripley.dm | 32 +-- .../effects/decals/Cleanable/aliens.dm | 1 + .../effects/decals/Cleanable/humans.dm | 16 +- .../effects/decals/Cleanable/robots.dm | 1 + .../effects/decals/Cleanable/tracks.dm | 8 +- .../game/objects/effects/decals/contraband.dm | 2 +- .../effects/effect_system/effects_foam.dm | 13 +- code/game/objects/items/ashtray.dm | 16 +- code/game/objects/items/bodybag.dm | 2 +- code/game/objects/items/candle.dm | 12 +- code/game/objects/items/crayons.dm | 14 +- code/game/objects/items/devices/flashlight.dm | 76 +++---- .../objects/items/devices/geiger_counter.dm | 12 +- .../objects/items/devices/lightreplacer.dm | 25 ++- .../items/devices/painter/airlock_painter.dm | 2 +- code/game/objects/items/devices/powersink.dm | 4 +- .../objects/items/devices/radio/intercom.dm | 22 +-- code/game/objects/items/devices/scanners.dm | 25 ++- .../objects/items/devices/taperecorder.dm | 34 ++-- .../objects/items/devices/transfer_valve.dm | 18 +- code/game/objects/items/flag.dm | 11 +- code/game/objects/items/his_grace.dm | 12 +- code/game/objects/items/robot/robot_parts.dm | 30 +-- .../objects/items/robot/robot_upgrades.dm | 16 +- code/game/objects/items/stacks/rods.dm | 6 +- .../objects/items/stacks/sheets/leather.dm | 6 +- code/game/objects/items/tools/welder.dm | 21 +- code/game/objects/items/toys.dm | 19 +- code/game/objects/items/weapons/RCL.dm | 11 +- code/game/objects/items/weapons/cash.dm | 5 +- .../objects/items/weapons/chrono_eraser.dm | 10 +- code/game/objects/items/weapons/defib.dm | 104 +++++----- code/game/objects/items/weapons/dice.dm | 12 +- .../objects/items/weapons/dnascrambler.dm | 4 +- code/game/objects/items/weapons/explosives.dm | 14 +- .../objects/items/weapons/flamethrower.dm | 17 +- code/game/objects/items/weapons/garrote.dm | 32 ++- .../items/weapons/grenades/chem_grenade.dm | 55 +++--- .../weapons/implants/implant_mindshield.dm | 2 - .../items/weapons/implants/implantcase.dm | 22 ++- .../items/weapons/implants/implanter.dm | 6 +- .../items/weapons/implants/implantpad.dm | 13 +- code/game/objects/items/weapons/legcuffs.dm | 4 +- code/game/objects/items/weapons/mop.dm | 3 +- code/game/objects/items/weapons/paint.dm | 1 + .../objects/items/weapons/storage/bags.dm | 49 ++--- .../objects/items/weapons/storage/belt.dm | 21 +- .../objects/items/weapons/storage/boxes.dm | 36 ++-- .../objects/items/weapons/storage/fancy.dm | 45 ++--- .../objects/items/weapons/storage/storage.dm | 2 +- .../objects/items/weapons/storage/toolbox.dm | 12 +- .../objects/items/weapons/storage/wallets.dm | 9 +- code/game/objects/items/weapons/stunbaton.dm | 8 +- .../game/objects/items/weapons/tanks/tanks.dm | 2 +- code/game/objects/items/weapons/tape.dm | 6 +- code/game/objects/items/weapons/twohanded.dm | 24 +-- code/game/objects/obj_defense.dm | 6 +- code/game/objects/objs.dm | 4 +- code/game/objects/structures/bedsheet_bin.dm | 7 +- code/game/objects/structures/coathanger.dm | 42 ++-- .../structures/crates_lockers/closets.dm | 29 ++- .../crates_lockers/closets/coffin.dm | 5 +- .../crates_lockers/closets/fireaxe.dm | 25 +-- .../crates_lockers/closets/gimmick.dm | 5 +- .../closets/secure/guncabinet.dm | 10 +- .../closets/secure/secure_closets.dm | 2 +- .../crates_lockers/closets/statue.dm | 5 +- .../structures/crates_lockers/crates.dm | 17 +- .../structures/crates_lockers/largecrate.dm | 7 +- code/game/objects/structures/depot.dm | 4 +- code/game/objects/structures/displaycase.dm | 20 +- code/game/objects/structures/door_assembly.dm | 27 +-- code/game/objects/structures/electricchair.dm | 23 ++- code/game/objects/structures/engicart.dm | 35 ++-- code/game/objects/structures/extinguisher.dm | 18 +- code/game/objects/structures/false_walls.dm | 2 +- code/game/objects/structures/grille.dm | 4 +- code/game/objects/structures/inflatable.dm | 60 +++--- code/game/objects/structures/janicart.dm | 24 +-- code/game/objects/structures/ladders.dm | 4 +- code/game/objects/structures/mineral_doors.dm | 77 +++----- code/game/objects/structures/mop_bucket.dm | 34 ++-- code/game/objects/structures/morgue.dm | 98 ++++----- code/game/objects/structures/safe.dm | 12 +- code/game/objects/structures/tables_racks.dm | 18 +- .../game/objects/structures/tank_dispenser.dm | 18 +- code/game/objects/structures/watercloset.dm | 11 +- .../objects/structures/windoor_assembly.dm | 12 +- code/game/objects/structures/window.dm | 8 +- code/game/turfs/simulated/floor.dm | 7 +- .../game/turfs/simulated/floor/fancy_floor.dm | 4 +- .../game/turfs/simulated/floor/light_floor.dm | 3 +- code/game/turfs/simulated/floor/mineral.dm | 4 +- .../turfs/simulated/floor/plasteel_floor.dm | 4 +- code/game/turfs/simulated/floor/plating.dm | 6 +- code/game/turfs/simulated/walls.dm | 33 ++-- code/game/turfs/simulated/walls_reinforced.dm | 4 +- code/game/turfs/space/transit.dm | 4 +- code/modules/admin/topic.dm | 8 +- .../vampire/vampire_powers/umbrae_powers.dm | 3 +- code/modules/arcade/arcade_base.dm | 3 - code/modules/arcade/arcade_prize.dm | 4 +- code/modules/arcade/claw_game.dm | 6 +- .../arcade/mob_hunt/battle_computer.dm | 3 +- code/modules/arcade/prize_counter.dm | 5 +- code/modules/assembly/bomb.dm | 11 +- code/modules/assembly/holder.dm | 14 +- code/modules/assembly/infrared.dm | 9 +- code/modules/assembly/mousetrap.dm | 2 +- code/modules/assembly/proximity.dm | 8 +- code/modules/assembly/signaler.dm | 3 +- code/modules/assembly/timer.dm | 6 +- .../atmospherics/machinery/airalarm.dm | 24 +-- .../atmospherics/machinery/atmospherics.dm | 11 +- .../components/binary_devices/circulator.dm | 36 ++-- .../components/binary_devices/dp_vent_pump.dm | 11 +- .../components/binary_devices/passive_gate.dm | 3 +- .../components/binary_devices/pump.dm | 4 +- .../components/binary_devices/valve.dm | 24 +-- .../components/binary_devices/volume_pump.dm | 4 +- .../components/trinary_devices/filter.dm | 4 +- .../components/trinary_devices/mixer.dm | 4 +- .../components/trinary_devices/tvalve.dm | 5 +- .../components/unary_devices/cryo.dm | 69 +++---- .../unary_devices/generator_input.dm | 4 +- .../unary_devices/heat_exchanger.dm | 4 +- .../unary_devices/outlet_injector.dm | 4 +- .../unary_devices/oxygen_generator.dm | 4 +- .../unary_devices/portables_connector.dm | 3 +- .../components/unary_devices/thermal_plate.dm | 4 +- .../components/unary_devices/thermomachine.dm | 2 +- .../components/unary_devices/vent_pump.dm | 13 +- .../components/unary_devices/vent_scrubber.dm | 13 +- .../atmospherics/machinery/other/meter.dm | 59 +++--- .../atmospherics/machinery/pipes/cap.dm | 12 +- .../atmospherics/machinery/pipes/manifold.dm | 19 +- .../machinery/pipes/manifold4w.dm | 21 +- .../machinery/pipes/simple/pipe_simple.dm | 15 +- .../pipes/simple/pipe_simple_hidden.dm | 17 +- .../pipes/simple/pipe_simple_visible.dm | 17 +- .../machinery/portable/canister.dm | 155 ++++++++------- .../portable/portable_atmospherics.dm | 43 ++-- .../atmospherics/machinery/portable/pump.dm | 48 ++--- .../machinery/portable/scrubber.dm | 42 ++-- code/modules/awaymissions/gateway.dm | 46 ++--- .../mission_code/ruins/oldstation.dm | 2 +- code/modules/awaymissions/pamphlet.dm | 2 +- code/modules/buildmode/buttons.dm | 5 +- code/modules/clothing/chameleon.dm | 1 + code/modules/clothing/clothing.dm | 182 +++++++++-------- .../clothing/glasses/engine_goggles.dm | 6 +- code/modules/clothing/glasses/glasses.dm | 30 +-- code/modules/clothing/glasses/hud.dm | 8 +- code/modules/clothing/gloves/miscellaneous.dm | 17 +- code/modules/clothing/gloves/rings.dm | 8 +- code/modules/clothing/head/hardhat.dm | 7 +- code/modules/clothing/head/helmet.dm | 4 +- code/modules/clothing/head/misc_special.dm | 62 ++---- code/modules/clothing/masks/breath.dm | 1 + code/modules/clothing/masks/gasmask.dm | 9 +- code/modules/clothing/masks/miscellaneous.dm | 4 +- code/modules/clothing/spacesuits/alien.dm | 2 +- code/modules/clothing/spacesuits/hardsuit.dm | 8 +- code/modules/clothing/spacesuits/plasmamen.dm | 17 +- code/modules/clothing/suits/toggles.dm | 6 +- code/modules/clothing/under/color.dm | 4 +- code/modules/clothing/under/miscellaneous.dm | 16 +- code/modules/clothing/under/oldstation_uni.dm | 8 +- code/modules/clothing/under/shorts.dm | 2 +- code/modules/clothing/under/syndicate.dm | 2 +- code/modules/customitems/item_defines.dm | 21 +- .../detective_work/footprints_and_rag.dm | 1 + code/modules/fish/fishtank.dm | 57 +++--- .../food_and_drinks/drinks/bottler/bottler.dm | 6 +- .../food_and_drinks/drinks/drinks/bottle.dm | 52 +++-- .../food_and_drinks/drinks/drinks/cans.dm | 51 +++-- .../drinks/drinks/shotglass.dm | 29 +-- .../food_and_drinks/food/foods/desserts.dm | 8 +- .../food_and_drinks/food/foods/ingredients.dm | 19 +- .../food_and_drinks/food/foods/pizza.dm | 111 ++++++----- .../kitchen_machinery/gibber.dm | 29 ++- .../kitchen_machinery/juicer.dm | 37 ++-- .../kitchen_machinery/smartfridge.dm | 55 +++--- code/modules/games/52card.dm | 4 +- code/modules/games/cards.dm | 77 +++++--- .../hydroponics/beekeeping/honeycomb.dm | 10 +- code/modules/hydroponics/biogenerator.dm | 14 +- code/modules/hydroponics/fermenting_barrel.dm | 4 +- code/modules/hydroponics/gene_modder.dm | 24 +-- code/modules/hydroponics/hydroitemdefines.dm | 28 +-- code/modules/hydroponics/hydroponics.dm | 81 ++++---- .../instruments/objs/items/headphones.dm | 16 +- code/modules/library/library_equipment.dm | 18 +- code/modules/martial_arts/martial.dm | 3 +- .../modules/mining/equipment/explorer_gear.dm | 7 +- .../mining/equipment/kinetic_crusher.dm | 13 +- .../mining/equipment/lazarus_injector.dm | 4 +- .../mining/equipment/marker_beacons.dm | 21 +- .../mining/equipment/regenerative_core.dm | 8 +- code/modules/mining/equipment/survival_pod.dm | 5 +- .../mining/lavaland/loot/hierophant_loot.dm | 2 +- .../mining/lavaland/loot/tendril_loot.dm | 2 +- code/modules/mining/machine_redemption.dm | 4 +- code/modules/mining/machine_vending.dm | 4 +- code/modules/mob/dead/observer/observer.dm | 5 +- code/modules/mob/living/living.dm | 4 +- .../mob/living/silicon/robot/drone/drone.dm | 1 - .../modules/mob/living/silicon/robot/robot.dm | 2 +- .../mob/living/simple_animal/bot/bot.dm | 8 +- .../living/simple_animal/bot/construction.dm | 149 +++++++++----- .../mob/living/simple_animal/bot/floorbot.dm | 16 +- .../mob/living/simple_animal/bot/honkbot.dm | 4 +- .../mob/living/simple_animal/bot/medbot.dm | 10 +- .../mob/living/simple_animal/bot/mulebot.dm | 9 +- .../mob/living/simple_animal/bot/syndicate.dm | 2 +- .../simple_animal/friendly/spiderbot.dm | 2 +- .../simple_animal/hostile/spaceworms.dm | 8 +- .../living/simple_animal/posessed_object.dm | 3 +- .../mob/living/simple_animal/slime/slime.dm | 3 +- code/modules/mob/mob_movement.dm | 2 +- code/modules/newscaster/obj/newscaster.dm | 22 ++- .../ninja/suit/n_suit_verbs/ninja_stars.dm | 2 +- code/modules/ninja/suit/suit_attackby.dm | 2 +- code/modules/paperwork/carbonpaper.dm | 2 +- code/modules/paperwork/clipboard.dm | 13 +- code/modules/paperwork/folders.dm | 21 +- code/modules/paperwork/frames.dm | 22 ++- code/modules/paperwork/paper.dm | 20 +- code/modules/paperwork/paper_bundle.dm | 60 +++--- code/modules/paperwork/paperbin.dm | 3 +- code/modules/paperwork/paperplane.dm | 7 +- code/modules/paperwork/pen.dm | 26 +-- code/modules/paperwork/photocopier.dm | 4 +- code/modules/paperwork/ticketmachine.dm | 6 +- code/modules/power/apc.dm | 78 ++++---- code/modules/power/cable.dm | 26 +-- code/modules/power/cell.dm | 31 ++- code/modules/power/generator.dm | 32 +-- code/modules/power/gravitygenerator.dm | 11 +- code/modules/power/lighting.dm | 4 +- code/modules/power/port_gen.dm | 2 +- code/modules/power/singularity/emitter.dm | 3 +- .../power/singularity/field_generator.dm | 11 +- .../particle_accelerator.dm | 11 +- .../particle_accelerator/particle_chamber.dm | 4 - .../particle_accelerator/particle_control.dm | 3 +- .../particle_accelerator/particle_emitter.dm | 4 - code/modules/power/smes.dm | 14 +- code/modules/power/solar.dm | 22 +-- code/modules/power/treadmill.dm | 8 +- code/modules/projectiles/ammunition.dm | 29 +-- .../projectiles/ammunition/ammo_casings.dm | 19 +- .../projectiles/ammunition/magazines.dm | 27 ++- code/modules/projectiles/guns/alien.dm | 5 +- code/modules/projectiles/guns/energy.dm | 80 ++++---- .../guns/energy/kinetic_accelerator.dm | 11 +- code/modules/projectiles/guns/energy/laser.dm | 7 +- .../projectiles/guns/energy/nuclear.dm | 6 +- .../projectiles/guns/energy/special.dm | 57 +++--- code/modules/projectiles/guns/magic.dm | 2 +- code/modules/projectiles/guns/magic/wand.dm | 2 +- .../projectiles/guns/misc/blastcannon.dm | 24 ++- code/modules/projectiles/guns/projectile.dm | 26 ++- .../projectiles/guns/projectile/automatic.dm | 61 +++--- .../projectiles/guns/projectile/bow.dm | 2 +- .../projectiles/guns/projectile/launchers.dm | 6 +- .../projectiles/guns/projectile/pistol.dm | 19 +- .../projectiles/guns/projectile/revolver.dm | 15 +- .../projectiles/guns/projectile/saw.dm | 2 +- .../projectiles/guns/projectile/shotgun.dm | 13 +- .../projectiles/guns/projectile/sniper.dm | 16 +- .../projectiles/guns/projectile/toy.dm | 17 +- code/modules/projectiles/guns/rocket.dm | 3 - code/modules/projectiles/guns/throw.dm | 5 +- .../projectiles/guns/throw/crossbow.dm | 11 +- .../projectiles/guns/throw/pielauncher.dm | 4 +- code/modules/projectiles/projectile/magic.dm | 2 +- .../projectiles/projectile/reusable.dm | 2 +- .../chemistry/machinery/chem_dispenser.dm | 32 ++- .../chemistry/machinery/chem_master.dm | 8 +- .../reagents/chemistry/machinery/pandemic.dm | 14 +- .../chemistry/machinery/reagentgrinder.dm | 8 +- code/modules/reagents/reagent_containers.dm | 4 +- .../reagents/reagent_containers/applicator.dm | 20 +- .../reagents/reagent_containers/bottle.dm | 10 +- .../reagent_containers/glass_containers.dm | 25 +-- .../reagents/reagent_containers/hypospray.dm | 4 +- .../reagents/reagent_containers/iv_bag.dm | 27 ++- .../reagents/reagent_containers/syringes.dm | 21 +- code/modules/recycling/conveyor2.dm | 17 +- .../recycling/disposal-construction.dm | 2 +- code/modules/recycling/disposal.dm | 8 +- code/modules/recycling/sortingmachinery.dm | 3 +- code/modules/research/message_server.dm | 7 +- code/modules/research/server.dm | 4 +- .../ruins/lavalandruin_code/fountain_hall.dm | 6 +- .../security_levels/keycard_authentication.dm | 8 +- .../security_levels/security_levels.dm | 10 +- code/modules/shuttle/emergency.dm | 5 +- code/modules/shuttle/shuttle_manipulator.dm | 10 +- code/modules/shuttle/shuttle_rotate.dm | 2 +- code/modules/shuttle/supply.dm | 2 +- code/modules/station_goals/bsa.dm | 9 +- code/modules/station_goals/dna_vault.dm | 5 +- code/modules/station_goals/shield.dm | 4 +- code/modules/surgery/implant_removal.dm | 2 +- code/modules/surgery/organs/augments_arms.dm | 6 +- code/modules/surgery/organs/eyes.dm | 2 +- code/modules/surgery/organs/heart.dm | 6 +- code/modules/surgery/organs/organ_icon.dm | 3 +- code/modules/surgery/organs/subtypes/slime.dm | 2 +- code/modules/telesci/gps.dm | 16 +- code/modules/vehicle/janicart.dm | 14 +- code/modules/vehicle/vehicle.dm | 3 +- icons/mob/clothing/eyes.dmi | Bin 17019 -> 17020 bytes icons/mob/clothing/head.dmi | Bin 257160 -> 257162 bytes icons/mob/clothing/mask.dmi | Bin 50129 -> 50129 bytes icons/mob/clothing/species/drask/eyes.dmi | Bin 10552 -> 10553 bytes icons/mob/clothing/species/drask/helmet.dmi | Bin 67792 -> 67793 bytes icons/mob/clothing/species/drask/mask.dmi | Bin 41299 -> 41299 bytes icons/mob/clothing/species/grey/eyes.dmi | Bin 13458 -> 13459 bytes icons/mob/clothing/species/grey/helmet.dmi | Bin 83530 -> 83533 bytes icons/mob/clothing/species/grey/mask.dmi | Bin 47443 -> 47443 bytes icons/mob/clothing/species/tajaran/helmet.dmi | Bin 59066 -> 59066 bytes icons/mob/clothing/species/tajaran/mask.dmi | Bin 31381 -> 31381 bytes icons/mob/clothing/species/unathi/helmet.dmi | Bin 63584 -> 63584 bytes icons/mob/clothing/species/unathi/mask.dmi | Bin 37687 -> 37687 bytes icons/mob/clothing/species/vox/eyes.dmi | Bin 13652 -> 13655 bytes icons/mob/clothing/species/vox/helmet.dmi | Bin 105621 -> 105622 bytes icons/mob/clothing/species/vox/mask.dmi | Bin 35415 -> 35415 bytes .../mob/clothing/species/vulpkanin/helmet.dmi | Bin 72553 -> 72554 bytes icons/mob/clothing/species/vulpkanin/mask.dmi | Bin 33602 -> 33601 bytes icons/mob/screen_white.dmi | Bin 20921 -> 21671 bytes icons/obj/clothing/glasses.dmi | Bin 14207 -> 14209 bytes icons/obj/clothing/hats.dmi | Bin 114451 -> 114452 bytes icons/obj/clothing/masks.dmi | Bin 28636 -> 28636 bytes icons/obj/doors/airlocks/station/overlays.dmi | Bin 9455 -> 10171 bytes paradise.dme | 2 + 429 files changed, 3487 insertions(+), 3296 deletions(-) create mode 100644 code/datums/components/emissive_blocker.dm create mode 100644 code/datums/components/persistent_overlay.dm diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm index 3f80482533b..33105bbd8c7 100644 --- a/code/__DEFINES/dcs/signals.dm +++ b/code/__DEFINES/dcs/signals.dm @@ -70,13 +70,29 @@ #define EXAMINE_POSITION_BEFORE (1<<1) //End positions #define COMPONENT_EXNAME_CHANGED (1<<0) -///from base of atom/update_icon(): () + ///from base of [/atom/proc/update_appearance]: (updates) + #define COMSIG_ATOM_UPDATE_APPEARANCE "atom_update_appearance" + /// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its name. + #define COMSIG_ATOM_NO_UPDATE_NAME UPDATE_NAME + /// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its desc. + #define COMSIG_ATOM_NO_UPDATE_DESC UPDATE_DESC + /// If returned from [COMSIG_ATOM_UPDATE_APPEARANCE] it prevents the atom from updating its icon. + #define COMSIG_ATOM_NO_UPDATE_ICON UPDATE_ICON +///from base of [/atom/proc/update_name]: (updates) +#define COMSIG_ATOM_UPDATE_NAME "atom_update_name" +///from base of [/atom/proc/update_desc]: (updates) +#define COMSIG_ATOM_UPDATE_DESC "atom_update_desc" +///from base of [/atom/update_icon]: () #define COMSIG_ATOM_UPDATE_ICON "atom_update_icon" - #define COMSIG_ATOM_NO_UPDATE_ICON_STATE (1<<0) - #define COMSIG_ATOM_NO_UPDATE_OVERLAYS (1<<1) -///from base of atom/update_overlays(): (list/new_overlays) + /// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its icon state. + #define COMSIG_ATOM_NO_UPDATE_ICON_STATE UPDATE_ICON_STATE + /// If returned from [COMSIG_ATOM_UPDATE_ICON] it prevents the atom from updating its overlays. + #define COMSIG_ATOM_NO_UPDATE_OVERLAYS UPDATE_OVERLAYS +///Sent after [atom/update_icon_state] is called by [/atom/update_icon]: () +#define COMSIG_ATOM_UPDATE_ICON_STATE "atom_update_icon_state" +///Sent after [atom/update_overlays] is called by [/atom/update_icon]: (list/new_overlays) #define COMSIG_ATOM_UPDATE_OVERLAYS "atom_update_overlays" -///from base of atom/update_icon(): (signalOut, did_anything) +///from base of [/atom/update_icon]: (signalOut, did_anything) #define COMSIG_ATOM_UPDATED_ICON "atom_updated_icon" ///from base of atom/Entered(): (atom/movable/entering, /atom) #define COMSIG_ATOM_ENTERED "atom_entered" diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index b4c7fade59a..62b6b9c8a23 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -27,6 +27,17 @@ ///Whether or not this atom shows screentips when hovered over #define NO_SCREENTIPS 32768 +// Update flags for [/atom/proc/update_appearance] +/// Update the atom's name +#define UPDATE_NAME (1<<0) +/// Update the atom's desc +#define UPDATE_DESC (1<<1) +/// Update the atom's icon state +#define UPDATE_ICON_STATE (1<<2) +/// Update the atom's overlays +#define UPDATE_OVERLAYS (1<<3) +/// Update the atom's icon +#define UPDATE_ICON (UPDATE_ICON_STATE|UPDATE_OVERLAYS) /* Secondary atom flags, for the flags_2 var, denoted with a _2 */ diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index f20a2193029..01d0721c3d9 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -855,7 +855,7 @@ Returns 1 if the chain up to the area contains the given typepath if(perfectcopy) if((O) && (original)) - var/static/list/forbidden_vars = list("type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group") + var/static/list/forbidden_vars = list("type","loc","locs","vars", "parent","parent_type", "verbs","ckey","key","power_supply","contents","reagents","stat","x","y","z","group", "comp_lookup", "datum_components") for(var/V in original.vars - forbidden_vars) if(istype(original.vars[V],/list)) @@ -869,7 +869,7 @@ Returns 1 if the chain up to the area contains the given typepath O.update_icon() return O -/area/proc/copy_contents_to(area/A , platingRequired = 0 ) +/area/proc/copy_contents_to(area/A , platingRequired = 0, perfect_copy = TRUE) //Takes: Area. Optional: If it should copy to areas that don't have plating //Returns: Nothing. //Notes: Attempts to move the contents of one area to another area. @@ -949,7 +949,7 @@ Returns 1 if the chain up to the area contains the given typepath for(var/obj/O in objs) - newobjs += DuplicateObject(O , 1) + newobjs += DuplicateObject(O , perfect_copy) for(var/obj/O in newobjs) diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 8d836571086..d62e1ecb545 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -88,7 +88,7 @@ name = "Show Buttons" else name = "Hide Buttons" - UpdateIcon() + update_icon(UPDATE_OVERLAYS) usr.update_action_buttons() /obj/screen/movable/action_button/hide_toggle/AltClick(mob/user) @@ -114,13 +114,13 @@ if(user.client) alpha = user.client.prefs.UI_style_alpha color = user.client.prefs.UI_style_color - UpdateIcon() + update_icon(UPDATE_OVERLAYS) -/obj/screen/movable/action_button/hide_toggle/proc/UpdateIcon() - cut_overlays() +/obj/screen/movable/action_button/hide_toggle/update_overlays() + . = ..() var/image/img = image(initial(icon), src, hidden ? "show" : "hide") img.appearance_flags = RESET_COLOR | RESET_ALPHA - overlays += img + . += img /obj/screen/movable/action_button/MouseEntered(location, control, params) . = ..() diff --git a/code/_onclick/hud/alien.dm b/code/_onclick/hud/alien.dm index a825cadb8d3..e7edc06d70a 100644 --- a/code/_onclick/hud/alien.dm +++ b/code/_onclick/hud/alien.dm @@ -119,7 +119,8 @@ mymob.pullin = new /obj/screen/pull() mymob.pullin.icon = 'icons/mob/screen_alien.dmi' - mymob.pullin.update_icon(mymob) + mymob.pullin.hud = src + mymob.pullin.update_icon(UPDATE_ICON_STATE) mymob.pullin.screen_loc = ui_pull_resist hotkeybuttons += mymob.pullin @@ -127,7 +128,8 @@ infodisplay += alien_plasma_display zone_select = new /obj/screen/zone_sel/alien() - zone_select.update_icon(mymob) + zone_select.hud = src + zone_select.update_icon(UPDATE_OVERLAYS) static_inventory += zone_select for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory)) diff --git a/code/_onclick/hud/alien_larva.dm b/code/_onclick/hud/alien_larva.dm index 68a2826fca3..f97e593d088 100644 --- a/code/_onclick/hud/alien_larva.dm +++ b/code/_onclick/hud/alien_larva.dm @@ -26,7 +26,8 @@ mymob.pullin = new /obj/screen/pull() mymob.pullin.icon = 'icons/mob/screen_alien.dmi' - mymob.pullin.update_icon(mymob) + mymob.pullin.hud = src + mymob.pullin.update_icon(UPDATE_ICON_STATE) mymob.pullin.screen_loc = ui_pull_resist hotkeybuttons += mymob.pullin @@ -35,5 +36,6 @@ static_inventory += using zone_select = new /obj/screen/zone_sel/alien() - zone_select.update_icon(mymob) + zone_select.hud = src + zone_select.update_icon(UPDATE_OVERLAYS) static_inventory += zone_select diff --git a/code/_onclick/hud/bot.dm b/code/_onclick/hud/bot.dm index 12320f2da3e..7370454bf96 100644 --- a/code/_onclick/hud/bot.dm +++ b/code/_onclick/hud/bot.dm @@ -28,6 +28,7 @@ mymob.pullin = new /obj/screen/pull() mymob.pullin.icon = 'icons/mob/screen_bot.dmi' - mymob.pullin.update_icon(mymob) + mymob.pullin.hud = src + mymob.pullin.update_icon(UPDATE_ICON_STATE) mymob.pullin.screen_loc = ui_bot_pull static_inventory += mymob.pullin diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index 3d885f81c24..40116b4d5c7 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -333,7 +333,8 @@ mymob.pullin = new /obj/screen/pull() mymob.pullin.icon = ui_style - mymob.pullin.update_icon(mymob) + mymob.pullin.hud = src + mymob.pullin.update_icon(UPDATE_ICON_STATE) mymob.pullin.screen_loc = ui_pull_resist static_inventory += mymob.pullin @@ -347,7 +348,8 @@ zone_select.color = ui_color zone_select.icon = ui_style zone_select.alpha = ui_alpha - zone_select.update_icon(mymob) + zone_select.hud = src + zone_select.update_icon(UPDATE_OVERLAYS) static_inventory += zone_select inventory_shown = FALSE diff --git a/code/_onclick/hud/other_mobs.dm b/code/_onclick/hud/other_mobs.dm index 8f243dfcdc1..0472a34dbef 100644 --- a/code/_onclick/hud/other_mobs.dm +++ b/code/_onclick/hud/other_mobs.dm @@ -26,6 +26,7 @@ mymob.pullin = new /obj/screen/pull() mymob.pullin.icon = 'icons/mob/screen_corgi.dmi' - mymob.pullin.update_icon(mymob) + mymob.pullin.hud = src + mymob.pullin.update_icon(UPDATE_ICON_STATE) mymob.pullin.screen_loc = ui_construct_pull static_inventory += mymob.pullin diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm index ad7794d2ae0..38e05cab03c 100644 --- a/code/_onclick/hud/robot.dm +++ b/code/_onclick/hud/robot.dm @@ -157,12 +157,14 @@ mymob.pullin = new /obj/screen/pull() mymob.pullin.icon = 'icons/mob/screen_robot.dmi' - mymob.pullin.update_icon(mymob) + mymob.pullin.hud = src + mymob.pullin.update_icon(UPDATE_ICON_STATE) mymob.pullin.screen_loc = ui_borg_pull hotkeybuttons += mymob.pullin zone_select = new /obj/screen/zone_sel/robot() - zone_select.update_icon(mymob) + zone_select.hud = src + zone_select.update_icon(UPDATE_OVERLAYS) static_inventory += zone_select //Headlamp diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index d7b047e6b2a..83424370862 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -22,6 +22,7 @@ /obj/screen/Destroy() master = null + hud = null return ..() /obj/screen/proc/component_click(obj/screen/component_button/component, params) @@ -120,10 +121,8 @@ /obj/screen/pull/Click() usr.stop_pulling() -/obj/screen/pull/update_icon(mob/mymob) - if(!mymob) - return - if(mymob.pulling) +/obj/screen/pull/update_icon_state() + if(hud?.mymob?.pulling) icon_state = "pull" else icon_state = "pull0" @@ -223,6 +222,7 @@ name = "damage zone" icon_state = "zone_sel" screen_loc = ui_zonesel + var/overlay_file = 'icons/mob/zone_sel.dmi' var/selecting = "chest" var/static/list/hover_overlays_cache = list() var/hovering @@ -323,32 +323,27 @@ return "eyes" return "head" -/obj/screen/zone_sel/proc/set_selected_zone(choice, mob/user) - if(isobserver(user)) +/obj/screen/zone_sel/proc/set_selected_zone(choice) + if(!hud) + return + if(isobserver(hud.mymob)) return if(choice != selecting) selecting = choice - update_icon(user) + update_icon(UPDATE_OVERLAYS) return 1 -/obj/screen/zone_sel/update_icon(mob/user) - overlays.Cut() - var/image/human = image('icons/mob/zone_sel.dmi', "human") - human.appearance_flags = RESET_COLOR - overlays += human - var/image/sel = image('icons/mob/zone_sel.dmi', "[selecting]") +/obj/screen/zone_sel/update_overlays() + . = ..() + var/image/sel = image(overlay_file, "[selecting]") sel.appearance_flags = RESET_COLOR - overlays += sel - user.zone_selected = selecting + . += sel + hud.mymob.zone_selected = selecting /obj/screen/zone_sel/alien icon = 'icons/mob/screen_alien.dmi' - -/obj/screen/zone_sel/alien/update_icon(mob/user) - overlays.Cut() - overlays += image('icons/mob/screen_alien.dmi', "[selecting]") - user.zone_selected = selecting + overlay_file = 'icons/mob/screen_alien.dmi' /obj/screen/zone_sel/robot icon = 'icons/mob/screen_robot.dmi' @@ -432,26 +427,24 @@ var/image/active_overlay var/image/handcuff_overlay -/obj/screen/inventory/hand/update_icon() - ..() +/obj/screen/inventory/hand/update_overlays() + . = ..() if(!active_overlay) active_overlay = image("icon"=icon, "icon_state"="hand_active") if(!handcuff_overlay) var/state = (slot_id == slot_r_hand) ? "markus" : "gabrielle" handcuff_overlay = image("icon"='icons/mob/screen_gen.dmi', "icon_state"=state) - overlays.Cut() - if(hud && hud.mymob) if(iscarbon(hud.mymob)) var/mob/living/carbon/C = hud.mymob if(C.handcuffed) - overlays += handcuff_overlay + . += handcuff_overlay if(slot_id == slot_l_hand && hud.mymob.hand) - overlays += active_overlay + . += active_overlay else if(slot_id == slot_r_hand && !hud.mymob.hand) - overlays += active_overlay + . += active_overlay /obj/screen/inventory/hand/Click() // At this point in client Click() code we have passed the 1/10 sec check and little else diff --git a/code/_onclick/telekinesis.dm b/code/_onclick/telekinesis.dm index 531f39182e2..71258f40080 100644 --- a/code/_onclick/telekinesis.dm +++ b/code/_onclick/telekinesis.dm @@ -68,6 +68,7 @@ layer = ABOVE_HUD_LAYER plane = ABOVE_HUD_PLANE + blocks_emissive = FALSE var/last_throw = 0 var/atom/movable/focus = null var/mob/living/host = null @@ -164,7 +165,7 @@ qdel(src) return focus = target - update_icon() + update_icon(UPDATE_OVERLAYS) apply_focus_overlay() // Make it behave like other equipment if(istype(target, /obj/item)) @@ -180,7 +181,7 @@ // Delete the key/value pair of item to TK grab host.tkgrabbed_objects -= focus focus = null - update_icon() + update_icon(UPDATE_OVERLAYS) /obj/item/tk_grab/proc/apply_focus_overlay() if(!focus) @@ -193,9 +194,9 @@ focus_object(target, user) -/obj/item/tk_grab/update_icon() - overlays.Cut() +/obj/item/tk_grab/update_overlays() + . = ..() if(focus && focus.icon && focus.icon_state) - overlays += icon(focus.icon,focus.icon_state) + . += icon(focus.icon,focus.icon_state) #undef TK_COOLDOWN diff --git a/code/datums/components/ducttape.dm b/code/datums/components/ducttape.dm index 06a882dbcf7..5a5f206d28f 100644 --- a/code/datums/components/ducttape.dm +++ b/code/datums/components/ducttape.dm @@ -8,7 +8,7 @@ if(!istype(I)) //Something went wrong return if(!hide_tape) //if TRUE this hides the tape overlay and added examine text - RegisterSignal(parent, COMSIG_OBJ_UPDATE_ICON, .proc/add_tape_overlay) + RegisterSignal(parent, COMSIG_ATOM_UPDATE_OVERLAYS, .proc/add_tape_overlay) RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/add_tape_text) x_offset = x y_offset = y @@ -27,7 +27,7 @@ tape_overlay = new('icons/obj/bureaucracy.dmi', "tape") tape_overlay.Shift(EAST, x_offset - 2) tape_overlay.Shift(NORTH, y_offset - 2) - O.overlays += tape_overlay + O.add_overlay(tape_overlay) /datum/component/ducttape/proc/remove_tape(obj/item/I, mob/user) to_chat(user, "You tear the tape off [I]!") @@ -38,7 +38,7 @@ for(var/datum/action/item_action/remove_tape/RT in I.actions) RT.Remove(user) qdel(RT) - I.overlays.Cut(tape_overlay) + I.cut_overlay(tape_overlay) user.transfer_fingerprints_to(I) qdel(src) diff --git a/code/datums/components/emissive_blocker.dm b/code/datums/components/emissive_blocker.dm new file mode 100644 index 00000000000..f54058f5e60 --- /dev/null +++ b/code/datums/components/emissive_blocker.dm @@ -0,0 +1,29 @@ +/datum/component/emissive_blocker + /// Stores either the mutable_appearance or a list of them + var/stored_blocker + +/datum/component/emissive_blocker/Initialize(_stored_blocker) + var/atom/movable/A = parent + stored_blocker = _stored_blocker + RegisterSignal(parent, COMSIG_ATOM_UPDATE_ICON_STATE, .proc/update_generic_block) + A.add_overlay(stored_blocker) + +/datum/component/emissive_blocker/Destroy() + stored_blocker = null + return ..() + +/// Updates the generic blocker when the icon_state is changed +/datum/component/emissive_blocker/proc/update_generic_block(datum/source) + var/atom/movable/A = parent + if(!A.blocks_emissive && stored_blocker) + A.cut_overlay(stored_blocker) + stored_blocker = null + return + if(!A.blocks_emissive) + return + var/mutable_appearance/gen_emissive_blocker = emissive_blocker(A.icon, A.icon_state, alpha = A.alpha, appearance_flags = A.appearance_flags) + gen_emissive_blocker.dir = A.dir + if(gen_emissive_blocker != stored_blocker || !A.overlays) + A.cut_overlay(stored_blocker) + stored_blocker = gen_emissive_blocker + A.add_overlay(stored_blocker) diff --git a/code/datums/components/persistent_overlay.dm b/code/datums/components/persistent_overlay.dm new file mode 100644 index 00000000000..419d6a8b301 --- /dev/null +++ b/code/datums/components/persistent_overlay.dm @@ -0,0 +1,35 @@ +/datum/component/persistent_overlay + var/image/persistent_overlay = null + var/atom/target = null + +/datum/component/persistent_overlay/Initialize(image_overlay, _target, timer) + persistent_overlay = image_overlay + target = _target + if(timer) + addtimer(CALLBACK(src, .proc/remove_persistent_overlay), timer) + if(target) + RegisterSignal(target, COMSIG_PARENT_QDELETING, .proc/remove_persistent_overlay) + RegisterSignal(parent, COMSIG_PARENT_QDELETING, .proc/remove_persistent_overlay) + add_persistent_overlay() + +/datum/component/persistent_overlay/Destroy() + persistent_overlay = null + target = null + return ..() + +/datum/component/persistent_overlay/proc/remove_persistent_overlay(datum/source) + var/atom/movable/A + if(target) + A = target + else + A = parent + A.cut_overlay(persistent_overlay, priority = TRUE) + qdel(src) + +/datum/component/persistent_overlay/proc/add_persistent_overlay(datum/source) + var/atom/movable/A + if(target) + A = target + else + A = parent + A.add_overlay(persistent_overlay, priority = TRUE) diff --git a/code/datums/spells/wizard.dm b/code/datums/spells/wizard.dm index fb05d3afd9f..6454ae3ab01 100644 --- a/code/datums/spells/wizard.dm +++ b/code/datums/spells/wizard.dm @@ -364,7 +364,7 @@ C.range = 20 return C -/obj/effect/proc_holder/spell/fireball/update_icon() +/obj/effect/proc_holder/spell/fireball/update_icon_state() if(!action) return action.button_icon_state = "fireball[active]" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index c9e292f629b..2519224062e 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -370,7 +370,7 @@ L.fire_mode = FALSE L.update(TRUE, TRUE, FALSE) -/area/proc/updateicon() +/area/update_icon_state() var/weather_icon for(var/V in SSweather.processing) var/datum/weather/W = V @@ -380,7 +380,7 @@ if(!weather_icon) icon_state = null -/area/space/updateicon() +/area/space/update_icon_state() icon_state = null /* @@ -417,7 +417,7 @@ for(var/obj/machinery/M in src) // for each machine in the area M.power_change() // reverify power status (to update icons etc.) SEND_SIGNAL(src, COMSIG_AREA_POWER_CHANGE) - updateicon() + update_icon(UPDATE_ICON_STATE) /area/proc/usage(chan) var/used = 0 diff --git a/code/game/area/areas/depot-areas.dm b/code/game/area/areas/depot-areas.dm index 691a5d99d48..8b9790d2d7e 100644 --- a/code/game/area/areas/depot-areas.dm +++ b/code/game/area/areas/depot-areas.dm @@ -36,25 +36,33 @@ var/obj/machinery/computer/syndicate_depot/syndiecomms/comms_computer = null var/obj/structure/fusionreactor/reactor -/area/syndicate_depot/core/updateicon() +/area/syndicate_depot/core/proc/update_state() if(destroyed) - icon_state = null invisibility = INVISIBILITY_MAXIMUM else if(on_peaceful) - icon_state = "green" invisibility = INVISIBILITY_LIGHTING else if(used_self_destruct) - icon_state = "radiation" invisibility = INVISIBILITY_LIGHTING else if(called_backup) - icon_state = "red" invisibility = INVISIBILITY_LIGHTING else if(local_alarm) - icon_state = "bluenew" invisibility = INVISIBILITY_LIGHTING else - icon_state = null invisibility = INVISIBILITY_MAXIMUM + update_icon(UPDATE_ICON_STATE) + +/area/syndicate_depot/core/update_icon_state() + if(invisibility == INVISIBILITY_MAXIMUM) + icon_state = null + return + else if(on_peaceful) + icon_state = "green" + else if(used_self_destruct) + icon_state = "radiation" + else if(called_backup) + icon_state = "red" + else if(local_alarm) + icon_state = "bluenew" /area/syndicate_depot/core/proc/reset_alert() @@ -84,7 +92,7 @@ detected_pod = FALSE detected_double_agent = FALSE mine_trigger_count = 0 - updateicon() + update_icon(UPDATE_ICON_STATE) if(!istype(reactor)) for(var/obj/structure/fusionreactor/R in src) @@ -112,7 +120,7 @@ return if(!used_self_destruct) activate_self_destruct(reason, FALSE, null) - updateicon() + update_icon(UPDATE_ICON_STATE) /area/syndicate_depot/core/proc/locker_looted() if(!something_looted) @@ -197,7 +205,7 @@ message_admins("- SYNDI DEPOT VISITOR: [ADMIN_FULLMONTY(M)]") list_add(M, hostile_list) peaceful_list = list() - updateicon() + update_icon(UPDATE_ICON_STATE) /area/syndicate_depot/core/proc/local_alarm(reason, silent) if(local_alarm) @@ -219,7 +227,7 @@ var/mob/living/simple_animal/bot/ed209/syndicate/B = new /mob/living/simple_animal/bot/ed209/syndicate(get_turf(S)) list_add(B, guard_list) B.depotarea = src - updateicon() + update_icon(UPDATE_ICON_STATE) /area/syndicate_depot/core/proc/call_backup(reason, silent) if(called_backup || used_self_destruct) @@ -252,7 +260,7 @@ list_add(S, guard_list) else if(!silent) announce_here("Depot Communications Offline", "Comms computer is damaged, destroyed or depowered. Unable to call in backup from Syndicate HQ.") - updateicon() + update_icon(UPDATE_ICON_STATE) /area/syndicate_depot/core/proc/activate_self_destruct(reason, containment_failure, mob/user) if(used_self_destruct) @@ -265,7 +273,7 @@ called_backup = TRUE activate_lockdown(TRUE) lockout_computers() - updateicon() + update_icon(UPDATE_ICON_STATE) despawn_guards() if(containment_failure) announce_here("Depot Code DELTA", reason) @@ -287,7 +295,7 @@ else log_debug("Depot: [src] called activate_self_destruct with no reactor.") message_admins("Syndicate Depot lacks reactor to initiate self-destruct. Must be destroyed manually.") - updateicon() + update_icon(UPDATE_ICON_STATE) /area/syndicate_depot/core/proc/activate_lockdown() if(used_lockdown) @@ -312,7 +320,7 @@ if(istype(A, /obj/machinery/door/airlock/hatch/syndicate/vault)) continue A.emergency = !!openaccess - A.update_icon() + A.update_appearance() /area/syndicate_depot/core/proc/toggle_falsewalls() for(var/obj/structure/falsewall/plastitanium/F in src) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 3e7c505e2ca..1db152a98ec 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -45,6 +45,8 @@ var/list/priority_overlays //overlays that should remain on top and not normally removed when using cut_overlay functions, like c4. var/list/remove_overlays // a very temporary list of overlays to remove var/list/add_overlays // a very temporary list of overlays to add + ///overlays managed by [update_overlays][/atom/proc/update_overlays] to prevent removing overlays that weren't added by the same proc. Single items are stored on their own, not in a list. + var/list/managed_overlays var/list/atom_colours //used to store the different colors on an atom //its inherent color, the colored paint applied on it, special color effect etc... @@ -189,6 +191,8 @@ LAZYCLEARLIST(overlays) LAZYCLEARLIST(priority_overlays) + managed_overlays = null + QDEL_NULL(light) return ..() @@ -391,6 +395,70 @@ SEND_SIGNAL(src, COMSIG_PARENT_EXAMINE, user, .) +/** + * Updates the appearence of the icon + * + * Mostly delegates to update_name, update_desc, and update_icon + * + * Arguments: + * - updates: A set of bitflags dictating what should be updated. Defaults to [ALL] + */ +/atom/proc/update_appearance(updates=ALL) + SHOULD_NOT_SLEEP(TRUE) + SHOULD_CALL_PARENT(TRUE) + + /// Signal sent should the appearance be updated. This is more broad if listening to a more specific signal doesn't cut it + updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_APPEARANCE, updates) + if(updates & UPDATE_NAME) + update_name(updates) + if(updates & UPDATE_DESC) + update_desc(updates) + if(updates & UPDATE_ICON) + update_icon(updates) + +/// Updates the name of the atom +/atom/proc/update_name(updates=ALL) + SHOULD_CALL_PARENT(TRUE) + return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_NAME, updates) + +/// Updates the description of the atom +/atom/proc/update_desc(updates=ALL) + SHOULD_CALL_PARENT(TRUE) + return SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_DESC, updates) + +/// Updates the icon of the atom +/atom/proc/update_icon(updates=ALL) + SIGNAL_HANDLER + SHOULD_CALL_PARENT(TRUE) + + updates &= ~SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON, updates) + if(updates & UPDATE_ICON_STATE) + update_icon_state() + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_ICON_STATE) + + if(updates & UPDATE_OVERLAYS) + var/list/new_overlays = update_overlays(updates) + if(managed_overlays) + cut_overlay(managed_overlays) + managed_overlays = null + if(length(new_overlays)) + if(length(new_overlays) == 1) + managed_overlays = new_overlays[1] + else + managed_overlays = new_overlays + add_overlay(new_overlays) + SEND_SIGNAL(src, COMSIG_ATOM_UPDATE_OVERLAYS) + + SEND_SIGNAL(src, COMSIG_ATOM_UPDATED_ICON, updates) + +/// Updates the icon state of the atom +/atom/proc/update_icon_state() + return + +/// Updates the overlays of the atom. It has to return a list of overlays if it can't call the parent to create one. The list can contain anything that would be valid for the add_overlay proc: Images, mutable appearances, icon states... +/atom/proc/update_overlays() + return list() + /atom/proc/relaymove() return diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index cdae41e26b6..6357fe9fea9 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -51,24 +51,17 @@ gen_emissive_blocker.color = EM_BLOCK_COLOR gen_emissive_blocker.dir = dir gen_emissive_blocker.appearance_flags |= appearance_flags - add_overlay(list(gen_emissive_blocker)) + AddComponent(/datum/component/emissive_blocker, gen_emissive_blocker) if(EMISSIVE_BLOCK_UNIQUE) render_target = ref(src) em_block = new(src, render_target) add_overlay(list(em_block)) /atom/movable/proc/update_emissive_block() - if(!blocks_emissive) - return - else if (blocks_emissive == EMISSIVE_BLOCK_GENERIC) - var/mutable_appearance/gen_emissive_blocker = emissive_blocker(icon, icon_state, alpha = src.alpha, appearance_flags = src.appearance_flags) - gen_emissive_blocker.dir = dir - return gen_emissive_blocker - else if(blocks_emissive == EMISSIVE_BLOCK_UNIQUE) - if(!em_block && !QDELETED(src)) - render_target = ref(src) - em_block = new(src, render_target) - add_overlay(list(em_block)) + if(!em_block && !QDELETED(src)) + render_target = ref(src) + em_block = new(src, render_target) + add_overlay(list(em_block)) /atom/movable/Destroy() unbuckle_all_mobs(force = TRUE) diff --git a/code/game/data_huds.dm b/code/game/data_huds.dm index ba93dca1f57..bb35e7f6a52 100644 --- a/code/game/data_huds.dm +++ b/code/game/data_huds.dm @@ -20,11 +20,11 @@ /datum/atom_hud/data/human/medical/basic /datum/atom_hud/data/human/medical/basic/proc/check_sensors(mob/living/carbon/human/H) - if(!istype(H)) return 0 + if(!istype(H)) return var/obj/item/clothing/under/U = H.w_uniform - if(!istype(U)) return 0 - if(U.sensor_mode <= 2) return 0 - return 1 + if(!istype(U)) return + if(U.sensor_mode <= SENSOR_VITALS) return + return TRUE /datum/atom_hud/data/human/medical/basic/add_to_single_hud(mob/M, mob/living/carbon/H) if(check_sensors(H) || istype(M,/mob/dead/observer) ) diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm index 4bf9acf2390..217f22b5fc3 100644 --- a/code/game/dna/dna_modifier.dm +++ b/code/game/dna/dna_modifier.dm @@ -168,6 +168,12 @@ add_fingerprint(usr) SStgui.update_uis(src) +/obj/machinery/dna_scannernew/update_icon_state() + if(occupant) + icon_state = "scanner_occupied" + else + icon_state = "scanner_open" + /obj/machinery/dna_scannernew/MouseDrop_T(atom/movable/O, mob/user) if(!istype(O)) return @@ -266,7 +272,7 @@ /obj/machinery/dna_scannernew/proc/put_in(mob/M) M.forceMove(src) occupant = M - icon_state = "scanner_occupied" + update_icon(UPDATE_ICON_STATE) SStgui.update_uis(src) // search for ghosts, if the corpse is empty and the scanner is connected to a cloner @@ -288,7 +294,7 @@ return occupant.forceMove(loc) occupant = null - icon_state = "scanner_open" + update_icon(UPDATE_ICON_STATE) SStgui.update_uis(src) /obj/machinery/dna_scannernew/force_eject_occupant(mob/target) @@ -304,7 +310,7 @@ if(A == occupant) occupant = null updateUsrDialog() - update_icon() + update_icon(UPDATE_ICON_STATE) SStgui.update_uis(src) // Checks if occupants can be irradiated/mutated - prevents exploits where wearing full rad protection would still let you gain mutations diff --git a/code/game/dna/mutations/powers.dm b/code/game/dna/mutations/powers.dm index 9cf2fd88304..daf3636557f 100644 --- a/code/game/dna/mutations/powers.dm +++ b/code/game/dna/mutations/powers.dm @@ -394,7 +394,7 @@ var/can_eat = TRUE if(iscarbon(user)) var/mob/living/carbon/C = user - if((C.head && (C.head.flags_cover & HEADCOVERSMOUTH)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSMOUTH) && !C.wear_mask.mask_adjusted)) + if((C.head && (C.head.flags_cover & HEADCOVERSMOUTH)) || (C.wear_mask && (C.wear_mask.flags_cover & MASKCOVERSMOUTH) && !C.wear_mask.up)) if(show_message) to_chat(C, "Your mouth is covered, preventing you from eating!") can_eat = FALSE diff --git a/code/game/gamemodes/blob/blobs/captured_nuke.dm b/code/game/gamemodes/blob/blobs/captured_nuke.dm index 1ed4620903a..15cbba514a8 100644 --- a/code/game/gamemodes/blob/blobs/captured_nuke.dm +++ b/code/game/gamemodes/blob/blobs/captured_nuke.dm @@ -11,12 +11,11 @@ START_PROCESSING(SSobj, src) N?.forceMove(src) -/obj/structure/blob/captured_nuke/update_icon() - ..() - cut_overlays() +/obj/structure/blob/captured_nuke/update_overlays() + . = ..() var/image/nuke_overlay = image('icons/mob/blob.dmi', "blob_nuke_overlay") nuke_overlay.appearance_flags = RESET_COLOR - add_overlay(nuke_overlay) + . += nuke_overlay /obj/structure/blob/captured_nuke/Destroy() for(var/obj/machinery/nuclearbomb/O in contents) diff --git a/code/game/gamemodes/blob/blobs/shield.dm b/code/game/gamemodes/blob/blobs/shield.dm index 323a8eb6b86..cada8996ad9 100644 --- a/code/game/gamemodes/blob/blobs/shield.dm +++ b/code/game/gamemodes/blob/blobs/shield.dm @@ -12,20 +12,43 @@ /obj/structure/blob/shield/core point_return = 0 -/obj/structure/blob/shield/update_icon() - ..() +/obj/structure/blob/shield/check_integrity() + var/old_compromised_integrity = compromised_integrity if(obj_integrity < max_integrity * 0.5) - icon_state = "[initial(icon_state)]_damaged" - name = "weakened [initial(name)]" - desc = "A wall of twitching tendrils." + compromised_integrity = TRUE + else + compromised_integrity = FALSE + if(old_compromised_integrity != compromised_integrity) + update_state() + update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE) + +/obj/structure/blob/shield/update_state() + if(compromised_integrity) atmosblock = FALSE else - icon_state = initial(icon_state) - name = initial(name) - desc = initial(desc) atmosblock = TRUE air_update_turf(1) +/obj/structure/blob/shield/update_name() + . = ..() + if(compromised_integrity) + name = "weakened [initial(name)]" + else + name = initial(name) + +/obj/structure/blob/shield/update_desc() + . = ..() + if(compromised_integrity) + desc = "A wall of twitching tendrils." + else + desc = initial(desc) + +/obj/structure/blob/shield/update_icon_state() + if(compromised_integrity) + icon_state = "[initial(icon_state)]_damaged" + else + icon_state = initial(icon_state) + /obj/structure/blob/shield/CanPass(atom/movable/mover, turf/target, height=0) if(istype(mover) && mover.checkpass(PASSBLOB)) return 1 return 0 diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm index 1408db828da..048d478a080 100644 --- a/code/game/gamemodes/blob/theblob.dm +++ b/code/game/gamemodes/blob/theblob.dm @@ -14,13 +14,15 @@ var/brute_resist = 0.5 //multiplies brute damage by this var/fire_resist = 1 //multiplies burn damage by this var/atmosblock = FALSE //if the blob blocks atmos and heat spread + /// If a threshold is reached, resulting in shifting variables + var/compromised_integrity = FALSE var/mob/camera/blob/overmind /obj/structure/blob/Initialize(mapload) . = ..() GLOB.blobs += src setDir(pick(GLOB.cardinal)) - update_icon() + check_integrity() if(atmosblock) air_update_turf(TRUE) ConsumeTile() @@ -63,13 +65,19 @@ /obj/structure/blob/proc/Life() return +/obj/structure/blob/proc/check_integrity() + return + +/obj/structure/blob/proc/update_state() + return + /obj/structure/blob/proc/RegenHealth() // All blobs heal over time when pulsed, but it has a cool down if(health_timestamp > world.time) return 0 if(obj_integrity < max_integrity) obj_integrity = min(max_integrity, obj_integrity + 1) - update_icon() + check_integrity() health_timestamp = world.time + 10 // 1 seconds @@ -186,7 +194,7 @@ /obj/structure/blob/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir) . = ..() if(. && obj_integrity > 0) - update_icon() + check_integrity() /obj/structure/blob/proc/change_to(type) if(!ispath(type)) @@ -219,6 +227,7 @@ if(lowertext(B.blob_reagent_datum.color) == lowertext(src.color)) // Goddamit why we use strings for these return B.blob_reagent_datum.description return "something unknown" + /obj/structure/blob/normal icon_state = "blob" light_range = 0 @@ -226,20 +235,38 @@ max_integrity = 25 brute_resist = 0.25 -/obj/structure/blob/normal/update_icon() - ..() +/obj/structure/blob/normal/check_integrity() + var/old_compromised_integrity = compromised_integrity if(obj_integrity <= 15) - icon_state = "blob_damaged" - name = "fragile blob" - desc = "A thin lattice of slightly twitching tendrils." + compromised_integrity = TRUE + else + compromised_integrity = FALSE + if(old_compromised_integrity != compromised_integrity) + update_state() + update_appearance(UPDATE_NAME|UPDATE_DESC|UPDATE_ICON_STATE) + +/obj/structure/blob/normal/update_state() + if(compromised_integrity) brute_resist = 0.5 - else if(overmind) - icon_state = "blob" - name = "blob" - desc = "A thick wall of writhing tendrils." + else brute_resist = 0.25 + +/obj/structure/blob/normal/update_name() + . = ..() + if(compromised_integrity) + name = "fragile blob" + else + name = "[overmind ? "blob" : "dead blob"]" + +/obj/structure/blob/normal/update_desc() + . = ..() + if(compromised_integrity) + desc = "A thin lattice of slightly twitching tendrils." + else + desc = "A thick wall of [overmind ? "writhing" : "lifeless"] tendrils." + +/obj/structure/blob/normal/update_icon_state() + if(compromised_integrity) + icon_state = "blob_damaged" else icon_state = "blob" - name = "dead blob" - desc = "A thick wall of lifeless tendrils." - brute_resist = 0.25 diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 9d6f9919f05..87e168731ed 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -249,7 +249,7 @@ prefix = "darkened" claw_damage_increase = 4 -/obj/item/whetstone/cult/update_icon() +/obj/item/whetstone/cult/update_icon_state() icon_state = "cult_sharpener[used ? "_used" : ""]" /obj/item/whetstone/cult/attackby(obj/item/I, mob/user, params) @@ -571,7 +571,7 @@ qdel(spear_act) ..() -/obj/item/twohanded/cult_spear/update_icon() +/obj/item/twohanded/cult_spear/update_icon_state() icon_state = "bloodspear[wielded]" /obj/item/twohanded/cult_spear/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) diff --git a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm index 342a4636fa6..ade2681afba 100644 --- a/code/game/gamemodes/miniantags/abduction/abduction_gear.dm +++ b/code/game/gamemodes/miniantags/abduction/abduction_gear.dm @@ -384,7 +384,7 @@
Congratulations! You are now trained for invasive xenobiology research!"} -/obj/item/paper/abductor/update_icon() +/obj/item/paper/abductor/update_icon_state() return /obj/item/paper/abductor/AltClick() @@ -422,12 +422,12 @@ Congratulations! You are now trained for invasive xenobiology research!"} txt = "probing" to_chat(usr, "You switch the baton to [txt] mode.") - update_icon() + update_icon(UPDATE_ICON_STATE) for(var/X in actions) var/datum/action/A = X A.UpdateButtonIcon() -/obj/item/abductor_baton/update_icon() +/obj/item/abductor_baton/update_icon_state() switch(mode) if(BATON_STUN) icon_state = "wonderprodStun" diff --git a/code/game/gamemodes/miniantags/abduction/gland.dm b/code/game/gamemodes/miniantags/abduction/gland.dm index cc2b60262c0..1bc5f5eb727 100644 --- a/code/game/gamemodes/miniantags/abduction/gland.dm +++ b/code/game/gamemodes/miniantags/abduction/gland.dm @@ -19,7 +19,7 @@ var/mind_control_duration = 1800 var/active_mind_control = FALSE -/obj/item/organ/internal/heart/gland/update_icon() +/obj/item/organ/internal/heart/gland/update_icon_state() return /obj/item/organ/internal/heart/gland/proc/ownerCheck() diff --git a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm index d97669ca7d9..c034cf88a7c 100644 --- a/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm +++ b/code/game/gamemodes/miniantags/abduction/machinery/experiment.dm @@ -17,6 +17,12 @@ eject_abductee() return ..() +/obj/machinery/abductor/experiment/update_icon_state() + if(occupant) + icon_state = "experiment" + else + icon_state = "experiment-open" + /obj/machinery/abductor/experiment/MouseDrop_T(mob/living/carbon/human/target, mob/user) if(user.stat || HAS_TRAIT(user, TRAIT_UI_BLOCKED) || !Adjacent(user) || !target.Adjacent(user) || !ishuman(target)) return @@ -34,7 +40,7 @@ target.forceMove(src) occupant = target - icon_state = "experiment" + update_icon(UPDATE_ICON_STATE) add_fingerprint(user) /obj/machinery/abductor/experiment/attack_hand(mob/user) @@ -196,7 +202,7 @@ var/mob/living/carbon/human/H = grabbed.affecting H.forceMove(src) occupant = H - icon_state = "experiment" + update_icon(UPDATE_ICON_STATE) add_fingerprint(user) qdel(G) return @@ -212,11 +218,11 @@ if(A == occupant) occupant = null updateUsrDialog() - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/abductor/experiment/proc/eject_abductee() if(!occupant) return occupant.forceMove(get_turf(src)) occupant = null - icon_state = "experiment-open" + update_icon(UPDATE_ICON_STATE) diff --git a/code/game/gamemodes/miniantags/guardian/guardian.dm b/code/game/gamemodes/miniantags/guardian/guardian.dm index 07c43498fa5..7a5b110a9b2 100644 --- a/code/game/gamemodes/miniantags/guardian/guardian.dm +++ b/code/game/gamemodes/miniantags/guardian/guardian.dm @@ -465,10 +465,9 @@ Protector: You will become leashed to your holoparasite instead of them to you. Has two modes, a medium attack/defense mode and a protection mode which greatly reduces incoming damage to the holoparasite. "} -/obj/item/paper/guardian/update_icon() +/obj/item/paper/guardian/update_icon_state() return - /obj/item/storage/box/syndie_kit/guardian name = "holoparasite injector kit" diff --git a/code/game/gamemodes/miniantags/slaughter/slaughter.dm b/code/game/gamemodes/miniantags/slaughter/slaughter.dm index 57c3ee43ef4..79de9ac744a 100644 --- a/code/game/gamemodes/miniantags/slaughter/slaughter.dm +++ b/code/game/gamemodes/miniantags/slaughter/slaughter.dm @@ -248,7 +248,7 @@ icon_state = "demon_heart" origin_tech = "combat=5;biotech=7" -/obj/item/organ/internal/heart/demon/update_icon() +/obj/item/organ/internal/heart/demon/update_icon_state() return //always beating visually /obj/item/organ/internal/heart/demon/prepare_eat() diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm index 13206a58df3..8555a33b04a 100644 --- a/code/game/gamemodes/nuclear/nuclearbomb.dm +++ b/code/game/gamemodes/nuclear/nuclearbomb.dm @@ -73,6 +73,11 @@ GLOBAL_VAR(bomb_set) INVOKE_ASYNC(src, .proc/explode) return +/obj/machinery/nuclearbomb/update_overlays() + . = ..() + if(panel_open) + . += "npanel_open" + /obj/machinery/nuclearbomb/attackby(obj/item/O as obj, mob/user as mob, params) if(istype(O, /obj/item/disk/nuclear)) if(extended) @@ -184,13 +189,11 @@ GLOBAL_VAR(bomb_set) if(auth || (istype(I, /obj/item/screwdriver/nuke))) if(!panel_open) panel_open = TRUE - overlays += image(icon, "npanel_open") to_chat(user, "You unscrew the control panel of [src].") anchor_stage = removal_stage removal_stage = core_stage else panel_open = FALSE - overlays -= image(icon, "npanel_open") to_chat(user, "You screw the control panel of [src] back on.") core_stage = removal_stage removal_stage = anchor_stage @@ -199,11 +202,11 @@ GLOBAL_VAR(bomb_set) to_chat(user, "[src] emits a buzzing noise, the panel staying locked in.") if(panel_open == TRUE) panel_open = FALSE - overlays -= image(icon, "npanel_open") to_chat(user, "You screw the control panel of [src] back on.") core_stage = removal_stage removal_stage = anchor_stage flick("nuclearbombc", src) + update_icon(UPDATE_OVERLAYS) /obj/machinery/nuclearbomb/wirecutter_act(mob/user, obj/item/I) if(!panel_open) diff --git a/code/game/machinery/Beacon.dm b/code/game/machinery/Beacon.dm index b3516470bdc..3107cb97cf0 100644 --- a/code/game/machinery/Beacon.dm +++ b/code/game/machinery/Beacon.dm @@ -43,10 +43,10 @@ /obj/machinery/bluespace_beacon/hide(intact) invisibility = intact ? INVISIBILITY_MAXIMUM : 0 - update_icon() + update_icon(UPDATE_ICON_STATE) // update the icon_state -/obj/machinery/bluespace_beacon/update_icon() +/obj/machinery/bluespace_beacon/update_icon_state() var/state="floor_beacon" if(invisibility) icon_state = "[state]f" @@ -60,11 +60,11 @@ Beacon.loc = loc else create_beacon() - update_icon() + update_icon(UPDATE_ICON_STATE) else if(Beacon) destroy_beacon() - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/bluespace_beacon/syndicate diff --git a/code/game/machinery/PDApainter.dm b/code/game/machinery/PDApainter.dm index 1eca027330f..7184de2558e 100644 --- a/code/game/machinery/PDApainter.dm +++ b/code/game/machinery/PDApainter.dm @@ -9,23 +9,21 @@ var/obj/item/pda/storedpda = null var/list/colorlist = list() - -/obj/machinery/pdapainter/update_icon() - cut_overlays() - +/obj/machinery/pdapainter/update_icon_state() if(stat & BROKEN) icon_state = "[initial(icon_state)]-broken" return - - if(storedpda) - add_overlay("[initial(icon_state)]-closed") - if(powered()) icon_state = initial(icon_state) else icon_state = "[initial(icon_state)]-off" - return +/obj/machinery/pdapainter/update_overlays() + . = ..() + if(stat & BROKEN) + return + if(storedpda) + . += "[initial(icon_state)]-closed" /obj/machinery/pdapainter/Initialize(mapload) . = ..() diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 17825dac64e..c0c5850768a 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -50,6 +50,12 @@ else set_light(0) +/obj/machinery/sleeper/update_icon_state() + if(occupant) + icon_state = base_icon + else + icon_state = "[base_icon]-open" + /obj/machinery/sleeper/Initialize(mapload) . = ..() component_parts = list() @@ -346,7 +352,7 @@ var/mob/M = G.affecting M.forceMove(src) occupant = M - icon_state = "[base_icon]" + update_icon(UPDATE_ICON_STATE) to_chat(M, "You feel cool air surround you. You go numb as your senses turn inward.") add_fingerprint(user) qdel(G) @@ -396,7 +402,7 @@ if(A == occupant) occupant = null updateUsrDialog() - update_icon() + update_icon(UPDATE_ICON_STATE) SStgui.update_uis(src) if(A == beaker) beaker = null @@ -431,7 +437,7 @@ return occupant.forceMove(loc) occupant = null - icon_state = "[base_icon]-open" + update_icon(UPDATE_ICON_STATE) // eject trash the occupant dropped for(var/atom/movable/A in contents - component_parts - list(beaker)) A.forceMove(loc) @@ -468,7 +474,6 @@ if(usr.incapacitated()) //are you cuffed, dying, lying, stunned or other return - icon_state = "[base_icon]-open" go_out() add_fingerprint(usr) return @@ -504,7 +509,7 @@ return L.forceMove(src) occupant = L - icon_state = "[base_icon]" + update_icon(UPDATE_ICON_STATE) to_chat(L, "You feel cool air surround you. You go numb as your senses turn inward.") add_fingerprint(user) if(user.pulling == L) @@ -575,7 +580,7 @@ usr.stop_pulling() usr.forceMove(src) occupant = usr - icon_state = "[base_icon]" + update_icon(UPDATE_ICON_STATE) for(var/obj/O in src) qdel(O) diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm index 4d8e95967fc..30f782f8238 100644 --- a/code/game/machinery/adv_med.dm +++ b/code/game/machinery/adv_med.dm @@ -48,6 +48,12 @@ component_parts += new /obj/item/stack/cable_coil(null, 2) RefreshParts() +/obj/machinery/bodyscanner/update_icon_state() + if(occupant) + icon_state = "bodyscanner" + else + icon_state = "bodyscanner-open" + /obj/machinery/bodyscanner/attackby(obj/item/I, mob/user) if(exchange_parts(user, I)) return @@ -71,7 +77,7 @@ return M.forceMove(src) occupant = M - icon_state = "bodyscanner" + update_icon(UPDATE_ICON_STATE) add_fingerprint(user) qdel(TYPECAST_YOUR_SHIT) SStgui.update_uis(src) @@ -135,7 +141,7 @@ H.forceMove(src) occupant = H - icon_state = "bodyscanner" + update_icon(UPDATE_ICON_STATE) add_fingerprint(user) SStgui.update_uis(src) @@ -178,7 +184,7 @@ return occupant.forceMove(loc) occupant = null - icon_state = "bodyscanner-open" + update_icon(UPDATE_ICON_STATE) // eject trash the occupant dropped for(var/atom/movable/A in contents - component_parts) A.forceMove(loc) @@ -197,7 +203,7 @@ if(A == occupant) occupant = null updateUsrDialog() - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/bodyscanner/narsie_act() go_out() diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm index a9cc35874bb..d6874027ff8 100644 --- a/code/game/machinery/ai_slipper.dm +++ b/code/game/machinery/ai_slipper.dm @@ -21,7 +21,7 @@ stat &= ~NOPOWER else stat |= NOPOWER - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/ai_slipper/attack_ai(mob/user) add_hiddenprint(user) @@ -56,7 +56,7 @@ power_change() addtimer(CALLBACK(src, .proc/recharge), cooldown_time) -/obj/machinery/ai_slipper/update_icon() +/obj/machinery/ai_slipper/update_icon_state() if(stat & (NOPOWER|BROKEN) || cooldown_on || !uses) icon_state = "liquid_dispenser" else diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm index ee129fbb73f..31ddd360f16 100644 --- a/code/game/machinery/camera/camera.dm +++ b/code/game/machinery/camera/camera.dm @@ -74,21 +74,21 @@ return if(!isEmpProof()) if(prob(150/severity)) - update_icon() + update_icon(UPDATE_ICON_STATE) var/list/previous_network = network network = list() GLOB.cameranet.removeCamera(src) stat |= EMPED set_light(0) emped = emped+1 //Increase the number of consecutive EMP's - update_icon() + update_icon(UPDATE_ICON_STATE) var/thisemp = emped //Take note of which EMP this proc is for spawn(900) if(!QDELETED(src)) if(emped == thisemp) //Only fix it if the camera hasn't been EMP'd again network = previous_network stat &= ~EMPED - update_icon() + update_icon(UPDATE_ICON_STATE) if(can_use()) GLOB.cameranet.addCamera(src) emped = 0 //Resets the consecutive EMP count @@ -243,7 +243,7 @@ new /obj/item/stack/cable_coil(loc, 2) qdel(src) -/obj/machinery/camera/update_icon() +/obj/machinery/camera/update_icon_state() if(!status) icon_state = "[initial(icon_state)]1" else if(stat & EMPED) @@ -277,7 +277,7 @@ visible_message("\The [src] [change_msg]!") playsound(loc, toggle_sound, 100, 1) - update_icon() + update_icon(UPDATE_ICON_STATE) // now disconnect anyone using the camera //Apparently, this will disconnect anyone even if the camera was re-activated. diff --git a/code/game/machinery/camera/camera_assembly.dm b/code/game/machinery/camera/camera_assembly.dm index a375e2d929b..1e3d9154d86 100644 --- a/code/game/machinery/camera/camera_assembly.dm +++ b/code/game/machinery/camera/camera_assembly.dm @@ -127,12 +127,12 @@ WRENCH_ANCHOR_TO_WALL_MESSAGE anchored = TRUE state = ASSEMBLY_WRENCHED - update_icon() + update_icon(UPDATE_ICON_STATE) auto_turn() else if(state == ASSEMBLY_WRENCHED) WRENCH_UNANCHOR_WALL_MESSAGE anchored = FALSE - update_icon() + update_icon(UPDATE_ICON_STATE) state = ASSEMBLY_UNBUILT else to_chat(user, "[src] can't fit here!") @@ -155,7 +155,7 @@ to_chat(user, "You unweld [src] from its place.") state = ASSEMBLY_WRENCHED -/obj/item/camera_assembly/update_icon() +/obj/item/camera_assembly/update_icon_state() if(anchored) icon_state = "camera1" else diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm index 6e8c7f4e094..4ca074556e3 100644 --- a/code/game/machinery/cell_charger.dm +++ b/code/game/machinery/cell_charger.dm @@ -21,20 +21,13 @@ QDEL_NULL(charging) return ..() -/obj/machinery/cell_charger/proc/updateicon() +/obj/machinery/cell_charger/update_icon_state() icon_state = "ccharger[charging ? 1 : 0]" +/obj/machinery/cell_charger/update_overlays() + . = ..() if(charging && !(stat & (BROKEN|NOPOWER))) - var/newlevel = round(charging.percent() * 4 / 100) - - if(chargelevel != newlevel) - chargelevel = newlevel - - overlays.Cut() - overlays += "ccharger-o[newlevel]" - - else - overlays.Cut() + . += "ccharger-o[chargelevel]" /obj/machinery/cell_charger/examine(mob/user) . = ..() @@ -66,8 +59,8 @@ I.forceMove(src) charging = I user.visible_message("[user] inserts a cell into the charger.", "You insert a cell into the charger.") - chargelevel = -1 - updateicon() + check_level() + update_icon() else return ..() @@ -89,7 +82,7 @@ charging.update_icon() charging = null chargelevel = -1 - updateicon() + update_icon() /obj/machinery/cell_charger/attack_hand(mob/user) if(!charging) @@ -134,4 +127,11 @@ use_power(200) //this used to use CELLRATE, but CELLRATE is fucking awful. feel free to fix this properly! charging.give(175) //inefficiency. - updateicon() + if(check_level()) + update_icon(UPDATE_OVERLAYS) + +/obj/machinery/cell_charger/proc/check_level() + var/newlevel = round(charging.percent() * 4 / 100) + if(chargelevel != newlevel) + chargelevel = newlevel + return TRUE diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 599fa5ad2b4..c697a11308a 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -523,13 +523,7 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\ mess = TRUE update_icon() -/obj/machinery/clonepod/update_icon() - ..() - cut_overlays() - - if(panel_open) - add_overlay("panel_open") - +/obj/machinery/clonepod/update_icon_state() if(occupant && !(stat & NOPOWER)) icon_state = "pod_cloning" else if(mess) @@ -537,6 +531,11 @@ GLOBAL_LIST_INIT(cloner_biomass_items, list(\ else icon_state = "pod_idle" +/obj/machinery/clonepod/update_overlays() + . = ..() + if(panel_open) + . += "panel_open" + /obj/machinery/clonepod/relaymove(mob/user) if(user.stat == CONSCIOUS) go_out() diff --git a/code/game/machinery/computer/HolodeckControl.dm b/code/game/machinery/computer/HolodeckControl.dm index 4a6401cce10..90f12c37946 100644 --- a/code/game/machinery/computer/HolodeckControl.dm +++ b/code/game/machinery/computer/HolodeckControl.dm @@ -289,7 +289,7 @@ for(var/mob/living/simple_animal/hostile/carp/C in linkedholodeck) qdel(C) - holographic_items = A.copy_contents_to(linkedholodeck , 1) + holographic_items = A.copy_contents_to(linkedholodeck , 1, perfect_copy = FALSE) if(emagged) for(var/obj/item/holo/H in linkedholodeck) @@ -343,9 +343,9 @@ /turf/simulated/floor/holofloor/carpet/Initialize(mapload) . = ..() - update_icon() + update_icon(UPDATE_ICON_STATE) -/turf/simulated/floor/holofloor/carpet/update_icon() +/turf/simulated/floor/holofloor/carpet/update_icon_state() if(!..()) return 0 if(smoothing_flags & (SMOOTH_CORNERS|SMOOTH_BITMASK)) @@ -594,7 +594,7 @@ ready = !ready - update_icon() + update_icon(UPDATE_ICON_STATE) var/numbuttons = 0 var/numready = 0 @@ -606,7 +606,7 @@ if(numbuttons == numready) begin_event() -/obj/machinery/readybutton/update_icon() +/obj/machinery/readybutton/update_icon_state() if(ready) icon_state = "auth_on" else diff --git a/code/game/machinery/computer/ai_core.dm b/code/game/machinery/computer/ai_core.dm index e020c89c3b6..0d84fc0d726 100644 --- a/code/game/machinery/computer/ai_core.dm +++ b/code/game/machinery/computer/ai_core.dm @@ -24,7 +24,7 @@ return playsound(loc, P.usesound, 50, 1) to_chat(user, "You place the circuit board inside the frame.") - update_icon() + update_icon(UPDATE_ICON_STATE) state = CIRCUIT_CORE P.forceMove(src) circuit = P @@ -38,7 +38,7 @@ if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use(5)) to_chat(user, "You add cables to the frame.") state = CABLED_CORE - update_icon() + update_icon(UPDATE_ICON_STATE) else to_chat(user, "You need five lengths of cable to wire the AI core!") return @@ -51,7 +51,7 @@ if(do_after(user, 20, target = src) && state == CABLED_CORE && G.use(2)) to_chat(user, "You put in the glass panel.") state = GLASS_CORE - update_icon() + update_icon(UPDATE_ICON_STATE) else to_chat(user, "You need two sheets of reinforced glass to insert them into the AI core!") return @@ -119,7 +119,7 @@ M.forceMove(src) brain = M to_chat(user, "You add [M.name] to the frame.") - update_icon() + update_icon(UPDATE_ICON_STATE) return return ..() @@ -147,7 +147,7 @@ to_chat(user, "You remove the brain.") brain.forceMove(loc) brain = null - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/structure/AIcore/screwdriver_act(mob/living/user, obj/item/I) if(!(state in list(SCREWED_CORE, CIRCUIT_CORE, GLASS_CORE, AI_READY_CORE))) @@ -185,7 +185,7 @@ if(AI_READY_CORE) to_chat(user, "You disconnect the monitor.") state = GLASS_CORE - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/structure/AIcore/wirecutter_act(mob/living/user, obj/item/I) @@ -199,7 +199,7 @@ else to_chat(user, "You remove the cables.") state = SCREWED_CORE - update_icon() + update_icon(UPDATE_ICON_STATE) var/obj/item/stack/cable_coil/A = new /obj/item/stack/cable_coil( loc ) A.amount = 5 @@ -209,7 +209,7 @@ return default_unfasten_wrench(user, I, 20) -/obj/structure/AIcore/update_icon() +/obj/structure/AIcore/update_icon_state() switch(state) if(EMPTY_CORE) icon_state = "0" diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm index 4a558d8eb27..a695b5d4ff0 100644 --- a/code/game/machinery/computer/aifixer.dm +++ b/code/game/machinery/computer/aifixer.dm @@ -74,7 +74,7 @@ if("radio") occupant.aiRadio.disabledAi = !occupant.aiRadio.disabledAi - update_icon() + update_icon(UPDATE_OVERLAYS) return TRUE /obj/machinery/computer/aifixer/proc/fix_ai() // Can we fix it? Probrably. @@ -86,26 +86,22 @@ occupant.updatehealth() if(occupant.health >= 0 && occupant.stat == DEAD) occupant.update_revive() - update_icon() + update_icon(UPDATE_OVERLAYS) sleep(10) active = FALSE -/obj/machinery/computer/aifixer/update_icon() - ..() - if(stat & (NOPOWER|BROKEN)) - return +/obj/machinery/computer/aifixer/update_overlays() + . = ..() + if(active) + . += "ai-fixer-on" + if(occupant) + switch(occupant.stat) + if(0) + . += "ai-fixer-full" + if(2) + . += "ai-fixer-404" else - var/overlay_layer = LIGHTING_LAYER+0.2 // +0.1 from the default computer overlays - if(active) - overlays += image(icon,"ai-fixer-on",overlay_layer) - if(occupant) - switch(occupant.stat) - if(0) - overlays += image(icon,"ai-fixer-full",overlay_layer) - if(2) - overlays += image(icon,"ai-fixer-404",overlay_layer) - else - overlays += image(icon,"ai-fixer-empty",overlay_layer) + . += "ai-fixer-empty" /obj/machinery/computer/aifixer/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card) if(!..()) @@ -121,7 +117,7 @@ AI.aiRadio.disabledAi = TRUE to_chat(AI, "You have been uploaded to a stationary terminal. Sadly, there is no remote access from here.") to_chat(user, "Transfer successful: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.") - update_icon() + update_icon(UPDATE_OVERLAYS) else //Uploading AI from terminal to card if(occupant && !active) @@ -129,7 +125,7 @@ to_chat(user, "Transfer successful: [occupant.name] ([rand(1000,9999)].exe) removed from host terminal and stored within local memory.") occupant.forceMove(card) occupant = null - update_icon() + update_icon(UPDATE_OVERLAYS) else if(active) to_chat(user, "ERROR: Reconstruction in progress.") else if(!occupant) diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm index 8d54f21ad0f..6394bcf0757 100644 --- a/code/game/machinery/computer/atmos_alert.dm +++ b/code/game/machinery/computer/atmos_alert.dm @@ -79,7 +79,7 @@ minor_alarms += zone update_icon() -/obj/machinery/computer/atmos_alert/update_icon() +/obj/machinery/computer/atmos_alert/update_icon_state() if(length(priority_alarms)) icon_screen = "alert:2" else if(length(minor_alarms)) diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index 6be347e34e8..762cdfaf05e 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -25,7 +25,7 @@ // 16 for nitrogen concentration // 32 for carbon dioxide concentration -/obj/machinery/air_sensor/update_icon() +/obj/machinery/air_sensor/update_icon_state() icon_state = "gsensor[on]" /obj/machinery/air_sensor/multitool_menu(mob/user, obj/item/multitool/P) diff --git a/code/game/machinery/computer/buildandrepair.dm b/code/game/machinery/computer/buildandrepair.dm index dc52ca7aab1..59a12849629 100644 --- a/code/game/machinery/computer/buildandrepair.dm +++ b/code/game/machinery/computer/buildandrepair.dm @@ -457,8 +457,7 @@ if(state == STATE_GLASS) new /obj/item/stack/sheet/glass(location, 2) -/obj/structure/computerframe/update_icon() - . = ..() +/obj/structure/computerframe/update_icon_state() icon_state = "comp_frame_[state]" /obj/structure/computerframe/welder_act(mob/user, obj/item/I) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 715c136a004..ab3716ca83f 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -67,24 +67,24 @@ update_icon() flickering = FALSE -/obj/machinery/computer/update_icon() - cut_overlays() +/obj/machinery/computer/update_overlays() + . = ..() underlays.Cut() if((stat & NOPOWER) || force_no_power_icon_state) if(icon_keyboard) - add_overlay("[icon_keyboard]_off") + . += "[icon_keyboard]_off" return // This whole block lets screens and keyboards ignore lighting and be visible even in the darkest room var/overlay_state = icon_screen if(stat & BROKEN) overlay_state = "[icon_state]_broken" - add_overlay("[overlay_state]") + . += "[overlay_state]" if(!(stat & BROKEN) && light) underlays += emissive_appearance(icon, "[icon_state]_lightmask") if(icon_keyboard) - add_overlay("[icon_keyboard]") + . += "[icon_keyboard]" underlays += emissive_appearance(icon, "[icon_keyboard]_lightmask") /obj/machinery/computer/power_change() diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm index 51bf18716dc..2f33ea3fac0 100644 --- a/code/game/machinery/computer/message.dm +++ b/code/game/machinery/computer/message.dm @@ -81,14 +81,12 @@ else to_chat(user, "A no server error appears on the screen.") -/obj/machinery/computer/message_monitor/update_icon() +/obj/machinery/computer/message_monitor/update_icon_state() if(emag || hacking) icon_screen = hack_icon else icon_screen = normal_icon - ..() - /obj/machinery/computer/message_monitor/attack_hand(mob/user as mob) if(..()) return diff --git a/code/game/machinery/computer/station_alert.dm b/code/game/machinery/computer/station_alert.dm index e3abb5b4842..61b7b2e8e0e 100644 --- a/code/game/machinery/computer/station_alert.dm +++ b/code/game/machinery/computer/station_alert.dm @@ -72,7 +72,7 @@ return update_icon() -/obj/machinery/computer/station_alert/update_icon() +/obj/machinery/computer/station_alert/update_icon_state() var/active_alarms = FALSE var/list/list/temp_alarm_list = SSalarm.alarms.Copy() for(var/cat in temp_alarm_list) @@ -92,5 +92,3 @@ icon_screen = "alert:2" else icon_screen = "alert:0" - - ..() diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm index da1f02f00ba..5bed31038cc 100644 --- a/code/game/machinery/dance_machine.dm +++ b/code/game/machinery/dance_machine.dm @@ -70,13 +70,11 @@ WRENCH_UNANCHOR_MESSAGE playsound(src, 'sound/items/deconstruct.ogg', 50, 1) -/obj/machinery/disco/update_icon() +/obj/machinery/disco/update_icon_state() if(active) icon_state = "disco1" else icon_state = "disco0" - ..() - /obj/machinery/disco/attack_hand(mob/user) if(..()) @@ -127,7 +125,7 @@ playsound(src, 'sound/misc/compiler-failure.ogg', 50, 1) return active = TRUE - update_icon() + update_icon(UPDATE_ICON_STATE) dance_setup() START_PROCESSING(SSobj, src) lights_spin() diff --git a/code/game/machinery/defib_mount.dm b/code/game/machinery/defib_mount.dm index fe333ebf4ef..e64d443a9c6 100644 --- a/code/game/machinery/defib_mount.dm +++ b/code/game/machinery/defib_mount.dm @@ -37,7 +37,7 @@ /obj/machinery/defibrillator_mount/loaded/Initialize(mapload) //loaded subtype for mapping use . = ..() defib = new/obj/item/defibrillator/loaded(src) - update_icon() + update_icon(UPDATE_OVERLAYS) /obj/machinery/defibrillator_mount/Destroy() QDEL_NULL(defib) @@ -58,19 +58,19 @@ if(defib && defib.cell && defib.cell.charge < defib.cell.maxcharge && is_operational()) use_power(200) defib.cell.give(180) //90% efficiency, slightly better than the cell charger's 87.5% - update_icon() + update_icon(UPDATE_OVERLAYS) -/obj/machinery/defibrillator_mount/update_icon() - cut_overlays() +/obj/machinery/defibrillator_mount/update_overlays() + . = ..() if(defib) - add_overlay("defib") + . += "defib" if(defib.powered) - add_overlay(defib.safety ? "online" : "emagged") + . += "[defib.safety ? "online" : "emagged"]" var/ratio = defib.cell.charge / defib.cell.maxcharge ratio = CEILING(ratio * 4, 1) * 25 - add_overlay("charge[ratio]") + . += "charge[ratio]" if(clamps_locked) - add_overlay("clamps") + . += "clamps" //defib interaction /obj/machinery/defibrillator_mount/attack_hand(mob/living/user) @@ -95,7 +95,7 @@ "You press [I] into the mount, and it clicks into place.") playsound(src, 'sound/machines/click.ogg', 50, TRUE) defib = I - update_icon() + update_icon(UPDATE_OVERLAYS) return else if(defib && I == defib.paddles) user.drop_item() @@ -108,7 +108,7 @@ return clamps_locked = !clamps_locked to_chat(user, "Clamps [clamps_locked ? "" : "dis"]engaged.") - update_icon() + update_icon(UPDATE_OVERLAYS) else to_chat(user, "Insufficient access.") return @@ -143,7 +143,7 @@ "You slide out [defib] from [src] and unhook the charging cables.") playsound(src, 'sound/items/deconstruct.ogg', 50, TRUE) defib = null - update_icon() + update_icon(UPDATE_OVERLAYS) //wallframe, for attaching the mounts easily /obj/item/mounted/frame/defib_mount diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 336e33aa68f..8af106feae7 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -330,8 +330,14 @@ GLOBAL_LIST_EMPTY(airlock_overlays) if(AIRLOCK_OPEN, AIRLOCK_CLOSED) if(AIRLOCK_DENY, AIRLOCK_OPENING, AIRLOCK_CLOSING, AIRLOCK_EMAG) icon_state = "nonexistenticonstate" //MADNESS + + . = ..(UPDATE_ICON_STATE) // Sent after the icon_state is changed + set_airlock_overlays(state) +/obj/machinery/door/airlock/update_icon_state() + return + /obj/machinery/door/airlock/proc/set_airlock_overlays(state) var/image/frame_overlay var/image/filling_overlay @@ -1380,9 +1386,13 @@ GLOBAL_LIST_EMPTY(airlock_overlays) /obj/machinery/door/airlock/proc/note_type() //Returns a string representing the type of note pinned to this airlock if(!note) return - else if(istype(note, /obj/item/paper)) - return "note" - else if(istype(note, /obj/item/photo)) + if(istype(note, /obj/item/paper)) + var/obj/item/paper/pinned_paper = note + if(pinned_paper.info) + return "note_words" + else + return "note" + if(istype(note, /obj/item/photo)) return "photo" //Removes the current note on the door if any. Returns if a note is removed diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm index 6df716b4664..7f23df56feb 100644 --- a/code/game/machinery/doors/airlock_control.dm +++ b/code/game/machinery/doors/airlock_control.dm @@ -155,7 +155,7 @@ var/alert = 0 var/previousPressure -/obj/machinery/airlock_sensor/update_icon() +/obj/machinery/airlock_sensor/update_icon_state() if(on) if(alert) icon_state = "airlock_sensor_alert" @@ -191,7 +191,7 @@ alert = (pressure < ONE_ATMOSPHERE*0.8) - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/airlock_sensor/set_frequency(new_frequency) SSradio.remove_object(src, frequency) @@ -226,7 +226,7 @@ var/command = "cycle" var/on = TRUE -/obj/machinery/access_button/update_icon() +/obj/machinery/access_button/update_icon_state() if(on) icon_state = "access_button_standby" else diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm index 1693af08f6f..0163edf9f24 100644 --- a/code/game/machinery/doors/brigdoors.dm +++ b/code/game/machinery/doors/brigdoors.dm @@ -142,9 +142,9 @@ if(T.id == id) targets += T - if(targets.len==0) + if(!length(targets)) stat |= BROKEN - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/door_timer/Destroy() QDEL_NULL(Radio) @@ -165,7 +165,7 @@ timer_end() // open doors, reset timer, clear status screen timing = FALSE . = PROCESS_KILL - update_icon() + update_icon(UPDATE_ICON_STATE) else timer_end() return PROCESS_KILL @@ -173,7 +173,7 @@ // has the door power situation changed, if so update icon. /obj/machinery/door_timer/power_change() ..() - update_icon() + update_icon(UPDATE_ICON_STATE) // open/closedoor checks if door_timer has power, if so it checks if the @@ -358,7 +358,7 @@ prisoner_time = null timing = TRUE timer_start() - update_icon() + update_icon(UPDATE_ICON_STATE) if("restart_timer") if(timing) var/reset_reason = sanitize(copytext(input(usr, "Reason for resetting timer:", name, "") as text|null, 1, MAX_MESSAGE_LEN)) @@ -395,7 +395,7 @@ // if NOPOWER, display blank // if BROKEN, display blue screen of death icon AI uses // if timing=true, run update display function -/obj/machinery/door_timer/update_icon() +/obj/machinery/door_timer/update_icon_state() if(stat & (NOPOWER)) icon_state = "frame" return diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 558e4ab8aa4..b679b848007 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -149,26 +149,34 @@ var/mob/living/simple_animal/bot/B = user B.door_opened(src) else + if(pry_open_check(user)) + return do_animate("deny") - if(HAS_TRAIT(user, TRAIT_FORCE_DOORS)) - var/datum/antagonist/vampire/V = user.mind.has_antag_datum(/datum/antagonist/vampire) - if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT)) - if(!V.bloodusable) - REMOVE_TRAIT(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT) - return - if(welded) - to_chat(user, "The door is welded.") - return - if(locked) - to_chat(user, "The door is bolted.") - return - if(density) - visible_message("[user] forces the door open!") - playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) - open(TRUE) - if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT)) - V.bloodusable = max(V.bloodusable - 5, 0) +/obj/machinery/door/proc/pry_open_check(mob/user) + . = TRUE + if(isterrorspider(user)) + return + + if(!HAS_TRAIT(user, TRAIT_FORCE_DOORS)) + return FALSE + var/datum/antagonist/vampire/V = user.mind?.has_antag_datum(/datum/antagonist/vampire) + if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT)) + if(!V.bloodusable) + REMOVE_TRAIT(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT) + return FALSE + if(welded) + to_chat(user, "The door is welded.") + return FALSE + if(locked) + to_chat(user, "The door is bolted.") + return FALSE + if(density) + visible_message("[user] forces the door open!") + playsound(loc, "sparks", 100, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) + open(TRUE) + if(V && HAS_TRAIT_FROM(user, TRAIT_FORCE_DOORS, VAMPIRE_TRAIT)) + V.bloodusable = max(V.bloodusable - 5, 0) /obj/machinery/door/attack_ai(mob/user) return attack_hand(user) @@ -194,7 +202,7 @@ open() else close() - return + return TRUE if(density) do_animate("deny") @@ -259,11 +267,8 @@ emagged = TRUE return TRUE -/obj/machinery/door/update_icon() - if(density) - icon_state = "door1" - else - icon_state = "door0" +/obj/machinery/door/update_icon_state() + icon_state = "door[density]" /obj/machinery/door/proc/do_animate(animation) switch(animation) diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm index f1d09a69a07..407287e54e6 100644 --- a/code/game/machinery/doors/firedoor.dm +++ b/code/game/machinery/doors/firedoor.dm @@ -200,18 +200,21 @@ flick("door_closing", src) playsound(src, 'sound/machines/airlock_ext_close.ogg', 30, 1) -/obj/machinery/door/firedoor/update_icon() - overlays.Cut() - if(active_alarm && hasPower()) - overlays += image('icons/obj/doors/doorfire.dmi', "alarmlights") +/obj/machinery/door/firedoor/update_icon_state() if(density) icon_state = "door_closed" - if(welded) - overlays += "welded" else icon_state = "door_open" - if(welded) - overlays += "welded_open" + +/obj/machinery/door/firedoor/update_overlays() + . = ..() + if(active_alarm && hasPower()) + . += image('icons/obj/doors/doorfire.dmi', "alarmlights") + if(density && welded) + . += "welded" + return + if(welded) + . += "welded_open" /obj/machinery/door/firedoor/proc/activate_alarm() active_alarm = TRUE @@ -344,8 +347,7 @@ if(CONSTRUCTION_NOCIRCUIT) . += "There are no firelock electronics in the frame. The frame could be cut apart." -/obj/structure/firelock_frame/update_icon() - ..() +/obj/structure/firelock_frame/update_icon_state() icon_state = "frame[constructionStep]" /obj/structure/firelock_frame/attackby(obj/item/C, mob/user) diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index be6880f5a3c..cb6318e930f 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -50,7 +50,7 @@ flick("closing", src) playsound(src, 'sound/machines/blastdoor.ogg', 30, 1) -/obj/machinery/door/poddoor/update_icon() +/obj/machinery/door/poddoor/update_icon_state() if(density) icon_state = "closed" else diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 39d8fc9bbf1..4b213746a73 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -28,7 +28,6 @@ /obj/machinery/door/window/Initialize(mapload) . = ..() if(req_access && req_access.len) - icon_state = "[icon_state]" base_state = icon_state /obj/machinery/door/window/Destroy() @@ -38,7 +37,7 @@ QDEL_NULL(electronics) return ..() -/obj/machinery/door/window/update_icon() +/obj/machinery/door/window/update_icon_state() if(density) icon_state = base_state else diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm index 47bdbd80385..fb2551c3e45 100644 --- a/code/game/machinery/dye_generator.dm +++ b/code/game/machinery/dye_generator.dm @@ -24,19 +24,19 @@ else stat |= NOPOWER set_light(0) - update_icon() + update_icon(UPDATE_OVERLAYS) /obj/machinery/dye_generator/extinguish_light() set_light(0) underlays.Cut() -/obj/machinery/dye_generator/update_icon() - cut_overlays() +/obj/machinery/dye_generator/update_overlays() + . = ..() underlays.Cut() if(stat & (BROKEN|NOPOWER)) - add_overlay("barbervend_off") + . += "barbervend_off" if(stat & BROKEN) - add_overlay("barbervend_broken") + . += "barbervend_broken" if(light) underlays += emissive_appearance(icon, "barbervend_lightmask") @@ -58,14 +58,14 @@ var/obj/item/hair_dye_bottle/HD = I user.visible_message("[user] fills [HD] up with some dye.","You fill [HD] up with some hair dye.") HD.dye_color = dye_color - HD.update_dye_overlay() + HD.update_icon() return return ..() /obj/machinery/dye_generator/obj_break(damage_flag) if(!(stat & BROKEN)) stat |= BROKEN - update_icon() + update_icon(UPDATE_OVERLAYS) //Hair Dye Bottle @@ -83,13 +83,13 @@ /obj/item/hair_dye_bottle/New() ..() - update_dye_overlay() + update_icon(UPDATE_OVERLAYS) -/obj/item/hair_dye_bottle/proc/update_dye_overlay() - overlays.Cut() +/obj/item/hair_dye_bottle/update_overlays() + . = ..() var/image/I = new('icons/obj/items.dmi', "hairdyebottle-overlay") I.color = dye_color - overlays += I + . += I /obj/item/hair_dye_bottle/attack(mob/living/carbon/M, mob/user) if(user.a_intent != INTENT_HELP) diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm index 8766864bdc1..51e2a632a93 100644 --- a/code/game/machinery/embedded_controller/airlock_controllers.dm +++ b/code/game/machinery/embedded_controller/airlock_controllers.dm @@ -75,7 +75,7 @@ name = "Access Controller" tag_secure = 1 -/obj/machinery/embedded_controller/radio/airlock/access_controller/update_icon() +/obj/machinery/embedded_controller/radio/airlock/access_controller/update_icon_state() if(on && program) if(program.memory["processing"]) icon_state = "access_control_process" diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm index 8e12c17bf7e..36d75590e09 100644 --- a/code/game/machinery/embedded_controller/embedded_controller_base.dm +++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm @@ -10,7 +10,7 @@ var/on = TRUE /obj/machinery/embedded_controller/proc/post_signal(datum/signal/signal, comm_line) - return 0 + return FALSE /obj/machinery/embedded_controller/receive_signal(datum/signal/signal, receive_method, receive_param) if(!signal || signal.encryption) return @@ -23,7 +23,7 @@ if(program) program.process() - update_icon() + update_icon(UPDATE_ICON_STATE) src.updateDialog() /obj/machinery/embedded_controller/attack_ghost(mob/user as mob) @@ -60,7 +60,7 @@ radio_connection = null return ..() -/obj/machinery/embedded_controller/radio/update_icon() +/obj/machinery/embedded_controller/radio/update_icon_state() if(on && program) if(program.memory["processing"]) icon_state = "airlock_control_process" diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm index 21a9bbff988..3a42aabf1af 100644 --- a/code/game/machinery/firealarm.dm +++ b/code/game/machinery/firealarm.dm @@ -44,13 +44,7 @@ FIRE ALARM report_fire_alarms = FALSE show_alert_level = FALSE -/obj/machinery/firealarm/update_icon() - underlays.Cut() - if(light) - if(overlays) - underlays += emissive_appearance(icon, "firealarm_overlay_lightmask") - if(!wiresexposed) - underlays += emissive_appearance(icon, "firealarm_lightmask") +/obj/machinery/firealarm/update_icon_state() if(wiresexposed) icon_state = "firealarm_b[buildstage]" return @@ -63,6 +57,17 @@ FIRE ALARM else icon_state = "firealarm_on" +/obj/machinery/firealarm/update_overlays() + . = ..() + underlays.Cut() + if(is_station_contact(z) && show_alert_level) + if(GLOB.security_level) + . += "overlay_[get_security_level()]" + if(light) + underlays += emissive_appearance(icon, "firealarm_overlay_lightmask") + if(light && !wiresexposed) + underlays += emissive_appearance(icon, "firealarm_lightmask") + /obj/machinery/firealarm/emag_act(mob/user) if(!emagged) emagged = TRUE @@ -271,12 +276,6 @@ FIRE ALARM setDir(direction) set_pixel_offsets_from_dir(26, -26, 26, -26) - if(is_station_contact(z) && show_alert_level) - if(GLOB.security_level) - overlays += image('icons/obj/monitors.dmi', "overlay_[get_security_level()]") - else - overlays += image('icons/obj/monitors.dmi', "overlay_green") - myArea = get_area(src) LAZYADD(myArea.firealarms, src) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 8c4df9e9efa..4ed612a9cf2 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -26,20 +26,21 @@ QDEL_NULL(cell) return ..() -/obj/machinery/floodlight/proc/updateicon() +/obj/machinery/floodlight/update_icon_state() icon_state = "flood[open ? "o" : ""][open && cell ? "b" : ""]0[on]" /obj/machinery/floodlight/process() if(!cell && on) on = FALSE visible_message("[src] shuts down due to lack of power!") - update_icon() + update_icon(UPDATE_ICON_STATE) set_light(0) + return if(on) cell.charge -= use if(cell.charge <= 0) on = FALSE - updateicon() + update_icon(UPDATE_ICON_STATE) set_light(0) visible_message("[src] shuts down due to lack of power!") @@ -55,7 +56,7 @@ cell.loc = loc cell.add_fingerprint(user) - cell.update_icon() + cell.update_icon(UPDATE_ICON_STATE) cell = null to_chat(user, "You remove the power cell.") @@ -63,7 +64,7 @@ on = FALSE visible_message("[src] shuts down due to lack of power!") set_light(0) - updateicon() + update_icon(UPDATE_ICON_STATE) return if(on) @@ -79,7 +80,7 @@ to_chat(user, "You turn on the light.") set_light(brightness_on) - updateicon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/floodlight/proc/mapVarInit() if(on) @@ -88,7 +89,7 @@ if(cell.charge <= 0) return set_light(brightness_on) - updateicon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/floodlight/attackby(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/wrench)) @@ -106,7 +107,7 @@ " You have loosened \the [src]'s casters.", \ "You hear ratchet.") anchored = FALSE - updateicon() + update_icon(UPDATE_ICON_STATE) return if(istype(W, /obj/item/screwdriver)) if(!open) @@ -116,19 +117,18 @@ else unlocked = TRUE to_chat(user, "You unscrew the battery panel.") - updateicon() + update_icon(UPDATE_ICON_STATE) return if(istype(W, /obj/item/crowbar)) if(unlocked) if(open) open = FALSE - overlays = null to_chat(user, "You crowbar the battery panel in place.") else if(unlocked) open = TRUE to_chat(user, "You remove the battery panel.") - updateicon() + update_icon(UPDATE_ICON_STATE) return if(istype(W, /obj/item/stock_parts/cell)) if(open) @@ -139,11 +139,11 @@ W.loc = src cell = W to_chat(user, "You insert the power cell.") - updateicon() + update_icon(UPDATE_ICON_STATE) return return ..() /obj/machinery/floodlight/extinguish_light() on = FALSE set_light(0) - update_icon() + update_icon(UPDATE_ICON_STATE) diff --git a/code/game/machinery/gameboard.dm b/code/game/machinery/gameboard.dm index e631d30dcb6..8c289849eeb 100644 --- a/code/game/machinery/gameboard.dm +++ b/code/game/machinery/gameboard.dm @@ -20,13 +20,13 @@ /obj/machinery/gameboard/power_change() . = ..() - update_icon() + update_icon(UPDATE_ICON_STATE) if(stat & NOPOWER) set_light(0) else set_light(3, 3) -/obj/machinery/gameboard/update_icon() +/obj/machinery/gameboard/update_icon_state() if(stat & NOPOWER) icon_state = "gboard_off" else diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index ec2fdbfcf88..18037dd5b28 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -290,7 +290,7 @@ GLOBAL_LIST_EMPTY(holopads) playsound(src, 'sound/machines/twobeep.ogg', 100) //bring, bring! ringing = TRUE - update_icon() + update_icon(UPDATE_ICON_STATE) //Try to transfer hologram to another pad that can project on T @@ -405,13 +405,11 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ active_power_usage = HOLOPAD_PASSIVE_POWER_USAGE + (HOLOGRAM_POWER_USAGE * total_users) if(total_users) set_light(2) - icon_state = "holopad1" else set_light(0) - icon_state = "holopad0" - update_icon() + update_icon(UPDATE_ICON_STATE) -/obj/machinery/hologram/holopad/update_icon() +/obj/machinery/hologram/holopad/update_icon_state() var/total_users = LAZYLEN(masters) + LAZYLEN(holo_calls) if(icon_state == "holopad_open") return diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm index ca62fab70ad..e5a30cf9733 100644 --- a/code/game/machinery/holosign.dm +++ b/code/game/machinery/holosign.dm @@ -14,9 +14,9 @@ if(stat & (BROKEN|NOPOWER)) return lit = !lit - update_icon() + update_icon(UPDATE_ICON_STATE) -/obj/machinery/holosign/update_icon() +/obj/machinery/holosign/update_icon_state() if(!lit) icon_state = "sign_off" else @@ -25,7 +25,7 @@ /obj/machinery/holosign/power_change() if(stat & NOPOWER) lit = FALSE - update_icon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/holosign/surgery name = "surgery holosign" diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 344bca5167a..c9bd1ab6360 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -11,19 +11,18 @@ /obj/machinery/iv_drip/process() if(istype(bag) && bag.injection_target) - update_icon() + update_icon(UPDATE_OVERLAYS) return return PROCESS_KILL -/obj/machinery/iv_drip/update_icon() - cut_overlays() - +/obj/machinery/iv_drip/update_overlays() + . = ..() if(bag) - add_overlay("hangingbag") + . += "hangingbag" if(bag.reagents.total_volume) var/image/filling = image('icons/goonstation/objects/iv.dmi', src, "hangingbag-fluid") filling.icon += mix_color_from_reagents(bag.reagents.reagent_list) - add_overlay(filling) + . += filling /obj/machinery/iv_drip/MouseDrop(mob/living/target) if(usr.incapacitated()) @@ -39,9 +38,9 @@ /obj/machinery/iv_drip/attack_hand(mob/user) if(bag) user.put_in_hands(bag) - bag.update_icon() + bag.update_icon(UPDATE_OVERLAYS) bag = null - update_icon() + update_icon(UPDATE_OVERLAYS) /obj/machinery/iv_drip/attackby(obj/item/I, mob/user, params) if(istype(I, /obj/item/reagent_containers/iv_bag)) @@ -54,12 +53,12 @@ I.forceMove(src) bag = I to_chat(user, "You attach [I] to [src].") - update_icon() + update_icon(UPDATE_OVERLAYS) START_PROCESSING(SSmachines, src) else if (bag && istype(I, /obj/item/reagent_containers)) bag.attackby(I) I.afterattack(bag, usr, TRUE) - update_icon() + update_icon(UPDATE_OVERLAYS) else return ..() diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm index 68304cdedec..f48c3451a1c 100644 --- a/code/game/machinery/lightswitch.dm +++ b/code/game/machinery/lightswitch.dm @@ -44,7 +44,7 @@ name = "light switch([area.name])" src.on = src.area.lightswitch - updateicon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/light_switch/Initialize() ..() @@ -63,18 +63,15 @@ radio_connection = null return ..() -/obj/machinery/light_switch/proc/updateicon() +/obj/machinery/light_switch/update_icon_state() if(stat & NOPOWER) icon_state = "light-p" - else - if(on) - icon_state = "light1" - else - icon_state = "light0" + return + icon_state = "light[on]" /obj/machinery/light_switch/examine(mob/user) . = ..() - . += "A light switch. It is [on? "on" : "off"]." + . += "A light switch. It is [on ? "on" : "off"]." /obj/machinery/light_switch/attack_ghost(mob/user) if(user.can_advanced_admin_interact()) @@ -83,11 +80,11 @@ /obj/machinery/light_switch/attack_hand(mob/user) on = !on playsound(src, 'sound/machines/lightswitch.ogg', 10, TRUE) - updateicon() + update_icon(UPDATE_ICON_STATE) if(light_connect) area.lightswitch = on - area.updateicon() + area.update_icon(UPDATE_ICON_STATE) if(logic_connect && powered(LIGHT)) //Don't bother sending a signal if we aren't set to send them or we have no power to send with. handle_output() @@ -95,7 +92,7 @@ if(light_connect) for(var/obj/machinery/light_switch/L in area) L.on = on - L.updateicon() + L.update_icon(UPDATE_ICON_STATE) area.power_change() @@ -135,7 +132,7 @@ else stat |= NOPOWER - updateicon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/light_switch/emp_act(severity) if(stat & (BROKEN|NOPOWER)) diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm index 15636bb9383..ff2757a707e 100644 --- a/code/game/machinery/magnet.dm +++ b/code/game/machinery/magnet.dm @@ -44,20 +44,11 @@ // update the invisibility and icon /obj/machinery/magnetic_module/hide(intact) invisibility = intact ? INVISIBILITY_MAXIMUM : 0 - updateicon() + update_icon(UPDATE_ICON_STATE) - // update the icon_state -/obj/machinery/magnetic_module/proc/updateicon() - var/state="floor_magnet" - var/onstate="" - if(!on) - onstate="0" - - if(invisibility) - icon_state = "[state][onstate]-f" // if invisible, set icon to faded version +/obj/machinery/magnetic_module/update_icon_state() + icon_state = "floor_magnet[on ? "" : "0"][invisibility ? "-f" : ""]" // if invisible, set icon to faded version // in case of being revealed by T-scanner - else - icon_state = "[state][onstate]" /obj/machinery/magnetic_module/receive_signal(datum/signal/signal) var/command = signal.data["command"] @@ -149,7 +140,7 @@ active_power_usage = electricity_level*15 else use_power = 0 - updateicon() + update_icon(UPDATE_ICON_STATE) /obj/machinery/magnetic_module/proc/magnetic_process() // proc that actually does the pulling diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm index 7cfa60344e3..70256099b9e 100644 --- a/code/game/machinery/navbeacon.dm +++ b/code/game/machinery/navbeacon.dm @@ -76,17 +76,11 @@ // hide the object if turf is intact /obj/machinery/navbeacon/hide(intact) invisibility = intact ? INVISIBILITY_MAXIMUM : 0 - updateicon() + update_icon(UPDATE_ICON_STATE) -// update the icon_state -/obj/machinery/navbeacon/proc/updateicon() - var/state="navbeacon[open]" - - if(invisibility) - icon_state = "[state]-f" // if invisible, set icon to faded version - // in case revealed by T-scanner - else - icon_state = "[state]" +/obj/machinery/navbeacon/update_icon_state() + icon_state = "navbeacon[open][invisibility ? "-f" : ""]" // if invisible, set icon to faded version + // in case revealed by T-scanner /obj/machinery/navbeacon/attackby(obj/item/I, mob/user, params) var/turf/T = loc @@ -98,7 +92,7 @@ user.visible_message("[user] [open ? "opens" : "closes"] the beacon's cover.", "You [open ? "open" : "close"] the beacon's cover.") - updateicon() + update_icon(UPDATE_ICON_STATE) else if(istype(I, /obj/item/card/id) || istype(I, /obj/item/pda)) if(open) @@ -221,4 +215,4 @@ Transponder Codes: