ECS Arcade Machines (#16791)
This commit is contained in:
@@ -24,40 +24,46 @@ namespace Content.Client.Arcade
|
||||
Title = Loc.GetString("spacevillain-menu-title");
|
||||
Owner = owner;
|
||||
|
||||
var grid = new GridContainer {Columns = 1};
|
||||
var grid = new GridContainer { Columns = 1 };
|
||||
|
||||
var infoGrid = new GridContainer {Columns = 3};
|
||||
infoGrid.AddChild(new Label{ Text = Loc.GetString("spacevillain-menu-label-player"), Align = Label.AlignMode.Center });
|
||||
infoGrid.AddChild(new Label{ Text = "|", Align = Label.AlignMode.Center });
|
||||
_enemyNameLabel = new Label{ Align = Label.AlignMode.Center};
|
||||
var infoGrid = new GridContainer { Columns = 3 };
|
||||
infoGrid.AddChild(new Label { Text = Loc.GetString("spacevillain-menu-label-player"), Align = Label.AlignMode.Center });
|
||||
infoGrid.AddChild(new Label { Text = "|", Align = Label.AlignMode.Center });
|
||||
_enemyNameLabel = new Label { Align = Label.AlignMode.Center };
|
||||
infoGrid.AddChild(_enemyNameLabel);
|
||||
|
||||
_playerInfoLabel = new Label {Align = Label.AlignMode.Center};
|
||||
_playerInfoLabel = new Label { Align = Label.AlignMode.Center };
|
||||
infoGrid.AddChild(_playerInfoLabel);
|
||||
infoGrid.AddChild(new Label{ Text = "|", Align = Label.AlignMode.Center });
|
||||
_enemyInfoLabel = new Label {Align = Label.AlignMode.Center};
|
||||
infoGrid.AddChild(new Label { Text = "|", Align = Label.AlignMode.Center });
|
||||
_enemyInfoLabel = new Label { Align = Label.AlignMode.Center };
|
||||
infoGrid.AddChild(_enemyInfoLabel);
|
||||
var centerContainer = new CenterContainer();
|
||||
centerContainer.AddChild(infoGrid);
|
||||
grid.AddChild(centerContainer);
|
||||
|
||||
_playerActionLabel = new Label {Align = Label.AlignMode.Center};
|
||||
_playerActionLabel = new Label { Align = Label.AlignMode.Center };
|
||||
grid.AddChild(_playerActionLabel);
|
||||
|
||||
_enemyActionLabel = new Label {Align = Label.AlignMode.Center};
|
||||
_enemyActionLabel = new Label { Align = Label.AlignMode.Center };
|
||||
grid.AddChild(_enemyActionLabel);
|
||||
|
||||
var buttonGrid = new GridContainer {Columns = 3};
|
||||
var buttonGrid = new GridContainer { Columns = 3 };
|
||||
_gameButtons[0] = new ActionButton(Owner, SharedSpaceVillainArcadeComponent.PlayerAction.Attack)
|
||||
{Text = Loc.GetString("spacevillain-menu-button-attack")};
|
||||
{
|
||||
Text = Loc.GetString("spacevillain-menu-button-attack")
|
||||
};
|
||||
buttonGrid.AddChild(_gameButtons[0]);
|
||||
|
||||
_gameButtons[1] = new ActionButton(Owner, SharedSpaceVillainArcadeComponent.PlayerAction.Heal)
|
||||
{Text = Loc.GetString("spacevillain-menu-button-heal")};
|
||||
{
|
||||
Text = Loc.GetString("spacevillain-menu-button-heal")
|
||||
};
|
||||
buttonGrid.AddChild(_gameButtons[1]);
|
||||
|
||||
_gameButtons[2] = new ActionButton(Owner, SharedSpaceVillainArcadeComponent.PlayerAction.Recharge)
|
||||
{Text = Loc.GetString("spacevillain-menu-button-recharge")};
|
||||
{
|
||||
Text = Loc.GetString("spacevillain-menu-button-recharge")
|
||||
};
|
||||
buttonGrid.AddChild(_gameButtons[2]);
|
||||
|
||||
centerContainer = new CenterContainer();
|
||||
@@ -65,7 +71,9 @@ namespace Content.Client.Arcade
|
||||
grid.AddChild(centerContainer);
|
||||
|
||||
var newGame = new ActionButton(Owner, SharedSpaceVillainArcadeComponent.PlayerAction.NewGame)
|
||||
{Text = Loc.GetString("spacevillain-menu-button-new-game")};
|
||||
{
|
||||
Text = Loc.GetString("spacevillain-menu-button-new-game")
|
||||
};
|
||||
grid.AddChild(newGame);
|
||||
|
||||
Contents.AddChild(grid);
|
||||
@@ -84,7 +92,8 @@ namespace Content.Client.Arcade
|
||||
|
||||
public void UpdateInfo(SharedSpaceVillainArcadeComponent.SpaceVillainArcadeDataUpdateMessage message)
|
||||
{
|
||||
if(message is SharedSpaceVillainArcadeComponent.SpaceVillainArcadeMetaDataUpdateMessage metaMessage) UpdateMetadata(metaMessage);
|
||||
if (message is SharedSpaceVillainArcadeComponent.SpaceVillainArcadeMetaDataUpdateMessage metaMessage)
|
||||
UpdateMetadata(metaMessage);
|
||||
|
||||
_playerInfoLabel.Text = $"HP: {message.PlayerHP} MP: {message.PlayerMP}";
|
||||
_enemyInfoLabel.Text = $"HP: {message.EnemyHP} MP: {message.EnemyMP}";
|
||||
@@ -97,7 +106,7 @@ namespace Content.Client.Arcade
|
||||
private readonly SpaceVillainArcadeBoundUserInterface _owner;
|
||||
private readonly SharedSpaceVillainArcadeComponent.PlayerAction _playerAction;
|
||||
|
||||
public ActionButton(SpaceVillainArcadeBoundUserInterface owner,SharedSpaceVillainArcadeComponent.PlayerAction playerAction)
|
||||
public ActionButton(SpaceVillainArcadeBoundUserInterface owner, SharedSpaceVillainArcadeComponent.PlayerAction playerAction)
|
||||
{
|
||||
_owner = owner;
|
||||
_playerAction = playerAction;
|
||||
|
||||
Reference in New Issue
Block a user