Skip to content

Commit

Permalink
Merge pull request #6 from new-frontiers-14/master
Browse files Browse the repository at this point in the history
111
  • Loading branch information
Vonsant authored May 27, 2024
2 parents c0992e0 + 5faef9c commit 5ca4432
Show file tree
Hide file tree
Showing 249 changed files with 33,540 additions and 9,591 deletions.
13 changes: 13 additions & 0 deletions .github/mapchecker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
]
# List of matchers that are illegal to use, unless the map is a ship and the ship belongs to the keyed shipyard.
CONDITIONALLY_ILLEGAL_MATCHES = {
"Civilian": [
"ButtonFrameCautionSecurity", # Decal.
],
"Scrap": [
"ButtonFrameCautionSecurity", # Decal.
],
"Expedition": [
"ButtonFrameCautionSecurity", # Decal.
],
"Custom": [
"ButtonFrameCautionSecurity", # Decal.
],
"Security": [ # These matchers are illegal unless the ship is part of the security shipyard.
"Security", # Anything with the word security in it should also only be appearing on security ships.
"Plastitanium", # Plastitanium walls should only be appearing on security ships.
Expand All @@ -29,6 +41,7 @@
],
"Syndicate": [
"Plastitanium", # And also on blackmarket ships cause syndicate.
"ButtonFrameCautionSecurity", # Decal.
],
"BlackMarket": [
"Plastitanium", # And also on blackmarket ships cause syndicate.
Expand Down
19 changes: 11 additions & 8 deletions .github/mapchecker/whitelist.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# POI's
Frontier: true
nfsd: true
Nfsd: true
LPBravo: true
Cove: true
Lodge: true

Cove:
- WallPlastitanium
- HighSecDoor
Lodge:
- WallPlastitanium
- HighSecDoor
#Cove:
# - WallPlastitanium
# - HighSecDoor
#Lodge:
# - WallPlastitanium
# - HighSecDoor

# TECHNICAL DEBT BELOW. These ones were added to this list to ensure other PR's would not break upon merging. It is
# the intention for this list to become empty in separate PR's.
#DartX:
# - HighSecDoor
# - HighSecDoor
5 changes: 4 additions & 1 deletion Content.Client/Administration/UI/AdminAnnounceWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public AdminAnnounceWindow()
AnnounceMethod.SetItemMetadata(0, AdminAnnounceType.Station);
AnnounceMethod.AddItem(_localization.GetString("admin-announce-type-server"));
AnnounceMethod.SetItemMetadata(1, AdminAnnounceType.Server);
AnnounceMethod.AddItem(_localization.GetString("admin-announce-type-antag")); // Frontier
AnnounceMethod.SetItemMetadata(2, AdminAnnounceType.Antag); // Frontier
AnnounceMethod.OnItemSelected += AnnounceMethodOnOnItemSelected;
Announcement.OnKeyBindUp += AnnouncementOnOnTextChanged;
}
Expand All @@ -35,7 +37,8 @@ private void AnnouncementOnOnTextChanged(GUIBoundKeyEventArgs args)
private void AnnounceMethodOnOnItemSelected(OptionButton.ItemSelectedEventArgs args)
{
AnnounceMethod.SelectId(args.Id);
Announcer.Editable = ((AdminAnnounceType?)args.Button.SelectedMetadata ?? AdminAnnounceType.Station) == AdminAnnounceType.Station;
Announcer.Editable = ((AdminAnnounceType?)args.Button.SelectedMetadata ?? AdminAnnounceType.Station) == AdminAnnounceType.Station
|| ((AdminAnnounceType?)args.Button.SelectedMetadata ?? AdminAnnounceType.Antag) == AdminAnnounceType.Antag; // Frontier
}
}
}
9 changes: 9 additions & 0 deletions Content.Client/Shuttles/UI/BaseShuttleControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ protected void DrawCircles(DrawingHandleScreen handle)
}
}

// Frontier Corvax: north line drawing
protected void DrawNorthLine(DrawingHandleScreen handle, Angle angle)
{
var origin = ScalePosition(-new Vector2(Offset.X, -Offset.Y));
var aExtent = (angle - Math.Tau / 4).ToVec() * ScaledMinimapRadius * 1.42f;
var lineColor = Color.Red.WithAlpha(0.1f);
handle.DrawLine(origin, origin + aExtent, lineColor);
}

