Skip to content

Commit

Permalink
Merge branch 'master' into changeling-gamerule-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
modern-nm committed May 21, 2024
2 parents c24038b + 9feeca4 commit 06b4105
Show file tree
Hide file tree
Showing 861 changed files with 750,355 additions and 92,834 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.203

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.203

- name: Install dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yaml-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET Core
uses: actions/[email protected]
with:
dotnet-version: 8.0.x
dotnet-version: 8.0.203
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion ADT_STATION
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using Content.Shared.BluespaceHarvester;
using JetBrains.Annotations;

namespace Content.Client.BluespaceHarvester;

[UsedImplicitly]
public sealed class BluespaceHarvesterBoundUserInterface : BoundUserInterface
{
private BluespaceHarvesterMenu? _window;

public BluespaceHarvesterBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

protected override void Open()
{
base.Open();

_window = new BluespaceHarvesterMenu(this);
_window.OnClose += Close;
_window?.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing)
return;

_window?.Dispose();
_window = null;
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);

if (state is not BluespaceHarvesterBoundUserInterfaceState current)
return;

_window?.UpdateState(current);
}

public void SendTargetLevel(int level)
{
SendMessage(new BluespaceHarvesterTargetLevelMessage(level));
}

public void SendBuy(Shared.BluespaceHarvester.BluespaceHarvesterCategory category)
{
SendMessage(new BluespaceHarvesterBuyMessage(category));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Control xmlns="https://spacestation14.io">
<GridContainer Margin = "2 0 0 0" Columns="2">
<Label Name="CategoryLabel" Text="Category" StyleClasses="StatusFieldTitle"></Label>
<Button Name="CategoryButton" Text="10000" StyleClasses="OpenRight" Access="Public"/>
</GridContainer>
</Control>
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Content.Shared.BluespaceHarvester;

namespace Content.Client.BluespaceHarvester;

[GenerateTypedNameReferences]
public sealed partial class BluespaceHarvesterCategory : Control
{
public BluespaceHarvesterCategory(BluespaceHarvesterCategoryInfo category, bool canBuy)
{
RobustXamlLoader.Load(this);

CategoryLabel.Text = Loc.GetString($"bluespace-harvester-category-{Enum.GetName(typeof(Shared.BluespaceHarvester.BluespaceHarvesterCategory), category.Type)}");

CategoryButton.Text = $"{category.Cost}";
CategoryButton.Disabled = !canBuy;
}
}
46 changes: 46 additions & 0 deletions Content.Client/BluespaceHarvester/BluespaceHarvesterMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<controls:FancyWindow xmlns="https://spacestation14.io"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="{Loc 'bluespace-harvester-window-title'}"
MinSize="480 360">
<BoxContainer Orientation="Vertical">
<Label Text="{Loc 'bluespace-harvester-window-lable-input'}"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<GridContainer Margin="2 0 0 0" Columns="2">
<Label Text="{Loc 'bluespace-harvester-window-level-input'}" StyleClasses="StatusFieldTitle"/>
<LineEdit Name="InputLevelBar" PlaceHolder="0" HorizontalExpand="True" Margin ="0 4"/>
<Label Text="{Loc 'bluespace-harvester-window-level-target'}" StyleClasses="StatusFieldTitle"/>
<Label Name="TargetLevel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-level-current'}" StyleClasses="StatusFieldTitle"/>
<Label Name="CurrentLevel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-level-desired'}" StyleClasses="StatusFieldTitle"/>
<ProgressBar Name="DesiredBar"
HorizontalExpand="True"
MinValue="0"
MaxValue="1"
SetHeight="25"/>
<Label Text="{Loc 'bluespace-harvester-window-power-usage'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerUsageLabel" Text="0w"/>
<Label Text="{Loc 'bluespace-harvester-window-power-next'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerUsageNextLabel" Text="0w"/>
<Label Text="{Loc 'bluespace-harvester-window-power-surplus'}" StyleClasses="StatusFieldTitle"/>
<Label Name="PowerSuppliertLabel" Text="0w"/>
</GridContainer>
<Control/>
<Label Text="{Loc 'bluespace-harvester-window-lable-output'}"/>
<controls:HLine Color="#404040" Thickness="2" Margin="0 5"/>
<GridContainer Margin="2 0 10 0" Columns="2">
<BoxContainer Orientation="Vertical">
<GridContainer Margin="2 0 0 0" Columns="2">
<Label Text="{Loc 'bluespace-harvester-window-points-available'}" StyleClasses="StatusFieldTitle"/>
<Label Name="AvailablePointsLabel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-points-generation'}" StyleClasses="StatusFieldTitle"/>
<Label Name="GenerationPointsLabel" Text="0"/>
<Label Text="{Loc 'bluespace-harvester-window-points-total'}" StyleClasses="StatusFieldTitle"/>
<Label Name="TotalPontsLabel" Text="0"/>
</GridContainer>
</BoxContainer>
<BoxContainer Name="Categories" Orientation="Vertical">
</BoxContainer>
</GridContainer>
</BoxContainer>
</controls:FancyWindow>
60 changes: 60 additions & 0 deletions Content.Client/BluespaceHarvester/BluespaceHarvesterMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.BluespaceHarvester;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.BluespaceHarvester;

[GenerateTypedNameReferences]
public sealed partial class BluespaceHarvesterMenu : FancyWindow
{
private readonly BluespaceHarvesterBoundUserInterface _owner;

public BluespaceHarvesterMenu(BluespaceHarvesterBoundUserInterface owner)
{
RobustXamlLoader.Load(this);

_owner = owner;

InputLevelBar.OnTextEntered += (args) =>
{
if (!int.TryParse(args.Text, out var level) || level < 0 || level > 20)
{
InputLevelBar.Text = "0";
return;
}
_owner.SendTargetLevel(level);
};

// EntityView.SetEntity(_owner.Owner);
}

public void UpdateState(BluespaceHarvesterBoundUserInterfaceState state)
{
TargetLevel.Text = $"{state.TargetLevel}";
CurrentLevel.Text = $"{state.CurrentLevel}";
DesiredBar.Value = ((float)state.CurrentLevel) / ((float)state.MaxLevel);

PowerUsageLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerUsage));
PowerUsageNextLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerUsageNext));
PowerSuppliertLabel.Text = Loc.GetString("power-monitoring-window-value", ("value", state.PowerSuppliert));

