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

job slots console #476

Merged
merged 6 commits into from
Dec 14, 2024

Conversation

MilonPL
Copy link
Contributor

@MilonPL MilonPL commented Nov 19, 2024

About the PR

adds a job slots console that does exactly what it says
admins get a fancy version that can also make slots infinite or not

Why / Balance

Closes #346

Technical details

new ui, system, component, etc etc
has a ProtoId hashset to blacklist specific jobs from being modified
Debug bool for the admins, can probably implement more functionality in the future with it

Media

Click me!
Boo!

image

admin version:
image

sprites:
image

blacklist tooltip:
image

@MilonPL
Copy link
Contributor Author

MilonPL commented Nov 19, 2024

@dffdff2423 added an access reader to the computer, now it checks if the actor can access the computer and if not, it plays the deny sound
instead of fucking with an int and a nullable bool, JobSlotAdjustment is an enum so it's infinitely times better and more expandable
the blacklist only has captain and CC jobs now, let me know if that's fine

@LankLTE
Copy link
Contributor

LankLTE commented Nov 27, 2024

Kinda meh on this, I think letting heads block more people from joining their department is generally gonna be a net negative. Blocking heads specifically makes sense given promotions but the only way to allow that currently is to blacklist everything.

@Nairodian
Copy link
Collaborator

Nairodian commented Nov 28, 2024

Kinda meh on this, I think letting heads block more people from joining their department is generally gonna be a net negative. Blocking heads specifically makes sense given promotions but the only way to allow that currently is to blacklist everything.

I kind of disagree, because it's HoP locked anyways, individual heads aren't going to be able to use this console meaning they'd have to go up and ask the HoP to restrict their whole department which is for sure going to net them a momentary odd look. I say we try it out with all the jobs being accessible (except Captain+) and then from there fine tune it if it goes poorly.

@LankLTE
Copy link
Contributor

LankLTE commented Nov 28, 2024

I kind of disagree, because it's HoP locked anyways, individual heads aren't going to be able to use this console meaning they'd have to go up and ask the HoP to restrict their whole department which is for sure going to net them a momentary odd look. I say we try it out with all the jobs being accessible (except Captain+) and then from there fine tune it if it goes poorly.

Alright, next question then is if this needs to be a separate console that we have to map instead of being on a different console (probably the ID one).

@github-actions github-actions bot added size/L Changes: UI Changes to UI files. and removed size/L labels Dec 1, 2024
@dffdff2423
Copy link
Collaborator

Alright, next question then is if this needs to be a separate console that we have to map instead of being on a different console (probably the ID one).

I think it should be a separate console. I think it would be a bit strange to put 2 UIs on the same entity.

@LankLTE
Copy link
Contributor

LankLTE commented Dec 2, 2024

I think it should be a separate console. I think it would be a bit strange to put 2 UIs on the same entity.

Alright I've been convinced you can hit merge whenever.

@dffdff2423 dffdff2423 merged commit 0b776fa into cosmatic-drift-14:master Dec 14, 2024
12 checks passed
Comment on lines +25 to +30

private void AdjustSlot(ProtoId<JobPrototype> jobId, JobSlotAdjustment adjustment)
{
SendMessage(new JobSlotsConsoleAdjustMessage(jobId, adjustment));
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use SendPredictedMessage and make the whole thing predicted?

Comment on lines +19 to +24

_menu = new JobSlotsConsoleMenu();
_menu.OpenCentered();
_menu.OnClose += Close;
_menu.OnAdjustPressed += AdjustSlot;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.CreateWindow?

Comment on lines +40 to +48

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;
_menu?.Close();
_menu = null;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obsolete

Comment on lines +133 to +141

private DepartmentPrototype? GetPrimaryDepartmentForJob(ProtoId<JobPrototype> jobId)
{
return _protoManager.EnumeratePrototypes<DepartmentPrototype>()
.FirstOrDefault(d => d.Roles.Contains(jobId) && d.Primary)
?? _protoManager.EnumeratePrototypes<DepartmentPrototype>()
.FirstOrDefault(d => d.Roles.Contains(jobId));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be on jobs or something rather than here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes: UI Changes to UI files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Job Slot Console
5 participants