Skip to content

Commit

Permalink
Merge pull request #56 from Aidenkrz/mergeupstream
Browse files Browse the repository at this point in the history
Merge Upstream
  • Loading branch information
Aidenkrz authored Jan 17, 2025
2 parents 243632a + 9f6171c commit aaa3496
Show file tree
Hide file tree
Showing 538 changed files with 27,094 additions and 13,113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PanelContainer StyleClasses="BackgroundDark"></PanelContainer>
<BoxContainer Name="SettingsBox" Orientation="Horizontal" HorizontalExpand="True" VerticalExpand="False">
<Label Text="{Loc 'glimmer-monitor-interval'}"/>
<Button Name="IntervalButton6s" Access="Public" Text="6s" StyleClasses="OpenRight"/>
<Button Name="IntervalButton1" Access="Public" Text="1m" StyleClasses="OpenRight"/>
<Button Name="IntervalButton5" Access="Public" Text="5m" StyleClasses="OpenBoth"/>
<Button Name="IntervalButton10" Access="Public" Text="10m" StyleClasses="OpenLeft"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ public GlimmerMonitorUiFragment()
VerticalExpand = true;

var intervalGroup = new ButtonGroup();
IntervalButton6s.Group = intervalGroup;
IntervalButton1.Group = intervalGroup;
IntervalButton5.Group = intervalGroup;
IntervalButton10.Group = intervalGroup;

IntervalButton1.Pressed = true;
IntervalButton6s.Pressed = true;

IntervalButton6s.OnPressed += _ => UpdateState(_cachedValues);
IntervalButton1.OnPressed += _ => UpdateState(_cachedValues);
IntervalButton5.OnPressed += _ => UpdateState(_cachedValues);
IntervalButton10.OnPressed += _ => UpdateState(_cachedValues);
Expand Down Expand Up @@ -62,14 +64,12 @@ private List<int> FormatGlimmerValues(List<int> glimmerValues)
{
var returnList = glimmerValues;

if (IntervalButton5.Pressed)
{
returnList = GetAveragedList(glimmerValues, 5);
}
else if (IntervalButton10.Pressed)
{
if (IntervalButton1.Pressed)
returnList = GetAveragedList(glimmerValues, 10);
}
else if (IntervalButton5.Pressed)
returnList = GetAveragedList(glimmerValues, 50);
else if (IntervalButton10.Pressed)
returnList = GetAveragedList(glimmerValues, 100);

return ClipToFifteen(returnList);
}
Expand Down
14 changes: 12 additions & 2 deletions Content.Client/Chat/UI/SpeechBubble.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
using Content.Client.Chat.Managers;
using Content.Shared.CCVar;
using Content.Shared.Chat;
using Content.Shared.Speech;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
Expand All @@ -17,6 +19,8 @@ public abstract class SpeechBubble : Control
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] protected readonly IConfigurationManager ConfigManager = default!;

private readonly SharedTransformSystem _transformSystem;

