Merge remote-tracking branch 'refs/remotes/wizards/master'

# Conflicts:
#	Content.Client/Administration/UI/Tabs/ObjectsTab/ObjectsTab.xaml.cs
#	Content.Client/Entry/EntryPoint.cs
#	Content.Client/IoC/ClientContentIoC.cs
#	Resources/migration.yml
This commit is contained in:
VigersRay 2024-06-28 07:56:45 +03:00
commit 60cbcb2e9d
29 changed files with 244 additions and 186 deletions

View file

@ -3,38 +3,57 @@ using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
namespace Content.Client.Administration.UI
namespace Content.Client.Administration.UI;
[GenerateTypedNameReferences]
public sealed partial class AdminMenuWindow : DefaultWindow
{
[GenerateTypedNameReferences]
public sealed partial class AdminMenuWindow : DefaultWindow
public event Action? OnDisposed;
public AdminMenuWindow()
{
public event Action? OnDisposed;
MinSize = new Vector2(650, 250);
Title = Loc.GetString("admin-menu-title");
RobustXamlLoader.Load(this);
MasterTabContainer.SetTabTitle((int) TabIndex.Admin, Loc.GetString("admin-menu-admin-tab"));
MasterTabContainer.SetTabTitle((int) TabIndex.Adminbus, Loc.GetString("admin-menu-adminbus-tab"));
MasterTabContainer.SetTabTitle((int) TabIndex.Atmos, Loc.GetString("admin-menu-atmos-tab"));
MasterTabContainer.SetTabTitle((int) TabIndex.Round, Loc.GetString("admin-menu-round-tab"));
MasterTabContainer.SetTabTitle((int) TabIndex.Server, Loc.GetString("admin-menu-server-tab"));
MasterTabContainer.SetTabTitle((int) TabIndex.PanicBunker, Loc.GetString("admin-menu-panic-bunker-tab"));
/*
* TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
*/
MasterTabContainer.SetTabTitle((int) TabIndex.BabyJail, Loc.GetString("admin-menu-baby-jail-tab"));
MasterTabContainer.SetTabTitle((int) TabIndex.Players, Loc.GetString("admin-menu-players-tab"));
MasterTabContainer.SetTabTitle((int) TabIndex.Objects, Loc.GetString("admin-menu-objects-tab"));
MasterTabContainer.OnTabChanged += OnTabChanged;
}
public AdminMenuWindow()
{
MinSize = new Vector2(650, 250);
Title = Loc.GetString("admin-menu-title");
RobustXamlLoader.Load(this);
MasterTabContainer.SetTabTitle(0, Loc.GetString("admin-menu-admin-tab"));
MasterTabContainer.SetTabTitle(1, Loc.GetString("admin-menu-adminbus-tab"));
MasterTabContainer.SetTabTitle(2, Loc.GetString("admin-menu-atmos-tab"));
MasterTabContainer.SetTabTitle(3, Loc.GetString("admin-menu-round-tab"));
MasterTabContainer.SetTabTitle(4, Loc.GetString("admin-menu-server-tab"));
MasterTabContainer.SetTabTitle(5, Loc.GetString("admin-menu-panic-bunker-tab"));
/*
* TODO: Remove baby jail code once a more mature gateway process is established. This code is only being issued as a stopgap to help with potential tiding in the immediate future.
*/
MasterTabContainer.SetTabTitle(6, Loc.GetString("admin-menu-baby-jail-tab"));
MasterTabContainer.SetTabTitle(7, Loc.GetString("admin-menu-players-tab"));
MasterTabContainer.SetTabTitle(8, Loc.GetString("admin-menu-objects-tab"));
}
private void OnTabChanged(int tabIndex)
{
var tabEnum = (TabIndex)tabIndex;
if (tabEnum == TabIndex.Objects)
ObjectsTabControl.RefreshObjectList();
}
protected override void Dispose(bool disposing)
{
OnDisposed?.Invoke();
base.Dispose(disposing);
OnDisposed = null;
}
protected override void Dispose(bool disposing)
{
OnDisposed?.Invoke();
base.Dispose(disposing);
OnDisposed = null;
}
private enum TabIndex
{
Admin = 0,
Adminbus,
Atmos,
Round,
Server,
PanicBunker,
BabyJail,
Players,
Objects,
}
}