AvailablePointsLabel.Text = $"{state.Points}";
TotalPontsLabel.Text = $"{state.TotalPoints}";
GenerationPointsLabel.Text = $"{state.PointsGen}";

Categories.RemoveAllChildren();
foreach (var category in state.Categories)
{
var child = new BluespaceHarvesterCategory(category, state.Points >= category.Cost);

child.CategoryButton.OnButtonDown += (args) =>
{
_owner.SendBuy(category.Type);
};

Categories.AddChild(child);
}
}
}
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowHealthIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected override void DeactivateInternal()

private void OnGetStatusIconsEvent(Entity<DamageableComponent> entity, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer)
if (!IsActive || args.InContainer || args.HasStealthComponent)
return;

var healthIcons = DecideHealthIcons(entity);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowHungerIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override void Initialize()

private void OnGetStatusIconsEvent(EntityUid uid, HungerComponent hungerComponent, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer)
if (!IsActive || args.InContainer || args.HasStealthComponent)
return;

var hungerIcons = DecideHungerIcon(uid, hungerComponent);
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowSecurityIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public override void Initialize()

private void OnGetStatusIconsEvent(EntityUid uid, StatusIconComponent _, ref GetStatusIconsEvent @event)
{
if (!IsActive || @event.InContainer)
if (!IsActive || @event.InContainer || @event.HasStealthComponent)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Overlays/ShowThirstIconsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public override void Initialize()

private void OnGetStatusIconsEvent(EntityUid uid, ThirstComponent thirstComponent, ref GetStatusIconsEvent args)
{
if (!IsActive || args.InContainer)
if (!IsActive || args.InContainer || args.HasStealthComponent)
return;

var thirstIcons = DecideThirstIcon(uid, thirstComponent);
Expand Down
25 changes: 0 additions & 25 deletions Content.Client/Revolutionary/UI/DeconvertedEui.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Content.Client/Revolutionary/UI/DeconvertedMenu.xaml

This file was deleted.

16 changes: 0 additions & 16 deletions Content.Client/Revolutionary/UI/DeconvertedMenu.xaml.cs

This file was deleted.

3 changes: 2 additions & 1 deletion Content.Client/SSDIndicator/SSDIndicatorSystem.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Shared.CCVar;
using Content.Shared.CCVar;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.NPC;
Expand Down Expand Up @@ -31,6 +31,7 @@ private void OnGetStatusIcon(EntityUid uid, SSDIndicatorComponent component, ref
if (component.IsSSD &&
_cfg.GetCVar(CCVars.ICShowSSDIndicator) &&
!args.InContainer &&
!args.HasStealthComponent &&
!_mobState.IsDead(uid) &&
!HasComp<ActiveNPCComponent>(uid) &&
TryComp<MindContainerComponent>(uid, out var mindContainer) &&
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/StatusIcon/StatusIconSystem.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Content.Shared.CCVar;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Content.Shared.Stealth.Components;
using Robust.Client.Graphics;
using Robust.Shared.Configuration;

Expand All @@ -13,6 +14,7 @@ public sealed class StatusIconSystem : SharedStatusIconSystem
{
[Dependency] private readonly IConfigurationManager _configuration = default!;
[Dependency] private readonly IOverlayManager _overlay = default!;
[Dependency] private readonly IEntityManager _entManager = default!;

private bool _globalEnabled;
private bool _localEnabled;
Expand Down Expand Up @@ -55,7 +57,8 @@ public List<StatusIconData> GetStatusIcons(EntityUid uid, MetaDataComponent? met
return list;

var inContainer = (meta.Flags & MetaDataFlags.InContainer) != 0;
var ev = new GetStatusIconsEvent(list, inContainer);
var hasStealthComponent = _entManager.HasComponent<StealthComponent>(uid);
var ev = new GetStatusIconsEvent(list, inContainer, hasStealthComponent);
RaiseLocalEvent(uid, ref ev);
return ev.StatusIcons;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public partial class RadialContainer : Control
/// <summary>
/// Radial item size, when cursor was focused on button
/// </summary>
public float FocusSize { get; set; } = 64f;
public float FocusSize { get; set; } = 82f;

/// <summary>
/// Normal radial item size, when cursor not focused
/// </summary>
public float NormalSize { get; set; } = 50f;
public float NormalSize { get; set; } = 64f;

/// <summary>
/// Items moving animation time, when radial was opened
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.Database;
Expand Down Expand Up @@ -32,8 +32,8 @@ public async Task AddAndGetSingleLog()

var guid = Guid.NewGuid();

var testMap = await pair.CreateTestMap();
var coordinates = testMap.GridCoords;
await pair.CreateTestMap();
var coordinates = pair.TestMap.GridCoords;
await server.WaitPost(() =>
{
var entity = sEntities.SpawnEntity(null, coordinates);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ await server.WaitAssertion(() =>
.ToDictionary(x => x, _ => false);
foreach (var (reagent, quantity) in solution.Contents)
{
Assert.That(foundProductsMap.TryFirstOrNull(x => x.Key.Key == reagent.Prototype && x.Key.Value == quantity, out var foundProduct), Is.True);
Assert.That(foundProductsMap.TryFirstOrNull(x => x.Key.Key == reagent.Prototype && x.Key.Value == quantity, out var foundProduct));
foundProductsMap[foundProduct.Value.Key] = true;
}
Expand Down
Loading

0 comments on commit 06b4105

Please sign in to comment.