Cuts down on unnecessary non-TGUI stuff (#79590)

## About The Pull Request

Removes INTERACT_MACHINE_SET_MACHINE on machines that don't use a
non-TGUI UI.
Removes set_machine from TGUI things that forgot to remove them
previously.
Decouples advanced camera consoles from UI procs since it doesn't
actually use one.

## Why It's Good For The Game

TGUI machines don't need to be using these procs and vars, and this
makes it more clear what does and doesn't use a TGUI menu from a glance.
I explain it a bit better
[here](https://hackmd.io/XLt5MoRvRxuhFbwtk4VAUA) if you're interested.

## Changelog

No player-facing changes.
This commit is contained in:
John Willard
2023-11-09 18:13:09 -05:00
committed by GitHub
parent 3922673cce
commit b52ce868bc
25 changed files with 29 additions and 46 deletions
+1 -2
View File
@@ -36,9 +36,8 @@
#define INTERACT_MACHINE_OPEN_SILICON (1<<4)
/// must be silicon to interact
#define INTERACT_MACHINE_REQUIRES_SILICON (1<<5)
/// MACHINES HAVE THIS BY DEFAULT, SOMEONE SHOULD RUN THROUGH MACHINES AND REMOVE IT FROM THINGS LIKE LIGHT SWITCHES WHEN POSSIBLE!!--------------------------
/// This flag determines if a machine set_machine's the user when the user uses it, making updateUsrDialog make the user re-call interact() on it.
/// THIS FLAG IS ON ALL MACHINES BY DEFAULT, NEEDS TO BE RE-EVALUATED LATER!!
/// This is exclusively used for non-TGUI UIs, and its instances should be removed when moved to TGUI.
#define INTERACT_MACHINE_SET_MACHINE (1<<6)
/// the user must have vision to interact (blind people need not apply)
#define INTERACT_MACHINE_REQUIRES_SIGHT (1<<7)
+1 -1
View File
@@ -131,7 +131,7 @@
var/subsystem_type = /datum/controller/subsystem/machines
var/obj/item/circuitboard/circuit // Circuit to be created and inserted when the machinery is created
var/interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OPEN_SILICON|INTERACT_MACHINE_SET_MACHINE
var/interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OPEN_SILICON
var/fair_market_price = 69
var/market_verb = "Customer"
var/payment_department = ACCOUNT_ENG
+1 -1
View File
@@ -6,7 +6,7 @@
max_integrity = 200
integrity_failure = 0.5
armor_type = /datum/armor/machinery_computer
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_REQUIRES_LITERACY
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_REQUIRES_LITERACY
/// How bright we are when turned on.
var/brightness_on = 1
/// Icon_state of the keyboard overlay.
@@ -77,7 +77,7 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
icon_keyboard = null
icon_screen = "invaders"
light_color = LIGHT_COLOR_GREEN
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE // we don't need to be literate to play video games fam
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON
var/list/prize_override
/obj/machinery/computer/arcade/proc/Reset()
@@ -157,6 +157,8 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list(
icon_state = "arcade"
circuit = /obj/item/circuitboard/computer/arcade/battle
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE // we don't need to be literate to play video games fam
var/enemy_name = "Space Villain"
///Enemy health/attack points
var/enemy_hp = 100
+3
View File
@@ -21,6 +21,9 @@
/// Controller for admin event arenas
/obj/machinery/computer/arena
name = "arena controller"
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_REQUIRES_LITERACY
/// Arena ID
var/arena_id = ARENA_DEFAULT_ID
/// Enables/disables spawning
+1 -1
View File
@@ -19,7 +19,7 @@
/// All the plane masters that need to be applied.
var/atom/movable/screen/background/cam_background
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_REQUIRES_SIGHT
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_REQUIRES_SIGHT
/obj/machinery/computer/security/Initialize(mapload)
. = ..()
@@ -24,7 +24,7 @@
///Should we supress any view changes?
var/should_supress_view_changes = TRUE
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_SET_MACHINE | INTERACT_MACHINE_REQUIRES_SIGHT
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_REQUIRES_SIGHT
/obj/machinery/computer/camera_advanced/Initialize(mapload)
. = ..()
@@ -76,12 +76,10 @@
/obj/machinery/computer/camera_advanced/remove_eye_control(mob/living/user)
if(!user)
return
for(var/V in actions)
var/datum/action/A = V
A.Remove(user)
for(var/V in eyeobj.visibleCameraChunks)
var/datum/camerachunk/C = V
C.remove(eyeobj)
for(var/datum/action/actions_removed as anything in actions)
actions_removed.Remove(user)
for(var/datum/camerachunk/camerachunks_gone as anything in eyeobj.visibleCameraChunks)
camerachunks_gone.remove(eyeobj)
if(user.client)
user.reset_perspective(null)
if(eyeobj.visible_icon && user.client)
@@ -91,12 +89,12 @@
eyeobj.eye_user = null
user.remote_control = null
current_user = null
user.unset_machine()
unset_machine(user)
playsound(src, 'sound/machines/terminal_off.ogg', 25, FALSE)
/obj/machinery/computer/camera_advanced/check_eye(mob/user)
if(!can_use(user) || (issilicon(user) && !user.has_unlimited_silicon_privilege))
user.unset_machine()
unset_machine(user)
/obj/machinery/computer/camera_advanced/Destroy()
if(eyeobj)
@@ -105,7 +103,7 @@
current_user = null
return ..()
/obj/machinery/computer/camera_advanced/on_unset_machine(mob/M)
/obj/machinery/computer/camera_advanced/proc/unset_machine(mob/M)
if(M == current_user)
remove_eye_control(M)
@@ -155,7 +153,7 @@
give_eye_control(L)
eyeobj.setLoc(camera_location)
else
user.unset_machine()
unset_machine(user)
else
give_eye_control(L)
eyeobj.setLoc(eyeobj.loc)
@@ -400,7 +400,6 @@
. = TRUE
add_fingerprint(usr)
usr.set_machine(src)
switch(action)
// Connect this DNA Console to a nearby DNA Scanner
@@ -1,4 +1,5 @@
/obj/machinery/computer/prisoner
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_REQUIRES_LITERACY
var/obj/item/card/id/advanced/prisoner/contained_id
/obj/machinery/computer/prisoner/Destroy()
@@ -106,6 +106,7 @@
base_icon_state = "access_control"
name = "access console"
desc = "A small console that can cycle opening between two airlocks."
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OPEN_SILICON|INTERACT_MACHINE_SET_MACHINE
var/obj/machinery/door/airlock/interiorAirlock
var/obj/machinery/door/airlock/exteriorAirlock
var/idInterior
@@ -12,7 +12,7 @@
armor_type = /datum/armor/machinery_newscaster
max_integrity = 200
integrity_failure = 0.25
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE|INTERACT_MACHINE_REQUIRES_LITERACY
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_REQUIRES_LITERACY
///Reference to the currently logged in user.
var/datum/bank_account/current_user
///Name of the logged in user.
@@ -351,7 +351,6 @@ GLOBAL_LIST_INIT(channel_tokens, list(
make_syndie()
/obj/item/radio/headset/screwdriver_act(mob/living/user, obj/item/tool)
user.set_machine(src)
if(keyslot || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
@@ -373,8 +372,6 @@ GLOBAL_LIST_INIT(channel_tokens, list(
return TRUE
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
user.set_machine(src)
if(istype(W, /obj/item/encryptionkey))
if(keyslot && keyslot2)
to_chat(user, span_warning("The headset can't hold another key!"))
@@ -69,7 +69,7 @@
name = "psyker navigation warper"
desc = "Uses amplified brainwaves to designate and map a precise transit location for the psyker shuttle."
icon_screen = "recharge_comp_on"
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_SET_MACHINE //blind friendly
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON //blind friendly
x_offset = 0
y_offset = 11
-10
View File
@@ -151,16 +151,6 @@
. = ..()
. += span_notice("\The [src] [secured? "is secured and ready to be used!" : "can be attached to other things."]")
/obj/item/assembly/attack_self(mob/user)
if(!user)
return FALSE
user.set_machine(src)
interact(user)
return TRUE
/obj/item/assembly/interact(mob/user)
return ui_interact(user)
/obj/item/assembly/ui_host(mob/user)
// In order, return:
// - The conencted wiring datum's owner, or
@@ -13,7 +13,7 @@ Passive gate is similar to the regular pump except:
desc = "A one-way air valve that does not require power. Passes gas when the output pressure is lower than the target pressure."
can_unwrench = TRUE
shift_underlay_only = FALSE
interaction_flags_machine = INTERACT_MACHINE_OFFLINE | INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_SET_MACHINE
interaction_flags_machine = INTERACT_MACHINE_OFFLINE | INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON
construction_type = /obj/item/pipe/directional
pipe_state = "passivegate"
use_power = NO_POWER_USE
@@ -10,6 +10,7 @@
use_power = NO_POWER_USE
layer = BELOW_OBJ_LAYER
max_integrity = 300
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OPEN_SILICON|INTERACT_MACHINE_SET_MACHINE
var/list/product_types = list()
var/selected_flavour = ICE_CREAM_VANILLA
var/obj/item/reagent_containers/beaker
@@ -516,7 +516,6 @@
if(isAI(user) && (machine_stat & NOPOWER))
return
user.set_machine(src)
switch(choice)
if("eject")
eject()
@@ -70,6 +70,7 @@
icon = 'icons/obj/machines/mining_machines.dmi'
icon_state = "console"
density = TRUE
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OPEN_SILICON|INTERACT_MACHINE_SET_MACHINE
/// Connected ore processing machine.
var/obj/machinery/mineral/processing_unit/processing_machine
+1
View File
@@ -8,6 +8,7 @@ GLOBAL_LIST_EMPTY(silo_access_logs)
icon_state = "silo"
density = TRUE
circuit = /obj/item/circuitboard/machine/ore_silo
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OPEN_SILICON|INTERACT_MACHINE_SET_MACHINE
/// The machine UI's page of logs showing ore history.
var/log_page = 1
-2
View File
@@ -83,8 +83,6 @@
return
if(!Adjacent(usr))
return
add_fingerprint(usr)
usr.set_machine(src)
switch(action)
if("removeall")
dump_box_contents()
-2
View File
@@ -26,7 +26,6 @@
if(!pai.encrypt_mod)
to_chat(user, span_alert("Encryption Key ports not configured."))
return
user.set_machine(src)
pai.radio.attackby(used, user, params)
to_chat(user, span_notice("You insert [used] into the [src]."))
return
@@ -35,7 +34,6 @@
/obj/item/pai_card/attack_self(mob/user)
if(!in_range(src, user))
return
user.set_machine(src)
ui_interact(user)
/obj/item/pai_card/Destroy()
+1
View File
@@ -26,6 +26,7 @@
density = TRUE
use_power = IDLE_POWER_USE
circuit = /obj/item/circuitboard/machine/experimentor
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN|INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_OPEN_SILICON|INTERACT_MACHINE_SET_MACHINE
var/recentlyExperimented = 0
/// Weakref to the first ian we can find at init
var/datum/weakref/tracked_ian_ref
@@ -107,10 +107,7 @@
)
/obj/machinery/rnd/production/ui_interact(mob/user, datum/tgui/ui)
user.set_machine(src)
ui = SStgui.try_update_ui(user, src, ui)
if(!ui)
ui = new(user, src, "Fabricator")
ui.open()
+1 -1
View File
@@ -13,7 +13,7 @@
icon_keyboard = "tech_key"
light_color = LIGHT_COLOR_CYAN
req_access = list()
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON|INTERACT_MACHINE_SET_MACHINE
interaction_flags_machine = INTERACT_MACHINE_ALLOW_SILICON
/// ID of the attached shuttle
var/shuttleId
/// Possible destinations of the attached shuttle
@@ -403,9 +403,6 @@
. = TRUE
add_fingerprint(usr)
usr.set_machine(src)
switch(action)
if("build")
var/designs = params["designs"]