Skip to content

Commit

Permalink
Merge branch 'new-frontiers-14:master' into 2024-01-03-ReEmag
Browse files Browse the repository at this point in the history
  • Loading branch information
dvir001 committed Jan 22, 2024
2 parents 8521272 + 1906d07 commit 852d6b0
Show file tree
Hide file tree
Showing 288 changed files with 24,174 additions and 8,529 deletions.
4 changes: 0 additions & 4 deletions .github/mapchecker/whitelist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ Metastable:
- SignSec
DartX:
- HighSecDoor
gourd:
- HoloprojectorSecurity
Praeda:
- ClothingEyesGlassesSecurity
- EncryptionKeyCommand
Expand All @@ -44,8 +42,6 @@ Pheonix:
Spectre:
- AirlockSecurity
- EncryptionKeyMedicalScience
Bazaar:
- AirlockSecurity
Anchor:
- AirlockSecurity
- IntercomCommand
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Lobby/LobbyState.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Client.NewFrontier.Latejoin;
using Content.Client._NF.Latejoin;
using Content.Client.Chat.Managers;
using Content.Client.GameTicking.Managers;
using Content.Client.LateJoin;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Shuttles/UI/RadarConsoleWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:ui="clr-namespace:Content.Client.Shuttles.UI"
Title="{Loc 'radar-console-window-title'}"
SetSize="648 648"
SetSize="648 672"
MinSize="256 256">
<ui:RadarControl Name="RadarScreen"
Margin="4"
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Shuttles/UI/ShuttleConsoleWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
xmlns:ui="clr-namespace:Content.Client.Shuttles.UI"
Title="{Loc 'shuttle-console-window-title'}"
SetSize="1180 648"
SetSize="1180 672"
MinSize="788 320">
<GridContainer Columns="3"
HorizontalAlignment="Stretch"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<controls:FancyWindow
xmlns="https://spacestation14.io"
xmlns:lateJoin="clr-namespace:Content.Client.NewFrontier.Latejoin"
xmlns:lateJoin="clr-namespace:Content.Client._NF.Latejoin"
xmlns:cc="clr-namespace:Content.Client.Administration.UI.CustomControls"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="Join Game"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

namespace Content.Client.NewFrontier.Latejoin;
namespace Content.Client._NF.Latejoin;

[GenerateTypedNameReferences]
public sealed partial class NFLateJoinGui : FancyWindow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using Robust.Client.Utility;
using Robust.Shared.Prototypes;

namespace Content.Client.NewFrontier.Latejoin;
namespace Content.Client._NF.Latejoin;

[GenerateTypedNameReferences]
public sealed partial class NewFrontierLateJoinJobButton : Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Player;

namespace Content.Client.NewFrontier.Latejoin;
namespace Content.Client._NF.Latejoin;

[GenerateTypedNameReferences]
public sealed partial class VesselListControl : BoxContainer
Expand All @@ -24,6 +25,7 @@ public NetEntity? Selected
return (NetEntity) i.Metadata!;
}
}
private IReadOnlyDictionary<NetEntity, Dictionary<string, uint?>>? _lastJobState;

public VesselListControl()
{
Expand All @@ -34,6 +36,12 @@ public VesselListControl()
UpdateUi(_gameTicker.JobsAvailable);

Comparison = DefaultComparison;

FilterLineEdit.OnTextChanged += _ =>
{
if (_lastJobState != null)
UpdateUi(_lastJobState);
};
}

protected override void Dispose(bool disposing)
Expand All @@ -44,7 +52,8 @@ protected override void Dispose(bool disposing)

private int DefaultComparison(NetEntity x, NetEntity y)
{
return (int)(_gameTicker.JobsAvailable[x].Values.Sum(a => a ?? 0) - _gameTicker.JobsAvailable[y].Values.Sum(b => b ?? 0));
// Negated to enforce descending order
return -(int)(_gameTicker.JobsAvailable[x].Values.Sum(a => a ?? 0) - _gameTicker.JobsAvailable[y].Values.Sum(b => b ?? 0));
}

public void Sort()
Expand All @@ -55,27 +64,18 @@ public void Sort()

