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

Admin assistant feedback popups #2595

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Content.Shared._DV.FeedbackOverwatch;
using Content.Shared.GameTicking;
using Content.Shared.Mind;
using Content.Shared.Roles.Jobs;

namespace Content.Server._DV.FeedbackPopup;

/// <summary>
/// System to get feedback on the new job!
/// </summary>
public sealed class AdminAssistantPopupSystem : EntitySystem
{
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly SharedJobSystem _job = default!;
[Dependency] private readonly SharedFeedbackOverwatchSystem _feedback = default!;

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RoundEndMessageEvent>(OnRoundEnd);
}

private void OnRoundEnd(RoundEndMessageEvent ev)
{
var allMinds = _mind.GetAliveHumans();
HashSet<EntityUid> commandMinds = new();

// Assumes the assistant is still there at the end of the round.
var roundHadAssistant = false;
foreach (var mind in allMinds)
{
if (!_job.MindTryGetJob(mind, out var jobProto))
continue;

if (_job.MindHasJobWithId(mind, "AdministrativeAssistant"))
{
_feedback.SendPopupMind(mind, "AdministrativeAssistantPopupSelf");
roundHadAssistant = true;
continue;
}

// Basically if they are command, send them the popup.
if (jobProto.RequireAdminNotify)
commandMinds.Add(mind);
}

if (roundHadAssistant)
foreach (var mind in commandMinds)
_feedback.SendPopupMind(mind, "AdministrativeAssistantPopupCommand");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
feedbackpopup-admin-assistant-self-name = Admin-Assistant
feedbackpopup-admin-assistant-self-title = [bold]Administrative Assistant Feedback[/bold]
feedbackpopup-admin-assistant-self-description-0 = Thanks for playing our new role! If you would like to share any feedback about this feature, please comment it below. We would like to hear what you liked or didn't like, and how you think this feature could be improved.

feedbackpopup-admin-assistant-cmd-name = Admin-Assistant-OTHER-COMMAND
feedbackpopup-admin-assistant-cmd-title = [bold]Administrative Assistant Feedback (As command)[/bold]
feedbackpopup-admin-assistant-cmd-description-0 = Looks like you played a round with an administrative assistant! If you would like to share any feedback about this feature, please comment it below. We would like to hear what you liked or didn't like, and how you think this feature could be improved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- type: feedbackPopup
id: AdministrativeAssistantPopupSelf
popupName: feedbackpopup-admin-assistant-self-name
title: feedbackpopup-admin-assistant-self-title
description:
- feedbackpopup-admin-assistant-self-description-0

- type: feedbackPopup
id: AdministrativeAssistantPopupCommand
popupName: feedbackpopup-admin-assistant-cmd-name
title: feedbackpopup-admin-assistant-cmd-title
description:
- feedbackpopup-admin-assistant-cmd-description-0
Loading