Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into Up130724
Browse files Browse the repository at this point in the history
  • Loading branch information
Vonsant committed Jul 13, 2024
2 parents 50d4dd8 + df8525a commit eaf31e7
Show file tree
Hide file tree
Showing 555 changed files with 35,627 additions and 17,754 deletions.
5 changes: 4 additions & 1 deletion .github/mapchecker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@
"Plastitanium", # Plastitanium walls should only be appearing on security ships.
"Kammerer", # Opportunity
"HighSecDoor",
"ShuttleGun",
],
"Syndicate": [
"Plastitanium", # And also on blackmarket ships cause syndicate.
"ButtonFrameCautionSecurity", # Decal.
"ButtonFrameCautionSecurity", # Decal.
"ShuttleGun",
],
"BlackMarket": [
"Plastitanium", # And also on blackmarket ships cause syndicate.
"ButtonFrameCautionSecurity", # Decal.
"ShuttleGun",
]
}
4 changes: 4 additions & 0 deletions .github/mapchecker/whitelist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ Trade: true
# the intention for this list to become empty in separate PR's.
#DartX:
# - HighSecDoor
Rogue:
- ShuttleGunFriendship
Bottleneck:
- PosterLegitPDAAd
12 changes: 10 additions & 2 deletions Content.Client/Bank/UI/BankATMMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* New Frontiers - This file is licensed under AGPLv3
* Copyright (c) 2024 New Frontiers Contributors
* See AGPLv3.txt for details.
*/
using Content.Client.UserInterface.Controls;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
Expand All @@ -22,13 +27,16 @@ public BankATMMenu()

public void SetBalance(int amount)
{
BalanceLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
BalanceLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
}

public void SetDeposit(int amount)
{
DepositButton.Disabled = amount <= 0;
DepositLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
if (amount >= 0) // Valid
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
else
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-error");
}

public void SetEnabled(bool enabled)
Expand Down
12 changes: 10 additions & 2 deletions Content.Client/Bank/UI/StationBankATMMenu.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* New Frontiers - This file is licensed under AGPLv3
* Copyright (c) 2024 New Frontiers Contributors
* See AGPLv3.txt for details.
*/
using Content.Client.UserInterface.Controls;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
Expand Down Expand Up @@ -36,13 +41,16 @@ private void OnReasonSelected(OptionButton.ItemSelectedEventArgs args)
}
public void SetBalance(int amount)
{
BalanceLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
BalanceLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
}

public void SetDeposit(int amount)
{
DepositButton.Disabled = amount <= 0;
DepositLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
if (amount >= 0) // Valid
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
else
DepositLabel.Text = Loc.GetString("bank-atm-menu-cash-error");
}

public void SetEnabled(bool enabled)
Expand Down
7 changes: 6 additions & 1 deletion Content.Client/Bank/UI/WithdrawBankATMMenu.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* New Frontiers - This file is licensed under AGPLv3
* Copyright (c) 2024 New Frontiers Contributors
* See AGPLv3.txt for details.
*/
using Content.Client.UserInterface.Controls;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
Expand All @@ -21,7 +26,7 @@ public WithdrawBankATMMenu()

public void SetBalance(int amount)
{
BalanceLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", amount.ToString()));
BalanceLabel.Text = Loc.GetString("bank-atm-menu-cash-amount", ("amount", amount.ToString()));
}

public void SetEnabled(bool enabled)
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Lathe/UI/LatheMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private string GenerateTooltipText(LatheRecipePrototype prototype)
if (!_prototypeManager.TryIndex<MaterialPrototype>(id, out var proto))
continue;

var adjustedAmount = SharedLatheSystem.AdjustMaterial(amount, prototype.ApplyMaterialDiscount, _entityManager.GetComponent<LatheComponent>(_owner).MaterialUseMultiplier);
var adjustedAmount = SharedLatheSystem.AdjustMaterial(amount, prototype.ApplyMaterialDiscount, _entityManager.GetComponent<LatheComponent>(_owner).FinalMaterialUseMultiplier); // Frontier: MaterialUseMultiplier<FinalMaterialUseMultiplier
var sheetVolume = _materialStorage.GetSheetVolume(proto);

var unit = Loc.GetString(proto.Unit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ protected override void Open()
_menu.TargetIdButton.OnPressed += _ => SendMessage(new ItemSlotButtonPressedEvent("ShipyardConsole-targetId"));
}

