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

[Port] Cherry Pick Fixes #207

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
34d2259
System to automatically restart server after certain uptime. (#32814)
PJB3005 Oct 20, 2024
8092a5a
Collapsible ghost roles menu (#32717)
MilenVolf Nov 4, 2024
9e47407
Makes the rat king's cheeseEm order more convenient to use (#32181)
PopGamer45 Sep 19, 2024
993ab74
Fix race condition causing disconnected admins to appear in adminwho …
PJB3005 Dec 24, 2024
a8aba3f
Fix the sensor monitoring console (#34035)
PJB3005 Dec 23, 2024
644a6e1
Fix admins not being able to health scan slimes (#33884)
slarticodefast Dec 18, 2024
49f6c71
Fix blank newline on empty examine groups (#33813)
metalgearsloth Dec 10, 2024
21b9895
Made anchor visuals generic (#33810)
TGRCdev Dec 11, 2024
8665c06
Logic Gate Compatibility with Non-Logic Signals bugfix (#33792)
Centronias Dec 19, 2024
b260648
Fix layout on wires UI (#33714)
PJB3005 Dec 4, 2024
10f4d3b
More device configurator serialization fixes (#33664)
ElectroJr Dec 5, 2024
9fe3f65
Fix for handcuffing someone more than once (#33646)
Plykiya Nov 30, 2024
298e50c
Fix for inspecting entities in the stripping window (#33644)
Plykiya Nov 30, 2024
f288428
Fix for inspecting entities in hand (#33642)
Plykiya Nov 30, 2024
816ab72
Light verb is now predicted (#33622)
beck-thompson Nov 28, 2024
bc33a98
fix a station event weighting bug (#33584)
IProduceWidgets Dec 6, 2024
33cb55c
Bug fixes for Store UIs with multiple currencies (#33565)
TGRCdev Dec 16, 2024
9568c69
Fix meteor's ArithmeticException (#33556)
Winkarst-cpu Dec 5, 2024
4657b26
removed obsolete netmessage creator (#33542)
benev0 Nov 25, 2024
53f29c0
Fix RA0003 warning for ChatBox (#33531)
CrafterKolyan Nov 25, 2024
989c536
Turn off PointLights on VendingMachines when broken or off. (#33513)
red15 Nov 25, 2024
331efe1
Fix Disposals Ejections (#33468)
sleepyyapril Dec 9, 2024
fa9345b
Fix mime broken vow alert (#33303)
CheddaCheez Nov 14, 2024
3c7ae25
fix PermanentBlindnessComponent to be not so permanent (#33292)
lunarcomets Nov 30, 2024
2ee7046
Fix vape use without check if doafter cancelled (#33245)
leonidussaks Nov 11, 2024
ab89ff5
Fix research disk crash (#33205)
ewokswagger Nov 8, 2024
536f5df
fix pie throwing sound not playing (#33017)
slarticodefast Oct 27, 2024
10e6a9b
using network
PuroSlavKing Dec 25, 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
2 changes: 1 addition & 1 deletion Content.Client/Eui/BaseEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public virtual void HandleMessage(EuiMessageBase msg)
/// </summary>
protected void SendMessage(EuiMessageBase msg)
{
var netMsg = _netManager.CreateNetMessage<MsgEuiMessage>();
var netMsg = new MsgEuiMessage();
netMsg.Id = Id;
netMsg.Message = msg;

Expand Down
6 changes: 6 additions & 0 deletions Content.Client/Inventory/StrippableBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,15 @@ private void SlotPressed(GUIBoundKeyEventArgs ev, SlotControl slot)
return;

if (ev.Function == ContentKeyFunctions.ExamineEntity)
{
_examine.DoExamine(slot.Entity.Value);
ev.Handle();
}
else if (ev.Function == EngineKeyFunctions.UseSecondary)
{
_ui.GetUIController<VerbMenuUIController>().OpenVerbMenu(slot.Entity.Value);
ev.Handle();
}
}

private void AddInventoryButton(EntityUid invUid, string slotId, InventoryComponent inv)
Expand Down
16 changes: 16 additions & 0 deletions Content.Client/Light/HandheldLightSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,22 @@ public override void Initialize()
SubscribeLocalEvent<HandheldLightComponent, AppearanceChangeEvent>(OnAppearanceChange);
}

/// <remarks>
/// TODO: Not properly predicted yet. Don't call this function if you want a the actual return value!
/// </remarks>
public override bool TurnOff(Entity<HandheldLightComponent> ent, bool makeNoise = true)
{
return true;
}
Comment on lines +24 to +30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Возвращаемое значение всегда true.

Функция TurnOff всегда возвращает true, но комментарий указывает, что результат может быть ненадёжным. Если дальнейшая логика действительно требует реального статуса (успешно выключен или нет), стоит доработать эту часть, чтобы возвращать корректный результат, либо убрать часть кода, создающую путаницу.


/// <remarks>
/// TODO: Not properly predicted yet. Don't call this function if you want a the actual return value!
/// </remarks>
public override bool TurnOn(EntityUid user, Entity<HandheldLightComponent> uid)
{
return true;
}

private void OnAppearanceChange(EntityUid uid, HandheldLightComponent? component, ref AppearanceChangeEvent args)
{
if (!Resolve(uid, ref component))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public sealed partial class SensorMonitoringWindow : FancyWindow, IComputerWindo
public SensorMonitoringWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
}

public void UpdateState(ConsoleUIState state)
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Store/Ui/StoreMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void UpdateBalance(Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> ba
foreach (var ((_, amount), proto) in currency)
{
balanceStr += Loc.GetString("store-ui-balance-display", ("amount", amount),
("currency", Loc.GetString(proto.DisplayName, ("amount", 1))));
("currency", Loc.GetString(proto.DisplayName, ("amount", 1)))) + "\n";
}

BalanceInfo.SetMarkup(balanceStr.TrimEnd());
Expand All @@ -66,7 +66,10 @@ public void UpdateBalance(Dictionary<ProtoId<CurrencyPrototype>, FixedPoint2> ba
foreach (var type in currency)
{
if (type.Value.CanWithdraw && type.Value.Cash != null && type.Key.Item2 > 0)
{
disabled = false;
break;
}
}

WithdrawButton.Disabled = disabled;
Expand Down
17 changes: 10 additions & 7 deletions Content.Client/Store/Ui/StoreWithdrawWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed partial class StoreWithdrawWindow : DefaultWindow
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

private Dictionary<FixedPoint2, CurrencyPrototype> _validCurrencies = new();
private Dictionary<CurrencyPrototype, FixedPoint2> _validCurrencies = new();
private HashSet<CurrencyWithdrawButton> _buttons = new();
public event Action<BaseButton.ButtonEventArgs, string, int>? OnWithdrawAttempt;

Expand All @@ -36,7 +36,7 @@ public void CreateCurrencyButtons(Dictionary<ProtoId<CurrencyPrototype>, FixedPo
if (!_prototypeManager.TryIndex(currency.Key, out var proto))
continue;

_validCurrencies.Add(currency.Value, proto);
_validCurrencies.Add(proto, currency.Value);
}

//this shouldn't ever happen but w/e
Expand All @@ -47,14 +47,17 @@ public void CreateCurrencyButtons(Dictionary<ProtoId<CurrencyPrototype>, FixedPo
_buttons.Clear();
foreach (var currency in _validCurrencies)
{
if (!currency.Key.CanWithdraw)
continue;

var button = new CurrencyWithdrawButton()
{
Id = currency.Value.ID,
Amount = currency.Key,
Id = currency.Key.ID,
Amount = currency.Value,
MinHeight = 20,
Text = Loc.GetString("store-withdraw-button-ui", ("currency",Loc.GetString(currency.Value.DisplayName, ("amount", currency.Key)))),
Text = Loc.GetString("store-withdraw-button-ui", ("currency",Loc.GetString(currency.Key.DisplayName, ("amount", currency.Value)))),
Disabled = false,
};
button.Disabled = false;
button.OnPressed += args =>
{
OnWithdrawAttempt?.Invoke(args, button.Id, WithdrawSlider.Value);
Expand All @@ -65,7 +68,7 @@ public void CreateCurrencyButtons(Dictionary<ProtoId<CurrencyPrototype>, FixedPo
ButtonContainer.AddChild(button);
}

var maxWithdrawAmount = _validCurrencies.Keys.Max().Int();
var maxWithdrawAmount = _validCurrencies.Values.Max().Int();

// setup withdraw slider
WithdrawSlider.MinValue = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
namespace Content.Client.UserInterface.Systems.Chat.Widgets;

[GenerateTypedNameReferences]
#pragma warning disable RA0003
[Virtual]
public partial class ChatBox : UIWidget
#pragma warning restore RA0003
{
private readonly ChatUIController _controller;
private readonly IEntityManager _entManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical"
Margin="8 0 8 0">
<BoxContainer Name="Buttons"
Orientation="Vertical"
SeparationOverride="5">
<!-- Buttons are added here by code -->
</BoxContainer>
</BoxContainer>
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@
namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRolesEntry : BoxContainer
public sealed partial class GhostRoleButtonsBox : BoxContainer
{
private SpriteSystem _spriteSystem;
public event Action<GhostRoleInfo>? OnRoleSelected;
public event Action<GhostRoleInfo>? OnRoleFollow;

public GhostRolesEntry(string name, string description, bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
public GhostRoleButtonsBox(bool hasAccess, FormattedMessage? reason, IEnumerable<GhostRoleInfo> roles, SpriteSystem spriteSystem)
{
RobustXamlLoader.Load(this);
_spriteSystem = spriteSystem;

Title.Text = name;
Description.SetMessage(description);

foreach (var role in roles)
{
var button = new GhostRoleEntryButtons(role);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Horizontal">
Orientation="Horizontal"
HorizontalAlignment="Stretch">
<Button Name="RequestButton"
Access="Public"
Text="{Loc 'ghost-roles-window-request-role-button'}"
StyleClasses="OpenRight"
HorizontalAlignment="Left"
SetWidth="300"/>
HorizontalExpand="True"
SizeFlagsStretchRatio="3"/>
<Button Name="FollowButton"
Access="Public"
Text="{Loc 'ghost-roles-window-follow-role-button'}"
StyleClasses="OpenLeft"
HorizontalAlignment="Right"
SetWidth="150"/>
HorizontalExpand="True"/>
</BoxContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical">
<Label Name="Title"
StyleClasses="LabelKeyText"/>
<PanelContainer StyleClasses="HighDivider" />
<RichTextLabel Name="Description"
Margin="0 4"/>
</BoxContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;

namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
[GenerateTypedNameReferences]
public sealed partial class GhostRoleInfoBox : BoxContainer
{
public GhostRoleInfoBox(string name, string description)
{
RobustXamlLoader.Load(this);

Title.Text = name;
Description.SetMessage(description);
}
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using System.Linq;
using Content.Client.Eui;
using Content.Client.Lobby;
using Content.Client.Players.PlayTimeTracking;
using Content.Shared.Clothing.Loadouts.Prototypes;
using Content.Shared.Customization.Systems;
using Content.Shared.Eui;
using Content.Shared.Ghost.Roles;
using Content.Shared.Preferences;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;

namespace Content.Client.UserInterface.Systems.Ghost.Controls.Roles
{
Expand Down Expand Up @@ -82,47 +76,46 @@ public override void HandleState(EuiStateBase state)

if (state is not GhostRolesEuiState ghostState)
return;

// We must save BodyVisible state, so all Collapsible boxes will not close
// on adding new ghost role.
// Save the current state of each Collapsible box being visible or not
_window.SaveCollapsibleBoxesStates();

// Clearing the container before adding new roles
_window.ClearEntries();

var entityManager = IoCManager.Resolve<IEntityManager>();
var sysManager = entityManager.EntitySysManager;
var spriteSystem = sysManager.GetEntitySystem<SpriteSystem>();
var requirementsManager = IoCManager.Resolve<JobRequirementsManager>();
var characterReqs = entityManager.System<CharacterRequirementsSystem>();
var prefs = IoCManager.Resolve<IClientPreferencesManager>();
var protoMan = IoCManager.Resolve<IPrototypeManager>();
var configManager = IoCManager.Resolve<IConfigurationManager>();

// TODO: role.Requirements value doesn't work at all as an equality key, this must be fixed
// Grouping roles
var groupedRoles = ghostState.GhostRoles.GroupBy(
role => (role.Name, role.Description, role.Requirements));

// Add a new entry for each role group
foreach (var group in groupedRoles)
{
var name = group.Key.Name;
var description = group.Key.Description;
// ReSharper disable once ReplaceWithSingleAssignment.True
var hasAccess = true;

if (!characterReqs.CheckRequirementsValid(
group.Key.Requirements ?? new(),
new(),
(HumanoidCharacterProfile) (prefs.Preferences?.SelectedCharacter ?? HumanoidCharacterProfile.DefaultWithSpecies()),
requirementsManager.GetRawPlayTimeTrackers(),
requirementsManager.IsWhitelisted(),
new LoadoutPrototype(), // idk
entityManager,
protoMan,
configManager,
out var reasons))
hasAccess = false;

_window.AddEntry(name, description, hasAccess, characterReqs.GetRequirementsText(reasons), group, spriteSystem);
var hasAccess = requirementsManager.CheckRoleRequirements(
group.Key.Requirements,
null,
out var reason);

// Adding a new role
_window.AddEntry(name, description, hasAccess, reason, group, spriteSystem);
}

// Restore the Collapsible box state if it is saved
_window.RestoreCollapsibleBoxesStates();

// Close the rules window if it is no longer needed
var closeRulesWindow = ghostState.GhostRoles.All(role => role.Identifier != _windowRulesId);
if (closeRulesWindow)
{
_windowRules?.Close();
}
}
}
}
Loading
Loading