protected void DrawGrid(DrawingHandleScreen handle, Matrix3 matrix, Entity<MapGridComponent> grid, Color color, float alpha = 0.01f)
{
var rator = Maps.GetAllTilesEnumerator(grid.Owner, grid.Comp);
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Shuttles/UI/ShuttleDockControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ protected override void Draw(DrawingHandleScreen handle)
}

DrawCircles(handle);
DrawNorthLine(handle, _angle.Value); // Frontier Corvax: north line drawing
var gridNent = EntManager.GetNetEntity(GridEntity);
var mapPos = _xformSystem.ToMapCoordinates(_coordinates.Value);
var ourGridMatrix = _xformSystem.GetWorldMatrix(gridXform.Owner);
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Shuttles/UI/ShuttleNavControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ protected override void Draw(DrawingHandleScreen handle)
Matrix3.Multiply(posMatrix, ourEntMatrix, out var ourWorldMatrix);
var ourWorldMatrixInvert = ourWorldMatrix.Invert();

// Frontier Corvax: north line drawing
var rot = ourEntRot + _rotation.Value;
DrawNorthLine(handle, rot);

// Draw our grid in detail
var ourGridId = xform.GridUid;
if (EntManager.TryGetComponent<MapGridComponent>(ourGridId, out var ourGrid) &&
Expand Down Expand Up @@ -178,7 +182,6 @@ protected override void Draw(DrawingHandleScreen handle)

handle.DrawPrimitives(DrawPrimitiveTopology.TriangleFan, radarPosVerts, Color.Lime);

var rot = ourEntRot + _rotation.Value;
var viewBounds = new Box2Rotated(new Box2(-WorldRange, -WorldRange, WorldRange, WorldRange).Translated(mapPos.Position), rot, mapPos.Position);
var viewAABB = viewBounds.CalcBoundingBox();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ public void BuildItemPieces()

//todo. at some point, we may want to only rebuild the pieces that have actually received new data.

_pieceGrid.Children.Clear();
_pieceGrid.RemoveAllChildren();
_pieceGrid.Rows = boundingGrid.Height + 1;
_pieceGrid.Columns = boundingGrid.Width + 1;
for (var y = boundingGrid.Bottom; y <= boundingGrid.Top; y++)
Expand All @@ -275,18 +275,29 @@ public void BuildItemPieces()

if (_entity.TryGetComponent<ItemComponent>(itemEnt, out var itemEntComponent))
{
var gridPiece = new ItemGridPiece((itemEnt, itemEntComponent), itemPos, _entity)
ItemGridPiece gridPiece;

if (_storageController.CurrentlyDragging?.Entity is { } dragging
&& dragging == itemEnt)
{
_storageController.CurrentlyDragging.Orphan();
gridPiece = _storageController.CurrentlyDragging;
}
else
{
MinSize = size,
Marked = Array.IndexOf(containedEntities, itemEnt) switch
gridPiece = new ItemGridPiece((itemEnt, itemEntComponent), itemPos, _entity)
{
0 => ItemGridPieceMarks.First,
1 => ItemGridPieceMarks.Second,
_ => null,
}
};
gridPiece.OnPiecePressed += OnPiecePressed;
gridPiece.OnPieceUnpressed += OnPieceUnpressed;
MinSize = size,
Marked = Array.IndexOf(containedEntities, itemEnt) switch
{
0 => ItemGridPieceMarks.First,
1 => ItemGridPieceMarks.Second,
_ => null,
}
};
gridPiece.OnPiecePressed += OnPiecePressed;
gridPiece.OnPieceUnpressed += OnPieceUnpressed;
}

control.AddChild(gridPiece);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,16 @@ private void OnPieceUnpressed(GUIBoundKeyEventArgs args, ItemGridPiece control)
_entity.GetNetEntity(storageEnt)));
}

_menuDragHelper.EndDrag();
_container?.BuildItemPieces();
}
else //if we just clicked, then take it out of the bag.
{
_menuDragHelper.EndDrag();
_entity.RaisePredictiveEvent(new StorageInteractWithItemEvent(
_entity.GetNetEntity(control.Entity),
_entity.GetNetEntity(storageEnt)));
}
_menuDragHelper.EndDrag();
args.Handle();
}