private void UpdateUi(IReadOnlyDictionary<NetEntity, Dictionary<string, uint?>> obj)
{
var itemsToRemove = new List<ItemList.Item>();
foreach (var (key, item) in VesselItemList.Select(x => ((NetEntity)x.Metadata!, x)))
{
if (!_gameTicker.StationNames.ContainsKey(key))
itemsToRemove.Add(item);
}

foreach (var item in itemsToRemove)
{
VesselItemList.Remove(item);
}
VesselItemList.Clear();

foreach (var (key, name) in _gameTicker.StationNames)
{
if (VesselItemList.Any(x => ((NetEntity)x.Metadata!) == key))
continue;

var jobsAvailable = _gameTicker.JobsAvailable[key].Values.Sum(a => a ?? 0).ToString();
var item = new ItemList.Item(VesselItemList)
{
Metadata = key,
Text = name
Text = name + $" ({jobsAvailable})"
};

if (!string.IsNullOrEmpty(FilterLineEdit.Text) &&
Expand All @@ -88,5 +88,7 @@ private void UpdateUi(IReadOnlyDictionary<NetEntity, Dictionary<string, uint?>>
}

Sort();

_lastJobState = obj;
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Content.Shared.Anomaly;
using Content.Shared.Anomaly;
using Content.Shared.Materials;
using Content.Shared.Radio;
using Robust.Shared.Audio;
Expand Down Expand Up @@ -37,13 +37,13 @@ public sealed partial class AnomalyGeneratorComponent : Component
/// The material needed to generate an anomaly
/// </summary>
[DataField("requiredMaterial", customTypeSerializer: typeof(PrototypeIdSerializer<MaterialPrototype>)), ViewVariables(VVAccess.ReadWrite)]
public string RequiredMaterial = "Plasma";
public string RequiredMaterial = "Bananium"; // Frontier - Plasma to Bananium

/// <summary>
/// The amount of material needed to generate a single anomaly
/// </summary>
[DataField("materialPerAnomaly"), ViewVariables(VVAccess.ReadWrite)]
public int MaterialPerAnomaly = 1500; // a bit less than a stack of plasma
public int MaterialPerAnomaly = 1000; // Frontier - Plasma to Bananium, 1500 to 1000

/// <summary>
/// The random anomaly spawner entity
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Content.Server.Item.PseudoItem;

/// <summary>
/// Signifies that pseudo-item creatures can sleep inside the container to which this component was added.
/// </summary>
[RegisterComponent]
public sealed partial class AllowsSleepInsideComponent : Component
{
}
23 changes: 23 additions & 0 deletions Content.Server/Nyanotrasen/Item/PseudoItem/PseudoItemSystem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using Content.Server.Actions;
using Content.Server.Bed.Sleep;
using Content.Server.DoAfter;
using Content.Server.Popups;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Bed.Sleep;
using Content.Shared.DoAfter;
using Content.Shared.Hands;
using Content.Shared.IdentityManagement;
Expand All @@ -18,6 +22,8 @@ public sealed class PseudoItemSystem : EntitySystem
[Dependency] private readonly ItemSystem _itemSystem = default!;
[Dependency] private readonly DoAfterSystem _doAfter = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
[Dependency] private readonly ActionsSystem _actions = default!; // Frontier
[Dependency] private readonly PopupSystem _popup = default!; // Frontier

[ValidatePrototypeId<TagPrototype>]
private const string PreventTag = "PreventLabel";
Expand All @@ -32,6 +38,7 @@ public override void Initialize()
SubscribeLocalEvent<PseudoItemComponent, DropAttemptEvent>(OnDropAttempt);
SubscribeLocalEvent<PseudoItemComponent, PseudoItemInsertDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<PseudoItemComponent, ContainerGettingInsertedAttemptEvent>(OnInsertAttempt);
SubscribeLocalEvent<PseudoItemComponent, TryingToSleepEvent>(OnTrySleeping); // Frontier
}

private void AddInsertVerb(EntityUid uid, PseudoItemComponent component, GetVerbsEvent<InnateVerb> args)
Expand Down Expand Up @@ -96,6 +103,10 @@ private void OnEntRemoved(EntityUid uid, PseudoItemComponent component, EntGotRe

RemComp<ItemComponent>(uid);
component.Active = false;

// Frontier
if (component.SleepAction is { Valid: true })
_actions.RemoveAction(uid, component.SleepAction);
}

private void OnGettingPickedUpAttempt(EntityUid uid, PseudoItemComponent component,
Expand Down Expand Up @@ -142,6 +153,10 @@ public bool TryInsert(EntityUid storageUid, EntityUid toInsert, PseudoItemCompon
return false;
}

// Frontier
if (HasComp<AllowsSleepInsideComponent>(storageUid))
_actions.AddAction(toInsert, ref component.SleepAction, SleepingSystem.SleepActionId, toInsert);

component.Active = true;
return true;
}
Expand Down Expand Up @@ -171,4 +186,12 @@ private void OnInsertAttempt(EntityUid uid, PseudoItemComponent component,
// This hopefully shouldn't trigger, but this is a failsafe just in case so we dont bluespace them cats
args.Cancel();
}

// Frontier - show a popup when a pseudo-item falls asleep inside a bag.
private void OnTrySleeping(EntityUid uid, PseudoItemComponent component, TryingToSleepEvent args)
{
var parent = Transform(uid).ParentUid;
if (!HasComp<SleepingComponent>(uid) && parent is { Valid: true } && HasComp<AllowsSleepInsideComponent>(parent))
_popup.PopupEntity(Loc.GetString("popup-sleep-in-bag", ("entity", uid)), uid);
}
}
20 changes: 10 additions & 10 deletions Content.Server/_NF/GameRule/NfAdventureRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private void OnStartup(RoundStartingEvent ev)
var tinnia = "/Maps/_NF/POI/tinnia.yml";
var caseys = "/Maps/_NF/POI/caseyscasino.yml";
var lpbravo = "/Maps/_NF/POI/lpbravo.yml";
var northpole = "/Maps/_NF/POI/northpole.yml";
// var northpole = "/Maps/_NF/POI/northpole.yml";
var arena = "/Maps/_NF/POI/arena.yml";
var cove = "/Maps/_NF/POI/cove.yml";
var courthouse = "/Maps/_NF/POI/courthouse.yml";
Expand Down Expand Up @@ -181,15 +181,15 @@ private void OnStartup(RoundStartingEvent ev)
_shuttle.AddIFFFlag(depotUid4s[0], IFFFlags.HideLabel);
}