View file

@ -4,18 +4,17 @@
xmlns:co="clr-namespace:Content.Client.UserInterface.Controls">
<BoxContainer Orientation="Vertical">
<BoxContainer Orientation="Horizontal">
<Label HorizontalExpand="True" SizeFlagsStretchRatio="0.50"
Text="{Loc object-tab-object-type}" />
<LineEdit Name="SearchLineEdit" PlaceHolder="{Loc object-tab-object-search}" HorizontalExpand="True" SizeFlagsStretchRatio="1"/>
<OptionButton Name="ObjectTypeOptions" HorizontalExpand="True" SizeFlagsStretchRatio="0.25"/>
<Label Text="{Loc object-tab-object-type}" />
<OptionButton Name="ObjectTypeOptions" HorizontalAlignment="Left" />
<LineEdit Name="SearchLineEdit" PlaceHolder="{Loc object-tab-object-search}" HorizontalExpand="True"
SizeFlagsStretchRatio="1" />
<Button Name="RefreshListButton" Text="{Loc object-tab-refresh-button}" ToggleMode="False" />
</BoxContainer>
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
</BoxContainer>
<cc:HSeparator/>
<cc:HSeparator />
<BoxContainer Orientation="Vertical" HorizontalExpand="True" VerticalExpand="True">
<ot:ObjectsTabHeader Name="ListHeader"/>
<cc:HSeparator/>
<co:SearchListContainer Name="SearchList" Access="Public" VerticalExpand="True"/>
<ot:ObjectsTabHeader Name="ListHeader" />
<cc:HSeparator />
<co:SearchListContainer Name="SearchList" Access="Public" VerticalExpand="True" />
</BoxContainer>
</BoxContainer>
</Control>

View file

