Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 2024-06-19-tree
Browse files Browse the repository at this point in the history
  • Loading branch information
metalgearsloth committed Sep 28, 2024
2 parents 74d9919 + 74e7e61 commit 3dbd2d6
Show file tree
Hide file tree
Showing 89 changed files with 457 additions and 937 deletions.
2 changes: 1 addition & 1 deletion MSBuild/Robust.Engine.Version.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<!-- This file automatically reset by Tools/version.py -->
<PropertyGroup><Version>233.0.2</Version></PropertyGroup>
<PropertyGroup><Version>235.0.0</Version></PropertyGroup>
</Project>
Expand Down
78 changes: 73 additions & 5 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,12 @@ END TEMPLATE-->

### New features

* `MarkupNode` is now `IEquatable<MarkupNode>`. It already supported equality checks, now it implements the interface.
* Added `Entity<T>` overloads to the following `SharedMapSystem` methods: `GetTileRef`, `GetAnchoredEntities`, `TileIndicesFor`.
* Added `EntityUid`-only overloads to the following `SharedTransformSystem` methods: `AnchorEntity`, `Unanchor`.
*None yet*

### Bugfixes

* Fixed equality checks for `MarkupNode` not properly handling attributes.
* Fixed `MarkupNode` not having a `GetHashCode()` implementation.
* Auto-networked dictionaries now use `TryAdd()` to avoid duplicate key errors when a dictionary contains multiple unknown networked entities.
* Fixed `ICommonSession.Ping` always returning zero instead of the ping. Note that this will still return zero for client-side code when trying to get the ping of other players.

### Other

Expand All @@ -57,6 +55,76 @@ END TEMPLATE-->
*None yet*


## 235.0.0

### Breaking changes

* Several different `AudioSystem` methods were incorrectly given a `[return: NotNullIfNotNull]` attribute. Content code that uses these methods needs to be updated to perform null checks.
* noSpawn is no longer obsolete and is now removed in lieu of the EntityCategory HideSpawnMenu.

### Bugfixes

* physics.maxlinvelocity is now a replicated cvar.
* Fix DistanceJoint debug drawing in physics not using the local anchors.
* Fixed filtered AudioSystem methods playing a sound for all players when given an empty filter.
* Fixed equality checks for `MarkupNode` not properly handling attributes.
* Fixed `MarkupNode` not having a `GetHashCode()` implementation.
* Fixed a PVS error that could occur when trying to delete the first entity that gets created in a round.
* Fixed the "to" and "take" toolshed commands not working as intended.
* Rich text controls within an `OutputPanel` control will now become invisible when they are out of view.

### Other

* Improve precision for Quaternion2D constructor from angles.


## 234.1.0

### New features

* SharedAudioSystem now has PlayLocal which only runs audio locally on the client.

### Bugfixes

* Fix AudioParams not being passed through on PlayGlobal methods.


## 234.0.0

### Breaking changes

* Remove a lot of obsoleted code that has been obsoleted for a while.

### New features

* Add another GetLocalEntitiesIntersecting override.

### Other

* Mark large replays as requiring Server GC.
* Obsolete some IResourceCache proxies.


## 233.1.0

### New features

* Add GetGridEntities and another GetEntitiesIntersecting overload to EntityLookupSystem.
* `MarkupNode` is now `IEquatable<MarkupNode>`. It already supported equality checks, now it implements the interface.
* Added `Entity<T>` overloads to the following `SharedMapSystem` methods: `GetTileRef`, `GetAnchoredEntities`, `TileIndicesFor`.
* Added `EntityUid`-only overloads to the following `SharedTransformSystem` methods: `AnchorEntity`, `Unanchor`.

### Bugfixes

* Fixed equality checks for `MarkupNode` not properly handling attributes.
* Fixed toolshed commands failing to generate error messages when working with array types
* Fixed `MarkupNode` not having a `GetHashCode()` implementation.

### Other

* If `EntityManager.FlushEntities()` fails to delete all entities, it will now attempt to do so a second time before throwing an exception.


## 233.0.2

### Bugfixes
Expand Down
4 changes: 2 additions & 2 deletions Resources/Locale/en-US/toolshed-commands.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ command-description-MulVecCommand =
command-description-DivVecCommand =
Divides every element in the input by a scalar (single value).
command-description-rng-to =
Returns a number from its input to its argument (i.e. n..m inclusive)
Returns a number between the input (inclusive) and the argument (exclusive).
command-description-rng-from =
Returns a number to its input from its argument (i.e. m..n inclusive)
Returns a number between the argument (inclusive) and the input (exclusive))
command-description-rng-prob =
Returns a boolean based on the input probability/chance (from 0 to 1)
command-description-sum =
Expand Down
11 changes: 11 additions & 0 deletions Robust.Client/Audio/AudioSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,17 @@ public override (EntityUid Entity, AudioComponent Component)? PlayPredicted(Soun
return null; // uhh Lets hope predicted audio never needs to somehow store the playing audio....
}