private void Populate(List<string> prototypes, string name)
private void Populate(List<string> prototypes, string name, bool freeListings)
{
if (_menu == null)
return;

_menu.PopulateProducts(prototypes, name);
_menu.PopulateProducts(prototypes, name, freeListings);
_menu.PopulateCategories();
}

Expand All @@ -61,7 +61,7 @@ protected override void UpdateState(BoundUserInterfaceState state)
Balance = cState.Balance;
ShipSellValue = cState.ShipSellValue;
var castState = (ShipyardConsoleInterfaceState) state;
Populate(castState.ShipyardPrototypes, castState.ShipyardName);
Populate(castState.ShipyardPrototypes, castState.ShipyardName, castState.FreeListings);
_menu?.UpdateState(castState);
}

Expand Down
25 changes: 19 additions & 6 deletions Content.Client/Shipyard/UI/ShipyardConsoleMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public sealed partial class ShipyardConsoleMenu : FancyWindow

private List<string> _lastProtos = new();
private string _lastType = "";
private bool _freeListings = false;

public ShipyardConsoleMenu(ShipyardConsoleBoundUserInterface owner)
{
Expand All @@ -41,12 +42,12 @@ public ShipyardConsoleMenu(ShipyardConsoleBoundUserInterface owner)
private void OnCategoryItemSelected(OptionButton.ItemSelectedEventArgs args)
{
SetCategoryText(args.Id);
PopulateProducts(_lastProtos, _lastType);
PopulateProducts(_lastProtos, _lastType, _freeListings);
}

private void OnSearchBarTextChanged(LineEdit.LineEditEventArgs args)
{
PopulateProducts(_lastProtos, _lastType);
PopulateProducts(_lastProtos, _lastType, _freeListings);
}

private void SetCategoryText(int id)
Expand All @@ -58,7 +59,7 @@ private void SetCategoryText(int id)
/// <summary>
/// Populates the list of products that will actually be shown, using the current filters.
/// </summary>
public void PopulateProducts(List<string> prototypes, string type)
public void PopulateProducts(List<string> prototypes, string type, bool free)
{
Vessels.RemoveAllChildren();

Expand All @@ -80,12 +81,18 @@ public void PopulateProducts(List<string> prototypes, string type)
search.Length != 0 && prototype!.Name.ToLowerInvariant().Contains(search) ||
search.Length == 0 && _category != null && prototype!.Category.Equals(_category))
{
string priceText;
if (_freeListings)
priceText = Loc.GetString("shipyard-console-menu-listing-free");
else
priceText = Loc.GetString("shipyard-console-menu-listing-amount", ("amount", prototype!.Price.ToString()));

var vesselEntry = new VesselRow
{
Vessel = prototype,
VesselName = { Text = prototype!.Name },
Purchase = { ToolTip = prototype.Description, TooltipDelay = 0.2f },
Price = { Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", prototype.Price.ToString())) },
Price = { Text = priceText },
};
vesselEntry.Purchase.OnPressed += (args) => { OnOrderApproved?.Invoke(args); };
Vessels.AddChild(vesselEntry);
Expand Down Expand Up @@ -125,8 +132,12 @@ public void PopulateCategories()

public void UpdateState(ShipyardConsoleInterfaceState state)
{
BalanceLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", state.Balance.ToString()));
ShipAppraisalLabel.Text = Loc.GetString("cargo-console-menu-points-amount", ("amount", state.ShipSellValue.ToString()));
BalanceLabel.Text = Loc.GetString("shipyard-console-menu-listing-amount", ("amount", state.Balance.ToString()));
int shipPrice = 0;
if (!state.FreeListings)
shipPrice = state.ShipSellValue;

ShipAppraisalLabel.Text = Loc.GetString("shipyard-console-menu-listing-amount", ("amount", shipPrice.ToString()));
SellShipButton.Disabled = state.ShipDeedTitle == null;
TargetIdButton.Text = state.IsTargetIdPresent
? Loc.GetString("id-card-console-window-eject-button")
Expand All @@ -139,5 +150,7 @@ public void UpdateState(ShipyardConsoleInterfaceState state)
{
DeedTitle.Text = $"None";
}
_freeListings = state.FreeListings;
PopulateProducts(_lastProtos, _lastType, _freeListings);
}
}
11 changes: 11 additions & 0 deletions Content.Client/Shuttles/UI/NavScreen.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,16 @@
<controls:Label Text="{controls:Loc 'shuttle-console-iff-search'}"></controls:Label>
<controls:LineEdit Name="IffSearchCriteria" Access="Public" HorizontalExpand="True"></controls:LineEdit>
</controls:BoxContainer>

<!-- Frontier - Maximum IFF Distance -->
<controls:BoxContainer Orientation="Vertical" HorizontalExpand="True" Name="MaximumIFFDistanceBox">
<controls:Label Text="{controls:Loc 'shuttle-console-maximum-iff-distance'}"/>
<controls:SliderIntInput Name="MaximumIFFDistanceValue"
Access="Public"
MinValue="0"
MaxValue="3000"
Value="3000"
HorizontalExpand="True"/>
</controls:BoxContainer>
</controls:BoxContainer>
</controls:BoxContainer>
10 changes: 10 additions & 0 deletions Content.Client/Shuttles/UI/NavScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public NavScreen()

// Frontier - IFF search
IffSearchCriteria.OnTextChanged += args => OnIffSearchChanged(args.Text);

// Frontier - Maximum IFF Distance
MaximumIFFDistanceValue.GetChild(0).GetChild(1).Margin = new Thickness(8,0,0,0);
MaximumIFFDistanceValue.OnValueChanged += args => OnRangeFilterChanged(args);
}

// Frontier - IFF search
Expand All @@ -51,6 +55,12 @@ private void OnIffSearchChanged(string text)
};
}