if (_map.TryLoad(mapId, northpole, out var northpoleUids, new MapLoadOptions
{
Offset = _random.NextVector2(2150f, 3900f)
}))
{
var meta = EnsureComp<MetaDataComponent>(northpoleUids[0]);
_shuttle.SetIFFColor(northpoleUids[0], lpbravoColor);
_shuttle.AddIFFFlag(northpoleUids[0], IFFFlags.HideLabel);
}
// if (_map.TryLoad(mapId, northpole, out var northpoleUids, new MapLoadOptions
// {
// Offset = _random.NextVector2(2150f, 3900f)
// }))
// {
// var meta = EnsureComp<MetaDataComponent>(northpoleUids[0]);
// _shuttle.SetIFFColor(northpoleUids[0], lpbravoColor);
// _shuttle.AddIFFFlag(northpoleUids[0], IFFFlags.HideLabel);
// }

if (_map.TryLoad(mapId, arena, out var depotUid5s, new MapLoadOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Content.Server._NF.PublicTransit.Components;

/// <summary>
/// Added to a station that is available for public transit.
/// </summary>
[RegisterComponent, Access(typeof(PublicTransitSystem))]
public sealed partial class StationTransitComponent : Component
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;

namespace Content.Server._NF.PublicTransit.Components;

/// <summary>
/// Added to a grid to have it act as an automated public transit bus.
/// Public Transit system will add this procedurally to any grid designated as a 'bus' through the CVAR
/// Mappers may add it to their shuttle if they wish, but this is going to force it's use and function as a public transit bus
/// </summary>
[RegisterComponent, Access(typeof(PublicTransitSystem))]
public sealed partial class TransitShuttleComponent : Component
{
[DataField("nextStation")]
public EntityUid NextStation;

[DataField("nextTransfer", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan NextTransfer;
}
Loading

0 comments on commit 852d6b0

Please sign in to comment.