Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pAIs to withdraw their candidacy #4940

Merged
merged 2 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions code/controllers/subsystem/pai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ SUBSYSTEM_DEF(pai)
candidate.savefile_load(user)
ui.send_full_update()
return TRUE
if("withdraw")
if(!candidate.ready)
to_chat(user, span_warning("You need to submit an application before you can withdraw one."))
return FALSE
candidate.ready = FALSE
to_chat(user, span_notice("Your pAI candidacy has been withdrawn."))
return TRUE
return FALSE

/**
Expand Down
8 changes: 8 additions & 0 deletions tgui/packages/tgui/interfaces/PaiSubmit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@ const ButtonsDisplay = (props) => {
SUBMIT
</Button>
</Stack.Item>
<Stack.Item>
<Button
onClick={() => act('withdraw')}
tooltip="Withdraws your pAI candidacy, if any."
>
WITHDRAW
</Button>
</Stack.Item>
</Stack>
</Section>
);
Expand Down
Loading