Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…on-14 into paper
  • Loading branch information
Lgibb18 committed Nov 10, 2024
2 parents c15e5df + 9e38ce3 commit 4bb338b
Show file tree
Hide file tree
Showing 2,994 changed files with 1,408,802 additions and 56,178 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/Resources/engineCommandPerms.yml @moonheart08 @Chief-Engineer
/Resources/clientCommandPerms.yml @moonheart08 @Chief-Engineer

/Resources/Prototypes/Maps/ @Emisse
/Resources/Prototypes/Maps/** @Emisse

/Resources/Prototypes/Body/ @DrSmugleaf # suffering
/Resources/Prototypes/Entities/Mobs/Player/ @DrSmugleaf
Expand Down Expand Up @@ -66,3 +66,4 @@

# Ping for all PRs
* @VigersRay
/Resources/Locale/ @Rinary1
6 changes: 3 additions & 3 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Project-Condor:
org: space-wizards
org: space-sunrise
project: 2
inbox: Inbox
labels:
"W: In Progress": "In Progress"
"W: In Progress": "В Прогрессе"
"W: Discussion": "Design and Discussion"
"W: Backlog": "Backlog"
"W: Next": "Next"
"W: Next": "Следующее"
14 changes: 9 additions & 5 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
"Changes: Sprites":
"Изменения: Спрайты":
- changed-files:
- any-glob-to-any-file: '**/*.rsi/*.png'

"Changes: Map":
"Изменения: Карты":
- changed-files:
- any-glob-to-any-file:
- 'Resources/Maps/**/*.yml'
- 'Resources/Prototypes/Maps/**/*.yml'

"Changes: UI":
"Изменения: Интерфейс":
- changed-files:
- any-glob-to-any-file: '**/*.xaml*'

"Changes: Shaders":
"Изменения: Шейдеры":
- changed-files:
- any-glob-to-any-file: '**/*.swsl'

"No C#":
"Изменения: Локализация":
- changed-files:
- any-glob-to-any-file: '**/*.ftl'

"Нет C#":
- changed-files:
# Equiv to any-glob-to-all as long as this has one matcher. If ALL changed files are not C# files, then apply label.
- all-globs-to-all-files: "!**/*.cs"
4 changes: 2 additions & 2 deletions .github/workflows/labeler-needsreview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions-ecosystem/action-add-labels@v1
with:
labels: "Status: Needs Review"
labels: "Статус: Требует Рассмотрения"
- uses: actions-ecosystem/action-remove-labels@v1
with:
labels: "Status: Awaiting Changes"
labels: "Статус: Ожидает Изменения"
2 changes: 1 addition & 1 deletion .github/workflows/labeler-untriaged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- uses: actions-ecosystem/action-add-labels@v1
if: join(github.event.issue.labels) == ''
with:
labels: "Status: Untriaged"
labels: "Статус: Несортированный"
28 changes: 28 additions & 0 deletions .github/workflows/validate-locale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Locale Validator

on:
push:
branches: [ staging, trying ]
pull_request:
types: [opened, synchronize, reopened]
paths:
- '**.yml'
- '**.ftl'

