Skip to content

Commit

Permalink
Changes opfor 'approve/deny' objective buttons, opfor chat qol (#232)
Browse files Browse the repository at this point in the history
* Fixes button overlap in objective title

* Admins who send a message automatically get marked down as handling
  • Loading branch information
vinylspiders authored and Iajret committed Jan 3, 2024
1 parent b48e2cc commit 757c92a
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@
submit_to_subsystem(usr)
if("send_message")
send_message(usr, params["message"])
if(!handling_admin && check_rights_for(usr.client, R_ADMIN) && usr != mind_reference)
handle(usr) // if an admin sends a message and it's not being handled, assign them as handling it
// Objective control
if("add_objective")
add_objective(usr)
Expand Down
119 changes: 63 additions & 56 deletions tgui/packages/tgui/interfaces/OpposingForcePanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -770,63 +770,70 @@ export const AdminTab = (props) => {
<Section
title={index + 1 + '. ' + objective.title}
key={objective.id}
buttons={
<>
<Button
icon="check"
color="good"
disabled={
objective.approved &&
objective.status_text !== 'Not Reviewed'
}
content="Approve Objective"
onClick={() =>
act('approve_objective', {
objective_ref: objective.ref,
})
}
/>
<Button
icon="times"
color="bad"
disabled={
!objective.approved &&
objective.status_text !== 'Not Reviewed'
}
content="Deny Objective"
onClick={() =>
act('deny_objective', {
objective_ref: objective.ref,
})
}
/>
</>
}
>
<LabeledList key={objective.id}>
<LabeledList.Item label="Description">
{objective.description}
</LabeledList.Item>
<LabeledList.Item label="Justification">
{objective.justification}
</LabeledList.Item>
<LabeledList.Item label="Intensity">
{'(' +
objective.intensity +
') ' +
objective.text_intensity}
</LabeledList.Item>
<LabeledList.Item label="Status">
{objective.status_text === 'Not Reviewed'
? 'Objective Not Reviewed'
: objective.approved
? 'Objective Approved'
: objective.denied_text
? 'Objective Denied - Reason: ' +
objective.denied_text
: 'Objective Denied'}
</LabeledList.Item>
</LabeledList>
<Stack vertical>
<Stack.Item>
<LabeledList key={objective.id}>
<LabeledList.Item label="Description">
{objective.description}
</LabeledList.Item>
<LabeledList.Item label="Justification">
{objective.justification}
</LabeledList.Item>
<LabeledList.Item label="Intensity">
{'(' +
objective.intensity +
') ' +
objective.text_intensity}
</LabeledList.Item>
<LabeledList.Item label="Status">
{objective.status_text === 'Not Reviewed'
? 'Objective Not Reviewed'
: objective.approved
? 'Objective Approved'
: objective.denied_text
? 'Objective Denied - Reason: ' +
objective.denied_text
: 'Objective Denied'}
</LabeledList.Item>
</LabeledList>
</Stack.Item>
<Stack mb={-1.5}>
<Stack.Divider hidden grow width="50%" />
<Stack.Item>
<Button
icon="check"
color="good"
disabled={
objective.approved &&
objective.status_text !== 'Not Reviewed'
}
content="Approve Objective"
onClick={() =>
act('approve_objective', {
objective_ref: objective.ref,
})
}
/>
</Stack.Item>
<Stack.Item>
<Button
icon="times"
color="bad"
disabled={
!objective.approved &&
objective.status_text !== 'Not Reviewed'
}
content="Deny Objective"
onClick={() =>
act('deny_objective', {
objective_ref: objective.ref,
})
}
/>
</Stack.Item>
</Stack>
</Stack>
</Section>
))
)}
Expand Down

0 comments on commit 757c92a

Please sign in to comment.