Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstream sync #1764

Merged
merged 203 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
ae59b07
Adjust prototype names to lowercase (#23810)
degradka Jan 9, 2024
88045af
Doors will no longer be pried open once the doafter finishes if they …
nikthechampiongr Jan 9, 2024
be11801
Fix fatal error when closing vending machine wire UI (#23815)
Tayrtahn Jan 9, 2024
6334203
Automatic changelog update
PJBot Jan 9, 2024
4cc3c91
Wheelchair users can bump open doors (#23806)
themias Jan 9, 2024
dd3bc60
Automatic changelog update
PJBot Jan 9, 2024
5d658fc
Add artifact fragments to salvage magnet (#23791)
metalgearsloth Jan 9, 2024
287b196
Automatic changelog update
PJBot Jan 9, 2024
59e989a
ruins (#23767)
Emisse Jan 9, 2024
de860ca
Gemini Engineering Rework + Minor fixes (#23817)
luckyshotpictures Jan 9, 2024
c34e18e
buff syndicate assault borgs (#23797)
Ilya246 Jan 9, 2024
2fe11e7
Fix test fail from dupe prototypes (#23827)
VasilisThePikachu Jan 9, 2024
782a6ad
Fix changelogs rss probably (#23830)
metalgearsloth Jan 10, 2024
31f97b2
Add more discord changelog logs (#23831)
metalgearsloth Jan 10, 2024
e0683f5
Remove the old python server/client packeging scripts (#23739)
VasilisThePikachu Jan 10, 2024
18696d5
Minor discord cl fix (#23833)
metalgearsloth Jan 10, 2024
aa455a8
Adjust Aspid max player count (#23829)
Kadeo64 Jan 10, 2024
798057e
Adds the old AI sat ruin from SS13 (#23836)
Flareguy Jan 10, 2024
5201ad8
djstation (#23839)
Emisse Jan 10, 2024
fbc9417
relaystation update (#23838)
Emisse Jan 10, 2024
041ff3c
bluespace jumper + renames old whiteship (#23841)
Carolyn3114 Jan 10, 2024
16fad79
bagel update (#23842)
Emisse Jan 10, 2024
30186a6
box update (#23843)
Emisse Jan 10, 2024
9da3b70
fland update (#23844)
Emisse Jan 10, 2024
1018fc3
marathon update (#23845)
Emisse Jan 10, 2024
a9f8a8e
meta update (#23846)
Emisse Jan 10, 2024
d85b9a5
aspid update (#23847)
Emisse Jan 10, 2024
7cd1ed2
Stationstation update (#23848)
Emisse Jan 10, 2024
1170121
Fix objects tab not showing nents (#23837)
metalgearsloth Jan 10, 2024
fcab540
more tarantula changes (#23816)
Dutch-VanDerLinde Jan 10, 2024
51a2b36
Adds footstep sounds to tables (#23851)
deathride58 Jan 10, 2024
24f8da8
Fix storage state (#23852)
metalgearsloth Jan 10, 2024
04c9d7a
gps can go inm belt (#23853)
Emisse Jan 10, 2024
cfeb431
Rad suit swag and toggleable now (#23854)
Emisse Jan 10, 2024
9d52833
marton fix arrivals (#23855)
Emisse Jan 10, 2024
b30afb3
Hide ruins spawns (#23857)
metalgearsloth Jan 10, 2024
b3008ab
Syndie elite uplink (#23859)
Emisse Jan 10, 2024
e790e8f
Update Core (#23860)
UbaserB Jan 10, 2024
e91e746
Moths get insect blood (#23671)
UbaserB Jan 10, 2024
7fe0f14
Enable worldgen on WD (#23861)
metalgearsloth Jan 10, 2024
af7327e
Show how close bodies are to rotting (#23530)
quatre Jan 10, 2024
a73f3ee
Rod/Transit Evacuation shuttle update (#23862)
UbaserB Jan 10, 2024
cd1ef71
Fix tiledef reloads AKA void planet (#23864)
metalgearsloth Jan 10, 2024
a46f6f3
Fix ruins being added to station grid (#23865)
metalgearsloth Jan 10, 2024
1cf07fa
Fix flippo sprite layer (#23877)
themias Jan 10, 2024
9c294d7
Fixed opened cargo airlock sprite (#23889)
snebl Jan 10, 2024
464f24d
Fix roller skates debug assert (#23876)
Arendian Jan 10, 2024
7aee192
Aghosts and other powerful beings no longer burn their hands on light…
nikthechampiongr Jan 10, 2024
23e714e
Fix borg becoming emag immune if emag attempted with panel closed. (#…
Arendian Jan 10, 2024
e7a4c5c
box update (#23871)
lzk228 Jan 10, 2024
036cf42
Gemini Hotfix (#23869)
luckyshotpictures Jan 10, 2024
80a44a6
bagel update (#23870)
lzk228 Jan 10, 2024
1fbb63f
aspid update (#23872)
lzk228 Jan 10, 2024
ef132c8
Fix tranquiliser shells not working (#23886)
nikthechampiongr Jan 10, 2024
c7ad10d
make intercoms draw above table (#23897)
Emisse Jan 10, 2024
a39999f
Fix admin log key order. (#23052)
PJB3005 Jan 11, 2024
31cc9ba
Makes lights use the "old" light fixture sprites (#23898)
Flareguy Jan 11, 2024
eee7aef
remove ame parts from cargo (#23903)
Emisse Jan 11, 2024
a35c91f
marathon update (#23904)
Emisse Jan 11, 2024
34d2330
Throttle MagicMirror do_afters (#23867)
metalgearsloth Jan 11, 2024
f1b90d0
bagel update (#23905)
Emisse Jan 11, 2024
e0af752
remove 1 chemist from gemini (#23909)
Emisse Jan 11, 2024
b3014e6
machine parts + power cell resprite (#23913)
EmoGarbage404 Jan 11, 2024
3b6bfde
reach update (#23915)
Emisse Jan 11, 2024
11bbf2b
Uranium & AP magazine and projectile sprites (#23914)
IProduceWidgets Jan 11, 2024
f9d5352
crusher rebalanceing (#23916)
Emisse Jan 11, 2024
7be42cc
revert core cargo shuttle for now (#23921)
Emisse Jan 11, 2024
d99c56f
Fix tips (#23920)
UbaserB Jan 11, 2024
801f141
Only hide ruins labels (#23925)
metalgearsloth Jan 11, 2024
1886941
Add doors to the station map (#23639)
EmoGarbage404 Jan 11, 2024
064d52d
Optimise the puddle system to reach an equilibrium quickly. (#23776)
mr-bo-jangles Jan 11, 2024
55a60b0
Split cargo shuttle to its own component (#23926)
metalgearsloth Jan 11, 2024
79ab290
Fix light tube broken state (#23939)
Flareguy Jan 11, 2024
cc823e2
Bluespace Anomaly Admin Logs (#23942)
tday93 Jan 11, 2024
25c477a
Fix clumsy defib debug assert (#23930)
themias Jan 11, 2024
f9f5db9
Respite and minor changes to mercenary items (#23783)
Jackal298 Jan 11, 2024
0126b98
Stop the inevitability of death from misgendering you (#23949)
EmoGarbage404 Jan 11, 2024
506acf5
Small clamp for fland cargo (#23947)
Arendian Jan 11, 2024
7f8dba4
Adds winterdrobe to cluster (#23928)
Aexxie Jan 11, 2024
581c95e
dedicated burn and shock meds (#23941)
deltanedas Jan 11, 2024
bd17444
Bulk plushie lizard crate (#23927)
SpaceLizardSky Jan 11, 2024
092d858
Gemini maint power (#23932)
Aexxie Jan 11, 2024
13c91c4
(Add) black cap and some contraband (#23933)
Jackal298 Jan 11, 2024
3d9a6f5
medsec hud is no longer a filler (#23934)
icekot8 Jan 11, 2024
faf4f50
atlas update (#23938)
deltanedas Jan 11, 2024
8bba4b8
Headphones can be turned on (#23882)
themias Jan 11, 2024
e2dd30f
New Lobbyscreen Art (#23943)
Alekshhh Jan 11, 2024
e665c24
Use item status extension method (#23884)
PJB3005 Jan 12, 2024
5dd48f3
Tesla Artifact Effect (#23958)
Blackern5000 Jan 12, 2024
4585589
Update submodule to 204.1.0 (#23959)
metalgearsloth Jan 12, 2024
8a7ab61
Ports some /tg/ + /vg/ space ambience (#23910)
Flareguy Jan 12, 2024
2d78e0f
sus attributions (#23962)
Emisse Jan 12, 2024
4309084
Fix Floodlight Collision (#23966)
Jrpl Jan 12, 2024
26c1a78
Update Blood Red Phone Sprite (#23964)
Jrpl Jan 12, 2024
e93231e
death squad armor tweaks (#23965)
Emisse Jan 12, 2024
996eba6
Minor change to vending machine inventory (#23967)
Jackal298 Jan 12, 2024
6820cff
new chemical-Necrosol (#23850)
icekot8 Jan 12, 2024
1b8e536
Greyscale decal tweaks + additions (#23961)
Aexxie Jan 12, 2024
b9f694e
Adds the "advanced" color palette (#23960)
Aexxie Jan 12, 2024
b8de514
Cuttable speaker wire for vending machines (#23873)
Tayrtahn Jan 12, 2024
0c045f8
Fixed Lizard swipe (#23953)
KittenColony Jan 12, 2024
abc5094
NewsSystem fixes (#23969)
metalgearsloth Jan 12, 2024
fa3da1a
Whistle for security (second try) (#23945)
Fahasor Jan 12, 2024
1c3c596
Pie tins returned from all pies in all situations, add lathe recipes …
GreyMario Jan 12, 2024
f5c40c3
Fixes construction graphs proccing while being microwaved (#23835)
deathride58 Jan 12, 2024
f8f5524
Limit hydraulic clamps to one DoAfter at a time (#23982)
themias Jan 12, 2024
668d0ec
Added search bar to warp points (#23978)
Crotalus Jan 12, 2024
d312d87
Fix double sound for shutters (#23975)
nikthechampiongr Jan 12, 2024
9e1342f
Tranquilizer balance (#23979)
takemysoult Jan 12, 2024
d2a1eae
Add "Skelly Versus The Rev" as lobby art (#23974)
FairlySadPanda Jan 12, 2024
a6c9c36
Dependency update / fixes / skrungle bungle (#23745)
PJB3005 Jan 12, 2024
023d541
Fix mass-media console (#23994)
themias Jan 12, 2024
fa56750
Fix exception with gas overlay rendering (#24001)
PJB3005 Jan 12, 2024
053924b
Matter bin & manipulator resprite (#23990)
EmoGarbage404 Jan 13, 2024
205c631
Fix autodrobe inventory (#24006)
lzk228 Jan 13, 2024
2375a6c
Moves ShootProjectile to shared (#24007)
keronshb Jan 13, 2024
3a2cd95
Fix solution editor UI (#24004)
PJB3005 Jan 13, 2024
bee200d
fix coal ejection (#23993)
EmoGarbage404 Jan 13, 2024
0edf04d
Automatic changelog update
PJBot Jan 13, 2024
2358023
Fix electrical crates drop plastic instead of metal (#23992)
degradka Jan 13, 2024
8085b9c
Automatic changelog update
PJBot Jan 13, 2024
0662c81
Substation resprite (#23977)
UbaserB Jan 13, 2024
a805195
Automatic changelog update
PJBot Jan 13, 2024
f0e4312
Ore crab drops nerf (#24012)
EmoGarbage404 Jan 13, 2024
a7a76ce
Automatic changelog update
PJBot Jan 13, 2024
0e45c63
Fix chem sources in guidebook (#23987)
EmoGarbage404 Jan 13, 2024
3e464a0
Automatic changelog update
PJBot Jan 13, 2024
5962f6d
Pneumatic cannon accuracy buff (#23996)
GreyMario Jan 13, 2024
f0e706a
Add nuclear bomb warp point (#23973)
Crotalus Jan 13, 2024
cde4ea7
make gas tanks not quick equipable (#23971)
lzk228 Jan 13, 2024
fd1d04b
Automatic changelog update
PJBot Jan 13, 2024
cb6aafc
Fixed shuttle movements on some systems (#24008)
koksnull Jan 13, 2024
bda8991
Station Map window edges (#24024)
Errant-4 Jan 13, 2024
e6e4027
Automatic changelog update
PJBot Jan 13, 2024
98f0814
Fix emergency flare not igniting through verb menu. (#24027)
Arendian Jan 13, 2024
b8b329c
Automatic changelog update
PJBot Jan 13, 2024
a97eb8d
fix plushie rouny sprite (#24031)
lzk228 Jan 13, 2024
bd27b53
Fix oxyburn energy not accounting for heatscale (#24023)
Ilya246 Jan 13, 2024
7f766ea
Remove spacepens (#23970)
VasilisThePikachu Jan 13, 2024
896c424
Automatic changelog update
PJBot Jan 13, 2024
bece0c9
Updates aspid (#24014)
Aexxie Jan 13, 2024
8e125e0
Remove AmmoTechFabCircuitboard from Thief objectives (#24037)
SlamBamActionman Jan 13, 2024
2f5e7cf
Automatic changelog update
PJBot Jan 13, 2024
7d258c9
Makes Eggs drawable with a syringe (#24042)
Varen Jan 13, 2024
96ae049
Automatic changelog update
PJBot Jan 13, 2024
562d7b4
Add a check for item size in the microwave system (#24026)
degradka Jan 13, 2024
c412e66
Automatic changelog update
PJBot Jan 13, 2024
8302240
Make changelog script able to manage admin changelogs (#24033)
PJB3005 Jan 14, 2024
93973ec
Update Credits (#24057)
github-actions[bot] Jan 14, 2024
055d62f
Fix vending machine thank you flag timing (#24049)
Tayrtahn Jan 14, 2024
f191c90
Desk bells can be rung with activate (#24047)
PJB3005 Jan 14, 2024
1e795c5
Colorblind-compatible QM uniform sprites (#24055)
deathride58 Jan 14, 2024
e47e359
Remove archaic accent (#24052)
lzk228 Jan 14, 2024
81b75ae
Automatic changelog update
PJBot Jan 14, 2024
3fae5de
Mayo (#24017)
21Melkuu Jan 14, 2024
023b841
Automatic changelog update
PJBot Jan 14, 2024
28095d5
Species' melee changes (#24019)
Aexxie Jan 14, 2024
a8bb897
Automatic changelog update
PJBot Jan 14, 2024
8416fc7
Quick dialog fixes (#24046)
PJB3005 Jan 14, 2024
6a7f1b2
Fix error when switching to a screen without an inventory gui widget …
DrSmugleaf Jan 14, 2024
a558b11
better deconversion (#23315)
deltanedas Jan 14, 2024
ee5b954
Automatic changelog update
PJBot Jan 14, 2024
7a84f9e
Add admin logs for thermomachines (#24056)
tday93 Jan 14, 2024
fbcb888
Automatic changelog update
PJBot Jan 14, 2024
6fc0aea
Add a neck gaiter into HOS's dresser (#24003)
degradka Jan 14, 2024
c41bf7e
Automatic changelog update
PJBot Jan 14, 2024
40db236
Navmap UI enhancements (#23777)
Errant-4 Jan 14, 2024
5e76028
Automatic changelog update
PJBot Jan 14, 2024
7682884
no time limit on nukie syndicate bomb (#24022)
Ilya246 Jan 14, 2024
7ac7683
Automatic changelog update
PJBot Jan 14, 2024
22c0b44
Cvar to allow whitelisted players to bypass panic bunker (#23885)
VasilisThePikachu Jan 14, 2024
2d6d2ab
Hackable intercoms (#23984)
Tayrtahn Jan 14, 2024
5ec4fbe
Automatic changelog update
PJBot Jan 14, 2024
db175fd
Teleport fixes (#24064)
metalgearsloth Jan 14, 2024
43da5f6
Fix iron ore being called steel ore in the vein descriptions (#24066)
EmoGarbage404 Jan 14, 2024
458d103
box update (#24065)
Emisse Jan 14, 2024
20461ff
meta update (#24067)
Emisse Jan 14, 2024
f9199e5
packed update (#24068)
Emisse Jan 14, 2024
b51d691
Revert "Greyscale decal tweaks + additions" (#24069)
Emisse Jan 14, 2024
123a414
BUI bugfixes / improvements (#23881)
PJB3005 Jan 14, 2024
88db476
Add greenshift preset (#24029)
deltanedas Jan 14, 2024
9063cfe
Tail wagging (#19573)
Morb0 Jan 14, 2024
1f3a29c
Entitylookup method renames (#23519)
metalgearsloth Jan 14, 2024
1346cc0
Update submodule to 206.0.0 (#24072)
metalgearsloth Jan 14, 2024
d1d11d0
Add TryGetPrimaryDepartment to jobs system (#23317)
deltanedas Jan 14, 2024
b80f7ee
Make throwable star damage stamina (#23527)
dakamakat Jan 14, 2024
95ef202
Fix error when the client gets an Eui state message before its open m…
DrSmugleaf Jan 14, 2024
108f001
Virtual items cleanup (#23912)
AJCM-git Jan 14, 2024
34a9d4d
Cerberus has AI (#24028)
QuietlyWhisper Jan 14, 2024
971ad5b
Automatic changelog update
PJBot Jan 14, 2024
29acc5e
Remove bad Dirty call introduced by PR #20778 (#24076)
Nopey Jan 14, 2024
620074a
Fix admins unable to hide the coordinates debug monitor (#24084)
koteq Jan 14, 2024
374260c
Suit Storage Visual Change (#23799)
Alekshhh Jan 14, 2024
a747e6d
Plates & Cash gridinv visuals (#24075)
Psychpsyo Jan 14, 2024
83f96a6
Automatic changelog update
PJBot Jan 14, 2024
fd7ff69
Grave digging and decomposition (#23646)
themias Jan 14, 2024
df58839
Automatic changelog update
PJBot Jan 14, 2024
abd0e6d
Nerf and Add More Reagent Slimes (#24087)
Nairodian Jan 14, 2024
f9a57dc
Automatic changelog update
PJBot Jan 14, 2024
37dc87a
Merge remote-tracking branch 'upstream/master' into upstream-sync
Morb0 Jan 14, 2024
a3f604c
Remove news CCVars
Morb0 Jan 14, 2024
d89306b
Update locale
Morb0 Jan 14, 2024
b7aef96
Fix Secrets
Morb0 Jan 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ dotnet_naming_symbols.type_parameters_symbols.applicable_kinds = type_parameter
resharper_braces_for_ifelse = required_for_multiline
resharper_keep_existing_attribute_arrangement = true

[*.{csproj,xml,yml,yaml,dll.config,msbuildproj,targets}]
[*.{csproj,xml,yml,yaml,dll.config,msbuildproj,targets,props}]
indent_size = 2

[nuget.config]
indent_size = 2

[{*.yaml,*.yml}]
Expand Down
2 changes: 1 addition & 1 deletion Content.Benchmarks/Content.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
<PackageReference Include="BenchmarkDotNet" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Content.Client\Content.Client.csproj" />
Expand Down
47 changes: 31 additions & 16 deletions Content.Client/Administration/QuickDialogSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace Content.Client.Administration;

// mfw they ported input() from BYOND

/// <summary>
/// This handles the client portion of quick dialogs.
/// </summary>
Expand All @@ -32,39 +34,48 @@ private void OpenDialog(QuickDialogOpenEvent ev)

var promptsDict = new Dictionary<string, LineEdit>();

foreach (var entry in ev.Prompts)
for (var index = 0; index < ev.Prompts.Count; index++)
{
var entry = ev.Prompts[index];
var entryBox = new BoxContainer()
{
Orientation = BoxContainer.LayoutOrientation.Horizontal
};

entryBox.AddChild(new Label { Text = entry.Prompt, HorizontalExpand = true, SizeFlagsStretchRatio = 0.5f });
var edit = new LineEdit() { HorizontalExpand = true};
var edit = new LineEdit() { HorizontalExpand = true };
entryBox.AddChild(edit);
switch (entry.Type)
{
case QuickDialogEntryType.Integer:
edit.IsValid += VerifyInt;
edit.PlaceHolder = "Integer..";
edit.PlaceHolder = Loc.GetString("quick-dialog-ui-integer");
break;
case QuickDialogEntryType.Float:
edit.IsValid += VerifyFloat;
edit.PlaceHolder = "Float..";
edit.PlaceHolder = Loc.GetString("quick-dialog-ui-float");
break;
case QuickDialogEntryType.ShortText:
edit.IsValid += VerifyShortText;
edit.PlaceHolder = "Short text..";
edit.PlaceHolder = Loc.GetString("quick-dialog-ui-short-text");
break;
case QuickDialogEntryType.LongText:
edit.IsValid += VerifyLongText;
edit.PlaceHolder = "Long text..";
edit.PlaceHolder = Loc.GetString("quick-dialog-ui-long-text");
break;
default:
throw new ArgumentOutOfRangeException();
}

promptsDict.Add(entry.FieldId, edit);
entryContainer.AddChild(entryBox);

if (index == ev.Prompts.Count - 1)
{
// Last text box gets enter confirmation.
// Only the last so you don't accidentally confirm early.
edit.OnTextEntered += _ => Confirm();
}
}

var buttonsBox = new BoxContainer()
Expand All @@ -79,17 +90,10 @@ private void OpenDialog(QuickDialogOpenEvent ev)
{
var okButton = new Button()
{
Text = "Ok",
Text = Loc.GetString("quick-dialog-ui-ok"),
};

okButton.OnPressed += _ =>
{
RaiseNetworkEvent(new QuickDialogResponseEvent(ev.DialogId,
promptsDict.Select(x => (x.Key, x.Value.Text)).ToDictionary(x => x.Key, x => x.Text),
QuickDialogButtonFlag.OkButton));
alreadyReplied = true;
window.Close();
};
okButton.OnPressed += _ => Confirm();

buttonsBox.AddChild(okButton);
}
Expand All @@ -98,7 +102,7 @@ private void OpenDialog(QuickDialogOpenEvent ev)
{
var cancelButton = new Button()
{
Text = "Cancel",
Text = Loc.GetString("quick-dialog-ui-cancel"),
};

cancelButton.OnPressed += _ =>
Expand Down Expand Up @@ -130,6 +134,17 @@ private void OpenDialog(QuickDialogOpenEvent ev)
window.MinWidth *= 2; // Just double it.

window.OpenCentered();

return;

void Confirm()
{
RaiseNetworkEvent(new QuickDialogResponseEvent(ev.DialogId,
promptsDict.Select(x => (x.Key, x.Value.Text)).ToDictionary(x => x.Key, x => x.Text),
QuickDialogButtonFlag.OkButton));
alreadyReplied = true;
window.Close();
}
}

private bool VerifyInt(string input)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ public override void Closed()
public override void HandleState(EuiStateBase baseState)
{
var state = (EditSolutionsEuiState) baseState;
_window.SetTargetEntity(state.Target);
_window.UpdateSolutions(state.Solutions);
_window.UpdateReagents();
_window.SetState(state);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
using Content.Shared.Administration;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Robust.Client.AutoGenerated;
using Robust.Client.Console;
using Robust.Client.Timing;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Timing;

namespace Content.Client.Administration.UI.ManageSolutions
{
Expand All @@ -16,11 +19,13 @@ public sealed partial class EditSolutionsWindow : DefaultWindow
{
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IClientGameTiming _timing = default!;

private NetEntity _target = NetEntity.Invalid;
private string? _selectedSolution;
private AddReagentWindow? _addReagentWindow;
private Dictionary<string, EntityUid>? _solutions;
private EditSolutionsEuiState? _nextState;

public EditSolutionsWindow()
{
Expand Down Expand Up @@ -327,5 +332,27 @@ public void UpdateSolutions(List<(string, NetEntity)>? solutions)
SolutionOption.Select(selectedIndex);
_selectedSolution = (string?) SolutionOption.SelectedMetadata;
}

protected override void FrameUpdate(FrameEventArgs args)
{
// TODO: THIS IS FUCKING TERRIBLE.
// Ok so the problem is that this shouldn't be via an EUI at all. Why?
// The EUI update notification comes in *before* the game state it updates from.
// So the UI doesn't update properly. Heck.
// I didn't wanna completely rewrite this thing to work properly so instead you get terrible hacks.

if (_nextState != null && _timing.LastRealTick >= _nextState.Tick)
{
SetTargetEntity(_nextState.Target);
UpdateSolutions(_nextState.Solutions);
UpdateReagents();
_nextState = null;
}
}

public void SetState(EditSolutionsEuiState state)
{
_nextState = state;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,28 @@
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Map.Components;
using Robust.Shared.Timing;

namespace Content.Client.Administration.UI.Tabs.ObjectsTab;

[GenerateTypedNameReferences]
public sealed partial class ObjectsTab : Control
{
[Dependency] private readonly EntityManager _entityManager = default!;
[Dependency] private readonly IGameTiming _timing = default!;

private readonly List<ObjectsTabEntry> _objects = new();
private List<ObjectsTabSelection> _selections = new();

public event Action<ObjectsTabEntry, GUIBoundKeyEventArgs>? OnEntryKeyBindDown;

// Listen I could either have like 4 different event subscribers (for map / grid / station changes) and manage their lifetimes in AdminUIController
// OR
// I can do this.
private TimeSpan _updateFrequency = TimeSpan.FromSeconds(2);

private TimeSpan _nextUpdate = TimeSpan.FromSeconds(2);

public ObjectsTab()
{
RobustXamlLoader.Load(this);
Expand All @@ -33,33 +42,38 @@ public ObjectsTab()
ObjectTypeOptions.AddItem(Enum.GetName((ObjectsTabSelection)type)!);
}

RefreshObjectList();
}

private void RefreshObjectList()
{
RefreshObjectList(_selections[ObjectTypeOptions.SelectedId]);
}

private void RefreshObjectList(ObjectsTabSelection selection)
{
var entities = new List<EntityUid>();
var entities = new List<(string Name, NetEntity Entity)>();
switch (selection)
{
case ObjectsTabSelection.Stations:
entities.AddRange(_entityManager.EntitySysManager.GetEntitySystem<StationSystem>().Stations);
break;
case ObjectsTabSelection.Grids:
{
var query = _entityManager.AllEntityQueryEnumerator<MapGridComponent>();
while (query.MoveNext(out var uid, out _))
var query = _entityManager.AllEntityQueryEnumerator<MapGridComponent, MetaDataComponent>();
while (query.MoveNext(out var uid, out _, out var metadata))
{
entities.Add(uid);
entities.Add((metadata.EntityName, _entityManager.GetNetEntity(uid)));
}

break;
}
case ObjectsTabSelection.Maps:
{
var query = _entityManager.AllEntityQueryEnumerator<MapComponent>();
while (query.MoveNext(out var uid, out _))
var query = _entityManager.AllEntityQueryEnumerator<MapComponent, MetaDataComponent>();
while (query.MoveNext(out var uid, out _, out var metadata))
{
entities.Add(uid);
entities.Add((metadata.EntityName, _entityManager.GetNetEntity(uid)));
}
break;
}
Expand All @@ -74,17 +88,28 @@ private void RefreshObjectList(ObjectsTabSelection selection)

_objects.Clear();

foreach (var entity in entities)
foreach (var (name, nent) in entities)
{
// TODO the server eitehr needs to send the entity's name, or it needs to ensure the client knows about the entity.
var name = _entityManager.GetComponentOrNull<MetaDataComponent>(entity)?.EntityName ?? "Unknown Entity"; // this should be fixed, so I CBF localizing.
var ctrl = new ObjectsTabEntry(name, entity);
var ctrl = new ObjectsTabEntry(name, nent);
_objects.Add(ctrl);
ObjectList.AddChild(ctrl);
ctrl.OnKeyBindDown += args => OnEntryKeyBindDown?.Invoke(ctrl, args);
}
}

protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);

if (_timing.CurTime < _nextUpdate)
return;

// I do not care for precision.
_nextUpdate = _timing.CurTime + _updateFrequency;

RefreshObjectList();
}

private enum ObjectsTabSelection
{
Grids,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ namespace Content.Client.Administration.UI.Tabs.ObjectsTab;
[GenerateTypedNameReferences]
public sealed partial class ObjectsTabEntry : ContainerButton
{
public EntityUid AssocEntity;
public NetEntity AssocEntity;

public ObjectsTabEntry(string name, EntityUid euid)
public ObjectsTabEntry(string name, NetEntity nent)
{
RobustXamlLoader.Load(this);
AssocEntity = euid;
EIDLabel.Text = euid.ToString();
AssocEntity = nent;
EIDLabel.Text = nent.ToString();
NameLabel.Text = name;
}
}
14 changes: 2 additions & 12 deletions Content.Client/Chemistry/EntitySystems/InjectorSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<InjectorComponent, ComponentHandleState>(OnHandleInjectorState);
SubscribeLocalEvent<InjectorComponent, ItemStatusCollectMessage>(OnItemInjectorStatus);
Subs.ItemStatus<InjectorComponent>(ent => new InjectorStatusControl(ent));
SubscribeLocalEvent<HyposprayComponent, ComponentHandleState>(OnHandleHyposprayState);
SubscribeLocalEvent<HyposprayComponent, ItemStatusCollectMessage>(OnItemHyposprayStatus);
Subs.ItemStatus<HyposprayComponent>(ent => new HyposprayStatusControl(ent));
}

private void OnHandleInjectorState(EntityUid uid, InjectorComponent component, ref ComponentHandleState args)
Expand All @@ -30,11 +30,6 @@ private void OnHandleInjectorState(EntityUid uid, InjectorComponent component, r
component.UiUpdateNeeded = true;
}

private void OnItemInjectorStatus(EntityUid uid, InjectorComponent component, ItemStatusCollectMessage args)
{
args.Controls.Add(new InjectorStatusControl(component));
}

private void OnHandleHyposprayState(EntityUid uid, HyposprayComponent component, ref ComponentHandleState args)
{
if (args.Current is not HyposprayComponentState cState)
Expand All @@ -44,9 +39,4 @@ private void OnHandleHyposprayState(EntityUid uid, HyposprayComponent component,
component.TotalVolume = cState.MaxVolume;
component.UiUpdateNeeded = true;
}

private void OnItemHyposprayStatus(EntityUid uid, HyposprayComponent component, ItemStatusCollectMessage args)
{
args.Controls.Add(new HyposprayStatusControl(component));
}
}
4 changes: 2 additions & 2 deletions Content.Client/Content.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<Platforms>AnyCPU</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nett" Version="0.15.0" />
<PackageReference Include="JetBrains.Annotations" Version="2022.1.0" PrivateAssets="All" />
<PackageReference Include="Nett" />
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\RobustToolbox\Lidgren.Network\Lidgren.Network.csproj" />
Expand Down
7 changes: 1 addition & 6 deletions Content.Client/Crayon/CrayonSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<CrayonComponent, ComponentHandleState>(OnCrayonHandleState);
SubscribeLocalEvent<CrayonComponent, ItemStatusCollectMessage>(OnCrayonItemStatus);
Subs.ItemStatus<CrayonComponent>(ent => new StatusControl(ent));
}

private static void OnCrayonHandleState(EntityUid uid, CrayonComponent component, ref ComponentHandleState args)
Expand All @@ -33,11 +33,6 @@ private static void OnCrayonHandleState(EntityUid uid, CrayonComponent component
component.UIUpdateNeeded = true;
}

private static void OnCrayonItemStatus(EntityUid uid, CrayonComponent component, ItemStatusCollectMessage args)
{
args.Controls.Add(new StatusControl(component));
}

private sealed class StatusControl : Control
{
private readonly CrayonComponent _parent;
Expand Down
Loading
Loading