Expand Down
26 changes: 23 additions & 3 deletions Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Content.Shared.Weapons.Melee;
using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Weapons.Ranged.Components;
using Content.Shared.Wieldable.Components;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
Expand Down Expand Up @@ -95,10 +96,29 @@ public override void Update(float frameTime)
// it's kinda tricky.
// I think as long as we make secondaries their own component it's probably fine
// as long as guncomp has an alt-use key then it shouldn't be too much of a PITA to deal with.
if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)

//Frontier: better support melee vs. ranged checks
/*if (TryComp<GunComponent>(weaponUid, out var gun) && gun.UseKey)
{
return;
}*/

// Ranged component has priority over melee if both are supported.
bool gunBoundToUse = false;
bool gunBoundToAlt = false;
if (TryComp<GunComponent>(weaponUid, out var gun)) {
gunBoundToUse = gun.UseKey;
gunBoundToAlt = !gun.UseKey; //Bound to alt-use when false

// If ranged mode only works when wielded, do not block melee attacks when unwielded
// (e.g. crusher & crusher glaive)
if (TryComp<GunRequiresWieldComponent>(weaponUid, out var _) &&
TryComp<WieldableComponent>(weaponUid, out var wield)) {
gunBoundToUse &= wield.Wielded;
gunBoundToAlt &= wield.Wielded;
}
}
//End Frontier

var mousePos = _eyeManager.PixelToMap(_inputManager.MouseScreenPosition);

Expand All @@ -119,7 +139,7 @@ public override void Update(float frameTime)
}

// Heavy attack.
if (altDown == BoundKeyState.Down)
if (altDown == BoundKeyState.Down && !gunBoundToAlt) //Frontier: add !gunBoundToAlt condition
{
// If it's an unarmed attack then do a disarm
if (weapon.AltDisarm && weaponUid == entity)
Expand All @@ -140,7 +160,7 @@ public override void Update(float frameTime)
}

// Light attack
if (useDown == BoundKeyState.Down)
if (useDown == BoundKeyState.Down && !gunBoundToUse) //Frontier: add !gunBoundToUse condition
{
var attackerPos = Transform(entity).MapPosition;

Expand Down
4 changes: 4 additions & 0 deletions Content.Server/Administration/UI/AdminAnnounceEui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Server.EUI;
using Content.Shared.Administration;
using Content.Shared.Eui;
using Robust.Shared.Audio; // Frontier

namespace Content.Server.Administration.UI
{
Expand Down Expand Up @@ -52,6 +53,9 @@ public override void HandleMessage(EuiMessageBase msg)
case AdminAnnounceType.Station:
_chatSystem.DispatchGlobalAnnouncement(doAnnounce.Announcement, doAnnounce.Announcer, colorOverride: Color.Gold);
break;
case AdminAnnounceType.Antag: // Frontier
_chatSystem.DispatchGlobalAnnouncement(doAnnounce.Announcement, doAnnounce.Announcer, true, new SoundPathSpecifier("/Audio/Announcements/war.ogg"), colorOverride: Color.Red);
break;
}

StateDirty();
Expand Down
2 changes: 1 addition & 1 deletion Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ private void OnApproveOrderMessage(EntityUid uid, CargoOrderConsoleComponent com
("approverName", approverName),
("approverJob", approverJob),
("cost", cost));
_radio.SendRadioMessage(uid, message, component.AnnouncementChannel, uid, escapeMarkup: false);
//_radio.SendRadioMessage(uid, message, component.AnnouncementChannel, uid, escapeMarkup: false); # Frontier
ConsolePopup(args.Actor, Loc.GetString("cargo-console-trade-station", ("destination", MetaData(uid).EntityName)));

// Log order approval
Expand Down
9 changes: 8 additions & 1 deletion Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,11 @@ private MessageRangeCheckResult MessageRangeCheck(ICommonSession session, ICChat
case ChatTransmitRange.NoGhosts:
initialResult = (data.Observer && !_adminManager.IsAdmin(session)) ? MessageRangeCheckResult.Disallowed : MessageRangeCheckResult.Full;
break;
// Frontier - prevent TVs from spamming the poor, poor admins
case ChatTransmitRange.GhostRangeLimitNoAdminCheck:
initialResult = (data.Observer && data.Range < 0) ? MessageRangeCheckResult.HideChat : MessageRangeCheckResult.Full;
break;
// End Frontier
}
var insistHideChat = data.HideChatOverride ?? false;
var insistNoHideChat = !(data.HideChatOverride ?? true);
Expand Down Expand Up @@ -964,5 +969,7 @@ public enum ChatTransmitRange : byte
/// Hidden from the chat window.
HideChat,
/// Ghosts can't hear or see it at all. Regular players can if in-range.
NoGhosts
NoGhosts,
/// Frontier: Normal, ghosts are still range-limited, and won't spam admins
GhostRangeLimitNoAdminCheck,
}
10 changes: 5 additions & 5 deletions Content.Server/Emp/EmpSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public override void Initialize()
SubscribeLocalEvent<EmpDisabledComponent, ApcToggleMainBreakerAttemptEvent>(OnApcToggleMainBreaker);
SubscribeLocalEvent<EmpDisabledComponent, SurveillanceCameraSetActiveAttemptEvent>(OnCameraSetActive);
//SubscribeLocalEvent<EmpDisabledComponent, ThrusterToggleAttemptEvent>(OnThrusterToggle);
SubscribeLocalEvent<EmpDisabledComponent, ShuttleToggleAttemptEvent>(OnShuttleConsoleToggle);
//SubscribeLocalEvent<EmpDisabledComponent, ShuttleToggleAttemptEvent>(OnShuttleConsoleToggle);
}