/// <inheritdoc />
public override (EntityUid Entity, AudioComponent Component)? PlayLocal(
SoundSpecifier? sound,
EntityUid source,
EntityUid? soundInitiator,
AudioParams? audioParams = null
)
{
return PlayPredicted(sound, source, soundInitiator, audioParams);
}

public override (EntityUid Entity, AudioComponent Component)? PlayPredicted(SoundSpecifier? sound, EntityCoordinates coordinates, EntityUid? user, AudioParams? audioParams = null)
{
if (Timing.IsFirstTimePredicted && sound != null)
Expand Down
6 changes: 0 additions & 6 deletions Robust.Client/Audio/Midi/IMidiRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ public interface IMidiRenderer : IDisposable
/// </summary>
bool LoopMidi { get; set; }

/// <summary>
/// This increases all note on velocities to 127.
/// </summary>
[Obsolete($"Use {nameof(VelocityOverride)} instead, you can set it to 127 to achieve the same effect.")]
bool VolumeBoost { get; set; }

/// <summary>
/// The midi program (instrument) the renderer is using.
/// </summary>
Expand Down
8 changes: 0 additions & 8 deletions Robust.Client/Audio/Midi/MidiRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,14 +205,6 @@ public bool LoopMidi
}
}

[ViewVariables(VVAccess.ReadWrite)]
[Obsolete($"Use {nameof(VelocityOverride)} instead, you can set it to 127 to achieve the same effect.")]
public bool VolumeBoost
{
get => VelocityOverride == 127;
set => VelocityOverride = value ? 127 : null;
}

[ViewVariables(VVAccess.ReadWrite)]
public EntityUid? TrackingEntity { get; set; } = null;

