Skip to content

Commit

Permalink
Reapply "Merge branch 'master' of https://github.com/VMSolidus/Einste…
Browse files Browse the repository at this point in the history
…in-Engines"

This reverts commit 23f4302.
  • Loading branch information
VMSolidus committed Jun 17, 2024
1 parent 23f4302 commit 61d18e1
Show file tree
Hide file tree
Showing 98 changed files with 584 additions and 456 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:

- name: Install Dependencies
run: |
cd "Tools/changelog"
cd "Tools/changelogs"
npm install
shell: bash
continue-on-error: true

- name: Generate Changelog
run: |
cd "Tools/changelog"
cd "Tools/changelogs"
node changelog.js
shell: bash
continue-on-error: true
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/prtitlecase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: PR Title Case
on:
pull_request_target:
types: [opened, edited, synchronize]

env:
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
PR_NUMBER: ${{ github.event.pull_request.number }}

jobs:
prtitlecase:
runs-on: ubuntu-latest
steps:
- name: Checkout Master
uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_TOKEN }}

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.x

- name: Install Dependencies
run: |
cd "Tools/prtitlecase"
npm install
shell: bash

- name: Change Title
run: |
cd "Tools/prtitlecase"
node src/index.js
shell: bash
4 changes: 1 addition & 3 deletions BuildChecker/BuildChecker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
-->
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Python>python3</Python>
<Python Condition="'$(OS)'=='Windows_NT' Or '$(OS)'=='Windows'">py -3</Python>
<ProjectGuid>{C899FCA4-7037-4E49-ABC2-44DE72487110}</ProjectGuid>
<TargetFrameworkMoniker>.NETFramework, Version=v4.7.2</TargetFrameworkMoniker>
<RestorePackages>false</RestorePackages>
Expand All @@ -39,7 +37,7 @@ https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild
<OutputPath>bin\DebugOpt\</OutputPath>
</PropertyGroup>
<Target Name="Build">
<Exec Command="$(Python) git_helper.py" CustomErrorRegularExpression="^Error" />
<Exec Command="git submodule update --init --recursive"/>
</Target>
<Target Name="Rebuild" DependsOnTargets="Build" />
<Target Name="Clean">
Expand Down
110 changes: 0 additions & 110 deletions BuildChecker/git_helper.py

This file was deleted.

13 changes: 0 additions & 13 deletions BuildChecker/hooks/post-checkout

This file was deleted.

5 changes: 0 additions & 5 deletions BuildChecker/hooks/post-merge

This file was deleted.

8 changes: 4 additions & 4 deletions Content.Client/Gameplay/GameplayState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,17 @@ private void LoadMainScreen()
var screenTypeString = _configurationManager.GetCVar(CCVars.UILayout);
if (!Enum.TryParse(screenTypeString, out ScreenType screenType))
{
screenType = default;
screenType = ScreenType.Separated;
}

switch (screenType)
{
case ScreenType.Default:
_uiManager.LoadScreen<DefaultGameScreen>();
break;
case ScreenType.Separated:
_uiManager.LoadScreen<SeparatedChatGameScreen>();
break;
case ScreenType.Overlay:
_uiManager.LoadScreen<OverlayChatGameScreen>();
break;
}

_loadController.LoadScreen();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<screens:DefaultGameScreen
<screens:OverlayChatGameScreen
xmlns="https://spacestation14.io"
xmlns:screens="clr-namespace:Content.Client.UserInterface.Screens"
xmlns:menuBar="clr-namespace:Content.Client.UserInterface.Systems.MenuBar.Widgets"
Expand Down Expand Up @@ -30,4 +30,4 @@
<hotbar:HotbarGui Name="Hotbar" Access="Protected" />
<chat:ResizableChatBox Name="Chat" Access="Protected" />
<alerts:AlertsUI Name="Alerts" Access="Protected" />
</screens:DefaultGameScreen>
</screens:OverlayChatGameScreen>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
namespace Content.Client.UserInterface.Screens;

