Skip to content

Commit b9c76a8

Browse files
authored
Revert "Upstream 25.02.26 (#496)" (#497)
This reverts commit 3b40bcf.
1 parent 3b40bcf commit b9c76a8

File tree

1,166 files changed

+13901
-24110
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,166 files changed

+13901
-24110
lines changed

.github/workflows/update-wiki.yml

Lines changed: 57 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ on:
66
branches: [ master, jsondump ]
77
paths:
88
- '.github/workflows/update-wiki.yml'
9-
- 'Content.Shared/**'
10-
- 'Content.Server/**'
11-
- 'Content.Client/**'
12-
- 'Resources/**'
9+
- 'Content.Shared/Chemistry/**.cs'
10+
- 'Content.Server/Chemistry/**.cs'
11+
- 'Content.Server/GuideGenerator/**.cs'
12+
- 'Content.Server/Corvax/GuideGenerator/**.cs'
13+
- 'Resources/Prototypes/Reagents/**.yml'
14+
- 'Resources/Prototypes/Chemistry/**.yml'
15+
- 'Resources/Prototypes/Recipes/Reactions/**.yml'
1316
- 'RobustToolbox/'
17+
- 'Resources/Locale/**.ftl'
1418

1519
jobs:
1620
update-wiki:
@@ -48,53 +52,52 @@ jobs:
4852
run: dotnet ./bin/Content.Server/Content.Server.dll --cvar autogen.destination_file=prototypes.json
4953
continue-on-error: true
5054

51-
# Проходит по всем JSON-файлам в директории BASE и загружает каждый файл как страницу в MediaWiki.
52-
# Имя страницы формируется из относительного пути к файлу.
53-
- name: Upload JSON files to wiki
54-
shell: bash
55-
run: |
56-
set -euo pipefail
57-
58-
BASE="./bin/Content.Server/data"
59-
ROOT="${{ secrets.WIKI_PAGE_ROOT }}"
60-
API="${{ secrets.WIKI_ROOT_URL }}/api.php"
61-
USER="${{ secrets.WIKI_BOT_USER }}"
62-
PASS="${{ secrets.WIKI_BOT_PASS }}"
63-
64-
API="$(printf "%s" "$API" | tr -d '\r\n' | sed 's/[[:space:]]*$//')"
65-
USER="$(printf "%s" "$USER" | tr -d '\r\n')"
66-
PASS="$(printf "%s" "$PASS" | tr -d '\r\n')"
67-
ROOT="$(printf "%s" "$ROOT" | tr -d '\r\n' | sed 's/[[:space:]]*$//')"
68-
69-
cookiejar="$(mktemp)"
70-
trap 'rm -f "$cookiejar"' EXIT
71-
72-
login_token=$(curl -sS -c "$cookiejar" --data "action=query&meta=tokens&type=login&format=json" "$API" | jq -r '.query.tokens.logintoken')
73-
curl -sS -c "$cookiejar" -b "$cookiejar" \
74-
--data-urlencode "action=login" \
75-
--data-urlencode "lgname=$USER" \
76-
--data-urlencode "lgpassword=$PASS" \
77-
--data-urlencode "lgtoken=$login_token" \
78-
--data-urlencode "format=json" \
79-
"$API" > /dev/null
80-
81-
find "$BASE" -type f -name '*.json' | while IFS= read -r file; do
82-
rel="${file#$BASE/}"
83-
rel="$(printf "%s" "$rel" | tr -d '\r\n' | sed 's/:/_/g')"
84-
page="$ROOT/$rel"
85-
echo "Uploading $rel → $page"
86-
87-
token=$(curl -sS -b "$cookiejar" --data "action=query&meta=tokens&format=json" "$API" | jq -r '.query.tokens.csrftoken')
88-
89-
curl -sS -b "$cookiejar" \
90-
--data-urlencode "action=edit" \
91-
--data-urlencode "title=$page" \
92-
--data-urlencode "summary=Update $rel via GitHub Actions" \
93-
--data-urlencode "text@${file}" \
94-
--data-urlencode "token=$token" \
95-
--data-urlencode "bot=true" \
96-
--data-urlencode "minor=true" \
97-
--data-urlencode "assert=bot" \
98-
--data-urlencode "format=json" \
99-
"$API" | jq -r '.'
100-
done
55+
- name: Upload chem_prototypes.json to wiki
56+
uses: jtmullen/mediawiki-edit-action@v0.1.1
57+
with:
58+
wiki_text_file: ./bin/Content.Server/data/chem_prototypes.json
59+
edit_summary: Update chem_prototypes.json via GitHub Actions
60+
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/chem_prototypes.json"
61+
api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php
62+
username: ${{ secrets.WIKI_BOT_USER }}
63+
password: ${{ secrets.WIKI_BOT_PASS }}
64+
65+
- name: Upload react_prototypes.json to wiki
66+
uses: jtmullen/mediawiki-edit-action@v0.1.1
67+
with:
68+
wiki_text_file: ./bin/Content.Server/data/react_prototypes.json
69+
edit_summary: Update react_prototypes.json via GitHub Actions
70+
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/react_prototypes.json"
71+
api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php
72+
username: ${{ secrets.WIKI_BOT_USER }}
73+
password: ${{ secrets.WIKI_BOT_PASS }}
74+
75+
- name: Upload entity_prototypes.json to wiki
76+
uses: jtmullen/mediawiki-edit-action@v0.1.1
77+
with:
78+
wiki_text_file: ./bin/Content.Server/data/entity_prototypes.json
79+
edit_summary: Update entity_prototypes.json via GitHub Actions
80+
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/entity_prototypes.json"
81+
api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php
82+
username: ${{ secrets.WIKI_BOT_USER }}
83+
password: ${{ secrets.WIKI_BOT_PASS }}
84+
85+
- name: Upload mealrecipes_prototypes.json to wiki
86+
uses: jtmullen/mediawiki-edit-action@v0.1.1
87+
with:
88+
wiki_text_file: ./bin/Content.Server/data/mealrecipes_prototypes.json
89+
edit_summary: Update mealrecipes_prototypes.json via GitHub Actions
90+
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/mealrecipes_prototypes.json"
91+
api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php
92+
username: ${{ secrets.WIKI_BOT_USER }}
93+
password: ${{ secrets.WIKI_BOT_PASS }}
94+
95+
- name: Upload loc.json to wiki
96+
uses: jtmullen/mediawiki-edit-action@v0.1.1
97+
with:
98+
wiki_text_file: ./bin/Content.Server/data/loc.json
99+
edit_summary: Update loc.json via GitHub Actions
100+
page_name: "${{ secrets.WIKI_PAGE_ROOT }}/loc.json"
101+
api_url: ${{ secrets.WIKI_ROOT_URL }}/api.php
102+
username: ${{ secrets.WIKI_BOT_USER }}
103+
password: ${{ secrets.WIKI_BOT_PASS }}

Content.Benchmarks/HeatCapacityBenchmark.cs

Lines changed: 0 additions & 83 deletions
This file was deleted.

Content.Client/Atmos/EntitySystems/AtmosphereSystem.Gases.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

Content.Client/Atmos/EntitySystems/AtmosphereSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace Content.Client.Atmos.EntitySystems;
77

8-
public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
8+
public sealed class AtmosphereSystem : SharedAtmosphereSystem
99
{
1010
public override void Initialize()
1111
{
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
using Content.Client.BarSign.Ui;
2+
using Content.Shared.BarSign;
3+
using Content.Shared.Power;
4+
using Robust.Client.GameObjects;
5+
using Robust.Shared.Prototypes;
6+
7+
namespace Content.Client.BarSign;
8+
9+
public sealed class BarSignSystem : VisualizerSystem<BarSignComponent>
10+
{
11+
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
12+
[Dependency] private readonly UserInterfaceSystem _ui = default!;
13+
14+
public override void Initialize()
15+
{
16+
base.Initialize();
17+
SubscribeLocalEvent<BarSignComponent, AfterAutoHandleStateEvent>(OnAfterAutoHandleState);
18+
}
19+
20+
private void OnAfterAutoHandleState(EntityUid uid, BarSignComponent component, ref AfterAutoHandleStateEvent args)
21+
{
22+
if (_ui.TryGetOpenUi<BarSignBoundUserInterface>(uid, BarSignUiKey.Key, out var bui))
23+
bui.Update(component.Current);
24+
25+
UpdateAppearance(uid, component);
26+
}
27+
28+
protected override void OnAppearanceChange(EntityUid uid, BarSignComponent component, ref AppearanceChangeEvent args)
29+
{
30+
UpdateAppearance(uid, component, args.Component, args.Sprite);
31+
}
32+
33+
private void UpdateAppearance(EntityUid id, BarSignComponent sign, AppearanceComponent? appearance = null, SpriteComponent? sprite = null)
34+
{
35+
if (!Resolve(id, ref appearance, ref sprite))
36+
return;
37+
38+
AppearanceSystem.TryGetData<bool>(id, PowerDeviceVisuals.Powered, out var powered, appearance);
39+
40+
if (powered
41+
&& sign.Current != null
42+
&& _prototypeManager.Resolve(sign.Current, out var proto))
43+
{
44+
SpriteSystem.LayerSetSprite((id, sprite), 0, proto.Icon);
45+
sprite.LayerSetShader(0, "unshaded");
46+
}
47+
else
48+
{
49+
SpriteSystem.LayerSetRsiState((id, sprite), 0, "empty");
50+
sprite.LayerSetShader(0, null, null);
51+
}
52+
}
53+
}

Content.Client/BarSign/BarSignVisualizerSystem.cs

Lines changed: 0 additions & 30 deletions
This file was deleted.

Content.Client/BarSign/Ui/BarSignBoundUserInterface.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,32 @@ protected override void Open()
1919
var sign = EntMan.GetComponentOrNull<BarSignComponent>(Owner)?.Current is { } current
2020
? _prototype.Index(current)
2121
: null;
22-
var allSigns = BarSignSystem.GetAllBarSigns(_prototype)
22+
var allSigns = Shared.BarSign.BarSignSystem.GetAllBarSigns(_prototype)
2323
.OrderBy(p => Loc.GetString(p.Name))
2424
.ToList();
2525
_menu = new(sign, allSigns);
2626

2727
_menu.OnSignSelected += id =>
2828
{
29-
SendPredictedMessage(new SetBarSignMessage(id));
29+
SendMessage(new SetBarSignMessage(id));
3030
};
3131

3232
_menu.OnClose += Close;
3333
_menu.OpenCentered();
3434
}
3535

36-
public override void Update()
36+
public void Update(ProtoId<BarSignPrototype>? sign)
3737
{
38-
if (!EntMan.TryGetComponent<BarSignComponent>(Owner, out var signComp))
39-
return;
40-
41-
if (_prototype.Resolve(signComp.Current, out var signPrototype))
38+
if (_prototype.Resolve(sign, out var signPrototype))
4239
_menu?.UpdateState(signPrototype);
4340
}
41+
42+
protected override void Dispose(bool disposing)
43+
{
44+
base.Dispose(disposing);
45+
if (!disposing)
46+
return;
47+
_menu?.Dispose();
48+
}
4449
}
4550

0 commit comments

Comments
 (0)