@ -4,6 +4,7 @@ using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Map.Components;
using Robust.Shared.Timing;
@ -17,17 +18,14 @@ public sealed partial class ObjectsTab : Control
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IClientConsoleHost _console = default!;
private readonly List<ObjectsTabEntry> _objects = new();
private readonly List<ObjectsTabSelection> _selections = new();
private bool _ascending = false; // Set to false for descending order by default
private ObjectsTabHeader.Header _headerClicked = ObjectsTabHeader.Header.ObjectName;
private readonly Color _altColor = Color.FromHex("#292B38");
private readonly Color _defaultColor = Color.FromHex("#2F2F3B");
public event Action<GUIBoundKeyEventArgs, ListData>? OnEntryKeyBindDown;
private bool _ascending;
private ObjectsTabHeader.Header _headerClicked = ObjectsTabHeader.Header.ObjectName;
private readonly TimeSpan _updateFrequency = TimeSpan.FromSeconds(2);
private TimeSpan _nextUpdate;
private readonly List<ObjectsTabSelection> _selections = [];
public event Action<GUIBoundKeyEventArgs, ListData>? OnEntryKeyBindDown;
private Action<NetEntity>? TeleportToObjAction { get; set; }
private Action<NetEntity>? DeleteObjAction { get; set; }
@ -43,25 +41,22 @@ public sealed partial class ObjectsTab : Control
RefreshObjectList(_selections[ev.Id]);
};
foreach (var type in Enum.GetValues(typeof(ObjectsTabSelection)))
foreach (var type in Enum.GetValues<ObjectsTabSelection>())
{
_selections.Add((ObjectsTabSelection)type!);
ObjectTypeOptions.AddItem(Loc.GetString($"object-tab-object-type-{((Enum.GetName((ObjectsTabSelection)type))!.ToString().ToLower())}"));
_selections.Add(type);
ObjectTypeOptions.AddItem(GetLocalizedEnumValue(type));
}
ListHeader.OnHeaderClicked += HeaderClicked;
SearchList.SearchBar = SearchLineEdit;
SearchList.GenerateItem += GenerateButton;
SearchList.DataFilterCondition += DataFilterCondition;
SearchList.ItemKeyBindDown += (args, data) => OnEntryKeyBindDown?.Invoke(args, data);
RefreshListButton.OnPressed += _ => RefreshObjectList();
RefreshObjectList();
// Set initial selection and refresh the list to apply the initial sort order
var defaultSelection = ObjectsTabSelection.Grids;
ObjectTypeOptions.SelectId((int)defaultSelection); // Set the default selection
RefreshObjectList(defaultSelection); // Refresh the list with the default selection
// Initialize the next update time
_nextUpdate = TimeSpan.Zero;
ObjectTypeOptions.SelectId((int) defaultSelection);
RefreshObjectList(defaultSelection);
TeleportToObjAction += TeleportToObj;
DeleteObjAction += DeleteObj;
@ -77,19 +72,7 @@ public sealed partial class ObjectsTab : Control
_console.ExecuteCommand($"delete {nent}");
}
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
if (_timing.CurTime < _nextUpdate)
return;
_nextUpdate = _timing.CurTime + _updateFrequency;
RefreshObjectList();
}
private void RefreshObjectList()
public void RefreshObjectList()
{
RefreshObjectList(_selections[ObjectTypeOptions.SelectedId]);
}
@ -119,6 +102,7 @@ public sealed partial class ObjectsTab : Control
{
entities.Add((metadata.EntityName, _entityManager.GetNetEntity(uid)));
}
break;
}
default:
@ -129,14 +113,18 @@ public sealed partial class ObjectsTab : Control
{
var valueA = GetComparableValue(a, _headerClicked);
var valueB = GetComparableValue(b, _headerClicked);
return _ascending ? Comparer<object>.Default.Compare(valueA, valueB) : Comparer<object>.Default.Compare(valueB, valueA);
return _ascending
? Comparer<object>.Default.Compare(valueA, valueB)
: Comparer<object>.Default.Compare(valueB, valueA);
});
var listData = new List<ObjectsListData>();
for (int index = 0; index < entities.Count; index++)
for (var index = 0; index < entities.Count; index++)
{
var info = entities[index];
listData.Add(new ObjectsListData(info, $"{info.Name} {info.Entity}", index % 2 == 0 ? _altColor : _defaultColor));
listData.Add(new ObjectsListData(info,
$"{info.Name} {info.Entity}",
index % 2 == 0 ? _altColor : _defaultColor));
}
SearchList.PopulateList(listData);
@ -147,10 +135,13 @@ public sealed partial class ObjectsTab : Control
if (data is not ObjectsListData { Info: var info, BackgroundColor: var backgroundColor })
return;
var entry = new ObjectsTabEntry(info.Name, info.Entity, new StyleBoxFlat { BackgroundColor = backgroundColor }, TeleportToObjAction, DeleteObjAction);
var entry = new ObjectsTabEntry(info.Name,
info.Entity,
new StyleBoxFlat { BackgroundColor = backgroundColor },
TeleportToObjAction,
DeleteObjAction);
button.ToolTip = $"{info.Name}, {info.Entity}";
button.OnKeyBindDown += args => OnEntryKeyBindDown?.Invoke(args, data);
button.AddChild(entry);
}
@ -172,7 +163,7 @@ public sealed partial class ObjectsTab : Control
{
ObjectsTabHeader.Header.ObjectName => entity.Name,
ObjectsTabHeader.Header.EntityID => entity.Entity.ToString(),
_ => entity.Name
_ => entity.Name,
};
}
@ -192,6 +183,17 @@ public sealed partial class ObjectsTab : Control
RefreshObjectList();
}
private string GetLocalizedEnumValue(ObjectsTabSelection selection)
{
return selection switch
{
ObjectsTabSelection.Grids => Loc.GetString("object-tab-object-type-grids"),
ObjectsTabSelection.Maps => Loc.GetString("object-tab-object-type-maps"),
ObjectsTabSelection.Stations => Loc.GetString("object-tab-object-type-stations"),
_ => throw new ArgumentOutOfRangeException(nameof(selection), selection, null),
};
}
private enum ObjectsTabSelection
{
Grids,
@ -200,4 +202,5 @@ public sealed partial class ObjectsTab : Control
}
}
public record ObjectsListData((string Name, NetEntity Entity) Info, string FilteringString, Color BackgroundColor) : ListData;
public record ObjectsListData((string Name, NetEntity Entity) Info, string FilteringString, Color BackgroundColor)
: ListData;

