Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowyFoxxo authored and SnowyFoxxo committed Jul 9, 2024
2 parents 61d2759 + 920a99c commit dac8f0b
Show file tree
Hide file tree
Showing 179 changed files with 4,784 additions and 1,467 deletions.
6 changes: 5 additions & 1 deletion Content.Client/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public void SendMessage(string text, ChatSelectChannel channel)
_consoleHost.ExecuteCommand($"me \"{CommandParsing.Escape(str)}\"");
break;

case ChatSelectChannel.Subtle: // Floofstation
_consoleHost.ExecuteCommand($"subtle \"{CommandParsing.Escape(str)}\"");
break;

case ChatSelectChannel.Dead:
if (_systems.GetEntitySystemOrNull<GhostSystem>() is {IsGhost: true})
goto case ChatSelectChannel.Local;
Expand Down Expand Up @@ -76,7 +80,7 @@ public void SendMessage(string text, ChatSelectChannel channel)
throw new ArgumentOutOfRangeException(nameof(channel), channel, null);
}
}
//Nyano - Summary: fires off the update permissions script.
//Nyano - Summary: fires off the update permissions script.
public void UpdatePermissions()
{
PermissionsUpdated?.Invoke();
Expand Down
16 changes: 16 additions & 0 deletions Content.Client/FurryServers/FurryServersWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<ui:FurryServersWindow xmlns="https://spacestation14.io"
xmlns:ui="clr-namespace:Content.Client.FurryServers"
xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
Title="Other Furry Servers..."
MinSize="500 300"
SetSize="500 450">
<ScrollContainer HScrollEnabled="False" Margin="4" VerticalExpand="True" ReturnMeasure="True">
<BoxContainer Orientation="Vertical">
<Label Margin="8 0 0 0" StyleClasses="FurryServersSectionHeader" Align="Center"
Text="BlepStation (LRP)" Name="BlepstationHeader" />
<RichTextLabel Margin="8 8 8 8" Name="BlepstationDescription" />

<Button Name="BlepstationWebsite" Text="Launch Website: BlepStation.com" />
</BoxContainer>
</ScrollContainer>
</ui:FurryServersWindow>
59 changes: 59 additions & 0 deletions Content.Client/FurryServers/FurryServersWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System.Linq;
using Content.Client.Administration.Managers;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Systems.EscapeMenu;
using Content.Shared.Administration;
using JetBrains.Annotations;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Console;
using Robust.Client.ResourceManagement;
using Robust.Shared.Utility;

namespace Content.Client.FurryServers
{
[GenerateTypedNameReferences]
public sealed partial class FurryServersWindow : FancyWindow
{
[Dependency] private readonly IResourceCache _resourceManager = default!;
[Dependency] private readonly IUriOpener _uri = default!;

public FurryServersWindow()
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);
Stylesheet = IoCManager.Resolve<IStylesheetManager>().SheetSpace;

BlepstationHeader.AddStyleClass(StyleBase.StyleClassLabelHeading);
BlepstationHeader.FontColorOverride = Color.FromHex("#7687f2");

var description = FormattedMessage.FromMarkup(_resourceManager.ContentFileReadAllText($"/FurryServers/Blepstation.txt"));
BlepstationDescription.SetMessage(description);

BlepstationWebsite.OnPressed += _ =>
{
_uri.OpenUri("https://blepstation.com");
};
}

protected override void Opened()
{
base.Opened();
}
}

[UsedImplicitly, AnyCommand]
public sealed class FurryServersCommand : IConsoleCommand
{
public string Command => "furry";
public string Description => "Shows list of furry space station 14 servers";
public string Help => "Usage: furry";

public void Execute(IConsoleShell shell, string argStr, string[] args)
{
IoCManager.Resolve<IUserInterfaceManager>().GetUIController<FurryServersUIController>().OpenWindow();
}
}
}
4 changes: 4 additions & 0 deletions Content.Client/Info/LinkBanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public LinkBanner()
};
buttons.AddChild(guidebookButton);

var furryServersButton = new Button() { Text = "More Furry Servers" };
furryServersButton.OnPressed += args => UserInterfaceManager.GetUIController<FurryServersUIController>().ToggleWindow();
buttons.AddChild(furryServersButton);

