Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "upstream merge 22/9" #1892

Merged
merged 1 commit into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 17 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,21 @@ jobs:
- name: Package client
run: dotnet run --project Content.Packaging client --no-wipe-release

- name: Upload build artifact
id: artifact-upload-step
uses: actions/upload-artifact@v4
with:
name: build
path: release/*.zip
compression-level: 0
retention-days: 0

- name: Publish version
run: Tools/publish_multi_request.py
run: Tools/publish_github_artifact.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
ARTIFACT_ID: ${{ steps.artifact-upload-step.outputs.artifact-id }}
GITHUB_REPOSITORY: ${{ vars.GITHUB_REPOSITORY }}

- name: Publish changelog (Discord)
Expand All @@ -57,3 +68,8 @@ jobs:
run: Tools/actions_changelog_rss.py
env:
CHANGELOG_RSS_KEY: ${{ secrets.CHANGELOG_RSS_KEY }}

- uses: geekyeggo/delete-artifact@v5
if: always()
with:
name: build
2 changes: 1 addition & 1 deletion Content.Client/Actions/ActionsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public void LoadActionAssignments(string path, bool userData)
continue;

var action = _serialization.Read<BaseActionComponent>(actionNode, notNullableOverride: true);
var actionId = Spawn();
var actionId = Spawn(null);
AddComp(actionId, action);
AddActionDirect(user, actionId);

Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Actions/UI/ActionAlertTooltip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected override void FrameUpdate(FrameEventArgs args)
{
var duration = Cooldown.Value.End - Cooldown.Value.Start;

if (!FormattedMessage.TryFromMarkup(Loc.GetString("ui-actionslot-duration", ("duration", (int)duration.TotalSeconds), ("timeLeft", (int)timeLeft.TotalSeconds + 1)), out var markup))
if (!FormattedMessage.TryFromMarkup($"[color=#a10505]{(int) duration.TotalSeconds} sec cooldown ({(int) timeLeft.TotalSeconds + 1} sec remaining)[/color]", out var markup))
return;

_cooldownLabel.SetMessage(markup);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using System.Linq;
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Preferences.Loadouts;
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Prototypes;

namespace Content.Client.Administration.UI.SetOutfit
Expand Down Expand Up @@ -64,18 +65,9 @@ private void SearchBarOnOnTextChanged(LineEdit.LineEditEventArgs obj)
PopulateByFilter(SearchBar.Text);
}

private IEnumerable<StartingGearPrototype> GetPrototypes()
{
// Filter out any StartingGearPrototypes that belong to loadouts
var loadouts = _prototypeManager.EnumeratePrototypes<LoadoutPrototype>();
var loadoutGears = loadouts.Select(l => l.StartingGear);
return _prototypeManager.EnumeratePrototypes<StartingGearPrototype>()
.Where(p => !loadoutGears.Contains(p.ID));
}

private void PopulateList()
{
foreach (var gear in GetPrototypes())
foreach (var gear in _prototypeManager.EnumeratePrototypes<StartingGearPrototype>())
{
OutfitList.Add(GetItem(gear, OutfitList));
}
Expand All @@ -84,7 +76,7 @@ private void PopulateList()
private void PopulateByFilter(string filter)
{
OutfitList.Clear();
foreach (var gear in GetPrototypes())
foreach (var gear in _prototypeManager.EnumeratePrototypes<StartingGearPrototype>())
{
if (!string.IsNullOrEmpty(filter) &&
gear.ID.ToLowerInvariant().Contains(filter.Trim().ToLowerInvariant()))
Expand Down
12 changes: 1 addition & 11 deletions Content.Client/Anomaly/AnomalySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ public override void Initialize()
SubscribeLocalEvent<AnomalyComponent, AppearanceChangeEvent>(OnAppearanceChanged);
SubscribeLocalEvent<AnomalyComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<AnomalyComponent, AnimationCompletedEvent>(OnAnimationComplete);

SubscribeLocalEvent<AnomalySupercriticalComponent, ComponentShutdown>(OnShutdown);
}

private void OnStartup(EntityUid uid, AnomalyComponent component, ComponentStartup args)
{
_floating.FloatAnimation(uid, component.FloatingOffset, component.AnimationKey, component.AnimationTime);
Expand Down Expand Up @@ -76,13 +75,4 @@ public override void Update(float frameTime)
}
}
}

private void OnShutdown(Entity<AnomalySupercriticalComponent> ent, ref ComponentShutdown args)
{
if (!TryComp<SpriteComponent>(ent, out var sprite))
return;

sprite.Scale = Vector2.One;
sprite.Color = sprite.Color.WithAlpha(1f);
}
}
50 changes: 0 additions & 50 deletions Content.Client/Anomaly/Effects/ClientInnerBodySystem.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Content.Client/Audio/AmbientSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,6 @@ private void ProcessNearbyAmbience(TransformComponent playerXform)
.WithMaxDistance(comp.Range);

var stream = _audio.PlayEntity(comp.Sound, Filter.Local(), uid, false, audioParams);
if (stream == null)
continue;

_playingSounds[sourceEntity] = (stream.Value.Entity, comp.Sound, key);
playingCount++;

Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Audio/ClientGlobalSoundSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void PlayAdminSound(AdminSoundEvent soundEvent)
if(!_adminAudioEnabled) return;

var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
_adminAudio.Add(stream?.Entity);
_adminAudio.Add(stream.Value.Entity);
}

private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
Expand All @@ -76,7 +76,7 @@ private void PlayStationEventMusic(StationEventMusicEvent soundEvent)
if(!_eventAudioEnabled || _eventAudio.ContainsKey(soundEvent.Type)) return;

var stream = _audio.PlayGlobal(soundEvent.Filename, Filter.Local(), false, soundEvent.AudioParams);
_eventAudio.Add(soundEvent.Type, stream?.Entity);
_eventAudio.Add(soundEvent.Type, stream.Value.Entity);
}

private void PlayGameSound(GameGlobalSoundEvent soundEvent)
Expand Down
4 changes: 2 additions & 2 deletions Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ private void UpdateAmbientMusic()
false,
AudioParams.Default.WithVolume(_musicProto.Sound.Params.Volume + _volumeSlider));

_ambientMusicStream = strim?.Entity;
_ambientMusicStream = strim.Value.Entity;

if (_musicProto.FadeIn && strim != null)
if (_musicProto.FadeIn)
{
FadeIn(_ambientMusicStream, strim.Value.Component, AmbientMusicFadeTime);
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private void PlaySoundtrack(string soundtrackFilename)
false,
_lobbySoundtrackParams.WithVolume(_lobbySoundtrackParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume)))
);
if (playResult == null)
if (playResult.Value.Entity == default)
{
_sawmill.Warning(
$"Tried to play lobby soundtrack '{{Filename}}' using {nameof(SharedAudioSystem)}.{nameof(SharedAudioSystem.PlayGlobal)} but it returned default value of EntityUid!",
Expand Down
52 changes: 50 additions & 2 deletions Content.Client/Commands/ActionsCommands.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using Content.Client.Actions;
using System.IO;
using Content.Client.Actions;
using Content.Client.Mapping;
using Content.Shared.Administration;
using Robust.Client.UserInterface;
using Robust.Shared.Console;
using YamlDotNet.RepresentationModel;

namespace Content.Client.Commands;

Expand Down Expand Up @@ -46,7 +50,7 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 1)
{
shell.WriteLine(Help);
LoadActs(); // DeltaV - Load from a file dialogue instead
return;
}

Expand All @@ -59,4 +63,48 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
}
}

/// <summary>
/// DeltaV - Load actions from a file stream instead
/// </summary>
private static async void LoadActs()
{
var fileMan = IoCManager.Resolve<IFileDialogManager>();
var actMan = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ActionsSystem>();

var stream = await fileMan.OpenFile(new FileDialogFilters(new FileDialogFilters.Group("yml")));
if (stream is null)
return;

var reader = new StreamReader(stream);
var yamlStream = new YamlStream();
yamlStream.Load(reader);

actMan.LoadActionAssignments(yamlStream);
reader.Close();
}
}

[AnyCommand]
public sealed class LoadMappingActionsCommand : LocalizedCommands
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;

public const string CommandName = "loadmapacts";

public override string Command => CommandName;

public override string Help => LocalizationManager.GetString($"cmd-{Command}-help", ("command", Command));

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
try
{
_entitySystemManager.GetEntitySystem<MappingSystem>().LoadMappingActions();
}
catch
{
shell.WriteError(LocalizationManager.GetString($"cmd-{Command}-error"));
}
}
}
7 changes: 2 additions & 5 deletions Content.Client/Commands/MappingClientSideSetupCommand.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Content.Client.Mapping;
using Content.Client.Markers;
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.State;
using Robust.Shared.Console;

namespace Content.Client.Commands;
Expand All @@ -12,7 +10,6 @@ internal sealed class MappingClientSideSetupCommand : LocalizedCommands
{
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly ILightManager _lightManager = default!;
[Dependency] private readonly IStateManager _stateManager = default!;

public override string Command => "mappingclientsidesetup";

Expand All @@ -24,8 +21,8 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
_entitySystemManager.GetEntitySystem<MarkerSystem>().MarkersVisible = true;
_lightManager.Enabled = false;
shell.ExecuteCommand("showsubfloorforever");
_stateManager.RequestStateChange<MappingState>();
shell.ExecuteCommand(ShowSubFloorForever.CommandName);
shell.ExecuteCommand(LoadMappingActionsCommand.CommandName);
}
}
}
Expand Down
38 changes: 2 additions & 36 deletions Content.Client/ContextMenu/UI/ContextMenuUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Threading;
using Content.Client.CombatMode;
using Content.Client.Gameplay;
using Content.Client.Mapping;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controllers;
using Timer = Robust.Shared.Timing.Timer;
Expand All @@ -17,7 +16,7 @@ namespace Content.Client.ContextMenu.UI
/// <remarks>
/// This largely involves setting up timers to open and close sub-menus when hovering over other menu elements.
/// </remarks>
public sealed class ContextMenuUIController : UIController, IOnStateEntered<GameplayState>, IOnStateExited<GameplayState>, IOnSystemChanged<CombatModeSystem>, IOnStateEntered<MappingState>, IOnStateExited<MappingState>
public sealed class ContextMenuUIController : UIController, IOnStateEntered<GameplayState>, IOnStateExited<GameplayState>, IOnSystemChanged<CombatModeSystem>
{
public static readonly TimeSpan HoverDelay = TimeSpan.FromSeconds(0.2);

Expand All @@ -43,51 +42,18 @@ public sealed class ContextMenuUIController : UIController, IOnStateEntered<Game
public Action<ContextMenuElement>? OnSubMenuOpened;
public Action<ContextMenuElement, GUIBoundKeyEventArgs>? OnContextKeyEvent;

private bool _setup;

public void OnStateEntered(GameplayState state)
{
Setup();
}

public void OnStateExited(GameplayState state)
{
Shutdown();
}

public void OnStateEntered(MappingState state)
{
Setup();
}

public void OnStateExited(MappingState state)
{
Shutdown();
}

public void Setup()
{
if (_setup)
return;

_setup = true;

RootMenu = new(this, null);
RootMenu.OnPopupHide += Close;
Menus.Push(RootMenu);
}

public void Shutdown()
public void OnStateExited(GameplayState state)
{
if (!_setup)
return;

_setup = false;

Close();
RootMenu.OnPopupHide -= Close;
RootMenu.Dispose();
RootMenu = default!;
}

/// <summary>
Expand Down
Loading
Loading