New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Admin Fax System #70072
Closed
Closed
Add Admin Fax System #70072
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
91e6f3f
Add manager system
twilightwanderer 00d2e05
Correcting Formation
twilightwanderer 2487989
Minor edits
twilightwanderer 9c90210
Renaming functions for better understanding
twilightwanderer c272fff
Separation of static and dynamic data
twilightwanderer a49390d
Combining the same actions into a procedure
twilightwanderer edc14be
Update code/modules/admin/verbs/fax.dm
twilightwanderer bb9da01
Update code/modules/paperwork/fax_manager.dm
twilightwanderer fc8fcf9
Merge branch 'fax-manager' of https://github.com/twilightwanderer/tgs…
twilightwanderer cf07582
Documentation
twilightwanderer 5162445
Adding an authorization button
twilightwanderer File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* This defines the list of faxes managed by the server administrators. They are not physically present in | ||
* the game, but are shown in the fax list as existing. | ||
* Lists: | ||
* * additional_faxes_list - A list of "legal" faxes available with authorization. | ||
* * syndicate_faxes_list - List of faxes available after hacking. | ||
* | ||
* The list consists of the following elements: | ||
* * fax_name - The name displayed in the fax list. | ||
* * button_color - The color of this fax button in the list of all faxes. | ||
*/ | ||
GLOBAL_LIST_INIT(additional_faxes_list, list( | ||
list("fax_name" = "Central Command", "button_color" = "#34c924"), | ||
list("fax_name" = "Clown Planet", "button_color" = "#f4c800"), | ||
)) | ||
|
||
GLOBAL_LIST_INIT(syndicate_faxes_list, list( | ||
list("fax_name" = "Syndicate Coordination Center", "button_color" = "#ff0000"), | ||
list("fax_name" = "Federation of Wizards", "button_color" = "#8b00ff"), | ||
list("fax_name" = "Nar-Sie Church", "button_color" = "#8b0000"), | ||
)) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/client/proc/fax_manager() | ||
set name = "Fax Manager" | ||
set desc = "Open the manager panel to view all requests during the round in progress." | ||
set category = "Admin.Game" | ||
SSblackbox.record_feedback("tally", "admin_verb", 1, "Fax Manager") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! | ||
GLOB.fax_manager.ui_interact(usr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
GLOBAL_DATUM_INIT(fax_manager, /datum/fax_manager, new) | ||
|
||
/** | ||
* Fax Request Manager | ||
* | ||
* In its functionality it is similar to the usual Request Manager, but respectively for faxes. | ||
* This manager allows you to send faxes on behalf of certain virtual faxes to all existing faxes, | ||
* as well as receive faxes in their name from the players. | ||
*/ | ||
/datum/fax_manager | ||
/// A list that contains faxes from players and other related information. You can view the filling of its fields in procedure receive_request. | ||
var/list/requests = list() | ||
twilightwanderer marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/datum/fax_manager/Destroy(force, ...) | ||
QDEL_LIST(requests) | ||
return ..() | ||
|
||
/datum/fax_manager/ui_interact(mob/user, datum/tgui/ui = null) | ||
ui = SStgui.try_update_ui(user, src, ui) | ||
if (!ui) | ||
ui = new(user, src, "FaxManager") | ||
ui.open() | ||
|
||
/datum/fax_manager/ui_state(mob/user) | ||
return GLOB.admin_state | ||
|
||
/datum/fax_manager/ui_static_data(mob/user) | ||
var/list/data = list() | ||
// Record additional faxes on a separate list | ||
data["additional_faxes"] = GLOB.additional_faxes_list + GLOB.syndicate_faxes_list | ||
return data | ||
|
||
/datum/fax_manager/ui_data(mob/user) | ||
var/list/data = list() | ||
//Record a list of all existing faxes. | ||
for(var/obj/machinery/fax/FAX in GLOB.machines) | ||
var/list/fax_data = list() | ||
fax_data["fax_name"] = FAX.fax_name | ||
fax_data["fax_id"] = FAX.fax_id | ||
fax_data["syndicate_network"] = FAX.syndicate_network | ||
data["faxes"] += list(fax_data) | ||
for(var/list/REQUEST in requests) | ||
var/list/request = list() | ||
request["id_message"] = REQUEST["id_message"] | ||
request["time"] = REQUEST["time"] | ||
var/mob/sender = REQUEST["sender"] | ||
request["sender_name"] = sender.name | ||
request["sender_fax_id"] = REQUEST["sender_fax_id"] | ||
request["sender_fax_name"] = REQUEST["sender_fax_name"] | ||
request["receiver_fax_name"] = REQUEST["receiver_fax_name"] | ||
data["requests"] += list(request) | ||
return data | ||
|
||
/datum/fax_manager/ui_act(action, list/params) | ||
. = ..() | ||
if(.) | ||
return | ||
|
||
switch(action) | ||
if("send") | ||
for(var/obj/machinery/fax/FAX in GLOB.machines) | ||
if (FAX.fax_id == params["fax_id"]) | ||
var/obj/item/paper/paper = new() | ||
paper.add_raw_text(params["message"]) | ||
FAX.receive(paper, params["fax_name"]) | ||
return TRUE | ||
if("flw_fax") | ||
for(var/obj/machinery/fax/FAX in GLOB.machines) | ||
if (FAX.fax_id == params["fax_id"]) | ||
usr.client.admin_follow(FAX) | ||
return TRUE | ||
if("read_message") | ||
var/list/REQUEST = get_request(params["id_message"]) | ||
var/obj/item/paper/request/paper = REQUEST["paper"] | ||
paper.ui_interact(usr) | ||
return TRUE | ||
if("flw") | ||
var/list/REQUEST = get_request(params["id_message"]) | ||
usr.client.admin_follow(REQUEST["sender"]) | ||
return TRUE | ||
if("pp") | ||
var/list/REQUEST = get_request(params["id_message"]) | ||
usr.client.holder.show_player_panel(REQUEST["sender"]) | ||
return TRUE | ||
if("vv") | ||
var/list/REQUEST = get_request(params["id_message"]) | ||
usr.client.debug_variables(REQUEST["sender"]) | ||
return TRUE | ||
if("sm") | ||
var/list/REQUEST = get_request(params["id_message"]) | ||
usr.client.cmd_admin_subtle_message(REQUEST["sender"]) | ||
return TRUE | ||
if("logs") | ||
var/list/REQUEST = get_request(params["id_message"]) | ||
if(!ismob(REQUEST["sender"])) | ||
to_chat(usr, "This can only be used on instances of type /mob.", confidential = TRUE) | ||
return TRUE | ||
show_individual_logging_panel(REQUEST["sender"], null, null) | ||
return TRUE | ||
if("smite") | ||
var/list/REQUEST = get_request(params["id_message"]) | ||
if(!check_rights(R_FUN)) | ||
to_chat(usr, "Insufficient permissions to smite, you require +FUN", confidential = TRUE) | ||
return TRUE | ||
var/mob/living/carbon/human/H = REQUEST["sender"] | ||
if (!H || !istype(H)) | ||
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human", confidential = TRUE) | ||
return TRUE | ||
usr.client.smite(H) | ||
return TRUE | ||
|
||
/datum/fax_manager/proc/get_request(id_message) | ||
for(var/list/REQUEST in requests) | ||
if(REQUEST["id_message"] == id_message) | ||
return REQUEST | ||
|
||
/datum/fax_manager/proc/receive_request(mob/sender, obj/machinery/fax/sender_fax, receiver_fax_name, obj/item/paper/paper, receiver_color) | ||
var/list/request = list() | ||
var/obj/item/paper/request/message = new() | ||
request["id_message"] = requests.len | ||
request["time"] = gameTimestamp() | ||
request["sender"] = sender | ||
request["sender_fax_id"] = sender_fax.fax_id | ||
request["sender_fax_name"] = sender_fax.fax_name | ||
request["receiver_fax_name"] = receiver_fax_name | ||
message.copy_properties(paper) | ||
request["paper"] = message | ||
requests += list(request) | ||
var/msg = span_adminnotice("<b><font color=[receiver_color]>[sanitize(receiver_fax_name)] fax</font> received a message from [sanitize(sender_fax.fax_name)][ADMIN_JMP(sender_fax)]/[ADMIN_FULLMONTY(sender)]</b>") | ||
to_chat(GLOB.admins, msg, confidential = TRUE) | ||
for(var/client/admin in GLOB.admins) | ||
if((admin.prefs.chat_toggles & CHAT_PRAYER) && (admin.prefs.toggles & SOUND_PRAYERS)) | ||
SEND_SOUND(admin, sound('sound/machines/printer.ogg')) | ||
|
||
// A special piece of paper for the administrator that will open the interface no matter what. | ||
/obj/item/paper/request/ui_status() | ||
return UI_INTERACTIVE | ||
JohnFulpWillard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// I'm sure there's a better way to transfer it, I just couldn't find it | ||
/obj/item/paper/request/proc/copy_properties(obj/item/paper/paper) | ||
raw_text_inputs = paper.raw_text_inputs | ||
raw_stamp_data = paper.raw_stamp_data | ||
raw_field_input_data = paper.raw_field_input_data | ||
show_written_words = paper.show_written_words | ||
stamp_cache = paper.stamp_cache | ||
contact_poison = paper.contact_poison | ||
contact_poison_volume = paper.contact_poison_volume | ||
default_raw_text = paper.default_raw_text | ||
input_field_count = paper.input_field_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this seems nice, I don't think I agree with it being in-game, unless you change the methods to gain these.
My thinking is limiting individual faxes to specific accesses (Centcom is Cap/Lawyer, Clown planet is Clown, Syndicate is Syndie access (the one that Agent IDs have), Nar'Sie could be maybe a culted fax using twisted construction, wizard federation I can't really explain at all).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand your criticism. But I still want to defend my approach. First of all, I'm afraid that organizing access for each role would make the system very complicated. Secondly, giving access to certain facsimiles for certain roles will narrow the framework for role-playing. I see no reason to limit the captain to be able to write complaints to Planet of the Clowns, and the clown to write unfunny jokes for the CC. Third, I created the list specifically based on requests from developers of other builds based on TG. They would like to be able to designate their own organizations and factions for their servers. For TG, I entered such organizations for example, and nothing stops them from tweaking or deleting.