Files
Letter NandGitHub cb37c3ba0a implement INTERACT_ATOM_* (#7465)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
title, will be used when i tgify machines (upgradable machinery)
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game

<!-- Argue for the merits of your changes and how they benefit the game,
especially if they are controversial and/or far reaching. If you can't
actually explain WHY what you are doing will improve the game, then it
probably isn't good for the game in the first place. -->

## Changelog

<!-- If your PR modifies aspects of the game that can be concretely
observed by players or admins you should add a changelog. If your change
does NOT meet this description, remove this section. Please note that
maintainers freely reserve the right to remove and add tags should they
deem it appropriate. You can attempt to finagle the system all you want,
but it's best to shoot for clear communication right off the bat. -->

🆑
code: properly implement `INTERACT_ATOM_*`
/🆑

<!-- Both 🆑's are required for the changelog to work! You can put
your name to the right of the first 🆑 if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
2026-01-14 00:06:48 -05:00

48 lines
1.6 KiB
Plaintext

//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//
/atom/movable/screen
plane = HUD_PLANE
layer = HUD_LAYER_BASE
animate_movement = SLIDE_STEPS
appearance_flags = APPEARANCE_UI
var/obj/master = null //A reference to the object in the slot. Grabs or items, generally.
var/datum/hud/hud_legacy = null // A reference to the owner HUD, if any.
interaction_flags_atom = parent_type::interaction_flags_atom | INTERACT_ATOM_MOUSEDROP_IGNORE_CHECKS
/**
* called to resync to a hud_style datum
*/
/atom/movable/screen/proc/sync_to_preferences(datum/hud_preferences/preference_set)
return
/atom/movable/screen/Destroy()
master = null
return ..()
//* Default Click Handling *//
//* At this point in time, all new screen objects should be able to self-sanitize their inputs. *//
//* This is to prevent security holes from happening when we eventually add the ability to *//
//* observe another player's POV, including their full UI. *//
/atom/movable/screen/Click(location, control, params)
if(!check_allowed(usr))
return
on_click(usr, params2list(params))
/atom/movable/screen/DblClick(location, control, params)
if(!check_allowed(usr))
return
on_doubleclick(usr, params2list(params))
/atom/movable/screen/proc/on_click(mob/user, list/params)
return
/atom/movable/screen/proc/on_doubleclick(mob/user, list/params)
return
/atom/movable/screen/proc/check_allowed(mob/user)
if(hud_legacy?.mymob && user != hud_legacy.mymob)
return FALSE
return TRUE