jobs:
validate_ymls:
name: Validate Locales
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install --no-cache-dir PyYAML
- name: Validate Locales
run: |
python3 Tools/_sunrise/Schemas/validate_yml.py Resources/Locale/ Resources/Prototypes/ --ignore Tools/_sunrise/Schemas/ignore_list.yml
6 changes: 5 additions & 1 deletion .github/workflows/validate-rsis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python dependencies
run: |
pip3 install --ignore-installed --user pillow jsonschema
- name: Validate RSIs
run: |
python3 Tools/Schemas/validate_rsis.py Resources/
python3 Tools/Schemas/validate_rsis.py Resources/Prototypes/
81 changes: 72 additions & 9 deletions Content.Client/Atmos/Consoles/AtmosAlertsComputerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow
{
private readonly IEntityManager _entManager;
private readonly SpriteSystem _spriteSystem;
private readonly SharedNavMapSystem _navMapSystem;

private EntityUid? _owner;
private NetEntity? _trackedEntity;
Expand All @@ -42,19 +43,32 @@ public sealed partial class AtmosAlertsComputerWindow : FancyWindow

private const float SilencingDuration = 2.5f;

// Colors
private Color _wallColor = new Color(64, 64, 64);
private Color _tileColor = new Color(28, 28, 28);
private Color _monitorBlipColor = Color.Cyan;
private Color _untrackedEntColor = Color.DimGray;
private Color _regionBaseColor = new Color(154, 154, 154);
private Color _inactiveColor = StyleNano.DisabledFore;
private Color _statusTextColor = StyleNano.GoodGreenFore;
private Color _goodColor = Color.LimeGreen;
private Color _warningColor = new Color(255, 182, 72);
private Color _dangerColor = new Color(255, 67, 67);

public AtmosAlertsComputerWindow(AtmosAlertsComputerBoundUserInterface userInterface, EntityUid? owner)
{
RobustXamlLoader.Load(this);
_entManager = IoCManager.Resolve<IEntityManager>();
_spriteSystem = _entManager.System<SpriteSystem>();
_navMapSystem = _entManager.System<SharedNavMapSystem>();

// Pass the owner to nav map
_owner = owner;
NavMap.Owner = _owner;

// Set nav map colors
NavMap.WallColor = new Color(64, 64, 64);
NavMap.TileColor = Color.DimGray * NavMap.WallColor;
NavMap.WallColor = _wallColor;
NavMap.TileColor = _tileColor;

// Set nav map grid uid
var stationName = Loc.GetString("atmos-alerts-window-unknown-location");
Expand Down Expand Up @@ -179,6 +193,9 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[
// Add tracked entities to the nav map
foreach (var device in console.AtmosDevices)
{
if (!device.NetEntity.Valid)
continue;

if (!NavMap.Visible)
continue;

Expand Down Expand Up @@ -209,7 +226,7 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[
if (consoleCoords != null && consoleUid != null)
{
var texture = _spriteSystem.Frame0(new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")));
var blip = new NavMapBlip(consoleCoords.Value, texture, Color.Cyan, true, false);
var blip = new NavMapBlip(consoleCoords.Value, texture, _monitorBlipColor, true, false);
NavMap.TrackedEntities[consoleUid.Value] = blip;
}

Expand Down Expand Up @@ -258,7 +275,7 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[
VerticalAlignment = VAlignment.Center,
};

label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", StyleNano.GoodGreenFore.ToHexNoAlpha())));
label.SetMarkup(Loc.GetString("atmos-alerts-window-no-active-alerts", ("color", _statusTextColor.ToHexNoAlpha())));

AlertsTable.AddChild(label);
}
Expand All @@ -270,6 +287,34 @@ public void UpdateUI(EntityCoordinates? consoleCoords, AtmosAlertsComputerEntry[
else
MasterTabContainer.SetTabTitle(0, Loc.GetString("atmos-alerts-window-tab-alerts", ("value", activeAlarmCount)));

// Update sensor regions
NavMap.RegionOverlays.Clear();
var prioritizedRegionOverlays = new Dictionary<NavMapRegionOverlay, int>();

if (_owner != null &&
_entManager.TryGetComponent<TransformComponent>(_owner, out var xform) &&
_entManager.TryGetComponent<NavMapComponent>(xform.GridUid, out var navMap))
{
var regionOverlays = _navMapSystem.GetNavMapRegionOverlays(_owner.Value, navMap, AtmosAlertsComputerUiKey.Key);

foreach (var (regionOwner, regionOverlay) in regionOverlays)
{
var alarmState = GetAlarmState(regionOwner);

if (!TryGetSensorRegionColor(regionOwner, alarmState, out var regionColor))
continue;

regionOverlay.Color = regionColor;

var priority = (_trackedEntity == regionOwner) ? 999 : (int)alarmState;
prioritizedRegionOverlays.Add(regionOverlay, priority);
}

// Sort overlays according to their priority
var sortedOverlays = prioritizedRegionOverlays.OrderBy(x => x.Value).Select(x => x.Key).ToList();
NavMap.RegionOverlays = sortedOverlays;
}

// Auto-scroll re-enable
if (_autoScrollAwaitsUpdate)
{
Expand All @@ -290,14 +335,32 @@ private void AddTrackedEntityToNavMap(AtmosAlertsDeviceNavMapData metaData, Atmo
var coords = _entManager.GetCoordinates(metaData.NetCoordinates);

if (_trackedEntity != null && _trackedEntity != metaData.NetEntity)
color *= Color.DimGray;
color *= _untrackedEntColor;

var selectable = true;
var blip = new NavMapBlip(coords, _spriteSystem.Frame0(texture), color, _trackedEntity == metaData.NetEntity, selectable);

NavMap.TrackedEntities[metaData.NetEntity] = blip;
}

private bool TryGetSensorRegionColor(NetEntity regionOwner, AtmosAlarmType alarmState, out Color color)
{
color = Color.White;

var blip = GetBlipTexture(alarmState);

if (blip == null)
return false;

// Color the region based on alarm state and entity tracking
color = blip.Value.Item2 * _regionBaseColor;

if (_trackedEntity != null && _trackedEntity != regionOwner)
color *= _untrackedEntColor;

return true;
}

private void UpdateUIEntry(AtmosAlertsComputerEntry entry, int index, Control table, AtmosAlertsComputerComponent console, AtmosAlertsFocusDeviceData? focusData = null)
{
// Make new UI entry if required
Expand Down Expand Up @@ -534,13 +597,13 @@ private AtmosAlarmType GetAlarmState(NetEntity netEntity)
switch (alarmState)
{
case AtmosAlarmType.Invalid:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), StyleNano.DisabledFore); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _inactiveColor); break;
case AtmosAlarmType.Normal:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), Color.LimeGreen); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_circle.png")), _goodColor); break;
case AtmosAlarmType.Warning:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), new Color(255, 182, 72)); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_triangle.png")), _warningColor); break;
case AtmosAlarmType.Danger:
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), new Color(255, 67, 67)); break;
output = (new SpriteSpecifier.Texture(new ResPath("/Textures/Interface/NavMap/beveled_square.png")), _dangerColor); break;
}

