Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…-station-14 into jul24-upstream-merge-228.0.0
  • Loading branch information
whatston3 committed Jul 15, 2024
2 parents d4d013b + fbfc77e commit a084d85
Show file tree
Hide file tree
Showing 716 changed files with 52,178 additions and 29,236 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 @@ -131,7 +131,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 @@ -176,9 +175,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
10 changes: 8 additions & 2 deletions Content.Server/Chat/Systems/ChatSystem.Emote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

using Content.Shared.DeltaV.Harpy;

namespace Content.Server.Chat.Systems;

// emotes using emote prototype
Expand Down Expand Up @@ -178,15 +180,19 @@ private void TryEmoteChatInput(EntityUid uid, string textInput)
/// <returns></returns>
private bool AllowedToUseEmote(EntityUid source, EmotePrototype emote)
{
if ((_whitelistSystem.IsWhitelistFail(emote.Whitelist, source) || _whitelistSystem.IsBlacklistPass(emote.Blacklist, source)))
// New Frontiers - Harpy Mimicry - Allows harpies to mimic other species,
// bypasses whitelist checks
// This code is licensed under AGPLv3. See AGPLv3.txt
if (!TryComp<SpeechComponent>(source, out var speech) ||
!speech.MimicEmotes && (_whitelistSystem.IsWhitelistFail(emote.Whitelist, source) || _whitelistSystem.IsBlacklistPass(emote.Blacklist, source)))
return false;

if (!emote.Available &&
TryComp<SpeechComponent>(source, out var speech) &&
!speech.AllowedEmotes.Contains(emote.ID))
return false;

return true;
// End of modified code
}

private void InvokeEmoteEvent(EntityUid uid, EmotePrototype proto)
Expand Down
Loading

0 comments on commit a084d85

Please sign in to comment.