var changelogButton = new ChangelogButton();
changelogButton.OnPressed += args => UserInterfaceManager.GetUIController<ChangelogUIController>().ToggleWindow();
buttons.AddChild(changelogButton);
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.SmartEquipBelt);
human.AddFunction(ContentKeyFunctions.OpenBackpack);
human.AddFunction(ContentKeyFunctions.OpenBelt);
human.AddFunction(ContentKeyFunctions.OfferItem);
human.AddFunction(ContentKeyFunctions.MouseMiddle);
human.AddFunction(ContentKeyFunctions.ArcadeUp);
human.AddFunction(ContentKeyFunctions.ArcadeDown);
Expand Down
5 changes: 4 additions & 1 deletion Content.Client/Inventory/StrippableBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.Player;
using Robust.Shared.Input;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
Expand All @@ -31,6 +32,7 @@ namespace Content.Client.Inventory
public sealed class StrippableBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IUserInterfaceManager _ui = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
private readonly ExamineSystem _examine;
private readonly InventorySystem _inv;
private readonly SharedCuffableSystem _cuffable;
Expand Down Expand Up @@ -198,7 +200,8 @@ private void AddInventoryButton(EntityUid invUid, string slotId, InventoryCompon
var entity = container.ContainedEntity;

// If this is a full pocket, obscure the real entity
if (entity != null && slotDef.StripHidden)
if (entity != null && slotDef.StripHidden
&& !(EntMan.TryGetComponent<ThievingComponent>(_playerManager.LocalEntity, out var thiefcomponent) && thiefcomponent.IgnoreStripHidden))
entity = _virtualHiddenEntity;

var button = new SlotButton(new SlotData(slotDef, container));
Expand Down
13 changes: 5 additions & 8 deletions Content.Client/Language/LanguageMenuWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
using Content.Client.Language.Systems;
using Content.Shared.Language;
using Content.Shared.Language.Systems;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Console;
using Robust.Shared.Utility;
using Serilog;
using static Content.Shared.Language.Systems.SharedLanguageSystem;

namespace Content.Client.Language;

Expand Down Expand Up @@ -121,8 +115,11 @@ private void AddLanguageEntry(string language)
private void OnLanguageChosen(string id)
{
var proto = _clientLanguageSystem.GetLanguagePrototype(id);
if (proto != null)
_clientLanguageSystem.RequestSetLanguage(proto);
if (proto == null)
return;

_clientLanguageSystem.RequestSetLanguage(proto);
UpdateState(id, _clientLanguageSystem.SpokenLanguages);
}


Expand Down
1 change: 0 additions & 1 deletion Content.Client/Language/Systems/LanguageSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using Content.Shared.Language.Events;
using Content.Shared.Language.Systems;
using Robust.Client;
using Robust.Shared.Console;

namespace Content.Client.Language.Systems;

Expand Down
8 changes: 0 additions & 8 deletions Content.Client/Language/Systems/TranslatorImplanterSystem.cs

This file was deleted.

14 changes: 13 additions & 1 deletion Content.Client/MainMenu/MainMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Robust.Shared.Network;
using Robust.Shared.Utility;
using UsernameHelpers = Robust.Shared.AuthLib.UsernameHelpers;
using Content.Client.UserInterface.Systems.WhitelistWindow;

namespace Content.Client.MainMenu
{
Expand Down Expand Up @@ -176,7 +177,18 @@ private void ParseAddress(string address, out string ip, out ushort port)

private void _onConnectFailed(object? _, NetConnectFailArgs args)
{
_userInterfaceManager.Popup(Loc.GetString("main-menu-failed-to-connect",("reason", args.Reason)));
// This assumes whitelist related disconnect will contain the text 'whitelist' which is probably a fair
// assumption. More ideally, disconnect reasons would send across an enum or something, but that looks to
// be in engine code, perhaps.
if (args.Reason.ToUpper().Contains("WHITELIST"))
{
// Whitelist specialized popup that shows application link for the whitelist
_userInterfaceManager.GetUIController<WhitelistDenialUIController>().OpenWindow(args.Reason);
} else {
// Generic popup
_userInterfaceManager.Popup(Loc.GetString("main-menu-failed-to-connect",("reason", args.Reason)));
}

_netManager.ConnectFailed -= _onConnectFailed;
_setConnectingState(false);
}
Expand Down
72 changes: 72 additions & 0 deletions Content.Client/OfferItem/OfferItemIndicatorsOverlay.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using System.Numerics;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Shared.Enums;
using Robust.Shared.Utility;

namespace Content.Client.OfferItem;

public sealed class OfferItemIndicatorsOverlay : Overlay
{
private readonly IInputManager _inputManager;
private readonly IEntityManager _entMan;
private readonly IEyeManager _eye;
private readonly OfferItemSystem _offer;

private readonly Texture _sight;

public override OverlaySpace Space => OverlaySpace.ScreenSpace;

private readonly Color _mainColor = Color.White.WithAlpha(0.3f);
private readonly Color _strokeColor = Color.Black.WithAlpha(0.5f);
private readonly float _scale = 0.6f; // 1 is a little big

public OfferItemIndicatorsOverlay(IInputManager input, IEntityManager entMan,
IEyeManager eye, OfferItemSystem offerSys)
{
_inputManager = input;
_entMan = entMan;
_eye = eye;
_offer = offerSys;

var spriteSys = _entMan.EntitySysManager.GetEntitySystem<SpriteSystem>();
_sight = spriteSys.Frame0(new SpriteSpecifier.Rsi(new ResPath("/Textures/Interface/Misc/give_item.rsi"),
"give_item"));
}

protected override bool BeforeDraw(in OverlayDrawArgs args)
{
if (!_offer.IsInOfferMode())
return false;

return base.BeforeDraw(in args);
}

protected override void Draw(in OverlayDrawArgs args)
{
var mouseScreenPosition = _inputManager.MouseScreenPosition;
var mousePosMap = _eye.PixelToMap(mouseScreenPosition);
if (mousePosMap.MapId != args.MapId)
return;


var mousePos = mouseScreenPosition.Position;
var uiScale = (args.ViewportControl as Control)?.UIScale ?? 1f;
var limitedScale = uiScale > 1.25f ? 1.25f : uiScale;

DrawSight(_sight, args.ScreenHandle, mousePos, limitedScale * _scale);
}

private void DrawSight(Texture sight, DrawingHandleScreen screen, Vector2 centerPos, float scale)
{
var sightSize = sight.Size * scale;
var expandedSize = sightSize + new Vector2(7f, 7f);

screen.DrawTextureRect(sight,
UIBox2.FromDimensions(centerPos - sightSize * 0.5f, sightSize), _strokeColor);
screen.DrawTextureRect(sight,
UIBox2.FromDimensions(centerPos - expandedSize * 0.5f, expandedSize), _mainColor);
}
}
51 changes: 51 additions & 0 deletions Content.Client/OfferItem/OfferItemSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
using Content.Shared.CCVar;
using Content.Shared.OfferItem;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.Player;
using Robust.Shared.Configuration;

namespace Content.Client.OfferItem;

public sealed class OfferItemSystem : SharedOfferItemSystem
{
[Dependency] private readonly IOverlayManager _overlayManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IInputManager _inputManager = default!;
[Dependency] private readonly IEyeManager _eye = default!;

public override void Initialize()
{
Subs.CVar(_cfg, CCVars.OfferModeIndicatorsPointShow, OnShowOfferIndicatorsChanged, true);
}
public override void Shutdown()
{
_overlayManager.RemoveOverlay<OfferItemIndicatorsOverlay>();

base.Shutdown();
}

public bool IsInOfferMode()
{
var entity = _playerManager.LocalEntity;

if (entity == null)
return false;

return IsInOfferMode(entity.Value);
}
private void OnShowOfferIndicatorsChanged(bool isShow)
{
if (isShow)
{
_overlayManager.AddOverlay(new OfferItemIndicatorsOverlay(
_inputManager,
EntityManager,
_eye,
this));
}
else
_overlayManager.RemoveOverlay<OfferItemIndicatorsOverlay>();
}
}
1 change: 1 addition & 0 deletions Content.Client/Options/UI/EscapeMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<Button Access="Public" Name="RulesButton" Text="{Loc 'ui-escape-rules'}" />
<Button Access="Public" Name="GuidebookButton" Text="{Loc 'ui-escape-guidebook'}" />
<Button Access="Public" Name="WikiButton" Text="{Loc 'ui-escape-wiki'}" />
<Button Access="Public" Name="FurryServersButton" Text="More Furry Servers" />
<Button Access="Public" Name="DisconnectButton" Text="{Loc 'ui-escape-disconnect'}" />
<Button Access="Public" Name="QuitButton" Text="{Loc 'ui-escape-quit'}" />
</BoxContainer>
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.SwapHands);
AddButton(ContentKeyFunctions.MoveStoredItem);
AddButton(ContentKeyFunctions.RotateStoredItem);
AddButton(ContentKeyFunctions.OfferItem);

AddHeader("ui-options-header-interaction-adv");
AddButton(ContentKeyFunctions.SmartEquipBackpack);
Expand Down
1 change: 1 addition & 0 deletions Content.Client/Options/UI/Tabs/MiscTab.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
StyleClasses="LabelKeyText"/>
<CheckBox Name="ShowHeldItemCheckBox" Text="{Loc 'ui-options-show-held-item'}" />
<CheckBox Name="ShowCombatModeIndicatorsCheckBox" Text="{Loc 'ui-options-show-combat-mode-indicators'}" />
<CheckBox Name="ShowOfferModeIndicatorsCheckBox" Text="{Loc 'ui-options-show-offer-mode-indicators'}" />
<Label Text="{Loc 'ui-options-general-storage'}"
FontColorOverride="{xNamespace:Static s:StyleNano.NanoGold}"
StyleClasses="LabelKeyText"/>
Expand Down
Loading

0 comments on commit dac8f0b

Please sign in to comment.