View file

@ -1,23 +1,28 @@
using Content.Client.Administration.Managers;
using Content.Client.Administration.Managers;
using Content.Shared.CCVar;
using Robust.Client;
using Robust.Client.UserInterface;
using Robust.Shared.Configuration;
namespace Content.Client.DebugMon;
/// <summary>
/// This handles preventing certain debug monitors from appearing.
/// This handles preventing certain debug monitors from being usable by non-admins.
/// </summary>
public sealed class DebugMonitorSystem : EntitySystem
internal sealed class DebugMonitorManager
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IClientAdminManager _admin = default!;
[Dependency] private readonly IUserInterfaceManager _userInterface = default!;
[Dependency] private readonly IBaseClient _baseClient = default!;
public override void FrameUpdate(float frameTime)
public void FrameUpdate()
{
if (!_admin.IsActive() && _cfg.GetCVar(CCVars.DebugCoordinatesAdminOnly))
if (_baseClient.RunLevel == ClientRunLevel.InGame
&& !_admin.IsActive()
&& _cfg.GetCVar(CCVars.DebugCoordinatesAdminOnly))
{
_userInterface.DebugMonitors.SetMonitor(DebugMonitor.Coords, false);
}
}
}

View file

@ -8,6 +8,7 @@ using Robust.Client.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.Containers;
namespace Content.Client.DoAfter;
@ -19,6 +20,7 @@ public sealed class DoAfterOverlay : Overlay
private readonly SharedTransformSystem _transform;
private readonly MetaDataSystem _meta;
private readonly ProgressColorSystem _progressColor;
private readonly SharedContainerSystem _container;
private readonly Texture _barTexture;
private readonly ShaderInstance _unshadedShader;
@ -41,6 +43,7 @@ public sealed class DoAfterOverlay : Overlay
_player = player;
_transform = _entManager.EntitySysManager.GetEntitySystem<SharedTransformSystem>();
_meta = _entManager.EntitySysManager.GetEntitySystem<MetaDataSystem>();
_container = _entManager.EntitySysManager.GetEntitySystem<SharedContainerSystem>();
_progressColor = _entManager.System<ProgressColorSystem>();
var sprite = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/progress_bar.rsi"), "icon");
_barTexture = _entManager.EntitySysManager.GetEntitySystem<SpriteSystem>().Frame0(sprite);
@ -98,11 +101,13 @@ public sealed class DoAfterOverlay : Overlay
var offset = 0f;
var isInContainer = _container.IsEntityOrParentInContainer(uid, meta, xform);
foreach (var doAfter in comp.DoAfters.Values)
{
// Hide some DoAfters from other players for stealthy actions (ie: thieving gloves)
var alpha = 1f;
if (doAfter.Args.Hidden)
if (doAfter.Args.Hidden || isInContainer)
{
if (uid != localEnt)
continue;

View file

@ -2,6 +2,7 @@ using Content.Client._Sunrise.ServersHub;
using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
using Content.Client.DebugMon;
using Content.Client.Eui;
using Content.Client.Fullscreen;
using Content.Client.GhostKick;
@ -34,6 +35,7 @@ using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.Prototypes;
using Robust.Shared.Replays;
using Robust.Shared.Timing;
namespace Content.Client.Entry
{
@ -69,6 +71,7 @@ namespace Content.Client.Entry
[Dependency] private readonly IReplayLoadManager _replayLoad = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!;
[Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!;
[Dependency] private readonly ServersHubManager _serversHubManager = default!; // Sunrise-Hub
public override void Init()
@ -210,5 +213,13 @@ namespace Content.Client.Entry
_stateManager.RequestStateChange<MainScreen>();
}
}
public override void Update(ModUpdateLevel level, FrameEventArgs frameEventArgs)
{
if (level == ModUpdateLevel.FramePreEngine)
{
_debugMonitorManager.FrameUpdate();
}
}
}
}

