Skip to content

Commit 2373454

Browse files
authored
BarDrone Law TGUI & button (#4203)
* 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 * commenting updates * indent fix lol i didn't use space indentation i promise * guh
1 parent 718da63 commit 2373454

File tree

3 files changed

+107
-0
lines changed

3 files changed

+107
-0
lines changed

code/modules/shuttle/special.dm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,10 @@
191191
"<span class='warning'>These rules are at admin discretion and will be heavily enforced. If you have questions about these rules AHELP it.</span>\n"+\
192192
"<span class='warning'><u></u></span>\n"+\
193193
"<span class='notice'>Prefix your message with :b to speak in Drone Chat.</span>\n"
194+
var/static/list/actions_to_add = list(
195+
/datum/action/drone/bar/information,
196+
)
197+
194198

195199
/mob/living/basic/drone/snowflake/bardrone/Initialize(mapload)
196200
. = ..()

monkestation/code/modules/mob/living/basic/drone/bardrone.dm

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,38 @@
4545
to_chat(user, span_danger("You need to play [playtime_left] more as [required_role] to spawn as a Bardrone!"))
4646
return FALSE
4747
return ..()
48+
49+
/datum/action/drone/bar/information //sets up action button datum for the button itself
50+
name = "Bar Drone Information"
51+
desc = "Shows information and laws for the Bar Drone."
52+
button_icon = 'icons/obj/art/musician.dmi'
53+
button_icon_state = "synth"
54+
55+
/datum/action/drone/bar/information/Trigger(trigger_flags) //what happens when the button is pressed
56+
var/datum/drone/bar/information/tgui = new(usr)
57+
tgui.ui_interact(usr)
58+
59+
/datum/drone/bar/information //datum required for the tgui component
60+
61+
/datum/drone/bar/information/ui_close()
62+
qdel(src)
63+
64+
/datum/drone/bar/information/ui_interact(mob/user, datum/tgui/ui)
65+
ui = SStgui.try_update_ui(user, src, ui)
66+
if(!ui)
67+
ui = new(user, src, "BarDrone")
68+
ui.open()
69+
70+
/datum/drone/bar/information/ui_state(mob/user) //should always be accessible, only inherited by bardrone anyway
71+
return GLOB.always_state
72+
73+
/mob/living/basic/drone/snowflake/bardrone/Initialize(mapload) //initialization of the action button onto the linked mob (only bardrones)
74+
. = ..()
75+
for (var/action_type in actions_to_add)
76+
var/datum/action/new_action = new action_type(src)
77+
new_action.Grant(src)
78+
79+
/mob/living/basic/drone/snowflake/bardrone/Login() //force open the tgui window with laws on login to the bardrone mob.
80+
..()
81+
var/datum/drone/bar/information/tgui = new(usr)
82+
tgui.ui_interact(usr)
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
import { Section, Box, LabeledList } from '../components';
2+
import { Window } from '../layouts';
3+
4+
export const BarDrone = () => {
5+
return (
6+
<Window title="Drone Information" width={600} height={320}>
7+
<Section title="">
8+
<Box color="red" fontSize="18px" margin="5px 0">
9+
<b>
10+
DO NOT INTERFERE WITH THE ROUND AS A DRONE OR YOU WILL BE DRONE
11+
BANNED
12+
</b>
13+
</Box>
14+
<Box fontSize="14px" margin="5px 0" color="#ffffff">
15+
Drones are a ghost role that are allowed to fix the station and build
16+
things. Interfering with the round as a drone is against the rules.
17+
</Box>
18+
<Box fontSize="14px" color="#ffffff" margin="5px 0">
19+
Actions that constitute interference include, but are not limited to:
20+
</Box>
21+
<LabeledList>
22+
<LabeledList.Item label="">
23+
<Box fontSize="14px" color="#ffffff">
24+
- Interacting with round-critical objects (IDs, weapons,
25+
contraband, powersinks, bombs, etc.)
26+
</Box>
27+
</LabeledList.Item>
28+
<LabeledList.Item label="">
29+
<Box fontSize="14px" color="#ffffff">
30+
- Interacting with living beings (communication, attacking,
31+
healing, etc.)
32+
</Box>
33+
</LabeledList.Item>
34+
<LabeledList.Item label="">
35+
<Box fontSize="14px" color="#ffffff">
36+
- Interacting with non-living beings (dragging bodies, looting
37+
bodies, etc.)
38+
</Box>
39+
</LabeledList.Item>
40+
</LabeledList>
41+
<Box color="red" fontSize="14px" margin="10px 0">
42+
These rules are at admin discretion and will be heavily enforced.
43+
</Box>
44+
<Box
45+
color="red"
46+
fontSize="14px"
47+
margin="10px 0"
48+
textDecoration="underline, bold"
49+
>
50+
<b>
51+
If you do not have the regular drone laws, follow your laws to the
52+
best of your ability.
53+
</b>
54+
</Box>
55+
<Box fontSize="14px" color="#ffffff" margin="5px 0">
56+
Prefix your message with <b>:b</b> to speak in Drone Chat.
57+
</Box>
58+
<Box fontSize="14px" color="#ffffff" margin="5px 0">
59+
Drone Rules and more info can be found at our wiki{' '}
60+
<a href="https://wiki.monkestation.com/en/jobs/non-human/drone">
61+
HERE
62+
</a>
63+
.
64+
</Box>
65+
</Section>
66+
</Window>
67+
);
68+
};

0 commit comments

Comments
 (0)