Skip to content

Commit

Permalink
let's just leave this on tbh
Browse files Browse the repository at this point in the history
  • Loading branch information
Zonespace27 committed Sep 8, 2024
1 parent 4d308fe commit c7d4807
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 42 deletions.
2 changes: 1 addition & 1 deletion code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@

//#define UNIT_TESTS //If this is uncommented, we do a single run though of the game setup and tear down process with unit tests in between

//#define TESTING
#define TESTING
// #define REFERENCE_TRACKING
// #define GC_FAILURE_HARD_LOOKUP
22 changes: 10 additions & 12 deletions code/modules/mob/living/carbon/human/ai/ai_management_menu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
/datum/human_ai_management_menu/ui_data(mob/user)
var/list/data = list()

//data["on_cooldown"] = !COOLDOWN_FINISHED(src, panel_emote_cooldown)

return data

/datum/human_ai_management_menu/ui_static_data(mob/user)
var/list/data = list()

data["orders"] = list()
for(var/datum/ongoing_action/order as anything in SShuman_ai.existing_orders)
data["orders"] += list(list(
Expand Down Expand Up @@ -62,6 +55,11 @@

return data

/datum/human_ai_management_menu/ui_static_data(mob/user)
var/list/data = list()

return data

/datum/human_ai_management_menu/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
Expand All @@ -81,7 +79,7 @@

if("create_squad")
SShuman_ai.create_new_squad()
update_static_data(usr, ui)
//update_static_data(usr, ui)
return TRUE

if("assign_to_squad")
Expand All @@ -90,7 +88,7 @@

var/datum/brain = locate(params["ai"])
brain:add_to_squad(params["squad"])
update_static_data(usr, ui)
//update_static_data(usr, ui)
return TRUE

if("assign_order")
Expand All @@ -99,7 +97,7 @@

var/datum/human_ai_squad/squad = SShuman_ai.get_squad("[params["squad"]]")
squad.set_order(locate(params["order"]))
update_static_data(usr, ui)
//update_static_data(usr, ui)
return TRUE

if("assign_sl")
Expand All @@ -109,11 +107,11 @@
var/datum/brain = locate(params["ai"])
var/datum/human_ai_squad/squad = SShuman_ai.get_squad("[params["squad"]]")
squad.set_squad_leader(brain)
update_static_data(usr, ui)
//update_static_data(usr, ui)
return TRUE

if("refresh")
update_static_data(usr, ui)
//update_static_data(usr, ui)
return TRUE

/client/proc/open_human_ai_management_panel()
Expand Down
74 changes: 45 additions & 29 deletions tgui/packages/tgui/interfaces/HumanAIManager.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import { useBackend, useLocalState } from '../backend';
import { Box, Button, LabeledList, NoticeBox, ProgressBar, Section, Dimmer, Stack, Tabs, Divider } from '../components';
import {
Box,
Button,
LabeledList,
NoticeBox,
ProgressBar,
Section,
Dimmer,
Stack,
Tabs,
Divider,
} from '../components';
import { Window } from '../layouts';
import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox';
import { classes, BooleanLike } from 'common/react';
Expand Down Expand Up @@ -41,39 +52,40 @@ const AIContext = (props, context) => {
const { data, act } = useBackend<BackendContext>(context);
const [squadAssignmentMode, setSquadAssignmentMode] = useLocalState(
context,
'squad_assignment_mode',
false
);
const [orderAssignmentMode, setOrderAssignmentMode] = useLocalState(
context,
'order_assignment_mode',
false
);
return (
<Stack fill vertical>
<div>
<div
style={{
'float': 'left',
'display': 'inline-block',
float: 'left',
display: 'inline-block',
'padding-right': '6px',
}}>
}}
>
<Button content="Refresh" onClick={() => act('refresh')} />
</div>
<div
style={{
'float': 'left',
'display': 'inline-block',
float: 'left',
display: 'inline-block',
'padding-right': '6px',
}}>
}}
>
<Button content="New Squad" onClick={() => act('create_squad')} />
</div>
<div
style={{
'float': 'left',
'display': 'inline-block',
float: 'left',
display: 'inline-block',
'padding-right': '6px',
}}>
}}
>
<Button
content="Squad Assignment Mode"
onClick={() => {
Expand All @@ -85,10 +97,11 @@ const AIContext = (props, context) => {
</div>
<div
style={{
'float': 'left',
'display': 'inline-block',
float: 'left',
display: 'inline-block',
'padding-right': '6px',
}}>
}}
>
<Button
content="Order Assignment Mode"
onClick={() => {
Expand Down Expand Up @@ -138,10 +151,11 @@ const CreatedOrder = (props) => {
return (
<div
style={{
'float': 'left',
'display': 'inline-block',
float: 'left',
display: 'inline-block',
'padding-right': '6px',
}}>
}}
>
<Section title={`${order.name}`}>
{orderAssignmentMode ? (
<>
Expand All @@ -157,7 +171,7 @@ const CreatedOrder = (props) => {
color="green"
disabled={selectedSquad === -1}
style={{
'float': 'left',
float: 'left',
}}
/>
<br />
Expand Down Expand Up @@ -202,10 +216,11 @@ const HumanAIReadout = (props) => {
return (
<div
style={{
'float': 'left',
'display': 'inline-block',
float: 'left',
display: 'inline-block',
'padding-right': '6px',
}}>
}}
>
<Section title={`${human.name}`}>
<div>
{squadAssignmentMode ? (
Expand All @@ -224,7 +239,7 @@ const HumanAIReadout = (props) => {
selectedSquad === -1 || human.squad_id == selectedSquad
}
style={{
'float': 'left',
float: 'left',
}}
/>
<Button
Expand All @@ -244,7 +259,7 @@ const HumanAIReadout = (props) => {
}
disabled={selectedSquad === human.squad_id ? false : true}
style={{
'float': 'left',
float: 'left',
}}
/>
</>
Expand All @@ -259,7 +274,7 @@ const HumanAIReadout = (props) => {
})
}
style={{
'float': 'left',
float: 'left',
}}
/>
<Button
Expand All @@ -271,7 +286,7 @@ const HumanAIReadout = (props) => {
})
}
style={{
'float': 'left',
float: 'left',
}}
/>
</>
Expand Down Expand Up @@ -311,10 +326,11 @@ const SquadReadout = (props) => {
return (
<div
style={{
'float': 'left',
'display': 'inline-block',
float: 'left',
display: 'inline-block',
'padding-right': '6px',
}}>
}}
>
<Section title={`${squad.id}`}>
{squadAssignmentMode || orderAssignmentMode ? (
<Button
Expand Down

0 comments on commit c7d4807

Please sign in to comment.