View file

@ -3,6 +3,7 @@ using Content.Client.Administration.Managers;
using Content.Client.Changelog;
using Content.Client.Chat.Managers;
using Content.Client.Clickable;
using Content.Client.DebugMon;
using Content.Client.Eui;
using Content.Client.GhostKick;
using Content.Client.Launcher;
@ -49,6 +50,7 @@ namespace Content.Client.IoC
collection.Register<DocumentParsingManager>();
collection.Register<ContentReplayPlaybackManager, ContentReplayPlaybackManager>();
collection.Register<ISharedPlaytimeManager, JobRequirementsManager>();
collection.Register<DebugMonitorManager>();
// Sunrise

View file

@ -230,7 +230,7 @@ public sealed class AdminUIController : UIController,
if (function == EngineKeyFunctions.UIClick)
_conHost.ExecuteCommand($"vv {uid}");
else if (function == EngineKeyFunctions.UseSecondary)
else if (function == EngineKeyFunctions.UIRightClick)
_verb.OpenVerbMenu(uid, true);
else
return;

View file

@ -86,7 +86,8 @@ public sealed class DecalPainter
image.Mutate(o => o.Rotate((float) -decal.Angle.Degrees));
var coloredImage = new Image<Rgba32>(image.Width, image.Height);
Color color = decal.Color?.ConvertImgSharp() ?? Color.White;
Color color = decal.Color?.WithAlpha(byte.MaxValue).ConvertImgSharp() ?? Color.White; // remove the encoded color alpha here
var alpha = decal.Color?.A ?? 1; // get the alpha separately so we can use it in DrawImage
coloredImage.Mutate(o => o.BackgroundColor(color));
image.Mutate(o => o
@ -95,6 +96,6 @@ public sealed class DecalPainter
// Very unsure why the - 1 is needed in the first place but all decals are off by exactly one pixel otherwise
// Woohoo!
canvas.Mutate(o => o.DrawImage(image, new Point((int) data.X, (int) data.Y - 1), 1.0f));
canvas.Mutate(o => o.DrawImage(image, new Point((int) data.X, (int) data.Y - 1), alpha));
}
}

View file

@ -123,19 +123,28 @@ public sealed class EntityPainter
image.Mutate(o => o.Crop(rect));
var spriteRotation = 0f;
if (!entity.Sprite.NoRotation && !entity.Sprite.SnapCardinals && entity.Sprite.GetLayerDirectionCount(layer) == 1)
{
spriteRotation = (float) worldRotation.Degrees;
}
var colorMix = entity.Sprite.Color * layer.Color;
var imageColor = Color.FromRgba(colorMix.RByte, colorMix.GByte, colorMix.BByte, colorMix.AByte);
var coloredImage = new Image<Rgba32>(image.Width, image.Height);
coloredImage.Mutate(o => o.BackgroundColor(imageColor));
var (imgX, imgY) = rsi?.Size ?? (EyeManager.PixelsPerMeter, EyeManager.PixelsPerMeter);
var offsetX = (int) (entity.Sprite.Offset.X * EyeManager.PixelsPerMeter);
var offsetY = (int) (entity.Sprite.Offset.Y * EyeManager.PixelsPerMeter);
image.Mutate(o => o
.DrawImage(coloredImage, PixelColorBlendingMode.Multiply, PixelAlphaCompositionMode.SrcAtop, 1)
.Resize(imgX, imgY)
.Flip(FlipMode.Vertical));
.Flip(FlipMode.Vertical)
.Rotate(spriteRotation));
var pointX = (int) entity.X - imgX / 2 + EyeManager.PixelsPerMeter / 2;
var pointY = (int) entity.Y - imgY / 2 + EyeManager.PixelsPerMeter / 2;
var pointX = (int) entity.X + offsetX - imgX / 2;
var pointY = (int) entity.Y + offsetY - imgY / 2;
canvas.Mutate(o => o.DrawImage(image, new Point(pointX, pointY), 1));
}
}

