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

Upstream sync #1512

Merged
merged 43 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e5f5a28
adds "idk." to the text to emote list (#21015)
QuietlyWhisper Oct 15, 2023
d10e33c
Allow Hand-Prying Most Unpowered Airlocks (#21002)
ike709 Oct 15, 2023
212a892
Automatic changelog update
PJBot Oct 15, 2023
bfb5bcd
add rainbow fish (#20955)
deltanedas Oct 15, 2023
687ceee
Rolling pin can be worn in belt slot (#21019)
deltanedas Oct 16, 2023
58ae379
Fix low tickrate eye lerping (#21001)
ElectroJr Oct 16, 2023
556e679
Make secure crate weldable (#21007)
iacore Oct 16, 2023
27b9c35
Automatic changelog update
PJBot Oct 16, 2023
3ecaa65
fixes behonkers, they now function like spitters and will attack via …
brainfood1183 Oct 16, 2023
e40172e
Automatic changelog update
PJBot Oct 16, 2023
c20bf50
Fix sound on material reclaimer (#21030)
ShadowCommander Oct 16, 2023
b5a7af1
Fix uncuffing for zombies (#21021)
EmoGarbage404 Oct 16, 2023
7032a5a
Update dev map (#21016)
ElectroJr Oct 16, 2023
f7fbaba
Less charges for Sci flash (#20959)
coolmankid12345 Oct 16, 2023
1f564f0
Automatic changelog update
PJBot Oct 16, 2023
c3e303b
Fix sorting admin player tab playtime alphabetically (#21028)
DrSmugleaf Oct 16, 2023
101cc34
upgrade (#20997)
Lomcastar Oct 16, 2023
4225440
Automatic changelog update
PJBot Oct 16, 2023
1f0c931
Default warp point names (#21017)
ElectroJr Oct 16, 2023
00e274e
Add new entity spawn test & fix misc bugs (#19953)
ElectroJr Oct 16, 2023
77964d4
Kill `SharedEntityExtensions` and all popup extensions (#20909)
mirrorcult Oct 16, 2023
a439a12
Stun baton tweak (#20970)
JoeHammad1844 Oct 16, 2023
2b1e4ed
Automatic changelog update
PJBot Oct 16, 2023
91ea140
Fix item drop mispredicts (#21035)
metalgearsloth Oct 16, 2023
fedc7c6
Automatic changelog update
PJBot Oct 16, 2023
fd99451
technology auto guidebook (#21029)
EmoGarbage404 Oct 16, 2023
d394477
Update submodule to 167.0.0 (#21060)
metalgearsloth Oct 17, 2023
ebd5238
Restrict arrows from being used in cannons (#21067)
VasilisThePikachu Oct 17, 2023
c08be70
Automatic changelog update
PJBot Oct 17, 2023
0cf28f9
Spear 1984 (#21065)
VasilisThePikachu Oct 17, 2023
b33b575
Automatic changelog update
PJBot Oct 17, 2023
df81532
Change wide swing sprites to be that of the weapon used (#21050)
notquitehadouken Oct 18, 2023
433c706
Automatic changelog update
PJBot Oct 18, 2023
cb1b067
Lockable Suit Storages (#20950)
rosieposieeee Oct 18, 2023
a136616
Replace Component.OnRemove with ComponentRemove event subscriptions (…
DrSmugleaf Oct 18, 2023
5934c67
Replace all T : Component constraints with T : IComponent (#21073)
DrSmugleaf Oct 18, 2023
7ac3387
Update RobustToolbox to 904ddea27497caa6e652eec1b9d3ff2743a79e5c (#21…
DrSmugleaf Oct 18, 2023
13cff0e
Fix build (#21075)
DrSmugleaf Oct 18, 2023
c72b95d
Fix debug assert when shooting guns (#21070)
DrSmugleaf Oct 18, 2023
7a878f7
Fix vaulting mispredict (#21082)
metalgearsloth Oct 18, 2023
6b58757
Automatic changelog update
PJBot Oct 18, 2023
1c61956
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Oct 18, 2023
41096e6
Update locale
Morb0 Oct 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ private int Compare(PlayerInfo x, PlayerInfo y)
Header.Character => Compare(x.CharacterName, y.CharacterName),
Header.Job => Compare(x.StartingJob, y.StartingJob),
Header.Antagonist => x.Antag.CompareTo(y.Antag),
Header.Playtime => Compare(x.PlaytimeString, y.PlaytimeString),
Header.Playtime => TimeSpan.Compare(x.OverallPlaytime ?? default, y.OverallPlaytime ?? default),
_ => 1
};
}
Expand Down
6 changes: 3 additions & 3 deletions Content.Client/Antag/AntagStatusIconSystem.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
using Content.Shared.Ghost;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;
using Content.Shared.Ghost;
using Robust.Client.Player;
using Robust.Shared.Prototypes;

namespace Content.Client.Antag;

/// <summary>
/// Used for assigning specified icons for antags.
/// </summary>
public abstract class AntagStatusIconSystem<T> : SharedStatusIconSystem
where T : Component
where T : IComponent
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IPlayerManager _player = default!;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Eye/EyeLerpingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private Vector2 UpdateZoom(EntityUid uid, float frameTime, EyeComponent? eye = n
return content.TargetZoom;
}

var change = diff * 8f * frameTime;
var change = diff * Math.Min(8f * frameTime, 1);

return eye.Zoom + change;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BoxContainer xmlns="https://spacestation14.io"
Orientation="Vertical">
<BoxContainer Name="DisciplineContainer" Orientation="Vertical"/>
</BoxContainer>
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Client.Guidebook.Richtext;
using Content.Shared.Research.Prototypes;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;

namespace Content.Client.Guidebook.Controls;

/// <summary>
/// Control for embedding all the technologies in a discipline into a guidebook.
/// </summary>
[UsedImplicitly, GenerateTypedNameReferences]
public sealed partial class GuideTechDisciplineEmbed : BoxContainer, IDocumentTag
{
[Dependency] private readonly IPrototypeManager _prototype = default!;

public GuideTechDisciplineEmbed()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
MouseFilter = MouseFilterMode.Stop;
}

public GuideTechDisciplineEmbed(string group) : this()
{
var prototypes = _prototype.EnumeratePrototypes<TechnologyPrototype>()
.Where(p => p.Discipline.Equals(group)).OrderBy(p => p.Tier).ThenBy(p => Loc.GetString(p.Name));
foreach (var tech in prototypes)
{
var embed = new GuideTechnologyEmbed(tech);
DisciplineContainer.AddChild(embed);
}
}

public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control)
{
control = null;
if (!args.TryGetValue("Discipline", out var group))
{
Logger.Error("Technology discipline embed tag is missing discipline argument");
return false;
}

var prototypes = _prototype.EnumeratePrototypes<TechnologyPrototype>()
.Where(p => p.Discipline.Equals(group)).OrderBy(p => p.Tier).ThenBy(p => Loc.GetString(p.Name));
foreach (var tech in prototypes)
{
var embed = new GuideTechnologyEmbed(tech);
DisciplineContainer.AddChild(embed);
}

control = this;
return true;
}
}
22 changes: 22 additions & 0 deletions Content.Client/Guidebook/Controls/GuideTechnologyEmbed.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<BoxContainer xmlns="https://spacestation14.io"
xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client"
xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"
Orientation="Vertical"
Margin="5 5 5 5">
<PanelContainer HorizontalExpand="True">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BorderThickness="1" BorderColor="#777777"/>
</PanelContainer.PanelOverride>
<BoxContainer Orientation="Vertical">
<PanelContainer Name="DisciplineColorBackground" HorizontalExpand="True" VerticalExpand="False" MinHeight="15"/>
<BoxContainer Orientation="Vertical" Margin="5 5 5 5">
<BoxContainer Orientation="Horizontal" HorizontalExpand="True">
<RichTextLabel Name="NameLabel" VerticalAlignment="Bottom" HorizontalExpand="True"/>
<TextureRect Name="TechTexture" VerticalAlignment="Center" HorizontalAlignment="Right"/>
</BoxContainer>
<customControls:HSeparator Margin="10 5 10 10"/>
<RichTextLabel Name="DescriptionLabel"/>
</BoxContainer>
</BoxContainer>
</PanelContainer>
</BoxContainer>
93 changes: 93 additions & 0 deletions Content.Client/Guidebook/Controls/GuideTechnologyEmbed.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
using System.Diagnostics.CodeAnalysis;
using Content.Client.Guidebook.Richtext;
using Content.Client.Message;
using Content.Client.Research;
using Content.Client.UserInterface.ControlExtensions;
using Content.Shared.Research.Prototypes;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;

namespace Content.Client.Guidebook.Controls;

/// <summary>
/// Control for embedding a research technology into a guidebook.
/// </summary>
[UsedImplicitly, GenerateTypedNameReferences]
public sealed partial class GuideTechnologyEmbed : BoxContainer, IDocumentTag, ISearchableControl
{
[Dependency] private readonly IEntitySystemManager _systemManager = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;

private readonly ResearchSystem _research;
private readonly SpriteSystem _sprite;

public GuideTechnologyEmbed()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
_research = _systemManager.GetEntitySystem<ResearchSystem>();
_sprite = _systemManager.GetEntitySystem<SpriteSystem>();
MouseFilter = MouseFilterMode.Stop;
}

public GuideTechnologyEmbed(string technology) : this()
{
GenerateControl(_prototype.Index<TechnologyPrototype>(technology));
}

public GuideTechnologyEmbed(TechnologyPrototype technology) : this()
{
GenerateControl(technology);
}

public bool CheckMatchesSearch(string query)
{
return this.ChildrenContainText(query);
}

public void SetHiddenState(bool state, string query)
{
Visible = CheckMatchesSearch(query) ? state : !state;
}

public bool TryParseTag(Dictionary<string, string> args, [NotNullWhen(true)] out Control? control)
{
control = null;
if (!args.TryGetValue("Technology", out var id))
{
Logger.Error("Technology embed tag is missing technology prototype argument");
return false;
}

if (!_prototype.TryIndex<TechnologyPrototype>(id, out var technology))
{
Logger.Error($"Specified technology prototype \"{id}\" is not a valid technology prototype");
return false;
}

GenerateControl(technology);

control = this;
return true;
}

private void GenerateControl(TechnologyPrototype technology)
{
var discipline = _prototype.Index(technology.Discipline);

NameLabel.SetMarkup($"[bold]{Loc.GetString(technology.Name)}[/bold]");
DescriptionLabel.SetMessage(_research.GetTechnologyDescription(technology, includePrereqs: true, disciplinePrototype: discipline));
TechTexture.Texture = _sprite.Frame0(technology.Icon);

DisciplineColorBackground.PanelOverride = new StyleBoxFlat
{
BackgroundColor = discipline.Color
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
Expand All @@ -15,10 +16,13 @@ public MiniTechnologyCardControl(TechnologyPrototype technology, IPrototypeManag
{
RobustXamlLoader.Load(this);

var discipline = prototypeManager.Index<TechDisciplinePrototype>(technology.Discipline);
var discipline = prototypeManager.Index(technology.Discipline);
Background.ModulateSelfOverride = discipline.Color;
Texture.Texture = spriteSys.Frame0(technology.Icon);
NameLabel.SetMessage(Loc.GetString(technology.Name));
Main.ToolTip = description.ToString();

var tooltip = new Tooltip();
tooltip.SetMessage(description);
Main.TooltipSupplier = _ => tooltip;
}
}
34 changes: 4 additions & 30 deletions Content.Client/Research/UI/ResearchConsoleMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public sealed partial class ResearchConsoleMenu : FancyWindow
private readonly TechnologyDatabaseComponent? _technologyDatabase;
private readonly ResearchSystem _research;
private readonly SpriteSystem _sprite;
private readonly AccessReaderSystem _accessReader = default!;
private readonly AccessReaderSystem _accessReader;

public readonly EntityUid Entity;

Expand Down Expand Up @@ -55,7 +55,7 @@ public void UpdatePanels(ResearchConsoleBoundInterfaceState state)

foreach (var tech in allTech)
{
var mini = new MiniTechnologyCardControl(tech, _prototype, _sprite, GetTechnologyDescription(tech, false));
var mini = new MiniTechnologyCardControl(tech, _prototype, _sprite, _research.GetTechnologyDescription(tech));
AvailableCardsContainer.AddChild(mini);
}

Expand All @@ -74,45 +74,19 @@ public void UpdatePanels(ResearchConsoleBoundInterfaceState state)
foreach (var techId in _technologyDatabase.CurrentTechnologyCards)
{
var tech = _prototype.Index<TechnologyPrototype>(techId);
var cardControl = new TechnologyCardControl(tech, _prototype, _sprite, GetTechnologyDescription(tech), state.Points, hasAccess);
var cardControl = new TechnologyCardControl(tech, _prototype, _sprite, _research.GetTechnologyDescription(tech, includeTier: false), state.Points, hasAccess);
cardControl.OnPressed += () => OnTechnologyCardPressed?.Invoke(techId);
TechnologyCardsContainer.AddChild(cardControl);
}

foreach (var unlocked in _technologyDatabase.UnlockedTechnologies)
{
var tech = _prototype.Index<TechnologyPrototype>(unlocked);
var cardControl = new MiniTechnologyCardControl(tech, _prototype, _sprite, GetTechnologyDescription(tech, false));
var cardControl = new MiniTechnologyCardControl(tech, _prototype, _sprite, _research.GetTechnologyDescription(tech, false));
UnlockedCardsContainer.AddChild(cardControl);
}
}

public FormattedMessage GetTechnologyDescription(TechnologyPrototype technology, bool includeCost = true)
{
var description = new FormattedMessage();
if (includeCost)
{
description.AddMarkup(Loc.GetString("research-console-cost", ("amount", technology.Cost)));
description.PushNewline();
}
description.AddMarkup(Loc.GetString("research-console-unlocks-list-start"));
foreach (var recipe in technology.RecipeUnlocks)
{
var recipeProto = _prototype.Index<LatheRecipePrototype>(recipe);
description.PushNewline();
description.AddMarkup(Loc.GetString("research-console-unlocks-list-entry",
("name",recipeProto.Name)));
}
foreach (var generic in technology.GenericUnlocks)
{
description.PushNewline();
description.AddMarkup(Loc.GetString("research-console-unlocks-list-entry-generic",
("name", Loc.GetString(generic.UnlockDescription))));
}

return description;
}

public void UpdateInformationPanel(ResearchConsoleBoundInterfaceState state)
{
var amountMsg = new FormattedMessage();
Expand Down
Loading
Loading