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:
no
2024-05-07 03:48:16 +02:00
committed by GitHub
parent 6685146a1e
commit 630a7a78ed
44 changed files with 1138 additions and 51 deletions

View File

@@ -6,9 +6,16 @@ namespace Content.Server.Ghost.Roles.UI
{
public sealed class GhostRolesEui : BaseEui
{
[Dependency] private readonly GhostRoleSystem _ghostRoleSystem;
public GhostRolesEui()
{
_ghostRoleSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<GhostRoleSystem>();
}
public override GhostRolesEuiState GetNewState()
{
return new(EntitySystem.Get<GhostRoleSystem>().GetGhostRolesInfo());
return new(_ghostRoleSystem.GetGhostRolesInfo(Player));
}
public override void HandleMessage(EuiMessageBase msg)
@@ -17,11 +24,14 @@ namespace Content.Server.Ghost.Roles.UI
switch (msg)
{
case GhostRoleTakeoverRequestMessage req:
EntitySystem.Get<GhostRoleSystem>().Takeover(Player, req.Identifier);
case RequestGhostRoleMessage req:
_ghostRoleSystem.Request(Player, req.Identifier);
break;
case GhostRoleFollowRequestMessage req:
EntitySystem.Get<GhostRoleSystem>().Follow(Player, req.Identifier);
case FollowGhostRoleMessage req:
_ghostRoleSystem.Follow(Player, req.Identifier);
break;
case LeaveGhostRoleRaffleMessage req:
_ghostRoleSystem.LeaveRaffle(Player, req.Identifier);
break;
}
}