return output;
Expand Down
12 changes: 3 additions & 9 deletions Content.Client/Buckle/BuckleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,11 @@ private void OnStrapMoveEvent(EntityUid uid, StrapComponent component, ref MoveE

private void OnAppearanceChange(EntityUid uid, BuckleComponent component, ref AppearanceChangeEvent args)
{
if (!TryComp<RotationVisualsComponent>(uid, out var rotVisuals))
if (!TryComp<RotationVisualsComponent>(uid, out var rotVisuals)
|| !Appearance.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, args.Component)
|| !buckled || args.Sprite == null)
return;

if (!Appearance.TryGetData<bool>(uid, BuckleVisuals.Buckled, out var buckled, args.Component) ||
!buckled ||
args.Sprite == null)
{
_rotationVisualizerSystem.SetHorizontalAngle((uid, rotVisuals), rotVisuals.DefaultRotation);
return;
}

// Animate strapping yourself to something at a given angle
// TODO: Dump this when buckle is better
_rotationVisualizerSystem.AnimateSpriteRotation(uid, args.Sprite, rotVisuals.HorizontalRotation, 0.125f);
Expand Down
12 changes: 11 additions & 1 deletion Content.Client/Entry/EntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Client.DebugMon;
using Content.Client.Eui;
using Content.Client.Fullscreen;
using Content.Client.GameTicking.Managers;
using Content.Client.GhostKick;
using Content.Client.Guidebook;
using Content.Client.Input;
Expand Down Expand Up @@ -71,6 +72,7 @@ public sealed class EntryPoint : GameClient
[Dependency] private readonly IReplayLoadManager _replayLoad = default!;
[Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!;
[Dependency] private readonly TitleWindowManager _titleWindowManager = default!;
[Dependency] private readonly ServersHubManager _serversHubManager = default!; // Sunrise-Hub

public override void Init()
Expand Down Expand Up @@ -106,7 +108,8 @@ public override void Init()
_prototypeManager.RegisterIgnore("htnPrimitive");
_prototypeManager.RegisterIgnore("gameMap");
_prototypeManager.RegisterIgnore("gameMapPool");
_prototypeManager.RegisterIgnore("lobbyBackground");
// Sunrise-Edit
// _prototypeManager.RegisterIgnore("lobbyBackground");
_prototypeManager.RegisterIgnore("gamePreset");
_prototypeManager.RegisterIgnore("noiseChannel");
_prototypeManager.RegisterIgnore("playerConnectionWhitelist");
Expand Down Expand Up @@ -146,6 +149,12 @@ public override void Init()
_configManager.SetCVar("interface.resolutionAutoScaleMinimum", 0.5f);
}

public override void Shutdown()
{
base.Shutdown();
_titleWindowManager.Shutdown();
}

public override void PostInit()
{
base.PostInit();
Expand All @@ -166,6 +175,7 @@ public override void PostInit()
_userInterfaceManager.SetDefaultTheme("SS14DefaultTheme");
_userInterfaceManager.SetActiveTheme(_configManager.GetCVar(CVars.InterfaceTheme));
_documentParsingManager.Initialize();
_titleWindowManager.Initialize();

_baseClient.RunLevelChanged += (_, args) =>
{
Expand Down
14 changes: 8 additions & 6 deletions Content.Client/GameTicking/Managers/ClientGameTicker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ public sealed class ClientGameTicker : SharedGameTicker
[ViewVariables] public bool IsGameStarted { get; private set; }
[ViewVariables] public string? RestartSound { get; private set; }
// Sunrise-Start
[ViewVariables] public string? LobbyParalax { get; private set; }
[ViewVariables] public LobbyImage? LobbyImage { get; private set; }
[ViewVariables] public string? LobbyType { get; private set; }
[ViewVariables] public string? LobbyParallax { get; private set; }
[ViewVariables] public string? LobbyAnimation { get; private set; }
[ViewVariables] public string? LobbyArt { get; private set; }
// Sunrise-End
[ViewVariables] public string? LobbyBackground { get; private set; }
[ViewVariables] public bool DisallowedLateJoin { get; private set; }
[ViewVariables] public string? ServerInfoBlob { get; private set; }
[ViewVariables] public TimeSpan StartTime { get; private set; }
Expand Down Expand Up @@ -124,9 +125,10 @@ private void LobbyStatus(TickerLobbyStatusEvent message)
IsGameStarted = message.IsRoundStarted;
AreWeReady = message.YouAreReady;
// Sunrise-Start
LobbyBackground = message.LobbyBackground;
LobbyParalax = message.LobbyParalax;
LobbyImage = message.LobbyImage;
LobbyType = message.LobbyType;
LobbyArt = message.LobbyArt;
LobbyParallax = message.LobbyParallax;
LobbyAnimation = message.LobbyAnimation;
// Sunrise-End
Paused = message.Paused;

Expand Down
Loading

0 comments on commit 4bb338b

Please sign in to comment.