This repository has been archived by the owner on Dec 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Jukebox #208
Open
DEATHB4DEFEAT
wants to merge
20
commits into
master
Choose a base branch
from
jukebox
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Jukebox #208
Changes from 11 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4c8283b
All of it
Pspritechologist 968a037
Merge branch 'master' of https://github.com/Simple-Station/Parkstatio…
Pspritechologist bebc7a8
it.. works?
DEATHB4DEFEAT 49e82e4
Removed borked scrolls, fixed trackbar
Pspritechologist 41fe374
what
DEATHB4DEFEAT a5ac623
Merge branch 'master' of https://github.com/Park-station/Parkstation …
DEATHB4DEFEAT 6945164
it's something?
DEATHB4DEFEAT 719f3fc
locale
DEATHB4DEFEAT 3c44e0b
more queued songs
DEATHB4DEFEAT f2f9c7e
everything stylish
DEATHB4DEFEAT 79ecdab
Jukeboxes can now be emagged. Renamed a handful of things to be less …
Pspritechologist 39e59ff
Handled map pausing, added some docs, and generally clarified things.
Pspritechologist 868e686
Added upgradable Jukebox parts (which means Jukeboxes are constructab…
Pspritechologist 8caa105
Replaced the timer with an update check. Autoplay is working baybee
Pspritechologist be7d1e7
Jukebox now supports signalling, both for controlling it and reacting…
Pspritechologist c16e74a
Several naming and doc clarifications- and Jukeboxes now have proper …
Pspritechologist 29fa453
Tons of stuff.
Pspritechologist 791e9f0
Component uses actual colors
Pspritechologist 5618361
Uses ResPath now
Pspritechologist 32d684c
Danya Vodogonez
Pspritechologist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
Content.Client/SimpleStation14/Jukebox/Ui/JukeboxBoundUserInterface.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
using Content.Shared.SimpleStation14.Jukebox; | ||
using JetBrains.Annotations; | ||
using Robust.Client.GameObjects; | ||
using Robust.Shared.Prototypes; | ||
using Robust.Shared.Timing; | ||
using Content.Shared.SimpleStation14.Prototypes; | ||
|
||
namespace Content.Client.SimpleStation14.Jukebox.Ui; | ||
|
||
[UsedImplicitly] | ||
public sealed class JukeboxBoundUserInterface : BoundUserInterface | ||
{ | ||
[Dependency] private readonly IEntityManager _entity = default!; | ||
|
||
private JukeboxWindow? _window; | ||
|
||
public JukeboxBoundUserInterface(EntityUid owner, Enum uiKey) : base (owner, uiKey) | ||
{ | ||
} | ||
|
||
protected override void Open() | ||
{ | ||
base.Open(); | ||
|
||
if (!_entity.TryGetComponent<JukeboxComponent>(Owner, out var jukeboxComp)) | ||
{ | ||
Logger.Error($"No Jukebox component found for {_entity.ToPrettyString(Owner)}!"); | ||
return; | ||
} | ||
|
||
_window = new JukeboxWindow(this, jukeboxComp) | ||
{ | ||
Title = _entity.GetComponent<MetaDataComponent>(Owner).EntityName | ||
}; | ||
|
||
_window.OpenCentered(); | ||
_window.OnClose += Close; | ||
|
||
_window.OnPlayButtonPressed += () => SendMessage(new JukeboxPlayButtonPressedMessage()); | ||
|
||
_window.OnSkipButtonPressed += () => SendMessage(new JukeboxSkipButtonPressedMessage()); | ||
|
||
_window.OnSongSelected += song => SendMessage(new JukeboxSongSelectedMessage(song)); | ||
} | ||
|
||
protected override void ReceiveMessage(BoundUserInterfaceMessage msg) | ||
{ | ||
base.ReceiveMessage(msg); | ||
|
||
if (msg is not JukeboxUpdateStateMessage jukeboxMessage) | ||
return; | ||
|
||
_window?.UpdateState(jukeboxMessage.PopulateSongs); | ||
} | ||
|
||
protected override void Dispose(bool disposing) | ||
{ | ||
base.Dispose(disposing); | ||
if (!disposing) return; | ||
|
||
_window?.Dispose(); | ||
} | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
Content.Client/SimpleStation14/Jukebox/Ui/JukeboxSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Content.Shared.Emag.Systems; | ||
using Content.Shared.SimpleStation14.Jukebox; | ||
|
||
namespace Content.Shared.SimpleStation14.Jukebox; | ||
|
||
public sealed class SharedJukeBoxSystem : EntitySystem | ||
{ | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
SubscribeLocalEvent<JukeboxComponent, GotEmaggedEvent>(OnEmagged); | ||
} | ||
|
||
/// <summary> | ||
/// Handles setting the Jukebox's state to emagged. | ||
/// </summary> | ||
private void OnEmagged(EntityUid jukeBox, JukeboxComponent jukeboxComp, ref GotEmaggedEvent args) | ||
{ | ||
args.Handled = true; | ||
} | ||
} |
295 changes: 295 additions & 0 deletions
295
Content.Client/SimpleStation14/Jukebox/Ui/JukeboxWindow.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,295 @@ | ||
<controls:FancyWindow | ||
xmlns="https://spacestation14.io" | ||
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client" | ||
Title="null" | ||
SetSize="550 775" | ||
Resizable="False"> | ||
<Control> | ||
<PanelContainer Name="BG_1"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#602C00"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<BoxContainer | ||
Margin="8 0 8 8" | ||
Orientation="Vertical" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"> | ||
|
||
<!-- Upper portion of UI --> | ||
<BoxContainer | ||
MinSize="530 487" | ||
Margin="10 10 10 10" | ||
Orientation="Horizontal"> | ||
<Control> | ||
<PanelContainer | ||
Name="Panel_1"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#767676"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<BoxContainer | ||
Orientation="Horizontal" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"> | ||
|
||
<!-- Left side of upper portion --> | ||
<BoxContainer | ||
MinSize="300 487" | ||
Orientation="Vertical" | ||
Margin="10 10 10 10" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"> | ||
|
||
<!-- Song art --> | ||
<BoxContainer | ||
Orientation="Vertical" | ||
MinSize="270 212" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"> | ||
<TextureRect | ||
Name="SongIcon" | ||
Stretch="KeepAspectCentered" | ||
SetSize="170 170" /> | ||
|
||
<Label | ||
Name="SongName" | ||
MinHeight="42" | ||
Text="Song Name" | ||
HorizontalAlignment="Center" | ||
HorizontalExpand="False" /> | ||
</BoxContainer> | ||
|
||
<!-- Controls/Next up --> | ||
<BoxContainer | ||
MinSize="295 236" | ||
Margin="12 5 12 5" | ||
Orientation="Horizontal" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Left"> | ||
<!-- Controls --> | ||
<BoxContainer | ||
MinSize="69 158" | ||
Orientation="Vertical" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Left"> | ||
|
||
<Control MinSize="69 69" HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<PanelContainer Name="Accent_1" StyleClasses="AngleRect" /> | ||
<TextureButton | ||
Name="PlayButton" | ||
Scale="2 2" | ||
TexturePath="/Textures/SimpleStation14/Interface/MediaControls/playpause.png" | ||
Margin="5 5 5 5" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"/> | ||
</Control> | ||
|
||
<Control MinSize="20 20"/> | ||
|
||
<Control MinSize="69 69" HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<PanelContainer Name="Accent_2" StyleClasses="AngleRect" /> | ||
<TextureButton | ||
Name="SkipButton" | ||
Scale="2 2" | ||
TexturePath="/Textures/SimpleStation14/Interface/MediaControls/skip.png" | ||
Margin="5 5 5 5" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"/> | ||
</Control> | ||
</BoxContainer> | ||
|
||
<Control HorizontalAlignment="Stretch" HorizontalExpand="True" /> | ||
|
||
<!-- Next up --> | ||
<ScrollContainer | ||
Name="NextUpScroll" | ||
MinSize="200 180" | ||
Margin="8 5 5 5" | ||
HScrollEnabled="False"> | ||
<BoxContainer | ||
Name="NextSongsBox" | ||
Orientation="Vertical" | ||
VerticalAlignment="Center"> | ||
<!-- Songs are added here by code --> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
</BoxContainer> | ||
|
||
<!-- Track bar --> | ||
<ProgressBar | ||
Name="RunTimeBar" | ||
MinSize="275 20" | ||
HorizontalExpand="True" | ||
MaxValue="1" | ||
MinValue="0" | ||
SetHeight="25" | ||
VerticalAlignment="Center"/> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</Control> | ||
|
||
<Control MinSize="20 20" /> | ||
|
||
<!-- Right side of upper portion --> | ||
<BoxContainer | ||
MinSize="190 485" | ||
Orientation="Vertical" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"> | ||
<!-- Song picker --> | ||
<Label | ||
Name="SongsLabel" | ||
Text="{Loc 'jukebox-ui-available-songs'}" | ||
MinHeight="42" | ||
HorizontalAlignment="Center" | ||
HorizontalExpand="False" /> | ||
|
||
<Control MinSize="190 445"> | ||
<PanelContainer Name="Panel_2"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#767676"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<BoxContainer | ||
Orientation="Vertical"> | ||
<ScrollContainer | ||
Name="SongPickerScroll" | ||
Margin="8 8 8 8" | ||
MinWidth="182" | ||
MaxWidth="182" | ||
MinHeight="437" | ||
HScrollEnabled="False"> | ||
<BoxContainer | ||
Name="SongPickerBox" | ||
Orientation="Vertical" | ||
Margin="5, 4, 2, 4"> | ||
<!-- Songs are added here by code --> | ||
</BoxContainer> | ||
</ScrollContainer> | ||
</BoxContainer> | ||
</Control> | ||
</BoxContainer> | ||
</BoxContainer> | ||
|
||
<!-- Divider --> | ||
<Control MinSize="512 2" HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<PanelContainer | ||
Name="Accent_3" | ||
StyleClasses="LowDivider"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#20181B"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
</Control> | ||
|
||
<!-- Lower portion of UI --> | ||
<BoxContainer | ||
MinSize="482 172" | ||
Margin="10 10 10 10" | ||
Orientation="Horizontal" | ||
VerticalAlignment="Center" | ||
HorizontalAlignment="Center"> | ||
<!-- Serial number plate --> | ||
<Control MinSize="264 172" Margin="4 4 4 4"> | ||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#9D9EA8"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<Control MinSize="258 164" HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#2D2D2D"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<Control VerticalAlignment="Stretch" /> | ||
|
||
<BoxContainer Orientation="Vertical"> | ||
<!-- Title --> | ||
<RichTextLabel Name="SerialTitle" MaxWidth="255" VerticalAlignment="Top" HorizontalAlignment="Center" /> | ||
|
||
<!-- Divider --> | ||
<Control SetSize="249 2" HorizontalAlignment="Center" VerticalAlignment="Stretch"> | ||
<PanelContainer | ||
Name="Accent_4" | ||
StyleClasses="LowDivider"> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#525252"/> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
</Control> | ||
<Control VerticalAlignment="Stretch" VerticalExpand="True" /> | ||
|
||
<BoxContainer Margin="8 8 8 8" Orientation="Horizontal" VerticalAlignment="Bottom"> | ||
<Label Name="SerialHeader" MinSize="58 22" HorizontalAlignment="Left" Text="S#:" /> | ||
|
||
<Control HorizontalExpand="True" HorizontalAlignment="Stretch" /> | ||
|
||
<Control MinSize="135 30" HorizontalAlignment="Right"> | ||
<PanelContainer StyleClasses="AngleRect" /> | ||
<Label Name="SerialNumber" MinSize="95 20" Text="000000" HorizontalAlignment="Center" /> | ||
</Control> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</Control> | ||
</Control> | ||
|
||
<Control MinSize="30 30" /> | ||
|
||
<BoxContainer MinSize="180 172" Margin="4 4 4 4"> | ||
<!-- Coins Marker --> | ||
<Control MinSize="80 172"> | ||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#A88B5E" /> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<Control MinSize="74 164" HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#903131" /> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<BoxContainer Name="CoinLabels" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"> | ||
<Label Text="C"/> | ||
<Label Text="O"/> | ||
<Label Text="I"/> | ||
<Label Text="N"/> | ||
<Label Text="S"/> | ||
</BoxContainer> | ||
</Control> | ||
</Control> | ||
|
||
<Control MinSize="22 22" /> | ||
|
||
<!-- Coin Slot --> | ||
<Control MinSize="78 172"> | ||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#480F0F" /> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
|
||
<Control MinSize="11 123" MaxSize="11 123 "> | ||
<PanelContainer> | ||
<PanelContainer.PanelOverride> | ||
<gfx:StyleBoxFlat BackgroundColor="#1A1A1C" /> | ||
</PanelContainer.PanelOverride> | ||
</PanelContainer> | ||
</Control> | ||
</Control> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</BoxContainer> | ||
</Control> | ||
</controls:FancyWindow> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ClientSide, not Shared.