Merge remote-tracking branch 'upstream/master' into ed-17-07-2024-upstream

This commit is contained in:
Ed
2024-07-17 23:25:31 +03:00
157 changed files with 554 additions and 1464 deletions

View File

@@ -54,7 +54,7 @@ public sealed class AudioUIController : UIController
{
if (!string.IsNullOrEmpty(value))
{
var resource = _cache.GetResource<AudioResource>(value);
var resource = GetSoundOrFallback(value, CCVars.UIClickSound.DefaultValue);
var source =
_audioManager.CreateAudioSource(resource);
@@ -77,7 +77,7 @@ public sealed class AudioUIController : UIController
{
if (!string.IsNullOrEmpty(value))
{
var hoverResource = _cache.GetResource<AudioResource>(value);
var hoverResource = GetSoundOrFallback(value, CCVars.UIHoverSound.DefaultValue);
var hoverSource =
_audioManager.CreateAudioSource(hoverResource);
@@ -95,4 +95,12 @@ public sealed class AudioUIController : UIController
UIManager.SetHoverSound(null);
}
}
private AudioResource GetSoundOrFallback(string path, string fallback)
{
if (!_cache.TryGetResource(path, out AudioResource? resource))
return _cache.GetResource<AudioResource>(fallback);
return resource;
}
}

View File

@@ -1,6 +1,5 @@
using Content.Shared.Research;
using Content.Shared.Research.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Research.UI
{

View File

@@ -1,5 +1,4 @@
using Content.Shared.Research.Components;
using Robust.Client.GameObjects;
namespace Content.Client.Research.UI
{

View File

@@ -1,6 +1,5 @@
using Content.Shared.Research.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
namespace Content.Client.Research.UI;

View File

@@ -81,7 +81,7 @@ public sealed partial class ResearchConsoleMenu : FancyWindow
public void UpdateInformationPanel(ResearchConsoleBoundInterfaceState state)
{
var amountMsg = new FormattedMessage();
amountMsg.AddMarkup(Loc.GetString("research-console-menu-research-points-text",
amountMsg.AddMarkupOrThrow(Loc.GetString("research-console-menu-research-points-text",
("points", state.Points)));
ResearchAmountLabel.SetMessage(amountMsg);
@@ -98,7 +98,7 @@ public sealed partial class ResearchConsoleMenu : FancyWindow
}
var msg = new FormattedMessage();
msg.AddMarkup(Loc.GetString("research-console-menu-main-discipline",
msg.AddMarkupOrThrow(Loc.GetString("research-console-menu-main-discipline",
("name", disciplineText), ("color", disciplineColor)));
MainDisciplineLabel.SetMessage(msg);

View File

@@ -23,7 +23,7 @@ public sealed partial class TechnologyCardControl : Control
DisciplineTexture.Texture = spriteSys.Frame0(discipline.Icon);
TechnologyNameLabel.Text = Loc.GetString(technology.Name);
var message = new FormattedMessage();
message.AddMarkup(Loc.GetString("research-console-tier-discipline-info",
message.AddMarkupOrThrow(Loc.GetString("research-console-tier-discipline-info",
("tier", technology.Tier), ("color", discipline.Color), ("discipline", Loc.GetString(discipline.Name))));
TierLabel.SetMessage(message);
UnlocksLabel.SetMessage(description);

View File

@@ -1,11 +1,13 @@
using System.Linq;
using Content.Client.CharacterInfo;
using Content.Client.Gameplay;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Systems.Character.Controls;
using Content.Client.UserInterface.Systems.Character.Windows;
using Content.Client.UserInterface.Systems.Objectives.Controls;
using Content.Shared.Input;
using Content.Shared.Objectives.Systems;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Player;
@@ -121,11 +123,17 @@ public sealed class CharacterUIController : UIController, IOnStateEntered<Gamepl
Modulate = Color.Gray
};
objectiveControl.AddChild(new Label
var objectiveText = new FormattedMessage();
objectiveText.TryAddMarkup(groupId, out _);
var objectiveLabel = new RichTextLabel
{
Text = groupId,
Modulate = Color.LightSkyBlue
});
StyleClasses = {StyleNano.StyleClassTooltipActionTitle}
};
objectiveLabel.SetMessage(objectiveText);
objectiveControl.AddChild(objectiveLabel);
foreach (var condition in conditions)
{