// Frontier - Maximum IFF Distance
private void OnRangeFilterChanged(int value)
{
NavRadar.MaximumIFFDistance = (float) value;
}

public void SetShuttle(EntityUid? shuttle)
{
_shuttleEntity = shuttle;
Expand Down
16 changes: 16 additions & 0 deletions Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
public bool ShowIFFShuttles { get; set; } = true;
public bool ShowDocks { get; set; } = true;

public float MaximumIFFDistance { get; set; } = -1f; // Frontier

/// <summary>
/// If present, called for every IFF. Must determine if it should or should not be shown.
/// </summary>
Expand Down Expand Up @@ -224,6 +226,20 @@ protected override void Draw(DrawingHandleScreen handle)
shouldDrawIFF &= ShowIFFShuttles;
}

// New Frontiers - Maximum IFF Distance - checks distance to object, draws if closer than max range
// This code is licensed under AGPLv3. See AGPLv3.txt
if (shouldDrawIFF && MaximumIFFDistance >= 0.0f)
{
var gridCentre = Vector2.Transform(gridBody.LocalCenter, matty);
var distance = gridCentre.Length();

if (distance > MaximumIFFDistance)
{
shouldDrawIFF = false;
}
}
// End of modified code

if (shouldDrawIFF)
{
var gridCentre = Vector2.Transform(gridBody.LocalCenter, matty);
Expand Down
5 changes: 2 additions & 3 deletions Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Client.UserInterface.Controls;
using Content.Shared.VendingMachines;
using Content.Shared.Cargo.Components;
using Content.Shared._NF.Cargo.Components;
using Content.Shared.Stacks;
using Robust.Client.AutoGenerated;
using Robust.Client.GameObjects;
Expand Down Expand Up @@ -150,9 +149,9 @@ public void Populate(List<VendingMachineInventoryEntry> inventory, float priceMo
}

// This block exists to allow the VendPrice flag to set a vending machine item price.
if (prototype != null && prototype.TryGetComponent<VendPriceComponent>(out var vendPriceComponent) && vendPriceComponent.Price != 0 && cost <= (float) vendPriceComponent.Price)
if (prototype != null && prototype.TryGetComponent<StaticPriceComponent>(out var vendPriceComponent) && vendPriceComponent.VendPrice != 0 && cost <= (float) vendPriceComponent.VendPrice)
{
var price = (float) vendPriceComponent.Price;
var price = (float) vendPriceComponent.VendPrice;
cost = (int) price;
}
// This block exists to allow the VendPrice flag to set a vending machine item price.
Expand Down
7 changes: 3 additions & 4 deletions Content.Server/Cargo/Systems/PricingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
using Content.Shared.Administration;
using Content.Shared.Body.Components;
using Content.Shared.Cargo.Components;
using Content.Shared._NF.Cargo.Components;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Materials;
Expand Down Expand Up @@ -385,10 +384,10 @@ private double GetVendPrice(EntityPrototype prototype)
{
var price = 0.0;

if (prototype.Components.TryGetValue(_factory.GetComponentName(typeof(VendPriceComponent)), out var vendProto))
if (prototype.Components.TryGetValue(_factory.GetComponentName(typeof(StaticPriceComponent)), out var vendProto))
{
var vendPrice = (VendPriceComponent) vendProto.Component;
price += vendPrice.Price;
var vendPrice = (StaticPriceComponent) vendProto.Component;
price += vendPrice.VendPrice;
}

return price;
Expand Down
15 changes: 9 additions & 6 deletions Content.Server/Connection/ConnectionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,14 @@ private async Task NetMgrOnConnecting(NetConnectingArgs e)
}

var adminData = await _dbManager.GetAdminDataForAsync(e.UserId);
// New Frontiers - Session Respector - Checks that a player was connected before applying panic bunker/baby jail/no whitelist on low pop checks
// This code is licensed under AGPLv3. See AGPLv3.txt
var wasInGame = EntitySystem.TryGet<GameTicker>(out var ticker) &&
ticker.PlayerGameStatuses.ContainsKey(userId); // Frontier: remove status.JoinedGame check, TryGetValue<ContainsKey

// Corvax-Start: Allow privileged players bypass bunker
var isPrivileged = await HavePrivilegedJoin(e.UserId);
if (_cfg.GetCVar(CCVars.PanicBunkerEnabled) && adminData == null && !isPrivileged)
if (_cfg.GetCVar(CCVars.PanicBunkerEnabled) && adminData == null && !isPrivileged && !wasInGame) // Frontier: allow users who joined before panic bunker was enforced to reconnect
// Corvax-End
{
var showReason = _cfg.GetCVar(CCVars.PanicBunkerShowReason);
Expand Down Expand Up @@ -215,17 +219,15 @@ private async Task NetMgrOnConnecting(NetConnectingArgs e)
}
}