Expand Down
9 changes: 0 additions & 9 deletions Robust.Client/Credits/CreditsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ namespace Robust.Client.Credits
/// </summary>
public static class CreditsManager
{
/// <summary>
/// Gets a list of open source software used in the engine and their license.
/// </summary>
[Obsolete("Use overload that takes in an explicit resource manager instead.")]
public static IEnumerable<LicenseEntry> GetLicenses()
{
return GetLicenses(IoCManager.Resolve<IResourceManager>());
}

/// <summary>
/// Gets a list of open source software used in the engine and their license.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Robust.Client/Debugging/DebugPhysicsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ private void DrawJoint(DrawingHandleWorld worldHandle, Joint joint)
switch (joint)
{
case DistanceJoint:
worldHandle.DrawLine(xf1, xf2, JointColor);
worldHandle.DrawLine(p1, p2, JointColor);
break;
case PrismaticJoint prisma:
var pA = Transform.Mul(xfa, joint.LocalAnchorA);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,6 @@ public void Play(EntityUid uid, AnimationPlayerComponent? component, Animation a
Play(new Entity<AnimationPlayerComponent>(uid, component), animation, key);
}

/// <summary>
/// Start playing an animation.
/// </summary>
[Obsolete("Use Play(EntityUid<AnimationPlayerComponent> ent, Animation animation, string key) instead")]
public void Play(AnimationPlayerComponent component, Animation animation, string key)
{
Play(new Entity<AnimationPlayerComponent>(component.Owner, component), animation, key);
}

public void Play(Entity<AnimationPlayerComponent> ent, Animation animation, string key)
{
AddComponent(ent);
Expand Down
3 changes: 0 additions & 3 deletions Robust.Client/GameStates/IClientGameStateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ public interface IClientGameStateManager
/// </summary>
int GetApplicableStateCount();

[Obsolete("use GetApplicableStateCount()")]
int CurrentBufferSize => GetApplicableStateCount();

/// <summary>
/// Total number of game states currently in the state buffer.
/// </summary>
Expand Down
1 change: 0 additions & 1 deletion Robust.Client/Physics/PhysicsSystem.Predict.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ internal void UpdateIsTouching(List<Contact> toUpdate)

if (activeA == false && activeB == false)
{
contact.IsTouching = false;
continue;
}

Expand Down
3 changes: 0 additions & 3 deletions Robust.Client/Player/PlayerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ private bool UpdatePlayerList(IEnumerable<SessionState> remotePlayers, bool full
// This is a new userid, so we create a new session.
DebugTools.Assert(state.UserId != LocalPlayer?.UserId);
var newSession = (ICommonSessionInternal)CreateAndAddSession(state.UserId, state.Name);
newSession.SetPing(state.Ping);
SetStatus(newSession, state.Status);
SetAttachedEntity(newSession, controlled, out _, true);
dirty = true;
Expand All @@ -271,7 +270,6 @@ private bool UpdatePlayerList(IEnumerable<SessionState> remotePlayers, bool full
// Check if the data is actually different
if (session.Name == state.Name
&& session.Status == state.Status
&& session.Ping == state.Ping
&& session.AttachedEntity == controlled)
{
continue;
Expand All @@ -280,7 +278,6 @@ private bool UpdatePlayerList(IEnumerable<SessionState> remotePlayers, bool full
dirty = true;
var local = (ICommonSessionInternal)session;
local.SetName(state.Name);
local.SetPing(state.Ping);
SetStatus(local, state.Status);
SetAttachedEntity(local, controlled, out _, true);
}
Expand Down
3 changes: 3 additions & 0 deletions Robust.Client/ResourceManagement/IResourceCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ T GetFallback<T>()
event Action<TextureLoadedEventArgs> OnRawTextureLoaded;
event Action<RsiLoadedEventArgs> OnRsiLoaded;

[Obsolete("Fetch these through IoC directly instead")]
IClyde Clyde { get; }

[Obsolete("Fetch these through IoC directly instead")]
IFontManager FontManager { get; }
}

15 changes: 12 additions & 3 deletions Robust.Client/UserInterface/Controls/OutputPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ protected internal override void Draw(DrawingHandleScreen handle)

var style = _getStyleBox();
var font = _getFont();
var lineSeparation = font.GetLineSeparation(UIScale);
style?.Draw(handle, PixelSizeBox, UIScale);
var contentBox = _getContentBox();

Expand All @@ -141,18 +142,26 @@ protected internal override void Draw(DrawingHandleScreen handle)
{
if (entryOffset + entry.Height < 0)
{
entryOffset += entry.Height + font.GetLineSeparation(UIScale);
// Controls within the entry are the children of this control, which means they are drawn separately
// after this Draw call, so we have to mark them as invisible to prevent them from being drawn.
//
// An alternative option is to ensure that the control position updating logic in entry.Draw is always
// run, and then setting RectClipContent = true to use scissor box testing to handle the controls
// visibility
entry.HideControls();
entryOffset += entry.Height + lineSeparation;
continue;
}

if (entryOffset > contentBox.Height)
{
break;
entry.HideControls();
continue;
}

entry.Draw(_tagManager, handle, font, contentBox, entryOffset, context, UIScale);

entryOffset += entry.Height + font.GetLineSeparation(UIScale);
entryOffset += entry.Height + lineSeparation;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Robust.Client/UserInterface/Controls/RichTextLabel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Numerics;
using JetBrains.Annotations;
using Robust.Client.Graphics;
Expand Down
45 changes: 12 additions & 33 deletions Robust.Client/UserInterface/Controls/TabContainer.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using Robust.Client.Graphics;
using Robust.Shared.Input;
Expand All @@ -21,6 +22,8 @@ public class TabContainer : Container

private int _currentTab;
private bool _tabsVisible = true;
// The right-most coordinate of each tab header
private List<float> _tabRight = new();

public int CurrentTab
{
Expand Down Expand Up @@ -157,11 +160,14 @@ protected internal override void Draw(DrawingHandleScreen handle)

var headerOffset = 0f;

_tabRight.Clear();

// Then, draw the tabs.
for (var i = 0; i < ChildCount; i++)
{
if (!GetTabVisible(i))
{
_tabRight.Add(headerOffset);
continue;
}

Expand Down Expand Up @@ -214,6 +220,8 @@ protected internal override void Draw(DrawingHandleScreen handle)
}

headerOffset += boxAdvance;
// Remember the right-most point of this tab, for testing clicked areas
_tabRight.Add(headerOffset);
}
}

Expand Down Expand Up @@ -283,46 +291,17 @@ protected internal override void KeyBindDown(GUIBoundKeyEventArgs args)
args.Handle();

var relX = args.RelativePixelPosition.X;

var font = _getFont();
var boxActive = _getTabBoxActive();
var boxInactive = _getTabBoxInactive();

var headerOffset = 0f;

float tabLeft = 0;
for (var i = 0; i < ChildCount; i++)
{
if (!GetTabVisible(i))
if (relX > tabLeft && relX <= _tabRight[i])
{
continue;
}

var title = GetActualTabTitle(i);

var titleLength = 0;
// Get string length.
foreach (var rune in title.EnumerateRunes())
{
if (!font.TryGetCharMetrics(rune, UIScale, out var metrics))
{
continue;
}

titleLength += metrics.Advance;
}

var active = _currentTab == i;
var box = active ? boxActive : boxInactive;
var boxAdvance = titleLength + (box?.MinimumSize.X ?? 0);

if (headerOffset < relX && headerOffset + boxAdvance > relX)
{
// Got em.
CurrentTab = i;
return;
}

headerOffset += boxAdvance;
// Next tab starts here
tabLeft = _tabRight[i];
}
}

Expand Down
10 changes: 0 additions & 10 deletions Robust.Client/UserInterface/CustomControls/SS14Window.cs

This file was deleted.

Loading

0 comments on commit 3dbd2d6

Please sign in to comment.