mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 19:51:59 +00:00
PDAs open their messenger when replying to messages through chat (#68355)
* Clicking Reply in PDA messages now opens your PDA messenger app. * Additionally does a ton of PDA code improvement.
This commit is contained in:
committed by
GitHub
parent
a8b911a549
commit
9c0ac84ba6
@@ -3,6 +3,7 @@
|
||||
var/filetype = "XXX" // File full names are [filename].[filetype] so like NewFile.XXX in this case
|
||||
var/size = 1 // File size in GQ. Integers only!
|
||||
var/obj/item/computer_hardware/hard_drive/holder // Holder that contains this file.
|
||||
var/obj/item/modular_computer/computer
|
||||
var/unsendable = FALSE // Whether the file may be sent to someone via NTNet transfer or other means.
|
||||
var/undeletable = FALSE // Whether the file may be deleted. Setting to TRUE prevents deletion/renaming/etc.
|
||||
var/uid // UID of this file
|
||||
@@ -18,9 +19,10 @@
|
||||
|
||||
holder.remove_file(src)
|
||||
// holder.holder is the computer that has drive installed. If we are Destroy()ing program that's currently running kill it.
|
||||
if(holder.holder && holder.holder.active_program == src)
|
||||
holder.holder.kill_program(forced = TRUE)
|
||||
if(computer && computer.active_program == src)
|
||||
computer.kill_program(forced = TRUE)
|
||||
holder = null
|
||||
computer = null
|
||||
return ..()
|
||||
|
||||
// Returns independent copy of this file.
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
var/list/transfer_access = list()
|
||||
/// PROGRAM_STATE_KILLED or PROGRAM_STATE_BACKGROUND or PROGRAM_STATE_ACTIVE - specifies whether this program is running.
|
||||
var/program_state = PROGRAM_STATE_KILLED
|
||||
/// Device that runs this program.
|
||||
var/obj/item/modular_computer/computer
|
||||
/// User-friendly name of this program.
|
||||
var/filedesc = "Unknown Program"
|
||||
/// Short description of this program's function.
|
||||
@@ -46,15 +44,6 @@
|
||||
/// How well this program will help combat detomatix viruses.
|
||||
var/detomatix_resistance = NONE
|
||||
|
||||
/datum/computer_file/program/New(obj/item/modular_computer/comp = null)
|
||||
..()
|
||||
if(comp && istype(comp))
|
||||
computer = comp
|
||||
|
||||
/datum/computer_file/program/Destroy()
|
||||
computer = null
|
||||
. = ..()
|
||||
|
||||
/datum/computer_file/program/clone()
|
||||
var/datum/computer_file/program/temp = ..()
|
||||
temp.required_access = required_access
|
||||
@@ -108,7 +97,7 @@
|
||||
return TRUE
|
||||
|
||||
/**
|
||||
*Check if the user can run program. Only humans and silicons can operate computer. Automatically called in run_program()
|
||||
*Check if the user can run program. Only humans and silicons can operate computer. Automatically called in on_start()
|
||||
*ID must be inserted into a card slot to be read. If the program is not currently installed (as is the case when
|
||||
*NT Software Hub is checking available software), a list can be given to be used instead.
|
||||
*Arguments:
|
||||
@@ -167,7 +156,7 @@
|
||||
|
||||
// This is performed on program startup. May be overridden to add extra logic. Remember to include ..() call. Return 1 on success, 0 on failure.
|
||||
// When implementing new program based device, use this to run the program.
|
||||
/datum/computer_file/program/proc/run_program(mob/living/user)
|
||||
/datum/computer_file/program/proc/on_start(mob/living/user)
|
||||
if(can_run(user, 1))
|
||||
if(requires_ntnet)
|
||||
var/obj/item/card/id/ID
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
if(length(alert_control.listener.alarms))
|
||||
has_alert = TRUE
|
||||
|
||||
/datum/computer_file/program/alarm_monitor/run_program(mob/user)
|
||||
/datum/computer_file/program/alarm_monitor/on_start(mob/user)
|
||||
. = ..(user)
|
||||
GLOB.alarmdisplay += src
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
program_icon = "magnet"
|
||||
var/armed = 0
|
||||
|
||||
/datum/computer_file/program/revelation/run_program(mob/living/user)
|
||||
/datum/computer_file/program/revelation/on_start(mob/living/user)
|
||||
. = ..(user)
|
||||
if(armed)
|
||||
activate()
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
PROGRAM_CATEGORY_MISC,
|
||||
)
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/run_program()
|
||||
/datum/computer_file/program/ntnetdownload/on_start()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_station_software
|
||||
antag_repo = SSnetworks.station_network.available_antag_software
|
||||
@@ -203,7 +203,7 @@
|
||||
tgui_id = "NtosNetDownloader"
|
||||
emagged = TRUE
|
||||
|
||||
/datum/computer_file/program/ntnetdownload/syndicate/run_program()
|
||||
/datum/computer_file/program/ntnetdownload/syndicate/on_start()
|
||||
. = ..()
|
||||
main_repo = SSnetworks.station_network.available_antag_software
|
||||
antag_repo = null
|
||||
|
||||
@@ -358,10 +358,18 @@
|
||||
if (ringer_status)
|
||||
computer.ring(ringtone)
|
||||
|
||||
/// topic call that answers to people pressing "(Reply)" in chat
|
||||
/datum/computer_file/program/messenger/Topic(href, href_list)
|
||||
..()
|
||||
if(QDELETED(src))
|
||||
return
|
||||
// send an activation message, open the messenger, kill whoever reads this nesting mess
|
||||
if(!computer.enabled)
|
||||
if(!computer.turn_on(usr, open_ui = FALSE))
|
||||
return
|
||||
if(computer.active_program != src)
|
||||
if(!computer.open_program(usr, src))
|
||||
return
|
||||
if(!href_list["close"] && usr.canUseTopic(computer, BE_CLOSE, FALSE, NO_TK))
|
||||
switch(href_list["choice"])
|
||||
if("Message")
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
else
|
||||
ui_header = "ntnrc_idle.gif"
|
||||
|
||||
/datum/computer_file/program/chatclient/run_program(mob/living/user)
|
||||
/datum/computer_file/program/chatclient/on_start(mob/living/user)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
var/next_record = 0
|
||||
|
||||
|
||||
/datum/computer_file/program/power_monitor/run_program(mob/living/user)
|
||||
/datum/computer_file/program/power_monitor/on_start(mob/living/user)
|
||||
. = ..(user)
|
||||
search()
|
||||
history["supply"] = list()
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
///Used by the tgui interface, themed for NT or Syndicate colors.
|
||||
var/pointercolor = "green"
|
||||
|
||||
/datum/computer_file/program/radar/run_program(mob/living/user)
|
||||
/datum/computer_file/program/radar/on_start(mob/living/user)
|
||||
. = ..()
|
||||
if(.)
|
||||
START_PROCESSING(SSfastprocess, src)
|
||||
@@ -310,7 +310,7 @@
|
||||
arrowstyle = "ntosradarpointerS.png"
|
||||
pointercolor = "red"
|
||||
|
||||
/datum/computer_file/program/radar/fission360/run_program(mob/living/user)
|
||||
/datum/computer_file/program/radar/fission360/on_start(mob/living/user)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
tgui_id = "NtosRobotact"
|
||||
program_icon = "terminal"
|
||||
|
||||
/datum/computer_file/program/robotact/run_program(mob/living/user)
|
||||
/datum/computer_file/program/robotact/on_start(mob/living/user)
|
||||
if(!istype(computer, /obj/item/modular_computer/tablet/integrated))
|
||||
to_chat(user, span_warning("A warning flashes across \the [computer]: Device Incompatible."))
|
||||
return FALSE
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
if(istype(computer))
|
||||
computer.update_appearance()
|
||||
|
||||
/datum/computer_file/program/supermatter_monitor/run_program(mob/living/user)
|
||||
/datum/computer_file/program/supermatter_monitor/on_start(mob/living/user)
|
||||
. = ..(user)
|
||||
if(!(active in GLOB.machines))
|
||||
active = null
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/// Sequence var for the id cache
|
||||
var/id_cache_seq = 1
|
||||
|
||||
/datum/computer_file/program/science/run_program(mob/living/user)
|
||||
/datum/computer_file/program/science/on_start(mob/living/user)
|
||||
. = ..()
|
||||
stored_research = SSresearch.science_tech
|
||||
|
||||
|
||||
Reference in New Issue
Block a user