if (_cfg.GetCVar(CCVars.BabyJailEnabled) && adminData == null)
if (_cfg.GetCVar(CCVars.BabyJailEnabled) && adminData == null && !wasInGame) // Frontier: allow users who joined before panic bunker was enforced to reconnect
{
var result = await IsInvalidConnectionDueToBabyJail(userId, e);

if (result.IsInvalid)
return (ConnectionDenyReason.BabyJail, result.Reason, null);
}

var wasInGame = EntitySystem.TryGet<GameTicker>(out var ticker) &&
ticker.PlayerGameStatuses.TryGetValue(userId, out var status) &&
status == PlayerGameStatus.JoinedGame;
// Frontier: wasInGame previously calculated here.
var adminBypass = _cfg.GetCVar(CCVars.AdminBypassMaxPlayers) && adminData != null;
// Corvax-Queue-Start
var isQueueEnabled = IoCManager.Instance!.TryResolveType<IServerJoinQueueManager>(out var mgr) && mgr.IsEnabled;
Expand All @@ -235,7 +237,7 @@ private async Task NetMgrOnConnecting(NetConnectingArgs e)
return (ConnectionDenyReason.Full, Loc.GetString("soft-player-cap-full"), null);
}

if (_cfg.GetCVar(CCVars.WhitelistEnabled))
if (_cfg.GetCVar(CCVars.WhitelistEnabled) && !wasInGame) // Frontier: allow users who joined before panic bunker was enforced to reconnect
{
var min = _cfg.GetCVar(CCVars.WhitelistMinPlayers);
var max = _cfg.GetCVar(CCVars.WhitelistMaxPlayers);
Expand All @@ -251,6 +253,7 @@ private async Task NetMgrOnConnecting(NetConnectingArgs e)
return (ConnectionDenyReason.Whitelist, msg, null);
}
}
// End of modified code

//Frontier
//This is our little chunk that serves as a dAuth. It takes in a comma seperated list of IP:PORT, and chekcs
Expand Down
3 changes: 3 additions & 0 deletions Content.Server/Forensics/Components/FiberComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ public sealed partial class FiberComponent : Component

[DataField]
public string? FiberColor;

[DataField]
public string? Fiberprint; // DeltaV, unique glove fibers
}
}
Loading

0 comments on commit eaf31e7

Please sign in to comment.