diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f43952d457d..a9c475e35ca 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -19,7 +19,7 @@ #/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer #/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer -#/Resources/Prototypes/Maps/ @Emisse +#/Resources/Prototypes/Maps/** @Emisse #/Resources/Prototypes/Body/ @DrSmugleaf # suffering #/Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf diff --git a/.github/labeler.yml b/.github/labeler.yml index b2240bf6986..0d6bf9d7db0 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -50,6 +50,10 @@ - changed-files: - any-glob-to-any-file: '**/*.swsl' +"Audio": +- changed-files: + - any-glob-to-any-file: '**/*.ogg' + "No C#": - changed-files: - all-globs-to-all-files: "!**/*.cs" diff --git a/.github/workflows/build-test-debug.yml b/.github/workflows/build-test-debug.yml index 57400747fe7..1d10d39f45e 100644 --- a/.github/workflows/build-test-debug.yml +++ b/.github/workflows/build-test-debug.yml @@ -7,9 +7,6 @@ on: pull_request: types: [ opened, reopened, synchronize, ready_for_review ] branches: [ master ] - pull_request_target: # Frontier: only run tests on C# changes - paths: # Frontier - - "**/*.cs" # Frontier jobs: build: @@ -50,11 +47,11 @@ jobs: - name: Run Content.Tests run: dotnet test --no-build --configuration DebugOpt Content.Tests/Content.Tests.csproj -- NUnit.ConsoleOut=0 - # - name: Run Content.IntegrationTests - # shell: pwsh - # run: | - # $env:DOTNET_gcServer=1 - # dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj --filter FullyQualifiedName!~ShipyardTest -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed + - name: Run Content.IntegrationTests + shell: pwsh + run: | + $env:DOTNET_gcServer=1 + dotnet test --no-build --configuration DebugOpt Content.IntegrationTests/Content.IntegrationTests.csproj --filter "FullyQualifiedName!~ShipyardTest" -- NUnit.ConsoleOut=0 NUnit.MapWarningTo=Failed ci-success: name: Build & Test Debug needs: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9b2bbb49d51..7b56e97519e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,8 +5,8 @@ concurrency: on: workflow_dispatch: - schedule: - - cron: '0 10 * * *' + # schedule: + # - cron: '0 10 * * *' jobs: build: diff --git a/.github/workflows/update-credits.yml b/.github/workflows/update-credits.yml index 5659ed66908..76e68ee1805 100644 --- a/.github/workflows/update-credits.yml +++ b/.github/workflows/update-credits.yml @@ -2,8 +2,8 @@ name: Update Contrib and Patreons in credits on: workflow_dispatch: - schedule: - - cron: 0 0 * * 0 + # schedule: # Frontier + # - cron: 0 0 * * 0 # Frontier jobs: get_credits: @@ -34,8 +34,22 @@ jobs: # Uncomment this and comment the other line if you do this. # https://github.com/stefanzweifel/git-auto-commit-action#push-to-protected-branches - - name: Commit new credit files - uses: stefanzweifel/git-auto-commit-action@v4 + #- name: Commit new credit files + # uses: stefanzweifel/git-auto-commit-action@v4 + # with: + # commit_message: Update Credits + # commit_author: PJBot + + # Taken from DeltaV, thank you mirrorcult, deltanedas. + # This will make a PR + - name: Set current date as env variable + run: echo "NOW=$(date +'%Y-%m-%dT%H-%M-%S')" >> $GITHUB_ENV + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 with: - commit_message: Update Credits - commit_author: FrontierATC + commit-message: Update Credits + title: Update Credits + body: This is an automated Pull Request. This PR updates the github contributors in the credits section. + author: FrontierATC + branch: automated/credits-${{env.NOW}} diff --git a/Content.Client/Actions/ActionsSystem.cs b/Content.Client/Actions/ActionsSystem.cs index 26a22fa8b8d..7b13233bab5 100644 --- a/Content.Client/Actions/ActionsSystem.cs +++ b/Content.Client/Actions/ActionsSystem.cs @@ -51,6 +51,29 @@ public override void Initialize() SubscribeLocalEvent(OnEntityWorldTargetHandleState); } + public override void FrameUpdate(float frameTime) + { + base.FrameUpdate(frameTime); + + var worldActionQuery = EntityQueryEnumerator(); + while (worldActionQuery.MoveNext(out var uid, out var action)) + { + UpdateAction(uid, action); + } + + var instantActionQuery = EntityQueryEnumerator(); + while (instantActionQuery.MoveNext(out var uid, out var action)) + { + UpdateAction(uid, action); + } + + var entityActionQuery = EntityQueryEnumerator(); + while (entityActionQuery.MoveNext(out var uid, out var action)) + { + UpdateAction(uid, action); + } + } + private void OnInstantHandleState(EntityUid uid, InstantActionComponent component, ref ComponentHandleState args) { if (args.Current is not InstantActionComponentState state) @@ -95,6 +118,8 @@ private void BaseHandleState(EntityUid uid, BaseActionComponent component, Ba component.Icon = state.Icon; component.IconOn = state.IconOn; component.IconColor = state.IconColor; + component.OriginalIconColor = state.OriginalIconColor; + component.DisabledIconColor = state.DisabledIconColor; component.Keywords.Clear(); component.Keywords.UnionWith(state.Keywords); component.Enabled = state.Enabled; @@ -125,6 +150,8 @@ public override void UpdateAction(EntityUid? actionId, BaseActionComponent? acti if (!ResolveActionData(actionId, ref action)) return; + action.IconColor = action.Charges < 1 ? action.DisabledIconColor : action.OriginalIconColor; + base.UpdateAction(actionId, action); if (_playerManager.LocalEntity != action.AttachedEntity) return; diff --git a/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml.cs b/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml.cs index f0b7ffbe119..81c9a409a3b 100644 --- a/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml.cs +++ b/Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml.cs @@ -23,6 +23,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow { private readonly IEntityManager _entManager; private readonly SpriteSystem _spriteSystem; + private readonly SharedNavMapSystem _navMapSystem; private EntityUid? _owner; private NetEntity? _trackedEntity; @@ -42,19 +43,32 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow private const float SilencingDuration = 2.5f; + // Colors + private Color _wallColor = new Color(64, 64, 64); + private Color _tileColor = new Color(28, 28, 28); + private Color _monitorBlipColor = Color.Cyan; + private Color _untrackedEntColor = Color.DimGray; + private Color _regionBaseColor = new Color(154, 154, 154); + private Color _inactiveColor = StyleNano.DisabledFore; + private Color _statusTextColor = StyleNano.GoodGreenFore; + private Color _goodColor = Color.LimeGreen; + private Color _warningColor = new Color(255, 182, 72); + private Color _dangerColor = new Color(255, 67, 67); + public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInterface, EntityUid? owner) { RobustXamlLoader.Load(this); _entManager = IoCManager.Resolve(); _spriteSystem = _entManager.System(); + _navMapSystem = _entManager.System(); // Pass the owner to nav map _owner = owner; NavMap.Owner = _owner; // Set nav map colors - NavMap.WallColor = new Color(64, 64, 64); - NavMap.TileColor = Color.DimGray * NavMap.WallColor; + NavMap.WallColor = _wallColor; + NavMap.TileColor = _tileColor; // Set nav map grid uid var stationName = Loc.GetString("atmos-alerts-window-unknown-location"); @@ -179,6 +193,9 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[ // Add tracked entities to the nav map foreach (var device in console.AtmosDevices) { + if (!device.NetEntity.Valid) + continue; + if (!NavMap.Visible) continue; @@ -209,7 +226,7 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[ if (consoleCoords != null && consoleUid != null) { var texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png"))); - var blip = new NavMapBlip(consoleCoords.Value, texture, Color.Cyan, true, false); + var blip = new NavMapBlip(consoleCoords.Value, texture, _monitorBlipColor, true, false); NavMap.TrackedEntities[consoleUid.Value] = blip; } @@ -258,7 +275,7 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[ VerticalAlignment = VAlignment.Center, }; - label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", StyleNano.GoodGreenFore.ToHexNoAlpha()))); + label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", _statusTextColor.ToHexNoAlpha()))); AlertsTable.AddChild(label); } @@ -270,6 +287,34 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[ else MasterTabContainer.SetTabTitle(0, Loc.GetString("atmos-alerts-window-tab-alerts", ("value", activeAlarmCount))); + // Update sensor regions + NavMap.RegionOverlays.Clear(); + var prioritizedRegionOverlays = new Dictionary(); + + if (_owner != null && + _entManager.TryGetComponent(_owner, out var xform) && + _entManager.TryGetComponent(xform.GridUid, out var navMap)) + { + var regionOverlays = _navMapSystem.GetNavMapRegionOverlays(_owner.Value, navMap, AtmosAlertsComputerUiKey.Key); + + foreach (var (regionOwner, regionOverlay) in regionOverlays) + { + var alarmState = GetAlarmState(regionOwner); + + if (!TryGetSensorRegionColor(regionOwner, alarmState, out var regionColor)) + continue; + + regionOverlay.Color = regionColor; + + var priority = (_trackedEntity == regionOwner) ? 999 : (int)alarmState; + prioritizedRegionOverlays.Add(regionOverlay, priority); + } + + // Sort overlays according to their priority + var sortedOverlays = prioritizedRegionOverlays.OrderBy(x => x.Value).Select(x => x.Key).ToList(); + NavMap.RegionOverlays = sortedOverlays; + } + // Auto-scroll re-enable if (_autoScrollAwaitsUpdate) { @@ -290,7 +335,7 @@ private void AddTrackedEntityToNavMap(AtmosAlertsDeviceNavMapData metaData, Atmo var coords = _entManager.GetCoordinates(metaData.NetCoordinates); if (_trackedEntity != null && _trackedEntity != metaData.NetEntity) - color *= Color.DimGray; + color *= _untrackedEntColor; var selectable = true; var blip = new NavMapBlip(coords, _spriteSystem.Frame0(texture), color, _trackedEntity == metaData.NetEntity, selectable); @@ -298,6 +343,24 @@ private void AddTrackedEntityToNavMap(AtmosAlertsDeviceNavMapData metaData, Atmo NavMap.TrackedEntities[metaData.NetEntity] = blip; } + private bool TryGetSensorRegionColor(NetEntity regionOwner, AtmosAlarmType alarmState, out Color color) + { + color = Color.White; + + var blip = GetBlipTexture(alarmState); + + if (blip == null) + return false; + + // Color the region based on alarm state and entity tracking + color = blip.Value.Item2 * _regionBaseColor; + + if (_trackedEntity != null && _trackedEntity != regionOwner) + color *= _untrackedEntColor; + + return true; + } + private void UpdateUIEntry(AtmosAlertsComputerEntry entry, int index, Control table, AtmosAlertsComputerComponent console, AtmosAlertsFocusDeviceData? focusData = null) { // Make new UI entry if required @@ -534,13 +597,13 @@ private AtmosAlarmType GetAlarmState(NetEntity netEntity) switch (alarmState) { case AtmosAlarmType.Invalid: - output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), StyleNano.DisabledFore); break; + output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _inactiveColor); break; case AtmosAlarmType.Normal: - output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), Color.LimeGreen); break; + output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _goodColor); break; case AtmosAlarmType.Warning: - output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), new Color(255, 182, 72)); break; + output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), _warningColor); break; case AtmosAlarmType.Danger: - output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), new Color(255, 67, 67)); break; + output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), _dangerColor); break; } return output; diff --git a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs index 9864dbcb2a9..7d7d77f51a3 100644 --- a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs +++ b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs @@ -20,7 +20,6 @@ public sealed partial class ContentAudioSystem { [Dependency] private readonly IBaseClient _client = default!; [Dependency] private readonly ClientGameTicker _gameTicker = default!; - [Dependency] private readonly IStateManager _stateManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f); @@ -71,7 +70,7 @@ private void InitializeLobbyMusic() Subs.CVar(_configManager, CCVars.LobbyMusicEnabled, LobbyMusicCVarChanged); Subs.CVar(_configManager, CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged); - _stateManager.OnStateChanged += StateManagerOnStateChanged; + _state.OnStateChanged += StateManagerOnStateChanged; _client.PlayerLeaveServer += OnLeave; @@ -115,7 +114,7 @@ private void LobbyMusicVolumeCVarChanged(float volume) private void LobbyMusicCVarChanged(bool musicEnabled) { - if (musicEnabled && _stateManager.CurrentState is LobbyState) + if (musicEnabled && _state.CurrentState is LobbyState) { StartLobbyMusic(); } @@ -234,7 +233,7 @@ private void PlayRestartSound(RoundRestartCleanupEvent ev) private void ShutdownLobbyMusic() { - _stateManager.OnStateChanged -= StateManagerOnStateChanged; + _state.OnStateChanged -= StateManagerOnStateChanged; _client.PlayerLeaveServer -= OnLeave; diff --git a/Content.Client/Bank/BUI/StationBankATMMenuBoundUserInterface.cs b/Content.Client/Bank/BUI/StationBankATMMenuBoundUserInterface.cs index 028e5db36e6..e3d7fb3fc77 100644 --- a/Content.Client/Bank/BUI/StationBankATMMenuBoundUserInterface.cs +++ b/Content.Client/Bank/BUI/StationBankATMMenuBoundUserInterface.cs @@ -1,8 +1,6 @@ using Content.Client.Bank.UI; using Content.Shared.Bank.BUI; using Content.Shared.Bank.Events; -using Robust.Client.GameObjects; -using Content.Shared.Access.Systems; namespace Content.Client.Cargo.BUI; @@ -35,18 +33,18 @@ protected override void Dispose(bool disposing) private void OnWithdraw() { - if (_menu?.Amount is not int amount) + if (_menu?.WithdrawalAmount is not int amount) return; - SendMessage(new StationBankWithdrawMessage(amount, _menu.Reason, _menu.Description)); + SendMessage(new StationBankWithdrawMessage(amount, _menu.WithdrawalReason, _menu.WithdrawalDescription)); } private void OnDeposit() { - if (_menu?.Amount is not int amount) + if (_menu?.DepositAmount is not int amount) return; - SendMessage(new StationBankDepositMessage(amount, _menu.Reason, _menu.Description)); + SendMessage(new StationBankDepositMessage(amount, _menu.DepositReason, _menu.DepositDescription)); } protected override void UpdateState(BoundUserInterfaceState state) diff --git a/Content.Client/Bank/BUI/WithdrawlBankATMMenuBoundUserInterface.cs b/Content.Client/Bank/BUI/WithdrawlBankATMMenuBoundUserInterface.cs index e59c5325861..54fabcf7d70 100644 --- a/Content.Client/Bank/BUI/WithdrawlBankATMMenuBoundUserInterface.cs +++ b/Content.Client/Bank/BUI/WithdrawlBankATMMenuBoundUserInterface.cs @@ -1,7 +1,6 @@ using Content.Client.Bank.UI; using Content.Shared.Bank.BUI; using Content.Shared.Bank.Events; -using Robust.Client.GameObjects; namespace Content.Client.Cargo.BUI; diff --git a/Content.Client/Bank/UI/StationBankATMMenu.xaml b/Content.Client/Bank/UI/StationBankATMMenu.xaml index 60f1fe06954..da0e46409f5 100644 --- a/Content.Client/Bank/UI/StationBankATMMenu.xaml +++ b/Content.Client/Bank/UI/StationBankATMMenu.xaml @@ -1,45 +1,54 @@ - - + SetSize="360 315" + MinSize="360 315"> + + - + Text="{Loc 'bank-atm-menu-no-bank'}" /> + - + StyleClasses="LabelKeyText" + HorizontalAlignment="Right" /> + + - + HorizontalAlignment="Right" /> + + - + +