From 092c8d07847566fda230f43a9f5cd41eebd4d2f5 Mon Sep 17 00:00:00 2001 From: Veth-s Date: Mon, 11 Nov 2024 04:55:31 +0000 Subject: [PATCH 1/4] BarDrone tgui window BarDrone tgui window that pops up when you select mob, and has a nice little button to review your laws at any times, as well as a link to the wiki, as requested by poooooooooooba --- code/modules/shuttle/special.dm | 3 + .../mob/living/basic/drone/bardrone.dm | 35 ++++++++++ tgui/packages/tgui/interfaces/BarDrone.tsx | 68 +++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 tgui/packages/tgui/interfaces/BarDrone.tsx diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index ae4dd19fc820..190475b292f1 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -162,6 +162,9 @@ unique_name = FALSE // disables the (123) number suffix initial_language_holder = /datum/language_holder/universal default_storage = null + var/static/list/actions_to_add = list( + /datum/action/drone/bar/information, + ) /mob/living/basic/drone/snowflake/bardrone/Initialize(mapload) . = ..() diff --git a/monkestation/code/modules/mob/living/basic/drone/bardrone.dm b/monkestation/code/modules/mob/living/basic/drone/bardrone.dm index ec5f3f1a37a8..98c875f6296a 100644 --- a/monkestation/code/modules/mob/living/basic/drone/bardrone.dm +++ b/monkestation/code/modules/mob/living/basic/drone/bardrone.dm @@ -45,3 +45,38 @@ to_chat(user, span_danger("You need to play [playtime_left] more as [required_role] to spawn as a Bardrone!")) return FALSE return ..() + +/datum/action/drone/bar/information + name = "Bar Drone Information" + desc = "Shows information and laws for the Bar Drone." + button_icon = 'icons/obj/art/musician.dmi' // The icon file path + button_icon_state = "synth" // Icon state to show on the button + +/datum/action/drone/bar/information/Trigger(trigger_flags) + var/datum/drone/bar/information/tgui = new(usr) + tgui.ui_interact(usr) + +/datum/drone/bar/information + +/datum/drone/bar/information/ui_close() + qdel(src) + +/datum/drone/bar/information/ui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if(!ui) + ui = new(user, src, "BarDrone") + ui.open() + +/datum/drone/bar/information/ui_state(mob/user) + return GLOB.always_state + +/mob/living/basic/drone/snowflake/bardrone/Initialize(mapload) + . = ..() + for (var/action_type in actions_to_add) + var/datum/action/new_action = new action_type(src) + new_action.Grant(src) + +/mob/living/basic/drone/snowflake/bardrone/Login() + ..() + var/datum/drone/bar/information/tgui = new(usr) + tgui.ui_interact(usr) diff --git a/tgui/packages/tgui/interfaces/BarDrone.tsx b/tgui/packages/tgui/interfaces/BarDrone.tsx new file mode 100644 index 000000000000..6e01200ed2ea --- /dev/null +++ b/tgui/packages/tgui/interfaces/BarDrone.tsx @@ -0,0 +1,68 @@ +import { Section, Box, LabeledList } from '../components'; +import { Window } from '../layouts'; + +export const BarDrone = () => { + return ( + +
+ + + DO NOT INTERFERE WITH THE ROUND AS A DRONE OR YOU WILL BE DRONE + BANNED + + + + Drones are a ghost role that are allowed to fix the station and build + things. Interfering with the round as a drone is against the rules. + + + Actions that constitute interference include, but are not limited to: + + + + + - Interacting with round-critical objects (IDs, weapons, + contraband, powersinks, bombs, etc.) + + + + + - Interacting with living beings (communication, attacking, + healing, etc.) + + + + + - Interacting with non-living beings (dragging bodies, looting + bodies, etc.) + + + + + These rules are at admin discretion and will be heavily enforced. + + + + If you do not have the regular drone laws, follow your laws to the + best of your ability. + + + + Prefix your message with :b to speak in Drone Chat. + + + Drone Rules and more info can be found at our wiki{' '} + + HERE + + . + +
+
+ ); +}; From 15d41892632ab3a7ddbf462bcc69aa77acb2a352 Mon Sep 17 00:00:00 2001 From: Veth-s Date: Mon, 11 Nov 2024 04:59:57 +0000 Subject: [PATCH 2/4] commenting updates --- code/modules/shuttle/special.dm | 1 + .../modules/mob/living/basic/drone/bardrone.dm | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index 190475b292f1..08372a70e4d5 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -162,6 +162,7 @@ unique_name = FALSE // disables the (123) number suffix initial_language_holder = /datum/language_holder/universal default_storage = null + //list used to add actions to the bardrone. Used a list incase we need to add more in future var/static/list/actions_to_add = list( /datum/action/drone/bar/information, ) diff --git a/monkestation/code/modules/mob/living/basic/drone/bardrone.dm b/monkestation/code/modules/mob/living/basic/drone/bardrone.dm index 98c875f6296a..65cb60407b9f 100644 --- a/monkestation/code/modules/mob/living/basic/drone/bardrone.dm +++ b/monkestation/code/modules/mob/living/basic/drone/bardrone.dm @@ -46,17 +46,17 @@ return FALSE return ..() -/datum/action/drone/bar/information +/datum/action/drone/bar/information //sets up action button datum for the button itself name = "Bar Drone Information" desc = "Shows information and laws for the Bar Drone." - button_icon = 'icons/obj/art/musician.dmi' // The icon file path - button_icon_state = "synth" // Icon state to show on the button + button_icon = 'icons/obj/art/musician.dmi' + button_icon_state = "synth" -/datum/action/drone/bar/information/Trigger(trigger_flags) +/datum/action/drone/bar/information/Trigger(trigger_flags) //what happens when the button is pressed var/datum/drone/bar/information/tgui = new(usr) tgui.ui_interact(usr) -/datum/drone/bar/information +/datum/drone/bar/information //datum required for the tgui component /datum/drone/bar/information/ui_close() qdel(src) @@ -67,16 +67,16 @@ ui = new(user, src, "BarDrone") ui.open() -/datum/drone/bar/information/ui_state(mob/user) +/datum/drone/bar/information/ui_state(mob/user) //should always be accessible, only inherited by bardrone anyway return GLOB.always_state -/mob/living/basic/drone/snowflake/bardrone/Initialize(mapload) +/mob/living/basic/drone/snowflake/bardrone/Initialize(mapload) //initialization of the action button onto the linked mob (only bardrones) . = ..() for (var/action_type in actions_to_add) var/datum/action/new_action = new action_type(src) new_action.Grant(src) -/mob/living/basic/drone/snowflake/bardrone/Login() +/mob/living/basic/drone/snowflake/bardrone/Login() //force open the tgui window with laws on login to the bardrone mob. ..() var/datum/drone/bar/information/tgui = new(usr) tgui.ui_interact(usr) From 135b385a85e06a8aa057020665bc63bfe9197d0e Mon Sep 17 00:00:00 2001 From: Veth-s Date: Mon, 11 Nov 2024 05:09:33 +0000 Subject: [PATCH 3/4] indent fix lol i didn't use space indentation i promise --- code/modules/shuttle/special.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index dc2de1b6ee16..fbeadde3a519 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -191,7 +191,6 @@ "These rules are at admin discretion and will be heavily enforced. If you have questions about these rules AHELP it.\n"+\ "\n"+\ "Prefix your message with :b to speak in Drone Chat.\n" - //list used to add actions to the bardrone. Used a list incase we need to add more in future var/static/list/actions_to_add = list( /datum/action/drone/bar/information, From 6c05703451837743879e6235017ec8068b6f6594 Mon Sep 17 00:00:00 2001 From: Veth-s Date: Mon, 11 Nov 2024 05:13:20 +0000 Subject: [PATCH 4/4] guh --- code/modules/shuttle/special.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/shuttle/special.dm b/code/modules/shuttle/special.dm index fbeadde3a519..11080aaad1b7 100644 --- a/code/modules/shuttle/special.dm +++ b/code/modules/shuttle/special.dm @@ -191,7 +191,6 @@ "These rules are at admin discretion and will be heavily enforced. If you have questions about these rules AHELP it.\n"+\ "\n"+\ "Prefix your message with :b to speak in Drone Chat.\n" - //list used to add actions to the bardrone. Used a list incase we need to add more in future var/static/list/actions_to_add = list( /datum/action/drone/bar/information, )