Skip to content

Commit

Permalink
Merge branch 'moths-fix' into 'master-ru'
Browse files Browse the repository at this point in the history
Moths sprites resolution fix

See merge request Workbench-Team/space-station-14!107
  • Loading branch information
MilenVolf committed Aug 5, 2023
2 parents 6f4facf + 90468df commit d574bf0
Show file tree
Hide file tree
Showing 1,433 changed files with 255,806 additions and 302,392 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build & Test Debug

on:
push:
branches: [ master, staging, trying, master-ru ]
branches: [ master, staging, trying, master-ru, arumoon-server ]
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build & Test Release

on:
push:
branches: [ master, staging, trying, master-ru ]
branches: [ master, staging, trying, master-ru, arumoon-server ]
merge_group:
pull_request:
types: [ opened, reopened, synchronize, ready_for_review ]
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/changelogs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *'
push:
branches: [ arumoon-server ]

jobs:
build:
Expand Down
98 changes: 98 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "arumoon-server" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "arumoon-server" ]
schedule:
- cron: '20 9 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'csharp', 'go', 'javascript', 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Use only 'java' to analyze code written in Java, Kotlin or both
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Submodule
run: |
git submodule update --init --recursive
- name: Pull engine updates
uses: space-wizards/[email protected]

- name: Update Engine Submodules
run: |
cd RobustToolbox/
git submodule update --init --recursive
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
#- name: Autobuild
# uses: github/codeql-action/autobuild@v2
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Install dependencies
run: dotnet restore

- name: Build Project
run: dotnet build --configuration Debug --no-restore /p:WarningsAsErrors=nullable /m

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:csharp"
1 change: 1 addition & 0 deletions .github/workflows/conflict-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- master-ru
- arumoon-server
pull_request_target:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

on:
push:
branches: [ master, staging, trying, master-ru ]
branches: [ master, staging, trying, master-ru, arumoon-server ]
paths:
- '**.cs'
- '**.csproj'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-wiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Update Wiki
on:
workflow_dispatch:
push:
branches: [ master, jsondump ]
branches: [ arumoon-server ]
paths:
- '.github/workflows/update-wiki.yml'
- 'Content.Shared/Chemistry/**.cs'
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
wiki_text_file: ./bin/Content.Server/data/chem_prototypes.json
edit_summary: Update chem_prototypes.json via GitHub Actions
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/chem_prototypes.json"
api_url: https://wiki.spacestation14.io/w/api.php
api_url: https://wiki.ss14.arumoon.ru/api.php
username: ${{ secrets.WIKI_BOT_USER }}
password: ${{ secrets.WIKI_BOT_PASS }}

Expand All @@ -66,7 +66,7 @@ jobs:
wiki_text_file: ./bin/Content.Server/data/react_prototypes.json
edit_summary: Update react_prototypes.json via GitHub Actions
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/react_prototypes.json"
api_url: https://wiki.spacestation14.io/w/api.php
api_url: https://wiki.ss14.arumoon.ru/api.php
username: ${{ secrets.WIKI_BOT_USER }}
password: ${{ secrets.WIKI_BOT_PASS }}

5 changes: 3 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"program": "${workspaceFolder}/bin/Content.Server/Content.Server.dll",
"args": [],
"console": "integratedTerminal",
"stopAtEntry": false
"stopAtEntry": false,
"requireExactSource": false,
},
{
"name": "YAML Linter",
Expand All @@ -43,4 +44,4 @@
"preLaunchTask": "build"
}
]
}
}
61 changes: 61 additions & 0 deletions Content.Client/Access/UI/AccessStorageBoundUserInterface.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System.Linq;
using Content.Shared.Access.Components;
using Content.Shared.Access.Systems;
using Robust.Client.GameObjects;
using Robust.Shared.Prototypes;

namespace Content.Client.Access.UI
{
public sealed class AccessStorageBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;

public AccessStorageBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
}

private AccessStorageWindow? _window;

protected override void Open()
{
base.Open();

List<string> accessLevels;

if (EntMan.TryGetComponent<AccessStorageComponent>(Owner, out var accessStorage))
{
accessLevels = accessStorage.AccessLevels;
accessLevels.Sort();
}
else
{
accessLevels = new List<string>();
}

_window = new AccessStorageWindow(this, _prototypeManager, accessLevels) {Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName};

_window.OnClose += Close;
_window.OpenCentered();
}

protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (!disposing) return;
_window?.Dispose();
}

protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
var castState = (AccessStorageBoundUserInterfaceState) state;
_window?.UpdateState(castState);
}

public void SubmitData(List<string> newAccessList, List<string> newDenyTags)
{
SendMessage(new WriteToTargetAccessStorageMessage(newAccessList, newDenyTags));
}
}
}
14 changes: 14 additions & 0 deletions Content.Client/Access/UI/AccessStorageWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<DefaultWindow xmlns="https://spacestation14.io"
MinSize="800 420">
<BoxContainer Orientation="Vertical">
<Control MinSize="0 8" />
<Label Text="{Loc 'access-reader-component-access-list'}" />
<GridContainer Name="AccessLevelGrid" Columns="5" HorizontalAlignment="Center">
<!-- Access level buttons are added here by the C# code -->
</GridContainer>
<Label Text="{Loc 'access-reader-component-deny-tags'}" />
<GridContainer Name="DenyTagsGrid" Columns="5" HorizontalAlignment="Center">
<!-- Deny tags buttons are added here by the C# code -->
</GridContainer>
</BoxContainer>
</DefaultWindow>
116 changes: 116 additions & 0 deletions Content.Client/Access/UI/AccessStorageWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
using System.Collections.Generic;
using System.Linq;
using Content.Shared.Access;
using Content.Shared.Access.Systems;
using Content.Shared.Roles;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;

namespace Content.Client.Access.UI
{
[GenerateTypedNameReferences]
public sealed partial class AccessStorageWindow : DefaultWindow
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;

private readonly AccessStorageBoundUserInterface _owner;

private readonly Dictionary<string, Button> _accessButtons = new();
private readonly Dictionary<string, Button> _denyButtons = new();

public AccessStorageWindow(AccessStorageBoundUserInterface owner, IPrototypeManager prototypeManager,
List<string> accessLevels)
{
RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this);

_owner = owner;

foreach (var access in accessLevels)
{
if (!prototypeManager.TryIndex<AccessLevelPrototype>(access, out var accessLevel))
{
Logger.Error($"Unable to find accesslevel for {access}");
continue;
}

var newButton = new Button
{
Text = GetAccessLevelName(accessLevel),
ToggleMode = true,
};
AccessLevelGrid.AddChild(newButton);
_accessButtons.Add(accessLevel.ID, newButton);
newButton.OnPressed += _ => SubmitData();
}
foreach (var access in accessLevels)
{
if (!prototypeManager.TryIndex<AccessLevelPrototype>(access, out var accessLevel))
{
Logger.Error($"Unable to find accesslevel for {access}");
continue;
}

var newButton = new Button
{
Text = GetAccessLevelName(accessLevel),
ToggleMode = true,
};
DenyTagsGrid.AddChild(newButton);
_denyButtons.Add(accessLevel.ID, newButton);
newButton.OnPressed += _ => SubmitData();
}
}

private static string GetAccessLevelName(AccessLevelPrototype prototype)
{
if (prototype.Name is { } name)
return Loc.GetString(name);

return prototype.ID;
}

private void ClearAllAccess()
{
foreach (var button in _accessButtons.Values)
{
if (button.Pressed)
{
button.Pressed = false;
}
}
foreach (var button in _denyButtons.Values)
{
if (button.Pressed)
{
button.Pressed = false;
}
}
}

public void UpdateState(AccessStorageBoundUserInterfaceState state)
{
foreach (var (accessName, button) in _accessButtons)
{
button.Disabled = false;
button.Pressed = state.AccessList?.Contains(accessName) ?? false;
}
foreach (var (accessName, button) in _denyButtons)
{
button.Disabled = false;
button.Pressed = state.DenyTags?.Contains(accessName) ?? false;
}
}

private void SubmitData()
{
// Iterate over the buttons dictionary, filter by `Pressed`, only get key from the key/value pair
_owner.SubmitData(_accessButtons.Where(x => x.Value.Pressed).Select(x => x.Key).ToList(), _denyButtons.Where(x => x.Value.Pressed).Select(x => x.Key).ToList());
}
}
}
2 changes: 1 addition & 1 deletion Content.Client/Access/UI/IdCardConsoleWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<DefaultWindow xmlns="https://spacestation14.io"
MinSize="650 290">
MinSize="800 390">
<BoxContainer Orientation="Vertical">
<GridContainer Columns="2">
<GridContainer Columns="3" HorizontalExpand="True">
Expand Down
Loading

0 comments on commit d574bf0

Please sign in to comment.