public enum SpeechType : byte
{
Emote,
Expand Down Expand Up @@ -83,6 +87,7 @@ public SpeechBubble(ChatMessage message, EntityUid senderEntity, string speechSt
{
IoCManager.InjectDependencies(this);
_senderEntity = senderEntity;
_transformSystem = _entityManager.System<SharedTransformSystem>();

// Use text clipping so new messages don't overlap old ones being pushed up.
RectClipContent = true;
Expand Down Expand Up @@ -139,8 +144,13 @@ protected override void FrameUpdate(FrameEventArgs args)
Modulate = Color.White;
}

var offset = (-_eyeManager.CurrentEye.Rotation).ToWorldVec() * -EntityVerticalOffset;
var worldPos = xform.WorldPosition + offset;
var baseOffset = 0f;

if (_entityManager.TryGetComponent<SpeechComponent>(_senderEntity, out var speech))
baseOffset = speech.SpeechBubbleOffset;

var offset = (-_eyeManager.CurrentEye.Rotation).ToWorldVec() * -(EntityVerticalOffset + baseOffset);
var worldPos = _transformSystem.GetWorldPosition(xform) + offset;

var lowerCenter = _eyeManager.WorldToScreen(worldPos) / UIScale;
var screenPos = lowerCenter - new Vector2(ContentSize.X / 2, ContentSize.Y + _verticalOffsetAchieved);
Expand Down
16 changes: 8 additions & 8 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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"
MinSize="620 670"
MinSize="620 770"
Title="{Loc 'chem-master-bound-user-interface-title'}">
<TabContainer Name="Tabs" Margin="5 5 7 5">
<BoxContainer Orientation="Vertical" HorizontalExpand="True" Margin="5" SeparationOverride="10">
Expand All @@ -13,12 +13,12 @@
<Button MinSize="80 0" Name="InputEjectButton" Access="Public" Text="{Loc 'chem-master-window-eject-button'}" />
</BoxContainer>

<PanelContainer VerticalExpand="True" MinSize="0 200">
<PanelContainer VerticalExpand="True" MinSize="0 300">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<ScrollContainer HorizontalExpand="True" MinSize="0 200">
<ScrollContainer HorizontalExpand="True" MinSize="0 300">
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
<BoxContainer Name="InputContainerInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
Expand All @@ -38,12 +38,12 @@
</BoxContainer>

<!-- Buffer info -->
<PanelContainer VerticalExpand="True" MinSize="0 200">
<PanelContainer VerticalExpand="True" MinSize="0 300">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<ScrollContainer HorizontalExpand="True" MinSize="0 200">
<ScrollContainer HorizontalExpand="True" MinSize="0 300">
<!-- Buffer reagent list -->
<BoxContainer Name="BufferInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-buffer-empty-text'}" />
Expand All @@ -60,12 +60,12 @@
<Button MinSize="80 0" Name="OutputEjectButton" Access="Public" Text="{Loc 'chem-master-window-eject-button'}" />
</BoxContainer>

<PanelContainer VerticalExpand="True" MinSize="0 200">
<PanelContainer VerticalExpand="True" MinSize="0 300">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#1B1B1E" />
</PanelContainer.PanelOverride>

<ScrollContainer HorizontalExpand="True" MinSize="0 200">
<ScrollContainer HorizontalExpand="True" MinSize="0 300">
<!-- Initially empty, when server sends state data this will have container contents and fill volume.-->
<BoxContainer Name="OutputContainerInfo" Orientation="Vertical" Margin="4" HorizontalExpand="True">
<Label Text="{Loc 'chem-master-window-no-container-loaded-text'}" />
Expand Down Expand Up @@ -129,4 +129,4 @@
</PanelContainer>
</BoxContainer>
</TabContainer>
</controls:FancyWindow>
</controls:FancyWindow>
5 changes: 3 additions & 2 deletions Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,16 @@ private ReagentButton MakeReagentButton(string text, ChemMasterReagentAmount amo
private List<ReagentButton> CreateReagentTransferButtons(ReagentId reagent, bool isBuffer, bool addReagentButtons)
{
if (!addReagentButtons)
return new List<ReagentButton>(); // Return an empty list if reagentTransferButton creation is disabled.
return new(); // Return an empty list if reagentTransferButton creation is disabled.

var buttons = new List<ReagentButton>();
var names = Enum.GetNames<ChemMasterReagentAmount>();
var values = Enum.GetValues<ChemMasterReagentAmount>();

for (int i = 0; i < names.Length; i++)
{
var name = names[i];
var isNumber = int.TryParse(names[i].Substring(1), out int number);
var name = isNumber ? number.ToString() : names[i];
var reagentAmount = values[i];

var reagentTransferButton = MakeReagentButton(
Expand Down
12 changes: 11 additions & 1 deletion Content.Client/Crayon/UI/CrayonBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected override void Open()
private void PopulateCrayons()
{
var crayonDecals = _protoManager.EnumeratePrototypes<DecalPrototype>().Where(x => x.Tags.Contains("crayon"));
_menu?.Populate(crayonDecals);
_menu?.Populate(crayonDecals.ToList());
}

public override void OnProtoReload(PrototypesReloadedEventArgs args)
Expand All @@ -44,6 +44,16 @@ public override void OnProtoReload(PrototypesReloadedEventArgs args)
PopulateCrayons();
}

protected override void ReceiveMessage(BoundUserInterfaceMessage message)
{
base.ReceiveMessage(message);

if (_menu is null || message is not CrayonUsedMessage crayonMessage)
return;

_menu.AdvanceState(crayonMessage.DrawnDecal);
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
Expand Down
11 changes: 5 additions & 6 deletions Content.Client/Crayon/UI/CrayonWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<DefaultWindow xmlns="https://spacestation14.io"
Title="{Loc 'crayon-window-title'}"
MinSize="250 300"
SetSize="250 300">
MinSize="450 500"
SetSize="450 500">
<BoxContainer Orientation="Vertical">
<ColorSelectorSliders Name="ColorSelector" Visible="False" />
<LineEdit Name="Search" />
<LineEdit Name="Search" Margin="0 0 0 8" PlaceHolder="{Loc 'crayon-window-placeholder'}" />
<ScrollContainer VerticalExpand="True">
<GridContainer Name="Grid" Columns="6">
<!-- Crayon decals get added here by code -->
</GridContainer>
<BoxContainer Name="Grids" Orientation="Vertical">
</BoxContainer>
</ScrollContainer>
</BoxContainer>
</DefaultWindow>
Loading

0 comments on commit aaa3496

Please sign in to comment.