mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
## About The Pull Request This is an update that touches many more things all at once (compared to my other PRs) meant to make PDAs in general feel more consistent and not take away from one of the experiences we want to encourage: interaction between players. 1. Replaced all checks of a 'pda' with a 'modular pc'. This means technically (though not done in-game currently) other modpcs can hold an uplink, and microwaves can charge laptops. 2. Speaking of microwave, they now don't break and require deconstruction if the cell is removed mid-charge. 3. When a Mod PC is out of power, it will now allow the Messenger to work (which now also doesn't consume any additional power), if the app exists on the PC. Here's a video demonstration https://github.com/tgstation/tgstation/assets/53777086/7ae12f81-a271-49b8-95fa-2ba54d2e2d1f 4. Flashlights can't be turned on while the cell is dead 5. I replaced a bunch of program vars with ``program_flags`` and renamed ``usage_flags`` to ``can_run_on_flags``. 6. Added a debug modPC that has every app installed by default. Mafia had some issues in the past that were unknown because Mafia wasn't preinstalled with any tablet so was never in create & destroy nor in any other unit test. This was just an easy solution I had, but PDAs should get more in-depth unit tests in the future for running apps n stuff- I just wanted to make sure no other apps were broken/harddeling. ## Why It's Good For The Game Currently when a PDA dies, its only use is to reply to PDA messages sent to you, since you can still reply to them. Instead of just fixing it and telling players to cope, I thought it would be nice to allow PDA Messenger to still work, as it is a vital app. You can call it some emergency power mode or whatever, I don't really mind the reason behind why it is this way. When I made cells used more on PDAs, my main goal was to encourage upgrading your PDA and/or limiting how many apps you use at once, I did not want this to hit on players who use it as a form of interaction. This is the best of both worlds, I think. The rest of the changes is just for modularity, if some downstream wants to add tablets, phone computers, or whatever the hell else, they can still get just as far as PDAs should be able to get to, hopefully. ## Changelog 🆑 add: PDAs with a dead power cell are now limited to using their Messenger app. fix: Microwaves now stop charging PDAs if the cell was removed mid-charge. fix: Microwaves can now charge laptops. fix: PDA Flashlights can't be turned on while the PDA is dead. fix: You can now hold a laptop up to a camera (if it has a notekeeper app installed) like PDAs already could. /🆑 --------- Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
97 lines
2.9 KiB
Plaintext
97 lines
2.9 KiB
Plaintext
/datum/computer_file/program/status
|
|
filename = "statusdisplay"
|
|
filedesc = "Status Display"
|
|
program_icon = "signal"
|
|
program_open_overlay = "generic"
|
|
size = 1
|
|
|
|
extended_desc = "An app used to change the message on the station status displays."
|
|
tgui_id = "NtosStatus"
|
|
|
|
can_run_on_flags = PROGRAM_ALL
|
|
program_flags = PROGRAM_REQUIRES_NTNET
|
|
|
|
var/upper_text = ""
|
|
var/lower_text = ""
|
|
|
|
/**
|
|
* Post status display radio packet.
|
|
* Arguments:
|
|
* * command - the status display command
|
|
* * data1 - the data1 value, as defined by status displays
|
|
* * data2 - the data2 value, as defined by status displays
|
|
*/
|
|
/datum/computer_file/program/status/proc/post_status(command, data1, data2)
|
|
var/datum/radio_frequency/frequency = SSradio.return_frequency(FREQ_STATUS_DISPLAYS)
|
|
if(!frequency)
|
|
return
|
|
|
|
var/datum/signal/status_signal = new(list("command" = command))
|
|
switch(command)
|
|
if("message")
|
|
status_signal.data["top_text"] = data1
|
|
status_signal.data["bottom_text"] = data2
|
|
if("alert")
|
|
status_signal.data["picture_state"] = data1
|
|
|
|
frequency.post_signal(src, status_signal)
|
|
|
|
/**
|
|
* Post a message to status displays
|
|
* Arguments:
|
|
* * upper - Top text
|
|
* * lower - Bottom text
|
|
*/
|
|
/datum/computer_file/program/status/proc/post_message(upper, lower)
|
|
post_status("message", upper, lower)
|
|
log_game("[key_name(usr)] has changed the station status display message to \"[upper] [lower]\" [loc_name(usr)]")
|
|
|
|
/**
|
|
* Post a picture to status displays
|
|
* Arguments:
|
|
* * picture - The picture name
|
|
*/
|
|
/datum/computer_file/program/status/proc/post_picture(picture)
|
|
if (!(picture in GLOB.status_display_approved_pictures))
|
|
return
|
|
if(picture in GLOB.status_display_state_pictures)
|
|
post_status(picture)
|
|
else
|
|
if(picture == "currentalert") // You cannot set Code Blue display during Code Red and similiar
|
|
switch(SSsecurity_level.get_current_level_as_number())
|
|
if(SEC_LEVEL_DELTA)
|
|
post_status("alert", "deltaalert")
|
|
if(SEC_LEVEL_RED)
|
|
post_status("alert", "redalert")
|
|
if(SEC_LEVEL_BLUE)
|
|
post_status("alert", "bluealert")
|
|
if(SEC_LEVEL_GREEN)
|
|
post_status("alert", "greenalert")
|
|
else
|
|
post_status("alert", picture)
|
|
|
|
log_game("[key_name(usr)] has changed the station status display message to \"[picture]\" [loc_name(usr)]")
|
|
|
|
/datum/computer_file/program/status/ui_act(action, list/params, datum/tgui/ui)
|
|
switch(action)
|
|
if("setStatusMessage")
|
|
upper_text = reject_bad_text(params["upperText"] || "", MAX_STATUS_LINE_LENGTH)
|
|
lower_text = reject_bad_text(params["lowerText"] || "", MAX_STATUS_LINE_LENGTH)
|
|
|
|
post_message(upper_text, lower_text)
|
|
if("setStatusPicture")
|
|
post_picture(params["picture"])
|
|
|
|
/datum/computer_file/program/status/ui_static_data(mob/user)
|
|
var/list/data = list()
|
|
data["maxStatusLineLength"] = MAX_STATUS_LINE_LENGTH
|
|
return data
|
|
|
|
/datum/computer_file/program/status/ui_data(mob/user)
|
|
var/list/data = list()
|
|
|
|
data["upperText"] = upper_text
|
|
data["lowerText"] = lower_text
|
|
|
|
return data
|