Add ghost role raffles (#26629)
* Add ghost role raffles * GRR: Fix dialogue sizing, fix merge * GRR: Add raffle deciders (winner picker) * GRR: Make settings prototype based with option to override * GRR: Use Raffles folder and namespace * GRR: DataFieldify and TimeSpanify * GRR: Don't actually DataFieldify HashSet<ICommonSession>s * GRR: add GetGhostRoleCount() + docs * update engine on branch * Ghost role raffles: docs, fix window size, cleanup, etc * GRR: Admin UI * GRR: Admin UI: Display initial/max/ext of selected raffle settings proto * GRR: Make a ton of roles raffled
This commit is contained in:
@@ -20,13 +20,24 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
|
||||
{
|
||||
_window = new GhostRolesWindow();
|
||||
|
||||
_window.OnRoleRequested += info =>
|
||||
_window.OnRoleRequestButtonClicked += info =>
|
||||
{
|
||||
if (_windowRules != null)
|
||||
_windowRules.Close();
|
||||
_windowRules?.Close();
|
||||
|
||||
if (info.Kind == GhostRoleKind.RaffleJoined)
|
||||
{
|
||||
SendMessage(new LeaveGhostRoleRaffleMessage(info.Identifier));
|
||||
return;
|
||||
}
|
||||
|
||||
_windowRules = new GhostRoleRulesWindow(info.Rules, _ =>
|
||||
{
|
||||
SendMessage(new GhostRoleTakeoverRequestMessage(info.Identifier));
|
||||
SendMessage(new RequestGhostRoleMessage(info.Identifier));
|
||||
|
||||
// if raffle role, close rules window on request, otherwise do
|
||||
// old behavior of waiting for the server to close it
|
||||
if (info.Kind != GhostRoleKind.FirstComeFirstServe)
|
||||
_windowRules?.Close();
|
||||
});
|
||||
_windowRulesId = info.Identifier;
|
||||
_windowRules.OnClose += () =>
|
||||
@@ -38,7 +49,7 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
|
||||
|
||||
_window.OnRoleFollow += info =>
|
||||
{
|
||||
SendMessage(new GhostRoleFollowRequestMessage(info.Identifier));
|
||||
SendMessage(new FollowGhostRoleMessage(info.Identifier));
|
||||
};
|
||||
|
||||
_window.OnClose += () =>
|
||||
@@ -64,7 +75,8 @@ namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
|
||||
{
|
||||
base.HandleState(state);
|
||||
|
||||
if (state is not GhostRolesEuiState ghostState) return;
|
||||
if (state is not GhostRolesEuiState ghostState)
|
||||
return;
|
||||
_window.ClearEntries();
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
Reference in New Issue
Block a user