1v1 me first to 31 no powerups [Deathmatch Gamemode] (#19467)

Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
Nemanja
2023-08-30 21:06:15 -04:00
committed by GitHub
parent 3f678104e3
commit 4d677f0685
44 changed files with 2821 additions and 155 deletions

View File

@@ -0,0 +1,58 @@
using Content.Client.CharacterInfo;
using Content.Client.Message;
using Content.Shared.Points;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameStates;
namespace Content.Client.Points;
/// <inheritdoc/>
public sealed class PointSystem : SharedPointSystem
{
[Dependency] private readonly CharacterInfoSystem _characterInfo = default!;
/// <inheritdoc/>
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PointManagerComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<CharacterInfoSystem.GetCharacterInfoControlsEvent>(OnGetCharacterInfoControls);
}
private void OnHandleState(EntityUid uid, PointManagerComponent component, ref ComponentHandleState args)
{
if (args.Current is not PointManagerComponentState state)
return;
component.Points = new(state.Points);
component.Scoreboard = state.Scoreboard;
_characterInfo.RequestCharacterInfo();
}
private void OnGetCharacterInfoControls(ref CharacterInfoSystem.GetCharacterInfoControlsEvent ev)
{
foreach (var point in EntityQuery<PointManagerComponent>())
{
var box = new BoxContainer
{
Margin = new Thickness(5),
Orientation = BoxContainer.LayoutOrientation.Vertical
};
var title = new RichTextLabel
{
HorizontalAlignment = Control.HAlignment.Center
};
title.SetMarkup(Loc.GetString("point-scoreboard-header"));
var text = new RichTextLabel();
text.SetMessage(point.Scoreboard);
box.AddChild(title);
box.AddChild(text);
ev.Controls.Add(box);
}
}
}

View File

@@ -109,6 +109,7 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
_window.NameLabel.Text = entityName;
_window.SubText.Text = job;
_window.Objectives.RemoveAllChildren();
_window.ObjectivesLabel.Visible = objectives.Any();
foreach (var (groupId, conditions) in objectives)
{

View File

@@ -14,7 +14,7 @@
<Label Name="SubText" VerticalAlignment="Top" StyleClasses="LabelSubText" Access="Public"/>
</BoxContainer>
</BoxContainer>
<Label Text="{Loc 'character-info-objectives-label'}" HorizontalAlignment="Center"/>
<Label Name="ObjectivesLabel" Access="Public" Text="{Loc 'character-info-objectives-label'}" HorizontalAlignment="Center"/>
<BoxContainer Orientation="Vertical" Name="Objectives" Access="Public"/>
<cc:Placeholder Name="RolePlaceholder" Access="Public" PlaceholderText="{Loc 'character-info-roles-antagonist-text'}"/>
</BoxContainer>