View file

@ -138,8 +138,8 @@ namespace Content.MapRenderer.Painters
var yOffset = (int) -grid.LocalAABB.Bottom;
var tileSize = grid.TileSize;
var x = ((float) Math.Floor(position.X) + xOffset) * tileSize * TilePainter.TileImageSize;
var y = ((float) Math.Floor(position.Y) + yOffset) * tileSize * TilePainter.TileImageSize;
var x = (position.X + xOffset) * tileSize * TilePainter.TileImageSize;
var y = (position.Y + yOffset) * tileSize * TilePainter.TileImageSize;
return (x, y);
}

View file

@ -40,7 +40,7 @@ namespace Content.Server.Atmos.Piping.Unary.Components
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("underPressureLockoutThreshold")]
public float UnderPressureLockoutThreshold = 60; // this must be tuned in conjunction with atmos.mmos_spacing_speed
public float UnderPressureLockoutThreshold = 80; // this must be tuned in conjunction with atmos.mmos_spacing_speed
/// <summary>
/// Pressure locked vents still leak a little (leading to eventual pressurization of sealed sections)

View file

@ -1,10 +0,0 @@
using Content.Server.Speech.EntitySystems;
namespace Content.Server.Speech.Components;
/// <summary>
/// Applies any accent components on this item to the name of the wearer while worn.
/// </summary>
[RegisterComponent]
[Access(typeof(AccentWearerNameClothingSystem))]
public sealed partial class AccentWearerNameClothingComponent : Component;

View file

@ -1,39 +0,0 @@
using Content.Server.Speech.Components;
using Content.Shared.Clothing;
using Content.Shared.Inventory;
using Content.Shared.NameModifier.EntitySystems;
namespace Content.Server.Speech.EntitySystems;
/// <inheritdoc cref="AccentWearerNameClothingComponent"/>
public sealed class AccentWearerNameClothingSystem : EntitySystem
{
[Dependency] private readonly NameModifierSystem _nameMod = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AccentWearerNameClothingComponent, ClothingGotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<AccentWearerNameClothingComponent, ClothingGotUnequippedEvent>(OnGotUnequipped);
SubscribeLocalEvent<AccentWearerNameClothingComponent, InventoryRelayedEvent<RefreshNameModifiersEvent>>(OnRefreshNameModifiers);
}
private void OnGotEquipped(Entity<AccentWearerNameClothingComponent> ent, ref ClothingGotEquippedEvent args)
{
_nameMod.RefreshNameModifiers(args.Wearer);
}
private void OnGotUnequipped(Entity<AccentWearerNameClothingComponent> ent, ref ClothingGotUnequippedEvent args)
{
_nameMod.RefreshNameModifiers(args.Wearer);
}
private void OnRefreshNameModifiers(Entity<AccentWearerNameClothingComponent> ent, ref InventoryRelayedEvent<RefreshNameModifiersEvent> args)
{
var ev = new AccentGetEvent(ent, args.Args.BaseName);
RaiseLocalEvent(ent, ev);
// Use a negative priority since we're going to bulldoze any earlier changes
args.Args.AddModifier("comp-accent-wearer-name-clothing-format", -1, ("accentedName", ev.Message));
}
}

View file