/// <summary>
Expand Down Expand Up @@ -143,10 +143,10 @@ private void OnCameraSetActive(EntityUid uid, EmpDisabledComponent component, re
// args.Cancelled = true;
//}

private void OnShuttleConsoleToggle(EntityUid uid, EmpDisabledComponent component, ref ShuttleToggleAttemptEvent args)
{
args.Cancelled = true;
}
//private void OnShuttleConsoleToggle(EntityUid uid, EmpDisabledComponent component, ref ShuttleToggleAttemptEvent args)
//{
// args.Cancelled = true;
//}
}

/// <summary>
Expand Down
47 changes: 31 additions & 16 deletions Content.Server/MassMedia/Systems/NewsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ public override void Initialize()
base.Initialize();

// News writer
SubscribeLocalEvent<NewsWriterComponent, MapInitEvent>(OnMapInit);
// Frontier: News is shared across the sector. No need to create shuttle-local news caches.
// SubscribeLocalEvent<NewsWriterComponent, MapInitEvent>(OnMapInit);
// End Frontier

// New writer bui messages
Subs.BuiEvents<NewsWriterComponent>(NewsWriterUiKey.Key, subs =>
Expand Down Expand Up @@ -75,14 +77,17 @@ public override void Update(float frameTime)

#region Writer Event Handlers

private void OnMapInit(Entity<NewsWriterComponent> ent, ref MapInitEvent args)
{
var station = _station.GetOwningStation(ent);
if (!station.HasValue)
return;
// Frontier: News is shared across the sector. No need to create shuttle-local news caches.
// private void OnMapInit(Entity<NewsWriterComponent> ent, ref MapInitEvent args)
// {
// var station = _station.GetOwningStation(ent);
// if (!station.HasValue) {
// return;
// }

EnsureComp<StationNewsComponent>(station.Value);
}
// EnsureComp<StationNewsComponent>(station.Value);
// }
// End Frontier

private void OnWriteUiDeleteMessage(Entity<NewsWriterComponent> ent, ref NewsWriterDeleteMessage msg)
{
Expand Down Expand Up @@ -229,15 +234,25 @@ private void OnReaderUiReady(Entity<NewsReaderCartridgeComponent> ent, ref Cartr

private bool TryGetArticles(EntityUid uid, [NotNullWhen(true)] out List<NewsArticle>? articles)
{
if (_station.GetOwningStation(uid) is not { } station ||
!TryComp<StationNewsComponent>(station, out var stationNews))
{
articles = null;
return false;
// Frontier: Get sector-wide article set instead of set for this station.
// if (_station.GetOwningStation(uid) is not { } station ||
// !TryComp<StationNewsComponent>(station, out var stationNews))
// {
// articles = null;
// return false;
// }
// articles = stationNews.Articles;
// return true;

// Any SectorNewsComponent will have a complete article set, we ensure one exists before returning the complete set.
var query = EntityQueryEnumerator<SectorNewsComponent>();
if (query.MoveNext(out var _)) {
articles = SectorNewsComponent.Articles;
return true;
}

articles = stationNews.Articles;
return true;
articles = null;
return false;
// End Frontier
}

private void UpdateWriterUi(Entity<NewsWriterComponent> ent)
Expand Down
Loading

0 comments on commit 5ca4432

Please sign in to comment.