[GenerateTypedNameReferences]
public sealed partial class DefaultGameScreen : InGameScreen
public sealed partial class OverlayChatGameScreen : InGameScreen
{
public DefaultGameScreen()
public OverlayChatGameScreen()
{
RobustXamlLoader.Load(this);

Expand Down
8 changes: 4 additions & 4 deletions Content.Client/UserInterface/Screens/ScreenType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ namespace Content.Client.UserInterface.Screens;
public enum ScreenType
{
/// <summary>
/// The modern SS14 user interface.
/// The classic SS13 user interface.
/// </summary>
Default,
Separated,
/// <summary>
/// The classic SS13 user interface.
/// The temporary SS14 user interface.
/// </summary>
Separated
Overlay,
}
16 changes: 8 additions & 8 deletions Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,16 @@ public void SetMainChat(bool setting)

switch (UIManager.ActiveScreen)
{
case DefaultGameScreen defaultScreen:
chatBox = defaultScreen.ChatBox;
chatSizeRaw = _config.GetCVar(CCVars.DefaultScreenChatSize);
SetChatSizing(chatSizeRaw, defaultScreen, setting);
break;
case SeparatedChatGameScreen separatedScreen:
chatBox = separatedScreen.ChatBox;
chatSizeRaw = _config.GetCVar(CCVars.SeparatedScreenChatSize);
SetChatSizing(chatSizeRaw, separatedScreen, setting);
break;
case OverlayChatGameScreen overlayScreen:
chatBox = overlayScreen.ChatBox;
chatSizeRaw = _config.GetCVar(CCVars.OverlayScreenChatSize);
SetChatSizing(chatSizeRaw, overlayScreen, setting);
break;
default:
// this could be better?
var maybeChat = UIManager.ActiveScreen.GetWidget<ChatBox>();
Expand Down Expand Up @@ -321,12 +321,12 @@ private void StoreChatSize(Vector2 size)
$"{size.X.ToString(CultureInfo.InvariantCulture)},{size.Y.ToString(CultureInfo.InvariantCulture)}";
switch (UIManager.ActiveScreen)
{
case DefaultGameScreen _:
_config.SetCVar(CCVars.DefaultScreenChatSize, stringSize);
break;
case SeparatedChatGameScreen _:
_config.SetCVar(CCVars.SeparatedScreenChatSize, stringSize);
break;
case OverlayChatGameScreen _:
_config.SetCVar(CCVars.OverlayScreenChatSize, stringSize);
break;
default:
// do nothing
return;
Expand Down
6 changes: 3 additions & 3 deletions Content.Client/UserInterface/Systems/Vote/VoteUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ private void OnScreenLoad()
{
switch (UIManager.ActiveScreen)
{
case DefaultGameScreen game:
_votes.SetPopupContainer(game.VoteMenu);
break;
case SeparatedChatGameScreen separated:
_votes.SetPopupContainer(separated.VoteMenu);
break;
case OverlayChatGameScreen overlay:
_votes.SetPopupContainer(overlay.VoteMenu);
break;
}
}

Expand Down
21 changes: 20 additions & 1 deletion Content.Server/Cargo/Components/CargoPalletComponent.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
namespace Content.Server.Cargo.Components;
using Content.Shared.Actions;
using Robust.Shared.Serialization.TypeSerializers.Implementations;

/// <summary>
/// Any entities intersecting when a shuttle is recalled will be sold.
/// </summary>

[Flags]
public enum BuySellType : byte
{
Buy = 1 << 0,
Sell = 1 << 1,
All = Buy | Sell
}


[RegisterComponent]
public sealed partial class CargoPalletComponent : Component {}
public sealed partial class CargoPalletComponent : Component
{
/// <summary>
/// Whether the pad is a buy pad, a sell pad, or all.
/// </summary>
[DataField]
public BuySellType PalletType;
}
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 @@ -205,7 +205,7 @@ private void OnApproveOrderMessage(EntityUid uid, CargoOrderConsoleComponent com
// Try to fulfill from any station where possible, if the pad is not occupied.
foreach (var trade in _listEnts)
{
var tradePads = GetCargoPallets(trade);
var tradePads = GetCargoPallets(trade, BuySellType.Buy);
_random.Shuffle(tradePads);

var freePads = GetFreeCargoPallets(trade, tradePads);
Expand Down
15 changes: 12 additions & 3 deletions Content.Server/Cargo/Systems/CargoSystem.Shuttle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,16 @@ private List<CargoOrderData> GetProjectedOrders(
/// </summary>
private int GetCargoSpace(EntityUid gridUid)
{
var space = GetCargoPallets(gridUid).Count;
var space = GetCargoPallets(gridUid, BuySellType.Buy).Count;
return space;
}

private List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent PalletXform)> GetCargoPallets(EntityUid gridUid)
/// GetCargoPallets(gridUid, BuySellType.Sell) to return only Sell pads
/// GetCargoPallets(gridUid, BuySellType.Buy) to return only Buy pads
private List<(EntityUid Entity, CargoPalletComponent Component, TransformComponent PalletXform)> GetCargoPallets(EntityUid gridUid, BuySellType requestType = BuySellType.All)
{
_pads.Clear();

var query = AllEntityQuery<CargoPalletComponent, TransformComponent>();

while (query.MoveNext(out var uid, out var comp, out var compXform))
Expand All @@ -215,7 +218,13 @@ private int GetCargoSpace(EntityUid gridUid)
continue;
}

if ((requestType & comp.PalletType) == 0)
{
continue;
}

_pads.Add((uid, comp, compXform));

}

return _pads;
Expand Down Expand Up @@ -275,7 +284,7 @@ private void GetPalletGoods(EntityUid gridUid, out HashSet<EntityUid> toSell, ou
amount = 0;
toSell = new HashSet<EntityUid>();

foreach (var (palletUid, _, _) in GetCargoPallets(gridUid))
foreach (var (palletUid, _, _) in GetCargoPallets(gridUid, BuySellType.Sell))
{
// Containers should already get the sell price of their children so can skip those.
_setEnts.Clear();
Expand Down
Loading

0 comments on commit 61d18e1

Please sign in to comment.