@ -1,5 +1,6 @@
using Content.Server.Popups;
using Content.Server.Tabletop.Components;
using Content.Shared.CCVar;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Content.Shared.Item;
@ -9,6 +10,7 @@ using Content.Shared.Tabletop.Events;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Map;
using Robust.Shared.Player;
@ -23,6 +25,7 @@ namespace Content.Server.Tabletop
[Dependency] private readonly EyeSystem _eye = default!;
[Dependency] private readonly ViewSubscriberSystem _viewSubscriberSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
public override void Initialize()
{
@ -73,6 +76,9 @@ namespace Content.Server.Tabletop
private void OnInteractUsing(EntityUid uid, TabletopGameComponent component, InteractUsingEvent args)
{
if (!_cfg.GetCVar(CCVars.GameTabletopPlace))
return;
if (!EntityManager.TryGetComponent(args.User, out HandsComponent? hands))
return;

View file

@ -105,4 +105,9 @@ public enum LogType
/// This is a default value used by <c>PlayerRateLimitManager</c>, though users can use different log types.
/// </remarks>
RateLimited = 91,
/// <summary>
/// A player did an item-use interaction of an item they were holding onto another object.
/// </summary>
InteractUsing = 92,
}

View file

@ -440,6 +440,16 @@ namespace Content.Shared.CCVar
public static readonly CVarDef<bool> RoundEndPVSOverrides =
CVarDef.Create("game.round_end_pvs_overrides", true, CVar.SERVERONLY);
/// <summary>
/// If true, players can place objects onto tabletop games like chess boards.
/// </summary>
/// <remarks>
/// This feature is currently highly abusable and can easily be used to crash the server,
/// so it's off by default.
/// </remarks>
public static readonly CVarDef<bool> GameTabletopPlace =
CVarDef.Create("game.tabletop_place", false, CVar.SERVERONLY);
/*
* Discord
*/

View file

@ -486,6 +486,21 @@ namespace Content.Shared.Interaction
public void InteractUsingRanged(EntityUid user, EntityUid used, EntityUid? target,
EntityCoordinates clickLocation, bool inRangeUnobstructed)
{
if (target != null)
{
_adminLogger.Add(
LogType.InteractUsing,
LogImpact.Low,
$"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target} using {ToPrettyString(used):used}");
}
else
{
_adminLogger.Add(
LogType.InteractUsing,
LogImpact.Low,
$"{ToPrettyString(user):user} interacted with *nothing* using {ToPrettyString(used):used}");
}
if (RangedInteractDoBefore(user, used, target, clickLocation, inRangeUnobstructed))
return;
@ -926,6 +941,11 @@ namespace Content.Shared.Interaction
if (checkCanUse && !_actionBlockerSystem.CanUseHeldEntity(user, used))
return;
_adminLogger.Add(
LogType.InteractUsing,
LogImpact.Low,
$"{ToPrettyString(user):user} interacted with {ToPrettyString(target):target} using {ToPrettyString(used):used}");
if (RangedInteractDoBefore(user, used, target, clickLocation, true))
return;

View file

@ -344,5 +344,13 @@ Entries:
id: 42
time: '2024-06-26T13:43:43.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29405
- author: Repo
changes:
- message: Changed admin object tab from auto to manual refresh on tab change or
button press so that entries don't shift around when selecting an object.
type: Tweak
id: 43
time: '2024-06-28T03:32:57.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/28681
Name: Admin
Order: 1

View file

@ -1,40 +1,4 @@
Entries:
- author: Killerqu00
changes:
- message: Quartermasters can now skip a single bounty in the list once every 15
minutes.
type: Add
id: 6325
time: '2024-04-09T22:18:07.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26537
- author: SkaldetSkaeg
changes:
- message: The Flippo lighter is now quieter and has a delay on use.
type: Tweak
id: 6326
time: '2024-04-09T22:20:57.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26846
- author: notquitehadouken
changes:
- message: Gave botanists droppers for easier chemical moving.
type: Add
id: 6327
time: '2024-04-10T17:28:03.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26839
- author: botanySupremist
changes:
- message: Clipping harvestable plants now yields undamaged seeds.
type: Add
id: 6328
time: '2024-04-10T17:51:25.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/25541
- author: deltanedas
changes:
- message: Fixed some doors having no access when they should.
type: Fix
id: 6329
time: '2024-04-10T20:06:31.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/26858
- author: Flareguy
changes:
- message: Added emergency nitrogen lockers. You can scarcely find them in public
@ -3831,3 +3795,40 @@
id: 6824
time: '2024-06-27T02:08:57.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29499
- author: PJB3005
changes:
- message: You can no longer place items onto tabletop games. The feature could
be easily abused to crash the server.
type: Remove
id: 6825
time: '2024-06-27T14:57:55.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29513
- author: KonstantinAngelov
changes:
- message: Chef's Cookbook has a more IC name.
type: Tweak
id: 6826
time: '2024-06-27T15:11:33.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29467
- author: metalgearsloth
changes:
- message: Ushanka no longer applies an accent to your name.
type: Tweak
id: 6827
time: '2024-06-28T00:08:09.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29524
- author: JIPDawg
changes:
- message: Changed the sound of pulling back the foam crossbow from the sound of
a Flash to just pulling back a bow.
type: Tweak
id: 6828
time: '2024-06-28T00:23:17.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29508
- author: Plykiya
changes:
- message: Do-after bars performed inside containers are hidden from view.
type: Add
id: 6829
time: '2024-06-28T03:34:24.0000000+00:00'
url: https://github.com/space-wizards/space-station-14/pull/29487

View file

@ -7,3 +7,4 @@ object-tab-object-search = Search...
object-tab-object-type-grids = Grids
object-tab-object-type-maps = Maps
object-tab-object-type-stations = Stations
object-tab-refresh-button = Refresh

View file

@ -1 +0,0 @@
comp-accent-wearer-name-clothing-format = {$accentedName}

View file

@ -15,7 +15,7 @@
orGroup: BookPool
- id: BookBartendersManual
orGroup: BookPool
- id: BookChefGaming
- id: BookHowToCookForFortySpaceman
orGroup: BookPool
- id: BookLeafLoversSecret
orGroup: BookPool

View file

@ -173,7 +173,7 @@
- id: BookSpaceEncyclopedia
- id: BookTheBookOfControl
- id: BookBartendersManual
- id: BookChefGaming
- id: BookHowToCookForFortySpaceman
- id: BookLeafLoversSecret
- id: BookEngineersHandbook
- id: BookScientistsGuidebook

View file

@ -495,8 +495,6 @@
- type: Appearance
- type: AddAccentClothing
accent: RussianAccent
- type: RussianAccent
- type: AccentWearerNameClothing
- type: Foldable
canFoldInsideContainer: true
- type: FoldableClothing

View file

@ -93,6 +93,7 @@
components:
- type: ImmovableRod
randomizeVelocity: false
maxSpeed: 0
- type: entity
parent: ImmovableRodKeepTilesStill

View file

@ -896,7 +896,7 @@
- BulletFoam
capacity: 1
soundInsert:
path: /Audio/Weapons/drawbow2.ogg
path: /Audio/Items/bow_pull.ogg
- type: ContainerContainer
containers:
ballistic-ammo: !type:Container

View file

@ -110,10 +110,10 @@
- Bartender
- type: entity
id: BookChefGaming
id: BookHowToCookForFortySpaceman
parent: BaseItem
name: chef gaming
description: A book about cooking written by a gamer chef.
name: How To Cook For Forty Spacemen
description: A book about cooking written by a space chef.
components:
- type: Sprite
sprite: Objects/Misc/books.rsi

View file

@ -356,5 +356,9 @@ ClothingOuterCoatInspector: ClothingOuterCoatDetectiveLoadout
FloorTileItemReinforced: PartRodMetal1
#2024-06-25
BookChefGaming: BookHowToCookForFortySpaceman
# Sunrise migrations
AirlockExternalGlassShuttleArrivals: AirlockExternalGlassShuttleArrivalsLocked