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

Upstream sync #567

Merged
merged 64 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
46cfd63
Add changelog for loadouts (#27020)
VasilisThePikachu Apr 16, 2024
33888b6
Automatic changelog update
PJBot Apr 16, 2024
e2be85b
Fix senior ID cards and other loadout shit (#27017)
Dutch-VanDerLinde Apr 16, 2024
5e7f224
Automatic changelog update
PJBot Apr 16, 2024
bbf0505
Re-add IAdminRemarksCommon to DB model for SS14.Admin (#27028)
PJB3005 Apr 16, 2024
d5b7e4b
Add autism pins to loadout (#27034)
Doctor-Cpu Apr 17, 2024
34fa48b
Add winter coats and shoes to loadouts (#27022)
Dutch-VanDerLinde Apr 17, 2024
30f73cf
Automatic changelog update
PJBot Apr 17, 2024
fcd6c25
LobbyUI fixes (#27033)
metalgearsloth Apr 17, 2024
4fa245f
Automatic changelog update
PJBot Apr 17, 2024
c31b3fd
Lower player requirements for nukies back down to 20 (#27036)
MACMAN2003 Apr 17, 2024
5ee597d
Automatic changelog update
PJBot Apr 17, 2024
7114b19
Add Nun Hood to Chaplain loadout options (#27025)
BellwetherLogic Apr 17, 2024
f825e5e
Automatic changelog update
PJBot Apr 17, 2024
3a32e3e
Locale tweaks (#2042)
lapatison Apr 17, 2024
7b11f87
Fix station goal stamp color (#2046)
lzk228 Apr 17, 2024
c9c931c
Update Maus (#2041)
lzk228 Apr 17, 2024
5ba5641
Update Paper Station (#2038)
Apr 17, 2024
5742dee
add ancient jumpsuit to passenger loadout (#27035)
Dutch-VanDerLinde Apr 17, 2024
177d69c
Update submodule to 218.2.0 (#27041)
metalgearsloth Apr 17, 2024
2db3749
Added Jukebox (#26736)
metalgearsloth Apr 17, 2024
ceef55b
Automatic changelog update
PJBot Apr 17, 2024
e2341c0
Add jani gloves loadout (#27011)
lzk228 Apr 17, 2024
5b8468c
Mobs auto state handlers (#26957)
CheesePlated Apr 17, 2024
432e6ec
Fix capitalization for pirates and rats (#26644)
Vermidia Apr 17, 2024
03f51ca
Automatic changelog update
PJBot Apr 17, 2024
f9f204a
Fix character preview not updating on character change (#27043)
metalgearsloth Apr 17, 2024
0785516
Automatic changelog update
PJBot Apr 17, 2024
afcdc8b
Fixed gloved weapons being able to attack when not equipped. (#26762)
beck-thompson Apr 17, 2024
9f461de
Automatic changelog update
PJBot Apr 17, 2024
24390ef
Make cargo pallets smoothing with eachother (#27049)
lzk228 Apr 17, 2024
ef72d3c
Revert "Update .editorconfig to correspond Code Conventions" (#27051)
PJB3005 Apr 17, 2024
5a5efa1
Show volume on the gas analyzer (#25720)
slarticodefast Apr 17, 2024
20b1694
Automatic changelog update
PJBot Apr 17, 2024
009d06d
Navmap rework (#26713)
chromiumboy Apr 17, 2024
e0589a1
fland update (#27064)
Emisse Apr 17, 2024
f2ed508
meta update (#27067)
Emisse Apr 17, 2024
d086002
saltern update (#26507)
deltanedas Apr 17, 2024
4673361
atlas artifact update (#26506)
deltanedas Apr 17, 2024
395c330
prop hunt ss14 (real) (#26691)
deltanedas Apr 17, 2024
a376f47
Automatic changelog update
PJBot Apr 17, 2024
da13682
box update (#27069)
Emisse Apr 17, 2024
a95fc86
Fix PDA and ID card data not getting set on loadouts (#27062)
ShadowCommander Apr 17, 2024
d2dc073
Automatic changelog update
PJBot Apr 17, 2024
d67d782
Standardize HoS/Warden winter coats, add unarmored variants for print…
Krunklehorn Apr 18, 2024
5659edd
Chances of triggering effects (#27056)
TheShuEd Apr 18, 2024
92089da
Automatic changelog update
PJBot Apr 18, 2024
fd109d6
cargo console radio messages on approving (#27038)
icekot8 Apr 18, 2024
45cefc9
Automatic changelog update
PJBot Apr 18, 2024
40d90dd
Make Holy Water more like Water (#27068)
Ghagliiarghii Apr 18, 2024
8213c89
Low-Key Zombie Rebalance (#27060)
BellwetherLogic Apr 18, 2024
d762115
Automatic changelog update
PJBot Apr 18, 2024
66f32d4
Partially reverts the remote signaller resprite (#27073)
Flareguy Apr 18, 2024
4453fe5
fix soap popup (#27054)
MisterMecky Apr 18, 2024
ac8d3d5
Automatic changelog update
PJBot Apr 18, 2024
b3ee929
Reduces the captain's sabre reflect chance to 10% (#26969)
deepdarkdepths Apr 18, 2024
06ecf2a
add greysec loadout (#27023)
Dutch-VanDerLinde Apr 18, 2024
8d64d2b
Automatic changelog update
PJBot Apr 18, 2024
cfa94be
Add ability to shake fizzy drinks so they spray in peoples' faces (#2…
Tayrtahn Apr 18, 2024
b672ea7
Automatic changelog update
PJBot Apr 18, 2024
5cd5a5d
Merge remote-tracking branch 'upstream/master' into upstream-sync
Rxup Apr 18, 2024
62c7945
Merge remote-tracking branch 'wizard/master' into upstream-sync
Rxup Apr 18, 2024
21b6aa4
upd
Rxup Apr 18, 2024
42a3aea
upd
Rxup Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ indent_style = space
tab_width = 4

# New line preferences
end_of_line = crlf:suggestion
#end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true

Expand Down Expand Up @@ -104,7 +104,6 @@ csharp_preferred_modifier_order = public, private, protected, internal, new, abs

# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:silent
csharp_style_namespace_declarations = file_scoped:suggestion

#### C# Formatting Rules ####

Expand Down
20 changes: 20 additions & 0 deletions Content.Client/Atmos/UI/GasAnalyzerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,26 @@ private void GenerateGasDisplay(GasMixEntry gasMix, Control parent)
parent.AddChild(panel);
panel.AddChild(dataContainer);

// Volume label
var volBox = new BoxContainer { Orientation = BoxContainer.LayoutOrientation.Horizontal };

volBox.AddChild(new Label
{
Text = Loc.GetString("gas-analyzer-window-volume-text")
});
volBox.AddChild(new Control
{
MinSize = new Vector2(10, 0),
HorizontalExpand = true
});
volBox.AddChild(new Label
{
Text = Loc.GetString("gas-analyzer-window-volume-val-text", ("volume", $"{gasMix.Volume:0.##}")),
Align = Label.AlignMode.Right,
HorizontalExpand = true
});
dataContainer.AddChild(volBox);

// Pressure label
var presBox = new BoxContainer { Orientation = BoxContainer.LayoutOrientation.Horizontal };

Expand Down
119 changes: 119 additions & 0 deletions Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
using Content.Shared.Audio.Jukebox;
using Robust.Client.Audio;
using Robust.Client.Player;
using Robust.Shared.Audio.Components;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

namespace Content.Client.Audio.Jukebox;

public sealed class JukeboxBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;

[ViewVariables]
private JukeboxMenu? _menu;

public JukeboxBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
IoCManager.InjectDependencies(this);
}

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

_menu = new JukeboxMenu();
_menu.OnClose += Close;
_menu.OpenCentered();

_menu.OnPlayPressed += args =>
{
if (args)
{
SendMessage(new JukeboxPlayingMessage());
}
else
{
SendMessage(new JukeboxPauseMessage());
}
};

_menu.OnStopPressed += () =>
{
SendMessage(new JukeboxStopMessage());
};

_menu.OnSongSelected += SelectSong;

_menu.SetTime += SetTime;
PopulateMusic();
Reload();
}

/// <summary>
/// Reloads the attached menu if it exists.
/// </summary>
public void Reload()
{
if (_menu == null || !EntMan.TryGetComponent(Owner, out JukeboxComponent? jukebox))
return;

_menu.SetAudioStream(jukebox.AudioStream);

if (_protoManager.TryIndex(jukebox.SelectedSongId, out var songProto))
{
var length = EntMan.System<AudioSystem>().GetAudioLength(songProto.Path.Path.ToString());
_menu.SetSelectedSong(songProto.Name, (float) length.TotalSeconds);
}
else
{
_menu.SetSelectedSong(string.Empty, 0f);
}
}

public void PopulateMusic()
{
_menu?.Populate(_protoManager.EnumeratePrototypes<JukeboxPrototype>());
}

public void SelectSong(ProtoId<JukeboxPrototype> songid)
{
SendMessage(new JukeboxSelectedMessage(songid));
}

public void SetTime(float time)
{
var sentTime = time;

// You may be wondering, what the fuck is this
// Well we want to be able to predict the playback slider change, of which there are many ways to do it
// We can't just use SendPredictedMessage because it will reset every tick and audio updates every frame
// so it will go BRRRRT
// Using ping gets us close enough that it SHOULD, MOST OF THE TIME, fall within the 0.1 second tolerance
// that's still on engine so our playback position never gets corrected.
if (EntMan.TryGetComponent(Owner, out JukeboxComponent? jukebox) &&
EntMan.TryGetComponent(jukebox.AudioStream, out AudioComponent? audioComp))
{
audioComp.PlaybackPosition = time;
}

SendMessage(new JukeboxSetTimeMessage(sentTime));
}

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

if (_menu == null)
return;

_menu.OnClose -= Close;
_menu.Dispose();
_menu = null;
}
}

18 changes: 18 additions & 0 deletions Content.Client/Audio/Jukebox/JukeboxMenu.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<ui:FancyWindow xmlns="https://spacestation14.io" xmlns:ui="clr-namespace:Content.Client.UserInterface.Controls"
SetSize="400 500" Title="{Loc 'jukebox-menu-title'}">
<BoxContainer Margin="4 0" Orientation="Vertical">
<ItemList Name="MusicList" SelectMode="Button" Margin="3 3 3 3"
HorizontalExpand="True" VerticalExpand="True" SizeFlagsStretchRatio="8"/>
<BoxContainer Orientation="Vertical">
<Label Name="SongSelected" Text="{Loc 'jukebox-menu-selectedsong'}" />
<Label Name="SongName" Text="---" />
<Slider Name="PlaybackSlider" HorizontalExpand="True" />
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True"
VerticalExpand="False" SizeFlagsStretchRatio="1">
<Button Name="PlayButton" Text="{Loc 'jukebox-menu-buttonplay'}" />
<Button Name="StopButton" Text="{Loc 'jukebox-menu-buttonstop'}" />
<Label Name="DurationLabel" Text="00:00 / 00:00" HorizontalAlignment="Right" HorizontalExpand="True"/>
</BoxContainer>
</BoxContainer>
</ui:FancyWindow>
166 changes: 166 additions & 0 deletions Content.Client/Audio/Jukebox/JukeboxMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
using Content.Shared.Audio.Jukebox;
using Robust.Client.Audio;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Audio.Components;
using Robust.Shared.Input;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using FancyWindow = Content.Client.UserInterface.Controls.FancyWindow;

namespace Content.Client.Audio.Jukebox;

[GenerateTypedNameReferences]
public sealed partial class JukeboxMenu : FancyWindow
{
[Dependency] private readonly IEntityManager _entManager = default!;
private AudioSystem _audioSystem;

/// <summary>
/// Are we currently 'playing' or paused for the play / pause button.
/// </summary>
private bool _playState;

/// <summary>
/// True if playing, false if paused.
/// </summary>
public event Action<bool>? OnPlayPressed;
public event Action? OnStopPressed;
public event Action<ProtoId<JukeboxPrototype>>? OnSongSelected;
public event Action<float>? SetTime;

private EntityUid? _audio;

private float _lockTimer;

public JukeboxMenu()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_audioSystem = _entManager.System<AudioSystem>();

MusicList.OnItemSelected += args =>
{
var entry = MusicList[args.ItemIndex];

if (entry.Metadata is not string juke)
return;

OnSongSelected?.Invoke(juke);
};

PlayButton.OnPressed += args =>
{
OnPlayPressed?.Invoke(!_playState);
};

StopButton.OnPressed += args =>
{
OnStopPressed?.Invoke();
};
PlaybackSlider.OnReleased += PlaybackSliderKeyUp;

SetPlayPauseButton(_audioSystem.IsPlaying(_audio), force: true);
}

public JukeboxMenu(AudioSystem audioSystem)
{
_audioSystem = audioSystem;
}

public void SetAudioStream(EntityUid? audio)
{
_audio = audio;
}

private void PlaybackSliderKeyUp(Slider args)
{
SetTime?.Invoke(PlaybackSlider.Value);
_lockTimer = 0.5f;
}

/// <summary>
/// Re-populates the list of jukebox prototypes available.
/// </summary>
public void Populate(IEnumerable<JukeboxPrototype> jukeboxProtos)
{
MusicList.Clear();

foreach (var entry in jukeboxProtos)
{
MusicList.AddItem(entry.Name, metadata: entry.ID);
}
}

public void SetPlayPauseButton(bool playing, bool force = false)
{
if (_playState == playing && !force)
return;

_playState = playing;

if (playing)
{
PlayButton.Text = Loc.GetString("jukebox-menu-buttonpause");
return;
}

PlayButton.Text = Loc.GetString("jukebox-menu-buttonplay");
}

public void SetSelectedSong(string name, float length)
{
SetSelectedSongText(name);
PlaybackSlider.MaxValue = length;
PlaybackSlider.SetValueWithoutEvent(0);
}

protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);

if (_lockTimer > 0f)
{
_lockTimer -= args.DeltaSeconds;
}

PlaybackSlider.Disabled = _lockTimer > 0f;

if (_entManager.TryGetComponent(_audio, out AudioComponent? audio))
{
DurationLabel.Text = $@"{TimeSpan.FromSeconds(audio.PlaybackPosition):mm\:ss} / {_audioSystem.GetAudioLength(audio.FileName):mm\:ss}";
}
else
{
DurationLabel.Text = $"00:00 / 00:00";
}

if (PlaybackSlider.Grabbed)
return;

if (audio != null || _entManager.TryGetComponent(_audio, out audio))
{
PlaybackSlider.SetValueWithoutEvent(audio.PlaybackPosition);
}
else
{
PlaybackSlider.SetValueWithoutEvent(0f);
}

SetPlayPauseButton(_audioSystem.IsPlaying(_audio, audio));
}

public void SetSelectedSongText(string? text)
{
if (!string.IsNullOrEmpty(text))
{
SongName.Text = text;
}
else
{
SongName.Text = "---";
}
}
}
Loading
Loading