Files
Bubberstation/code/datums/request_message.dm
Profakos dde5785f82 Request Console refactor (#75067)
## About The Pull Request

This PR changes the request consoles in the folowing ways:

- The request console's had some very old UI, so I decided to convert it
to tgUI.
- Cleans up and changes various variable names. Also removes a
historical comment (desouls the file)
- Sending an announcement now has a cooldown of 30 seconds like the
message console priority announcement
- Audio feedback on successful and erroneous message give a little audio
feedback
- Reply is now Quick Reply, which you do in a popup

I have half a mind to remove the long material list from the ORM, as
some people told me I should, but for now it stays.

<details> 
<summary>Screenshots of the new UI</summary>


![image](https://user-images.githubusercontent.com/2676196/235372296-eab8f99e-489c-4268-8c09-e5998ebbfeec.png)


![image](https://user-images.githubusercontent.com/2676196/235372122-c52b6663-a34c-43a0-be3c-87211a2116d8.png)


![image](https://user-images.githubusercontent.com/2676196/235372030-c465416c-9a0e-4ef2-8c0c-ea104c85f44d.png)

</details>

I originally planned to add mapping helpers, but decided to delay it
until a future PR.

## Why It's Good For The Game

TgUI is good and powerful.

## Changelog

🆑
refactor: converts the request console to tgui
/🆑
2023-05-06 18:07:24 -07:00

58 lines
2.1 KiB
Plaintext

/datum/request_message
/// The r5tname of the department request console that sent the message
var/sender_department = ""
/// The time when the message arrived
var/received_time = null
/// The message itself
var/content = ""
/// The name on the ID that verified the message
var/message_verified_by = ""
/// The name of the stamp that verified the message
var/message_stamped_by = ""
/// The priority of the message
var/priority = ""
/// The radio frequency the message should be broadcasted on
var/radio_freq = null
/// The type of the request
var/request_type = ""
/// A list to be appended after the message, for example, list of ores
var/appended_list = list()
/datum/request_message/New(data)
sender_department = data["sender_department"]
received_time = station_time_timestamp()
content = data["message"]
message_verified_by = data["verified"]
message_stamped_by = data["stamped"]
priority = data["priority"]
radio_freq = data["notify_freq"]
request_type = data["ore_update"] ? ORE_UPDATE_REQUEST : data["request_type"]
var/list/data_appended_list = data["appended_list"]
if(data_appended_list && data_appended_list.len)
appended_list = data_appended_list
/// Retrieves the alert spoken/blared by the requests console that recieves this message
/datum/request_message/proc/get_alert()
var/authenticated = ""
if(message_verified_by)
authenticated = ", Verified by [message_verified_by] (Authenticated)"
else if (message_stamped_by)
authenticated = ", Stamped by [message_stamped_by] (Authenticated)"
return "Message from [sender_department][authenticated]"
/// Converts the message into a format for the tgui ui_data json
/datum/request_message/proc/message_ui_data()
var/list/ui_data = list()
ui_data["sender_department"] = sender_department
ui_data["received_time"] = received_time
ui_data["content"] = content
ui_data["message_verified_by"] = message_verified_by
ui_data["message_stamped_by"] = message_stamped_by
ui_data["priority"] = priority
ui_data["request_type"] = request_type
ui_data["appended_list"] = appended_list
return ui_data