Skip to content

Commit

Permalink
sentries in other UIs
Browse files Browse the repository at this point in the history
  • Loading branch information
realforest2001 committed May 27, 2024
1 parent 2bbe3da commit e913a5e
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 39 deletions.
16 changes: 16 additions & 0 deletions code/game/machinery/ARES/ARES_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@
data["security_vents"] = link.get_ares_vents()

data["sentry_setting"] = link.faction_label
data["sentry_setting"] = link.faction_label
data["faction_options"] = link.faction_options

return data

Expand Down Expand Up @@ -549,5 +551,19 @@
aicore_lockdown(user)
return TRUE

if("update_sentries")
playsound = FALSE
var/new_iff = params["chosen_iff"]
if(!new_iff)
to_chat(user, SPAN_WARNING("ERROR: Unknown setting."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(new_iff == link.faction_label)
return FALSE
link.change_iff(new_iff)
playsound(src, 'sound/machines/chime.ogg', 15, 1)
to_chat(user, SPAN_WARNING("Sentry IFF settings updated!"))
return TRUE

if(playsound)
playsound(src, "keyboard_alt", 15, 1)
13 changes: 12 additions & 1 deletion code/game/machinery/ARES/ARES_interface_admin.dm
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
data["access_tickets"] = logged_access

data["security_vents"] = get_ares_vents()

data["sentry_setting"] = faction_label
data["faction_options"] = faction_options

return data

Expand Down Expand Up @@ -525,3 +525,14 @@
return FALSE
aicore_lockdown(user)
return TRUE

if("update_sentries")
var/new_iff = params["chosen_iff"]
if(!new_iff)
to_chat(user, SPAN_WARNING("ERROR: Unknown setting."))
return FALSE
if(new_iff == faction_label)
return FALSE
change_iff(new_iff)
to_chat(user, SPAN_WARNING("Sentry IFF settings updated!"))
return TRUE
4 changes: 2 additions & 2 deletions code/game/machinery/ARES/ARES_interface_apollo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,8 @@
data["access_tickets"] = logged_access

data["security_vents"] = link.get_ares_vents()

data["sentry_setting"] = link.faction_label
data["faction_options"] = list(FACTION_MARINE, FACTION_WY, "USCM-WY", FACTION_ARES)
data["faction_options"] = link.faction_options

return data

Expand Down Expand Up @@ -458,6 +457,7 @@
return FALSE
link.change_iff(new_iff)
playsound(src, 'sound/machines/chime.ogg', 15, 1)
to_chat(user, SPAN_WARNING("Sentry IFF settings updated!"))
return TRUE

if(playsound)
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/ARES/ARES_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ GLOBAL_LIST_INIT(maintenance_categories, list(
///Sentry faction stuff
var/faction_label = FACTION_MARINE
var/list/faction_group = FACTION_LIST_ARES_MARINE
var/list/faction_options = list(FACTION_MARINE, FACTION_WY, "USCM-WY", FACTION_ARES)
var/list/core_sentries = list()

/datum/ares_link/New()
Expand Down
16 changes: 15 additions & 1 deletion code/game/machinery/ARES/apollo_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@
data["access_tickets"] = logged_access

data["security_vents"] = link.get_ares_vents()

data["sentry_setting"] = link.faction_label
data["faction_options"] = link.faction_options

return data

Expand Down Expand Up @@ -472,6 +472,20 @@
aicore_lockdown(user)
return TRUE

if("update_sentries")
playsound = FALSE
var/new_iff = params["chosen_iff"]
if(!new_iff)
to_chat(user, SPAN_WARNING("ERROR: Unknown setting."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(new_iff == link.faction_label)
return FALSE
link.change_iff(new_iff)
playsound(src, 'sound/machines/chime.ogg', 15, 1)
to_chat(user, SPAN_WARNING("Sentry IFF settings updated!"))
return TRUE

if(playsound)
var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg')
playsound(src, sound, 15, TRUE)
15 changes: 15 additions & 0 deletions code/game/machinery/ARES/debug_pda.dm
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@
data["access_tickets"] = logged_access

data["security_vents"] = link.get_ares_vents()
data["sentry_setting"] = link.faction_label
data["faction_options"] = link.faction_options

return data

Expand Down Expand Up @@ -735,6 +737,19 @@
sec_vent.create_gas(VENT_GAS_CN20_XENO, 6, 5 SECONDS)
log_admin("[key_name(user)] released nerve gas from Vent '[sec_vent.vent_tag]' via ARES.")

if("update_sentries")
playsound = FALSE
var/new_iff = params["chosen_iff"]
if(!new_iff)
to_chat(user, SPAN_WARNING("ERROR: Unknown setting."))
playsound(src, 'sound/machines/buzz-two.ogg', 15, 1)
return FALSE
if(new_iff == link.faction_label)
return FALSE
link.change_iff(new_iff)
playsound(src, 'sound/machines/chime.ogg', 15, 1)
to_chat(user, SPAN_WARNING("Sentry IFF settings updated!"))
return TRUE

if(playsound)
var/sound = pick('sound/machines/pda_button1.ogg', 'sound/machines/pda_button2.ogg')
Expand Down
59 changes: 40 additions & 19 deletions tgui/packages/tgui/interfaces/AresAdmin.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useBackend } from '../backend';
import { Box, Button, Flex, Section, Stack } from '../components';
import { Box, Button, Dropdown, Flex, Section, Stack } from '../components';
import { Window } from '../layouts';

const PAGES = {
Expand Down Expand Up @@ -96,8 +96,16 @@ const Login = (props) => {

const MainMenu = (props) => {
const { data, act } = useBackend();
const { logged_in, access_text, last_page, current_menu, sudo, admin_login } =
data;
const {
logged_in,
access_text,
last_page,
current_menu,
sudo,
admin_login,
faction_options,
sentry_setting,
} = data;

return (
<>
Expand Down Expand Up @@ -412,28 +420,41 @@ const MainMenu = (props) => {
color="red"
ml="auto"
px="2rem"
width="50%"
width="100%"
bold
onClick={() => act('page_core_sec')}
>
Nerve Gas Control
</Button>

<Button.Confirm
align="center"
tooltipPosition="top"
tooltip="Activate/Deactivate the AI Core Lockdown."
icon="lock"
color="red"
ml="auto"
px="2rem"
width="50%"
bold
onClick={() => act('security_lockdown')}
disabled={remotelock}
>
AI Core Lockdown
</Button.Confirm>
<Stack>
<Stack.Item grow mr="0">
<Button.Confirm
align="center"
tooltip="Activate/Deactivate the AI Core Lockdown."
icon="lock"
color="red"
px="2rem"
width="100%"
bold
onClick={() => act('security_lockdown')}
>
AI Core Lockdown
</Button.Confirm>
</Stack.Item>
<Stack.Item ml="0" mr="0">
<Dropdown
options={faction_options}
selected={sentry_setting}
color="red"
onSelected={(value) =>
act('update_sentries', { chosen_iff: value })
}
width="90px"
tooltip="Change core sentries IFF settings."
/>
</Stack.Item>
</Stack>
</Section>
<Section>
<Stack>
Expand Down
51 changes: 35 additions & 16 deletions tgui/packages/tgui/interfaces/AresInterface.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// -------------------------------------------------------------------- //

import { useBackend } from '../backend';
import { Box, Button, Flex, Section, Stack } from '../components';
import { Box, Button, Dropdown, Flex, Section, Stack } from '../components';
import { Window } from '../layouts';

const PAGES = {
Expand Down Expand Up @@ -93,6 +93,8 @@ const MainMenu = (props) => {
last_page,
current_menu,
access_level,
faction_options,
sentry_setting,
sudo,
} = data;

Expand Down Expand Up @@ -385,15 +387,16 @@ const MainMenu = (props) => {
)}
<Stack.Item>
<Button
content="Bioscan"
icon="satellite"
ml="auto"
px="2rem"
width="25vw"
bold
onClick={() => act('bioscan')}
tooltip="Trigger an immediate bioscan for diagnostics."
/>
>
Bioscan
</Button>
</Stack.Item>
</Stack>
)}
Expand All @@ -415,19 +418,35 @@ const MainMenu = (props) => {
>
Nerve Gas Control
</Button>
<Button.Confirm
align="center"
tooltip="Activate/Deactivate the AI Core Lockdown."
icon="lock"
color="red"
ml="auto"
px="2rem"
width="100%"
bold
onClick={() => act('security_lockdown')}
>
AI Core Lockdown
</Button.Confirm>
<Stack>
<Stack.Item grow mr="0">
<Button.Confirm
align="center"
tooltip="Activate/Deactivate the AI Core Lockdown."
icon="lock"
color="red"
px="2rem"
width="100%"
bold
onClick={() => act('security_lockdown')}
>
AI Core Lockdown
</Button.Confirm>
</Stack.Item>
<Stack.Item ml="0" mr="0">
<Dropdown
options={faction_options}
selected={sentry_setting}
color="red"
onSelected={(value) =>
act('update_sentries', { chosen_iff: value })
}
width="90px"
disabled={access_level < 9}
tooltip="Change core sentries IFF settings."
/>
</Stack.Item>
</Stack>
</Section>
)}
</>
Expand Down

0 comments on commit e913a5e

Please sign in to comment.