From 0738f62ed0cb403ccb6dcf529d68bc37175f8ce3 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 17 Dec 2020 23:30:48 +0100 Subject: [PATCH 1/7] things --- .../{ConstructionMenu.cs => ConstructionMenu.xaml.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Content.Client/Construction/{ConstructionMenu.cs => ConstructionMenu.xaml.cs} (100%) diff --git a/Content.Client/Construction/ConstructionMenu.cs b/Content.Client/Construction/ConstructionMenu.xaml.cs similarity index 100% rename from Content.Client/Construction/ConstructionMenu.cs rename to Content.Client/Construction/ConstructionMenu.xaml.cs From 2befb8887251376b19daaa9fb1a31ca750bc182c Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 18 Dec 2020 00:50:34 +0100 Subject: [PATCH 2/7] adds targets for xamlui codebehind --- Content.Client/Content.Client.csproj | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Content.Client/Content.Client.csproj b/Content.Client/Content.Client.csproj index 697faf5f75..3efa621c2c 100644 --- a/Content.Client/Content.Client.csproj +++ b/Content.Client/Content.Client.csproj @@ -33,4 +33,27 @@ OptionsMenu.cs + + + + %(Filename) + + + + + + + + + + + + + + $(IntermediateOutputPath)XAML/references + $(IntermediateOutputPath)XAML/original.dll + + + + From c6021c4b051ecb00b39e3d47bb071428a957f4b5 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 18 Dec 2020 00:50:49 +0100 Subject: [PATCH 3/7] constructionmenu but not shit --- .../Construction/ConstructionMenu.xaml | 31 ++++ .../Construction/ConstructionMenu.xaml.cs | 161 ++++++------------ 2 files changed, 80 insertions(+), 112 deletions(-) create mode 100644 Content.Client/Construction/ConstructionMenu.xaml diff --git a/Content.Client/Construction/ConstructionMenu.xaml b/Content.Client/Construction/ConstructionMenu.xaml new file mode 100644 index 0000000000..e4269c3209 --- /dev/null +++ b/Content.Client/Construction/ConstructionMenu.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Content.Client/Construction/ConstructionMenu.xaml.cs b/Content.Client/Construction/ConstructionMenu.xaml.cs index 88a799c4de..928c8ac9d1 100644 --- a/Content.Client/Construction/ConstructionMenu.xaml.cs +++ b/Content.Client/Construction/ConstructionMenu.xaml.cs @@ -7,15 +7,12 @@ using Content.Client.Utility; using Content.Shared.Construction; using Content.Shared.GameObjects.Components; using Content.Shared.GameObjects.Components.Interactable; -using Content.Shared.Materials; using Robust.Client.Graphics; using Robust.Client.Interfaces.Placement; using Robust.Client.Interfaces.ResourceManagement; -using Robust.Client.Placement; -using Robust.Client.ResourceManagement; -using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.CustomControls; +using Robust.Client.UserInterface.XAML; using Robust.Client.Utility; using Robust.Shared.Enums; using Robust.Shared.GameObjects.Systems; @@ -27,7 +24,8 @@ using Robust.Shared.Prototypes; namespace Content.Client.Construction { - public class ConstructionMenu : SS14Window + [GenerateTypedNameReferences] + public partial class ConstructionMenu : SS14Window { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; @@ -39,89 +37,28 @@ namespace Content.Client.Construction private ConstructionPrototype? _selected; private string[] _categories = Array.Empty(); - private readonly ItemList _recipes; - private readonly ItemList _stepList; - private readonly Button _buildButton; - private readonly Button _eraseButton; - private readonly LineEdit _searchBar; - private readonly OptionButton _category; - private readonly TextureRect _targetTexture; - private readonly RichTextLabel _targetName; - private readonly RichTextLabel _targetDescription; - public ConstructionMenu() { IoCManager.InjectDependencies(this); + RobustXamlLoader.Load(this); _placementManager.PlacementChanged += PlacementChanged; - Title = "Construction"; + Title = Loc.GetString("Construction"); - var hbox = new HBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand}; + BuildButton.Text = Loc.GetString("Place construction ghost"); + RecipesList.OnItemSelected += RecipeSelected; + RecipesList.OnItemDeselected += RecipeDeselected; - var recipeContainer = new VBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.45f}; + SearchBar.OnTextChanged += SearchTextChanged; + Category.OnItemSelected += CategorySelected; - var searchContainer = new HBoxContainer() {SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.1f}; - _searchBar = new LineEdit() {PlaceHolder = "Search", SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.6f}; - _category = new OptionButton() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.4f}; - - _recipes = new ItemList() {SelectMode = ItemList.ItemListSelectMode.Single, SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.9f}; - - var spacer = new Control() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.05f}; - - var stepsContainer = new VBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.45f}; - var targetContainer = new HBoxContainer() {Align = BoxContainer.AlignMode.Center, SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.25f}; - _targetTexture = new TextureRect() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.15f, Stretch = TextureRect.StretchMode.KeepCentered}; - var targetInfoContainer = new VBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.85f}; - _targetName = new RichTextLabel() {SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.1f}; - _targetDescription = new RichTextLabel() {SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.9f}; - - _stepList = new ItemList() {SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.75f, SelectMode = ItemList.ItemListSelectMode.None}; - - var buttonContainer = new VBoxContainer() {SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.1f}; - _buildButton = new Button() {Disabled = true, ToggleMode = true, Text = Loc.GetString("Place construction ghost"), SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.5f}; - - var eraseContainer = new HBoxContainer() {SizeFlagsVertical = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.5f}; - _eraseButton = new Button() {Text = Loc.GetString("Eraser Mode"), ToggleMode = true, SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.7f}; - var clearButton = new Button() {Text = Loc.GetString("Clear All"), SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 0.3f}; - - recipeContainer.AddChild(searchContainer); - recipeContainer.AddChild(_recipes); - - searchContainer.AddChild(_searchBar); - searchContainer.AddChild(_category); - - targetInfoContainer.AddChild(_targetName); - targetInfoContainer.AddChild(_targetDescription); - - targetContainer.AddChild(_targetTexture); - targetContainer.AddChild(targetInfoContainer); - - stepsContainer.AddChild(targetContainer); - stepsContainer.AddChild(_stepList); - - eraseContainer.AddChild(_eraseButton); - eraseContainer.AddChild(clearButton); - - buttonContainer.AddChild(_buildButton); - buttonContainer.AddChild(eraseContainer); - - stepsContainer.AddChild(buttonContainer); - - hbox.AddChild(recipeContainer); - hbox.AddChild(spacer); - hbox.AddChild(stepsContainer); - Contents.AddChild(hbox); - - _recipes.OnItemSelected += RecipeSelected; - _recipes.OnItemDeselected += RecipeDeselected; - - _searchBar.OnTextChanged += SearchTextChanged; - _category.OnItemSelected += CategorySelected; - - _buildButton.OnToggled += BuildButtonToggled; - clearButton.OnPressed += ClearAllButtonPressed; - _eraseButton.OnToggled += EraseButtonToggled; + BuildButton.Text = Loc.GetString("Place construction ghost"); + BuildButton.OnToggled += BuildButtonToggled; + ClearButton.Text = Loc.GetString("Clear All"); + ClearButton.OnPressed += ClearAllButtonPressed; + EraseButton.Text = Loc.GetString("Eraser Mode"); + EraseButton.OnToggled += EraseButtonToggled; PopulateCategories(); PopulateAll(); @@ -129,15 +66,15 @@ namespace Content.Client.Construction private void PlacementChanged(object? sender, EventArgs e) { - _buildButton.Pressed = false; - _eraseButton.Pressed = false; + BuildButton.Pressed = false; + EraseButton.Pressed = false; } private void PopulateAll() { foreach (var recipe in _prototypeManager.EnumeratePrototypes()) { - _recipes.Add(GetItem(recipe, _recipes)); + RecipesList.Add(GetItem(recipe, RecipesList)); } } @@ -155,7 +92,7 @@ namespace Content.Client.Construction private void PopulateBy(string search, string category) { - _recipes.Clear(); + RecipesList.Clear(); foreach (var recipe in _prototypeManager.EnumeratePrototypes()) { @@ -171,7 +108,7 @@ namespace Content.Client.Construction continue; } - _recipes.Add(GetItem(recipe, _recipes)); + RecipesList.Add(GetItem(recipe, RecipesList)); } } @@ -190,7 +127,7 @@ namespace Content.Client.Construction uniqueCategories.Add(category); } - _category.Clear(); + Category.Clear(); var array = uniqueCategories.ToArray(); Array.Sort(array); @@ -198,7 +135,7 @@ namespace Content.Client.Construction for (var i = 0; i < array.Length; i++) { var category = array[i]; - _category.AddItem(category, i); + Category.AddItem(category, i); } _categories = array; @@ -210,11 +147,11 @@ namespace Content.Client.Construction var isItem = prototype.Type == ConstructionType.Item; - _buildButton.Disabled = false; - _buildButton.Text = Loc.GetString(!isItem ? "Place construction ghost" : "Craft"); - _targetName.SetMessage(prototype.Name); - _targetDescription.SetMessage(prototype.Description); - _targetTexture.Texture = prototype.Icon.Frame0(); + BuildButton.Disabled = false; + BuildButton.Text = Loc.GetString(!isItem ? "Place construction ghost" : "Craft"); + TargetName.SetMessage(prototype.Name); + TargetDesc.SetMessage(prototype.Description); + TargetTexture.Texture = prototype.Icon.Frame0(); if (!_prototypeManager.TryIndex(prototype.Graph, out ConstructionGraphPrototype graph)) return; @@ -295,7 +232,7 @@ namespace Content.Client.Construction if (firstNode) { - _stepList.AddItem(isItem + StepList.AddItem(isItem ? Loc.GetString($"{stepNumber++}. To craft this item, you need:") : Loc.GetString($"{stepNumber++}. To build this, first you need:")); } @@ -307,7 +244,7 @@ namespace Content.Client.Construction switch (step) { case MaterialConstructionGraphStep materialStep: - _stepList.AddItem( + StepList.AddItem( !firstNode ? Loc.GetString( "{0}. Add {1}x {2}.", stepNumber++, materialStep.Amount, materialStep.Material) @@ -316,20 +253,20 @@ namespace Content.Client.Construction break; case ToolConstructionGraphStep toolStep: - _stepList.AddItem(Loc.GetString("{0}. Use a {1}.", stepNumber++, toolStep.Tool.GetToolName()), icon); + StepList.AddItem(Loc.GetString("{0}. Use a {1}.", stepNumber++, toolStep.Tool.GetToolName()), icon); break; case PrototypeConstructionGraphStep prototypeStep: - _stepList.AddItem(Loc.GetString("{0}. Add {1}.", stepNumber++, prototypeStep.Name), icon); + StepList.AddItem(Loc.GetString("{0}. Add {1}.", stepNumber++, prototypeStep.Name), icon); break; case ComponentConstructionGraphStep componentStep: - _stepList.AddItem(Loc.GetString("{0}. Add {1}.", stepNumber++, componentStep.Name), icon); + StepList.AddItem(Loc.GetString("{0}. Add {1}.", stepNumber++, componentStep.Name), icon); break; case NestedConstructionGraphStep nestedStep: var parallelNumber = 1; - _stepList.AddItem(Loc.GetString("{0}. In parallel...", stepNumber++)); + StepList.AddItem(Loc.GetString("{0}. In parallel...", stepNumber++)); foreach (var steps in nestedStep.Steps) { @@ -343,19 +280,19 @@ namespace Content.Client.Construction { case MaterialConstructionGraphStep materialStep: if (!isItem) - _stepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}x {4}.", stepNumber, parallelNumber, subStepNumber++, materialStep.Amount, materialStep.Material), icon); + StepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}x {4}.", stepNumber, parallelNumber, subStepNumber++, materialStep.Amount, materialStep.Material), icon); break; case ToolConstructionGraphStep toolStep: - _stepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Use a {3}.", stepNumber, parallelNumber, subStepNumber++, toolStep.Tool.GetToolName()), icon); + StepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Use a {3}.", stepNumber, parallelNumber, subStepNumber++, toolStep.Tool.GetToolName()), icon); break; case PrototypeConstructionGraphStep prototypeStep: - _stepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}.", stepNumber, parallelNumber, subStepNumber++, prototypeStep.Name), icon); + StepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}.", stepNumber, parallelNumber, subStepNumber++, prototypeStep.Name), icon); break; case ComponentConstructionGraphStep componentStep: - _stepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}.", stepNumber, parallelNumber, subStepNumber++, componentStep.Name), icon); + StepList.AddItem(Loc.GetString(" {0}.{1}.{2}. Add {3}.", stepNumber, parallelNumber, subStepNumber++, componentStep.Name), icon); break; } } @@ -373,11 +310,11 @@ namespace Content.Client.Construction private void ClearInfo() { - _buildButton.Disabled = true; - _targetName.SetMessage(string.Empty); - _targetDescription.SetMessage(string.Empty); - _targetTexture.Texture = null; - _stepList.Clear(); + BuildButton.Disabled = true; + TargetName.SetMessage(string.Empty); + TargetDesc.SetMessage(string.Empty); + TargetTexture.Texture = null; + StepList.Clear(); } private void RecipeSelected(ItemList.ItemListSelectedEventArgs obj) @@ -394,13 +331,13 @@ namespace Content.Client.Construction private void CategorySelected(OptionButton.ItemSelectedEventArgs obj) { - _category.SelectId(obj.Id); - PopulateBy(_searchBar.Text, _categories[obj.Id]); + Category.SelectId(obj.Id); + PopulateBy(SearchBar.Text, _categories[obj.Id]); } private void SearchTextChanged(LineEdit.LineEditEventArgs obj) { - PopulateBy(_searchBar.Text, _categories[_category.SelectedId]); + PopulateBy(SearchBar.Text, _categories[Category.SelectedId]); } private void BuildButtonToggled(BaseButton.ButtonToggledEventArgs args) @@ -414,7 +351,7 @@ namespace Content.Client.Construction if (_selected.Type == ConstructionType.Item) { constructSystem.TryStartItemConstruction(_selected.ID); - _buildButton.Pressed = false; + BuildButton.Pressed = false; return; } @@ -429,14 +366,14 @@ namespace Content.Client.Construction _placementManager.Clear(); } - _buildButton.Pressed = args.Pressed; + BuildButton.Pressed = args.Pressed; } private void EraseButtonToggled(BaseButton.ButtonToggledEventArgs args) { if (args.Pressed) _placementManager.Clear(); _placementManager.ToggleEraserHijacked(new ConstructionPlacementHijack(_systemManager.GetEntitySystem(), null)); - _eraseButton.Pressed = args.Pressed; + EraseButton.Pressed = args.Pressed; } private void ClearAllButtonPressed(BaseButton.ButtonEventArgs obj) From 76fba70db1856ff5225b8005993efde941e87be7 Mon Sep 17 00:00:00 2001 From: Paul Date: Fri, 18 Dec 2020 01:00:04 +0100 Subject: [PATCH 4/7] things --- Content.Client/Construction/ConstructionMenu.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Content.Client/Construction/ConstructionMenu.xaml.cs b/Content.Client/Construction/ConstructionMenu.xaml.cs index 928c8ac9d1..ccb631586f 100644 --- a/Content.Client/Construction/ConstructionMenu.xaml.cs +++ b/Content.Client/Construction/ConstructionMenu.xaml.cs @@ -7,6 +7,7 @@ using Content.Client.Utility; using Content.Shared.Construction; using Content.Shared.GameObjects.Components; using Content.Shared.GameObjects.Components.Interactable; +using Robust.Client.AutoGenerated; using Robust.Client.Graphics; using Robust.Client.Interfaces.Placement; using Robust.Client.Interfaces.ResourceManagement; From df81912e45c79bc52a11ae6c9ade8bfbe24b9710 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 19 Dec 2020 12:59:53 +0100 Subject: [PATCH 5/7] stuff --- Content.Client/Content.Client.csproj | 4 ++-- SpaceStation14.sln | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Content.Client/Content.Client.csproj b/Content.Client/Content.Client.csproj index 3efa621c2c..73ae92a47a 100644 --- a/Content.Client/Content.Client.csproj +++ b/Content.Client/Content.Client.csproj @@ -33,7 +33,7 @@ OptionsMenu.cs - + %(Filename) @@ -43,7 +43,7 @@ - + diff --git a/SpaceStation14.sln b/SpaceStation14.sln index 0095624659..6fc157b592 100644 --- a/SpaceStation14.sln +++ b/SpaceStation14.sln @@ -74,6 +74,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Robust.Physics", "RobustToo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robust.LoaderApi", "RobustToolbox\Robust.LoaderApi\Robust.LoaderApi\Robust.LoaderApi.csproj", "{1FAE651D-29D8-437A-9864-47CE0D180016}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robust.Client.NameGenerator", "RobustToolbox\Robust.Client.NameGenerator\Robust.Client.NameGenerator.csproj", "{3CFEB7DB-12C6-46F3-89FC-1450F3016FFA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robust.Client.Injectors", "RobustToolbox\Robust.Client.Injectors\Robust.Client.Injectors.csproj", "{8922428F-17C3-47A7-BFE9-570DEB2464DA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -154,6 +158,14 @@ Global {1FAE651D-29D8-437A-9864-47CE0D180016}.Debug|Any CPU.Build.0 = Debug|Any CPU {1FAE651D-29D8-437A-9864-47CE0D180016}.Release|Any CPU.ActiveCfg = Release|Any CPU {1FAE651D-29D8-437A-9864-47CE0D180016}.Release|Any CPU.Build.0 = Release|Any CPU + {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA}.Release|Any CPU.Build.0 = Release|Any CPU + {8922428F-17C3-47A7-BFE9-570DEB2464DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8922428F-17C3-47A7-BFE9-570DEB2464DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8922428F-17C3-47A7-BFE9-570DEB2464DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8922428F-17C3-47A7-BFE9-570DEB2464DA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -173,6 +185,8 @@ Global {7B9472D3-79D4-48D1-9B22-BCDE518FE842} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} {3BC34700-882F-426B-82BB-56D5708B5E0D} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} {1FAE651D-29D8-437A-9864-47CE0D180016} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} + {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} + {8922428F-17C3-47A7-BFE9-570DEB2464DA} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AA37ED9F-F8D6-468E-A101-658AD605B09A} From d0c7cfdbdcc5b3b3596c9197a3e7eb218305968c Mon Sep 17 00:00:00 2001 From: Paul Date: Sun, 20 Dec 2020 21:47:46 +0100 Subject: [PATCH 6/7] targets file --- Content.Client/Content.Client.csproj | 23 +---------------------- SpaceStation14.sln | 1 + 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Content.Client/Content.Client.csproj b/Content.Client/Content.Client.csproj index 73ae92a47a..489f0952cc 100644 --- a/Content.Client/Content.Client.csproj +++ b/Content.Client/Content.Client.csproj @@ -34,26 +34,5 @@ - - - %(Filename) - - - - - - - - - - - - - - $(IntermediateOutputPath)XAML/references - $(IntermediateOutputPath)XAML/original.dll - - - - + diff --git a/SpaceStation14.sln b/SpaceStation14.sln index 6fc157b592..b83df1d403 100644 --- a/SpaceStation14.sln +++ b/SpaceStation14.sln @@ -49,6 +49,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MSBuild", "MSBuild", "{5040 RobustToolbox\MSBuild\Robust.DefineConstants.targets = RobustToolbox\MSBuild\Robust.DefineConstants.targets RobustToolbox\MSBuild\Robust.Engine.targets = RobustToolbox\MSBuild\Robust.Engine.targets RobustToolbox\MSBuild\Robust.Properties.targets = RobustToolbox\MSBuild\Robust.Properties.targets + RobustToolbox\MSBuild\XamlIL.targets = RobustToolbox\MSBuild\XamlIL.targets EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{806ED41A-411B-4B3B-BEB6-DEC6DCA4C205}" From e6444a1d8042361d9575870e68e52a19acff350f Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Mon, 21 Dec 2020 04:14:36 +0100 Subject: [PATCH 7/7] Update submodule, statushost changes, fix missing projects to sln --- Content.Server/MoMMILink.cs | 15 +++++++-------- RobustToolbox | 2 +- SpaceStation14.sln | 31 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 9 deletions(-) diff --git a/Content.Server/MoMMILink.cs b/Content.Server/MoMMILink.cs index facd9ce93f..fb944a5525 100644 --- a/Content.Server/MoMMILink.cs +++ b/Content.Server/MoMMILink.cs @@ -8,7 +8,6 @@ using Content.Server.Interfaces.Chat; using Content.Shared; using Newtonsoft.Json; using Robust.Server.Interfaces.ServerStatus; -using Robust.Server.ServerStatus; using Robust.Shared.Asynchronous; using Robust.Shared.Interfaces.Configuration; using Robust.Shared.IoC; @@ -73,9 +72,9 @@ namespace Content.Server } } - private bool _handleChatPost(HttpMethod method, HttpListenerRequest request, HttpListenerResponse response) + private bool _handleChatPost(IStatusHandlerContext context) { - if (method != HttpMethod.Post || request.Url!.AbsolutePath != "/ooc") + if (context.RequestMethod != HttpMethod.Post || context.Url!.AbsolutePath != "/ooc") { return false; } @@ -84,14 +83,14 @@ namespace Content.Server if (string.IsNullOrEmpty(password)) { - response.StatusCode = (int) HttpStatusCode.Forbidden; + context.RespondError(HttpStatusCode.Forbidden); return true; } OOCPostMessage message = null; try { - message = request.GetFromJson(); + message = context.RequestBodyJson(); } catch (JsonSerializationException) { @@ -100,19 +99,19 @@ namespace Content.Server if (message == null) { - response.StatusCode = (int) HttpStatusCode.BadRequest; + context.RespondError(HttpStatusCode.BadRequest); return true; } if (message.Password != password) { - response.StatusCode = (int) HttpStatusCode.Forbidden; + context.RespondError(HttpStatusCode.Forbidden); return true; } _taskManager.RunOnMainThread(() => _chatManager.SendHookOOC(message.Sender, message.Contents)); - response.StatusCode = (int) HttpStatusCode.OK; + context.Respond("Success", HttpStatusCode.OK); return false; } diff --git a/RobustToolbox b/RobustToolbox index 58560f589f..feaa69f825 160000 --- a/RobustToolbox +++ b/RobustToolbox @@ -1 +1 @@ -Subproject commit 58560f589f6defe7e092cecd71b2353d26a2220d +Subproject commit feaa69f825f452a016d9eba169009d1d4f20b8ef diff --git a/SpaceStation14.sln b/SpaceStation14.sln index b83df1d403..9736962bea 100644 --- a/SpaceStation14.sln +++ b/SpaceStation14.sln @@ -79,6 +79,16 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robust.Client.NameGenerator EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Robust.Client.Injectors", "RobustToolbox\Robust.Client.Injectors\Robust.Client.Injectors.csproj", "{8922428F-17C3-47A7-BFE9-570DEB2464DA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.HttpListener", "RobustToolbox\ManagedHttpListener\src\System.Net.HttpListener.csproj", "{3429ACDA-F32F-4710-90F5-8C6DF4800304}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlX.IL.Cecil", "RobustToolbox\XamlX\src\XamlX.IL.Cecil\XamlX.IL.Cecil.csproj", "{16F7DE32-0186-44B9-9345-0C20D1BF2422}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "XamlX", "XamlX", "{AFF53804-115F-4E67-B81F-26265EA27880}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlX", "RobustToolbox\XamlX\src\XamlX\XamlX.csproj", "{23F09C45-950E-4DB7-A465-E937450FF008}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamlX.Runtime", "RobustToolbox\XamlX\src\XamlX.Runtime\XamlX.Runtime.csproj", "{440426C1-8DCA-43F6-967F-94439B8DAF47}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -167,6 +177,22 @@ Global {8922428F-17C3-47A7-BFE9-570DEB2464DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {8922428F-17C3-47A7-BFE9-570DEB2464DA}.Release|Any CPU.ActiveCfg = Release|Any CPU {8922428F-17C3-47A7-BFE9-570DEB2464DA}.Release|Any CPU.Build.0 = Release|Any CPU + {3429ACDA-F32F-4710-90F5-8C6DF4800304}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3429ACDA-F32F-4710-90F5-8C6DF4800304}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3429ACDA-F32F-4710-90F5-8C6DF4800304}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3429ACDA-F32F-4710-90F5-8C6DF4800304}.Release|Any CPU.Build.0 = Release|Any CPU + {16F7DE32-0186-44B9-9345-0C20D1BF2422}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16F7DE32-0186-44B9-9345-0C20D1BF2422}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16F7DE32-0186-44B9-9345-0C20D1BF2422}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16F7DE32-0186-44B9-9345-0C20D1BF2422}.Release|Any CPU.Build.0 = Release|Any CPU + {23F09C45-950E-4DB7-A465-E937450FF008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {23F09C45-950E-4DB7-A465-E937450FF008}.Debug|Any CPU.Build.0 = Debug|Any CPU + {23F09C45-950E-4DB7-A465-E937450FF008}.Release|Any CPU.ActiveCfg = Release|Any CPU + {23F09C45-950E-4DB7-A465-E937450FF008}.Release|Any CPU.Build.0 = Release|Any CPU + {440426C1-8DCA-43F6-967F-94439B8DAF47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {440426C1-8DCA-43F6-967F-94439B8DAF47}.Debug|Any CPU.Build.0 = Debug|Any CPU + {440426C1-8DCA-43F6-967F-94439B8DAF47}.Release|Any CPU.ActiveCfg = Release|Any CPU + {440426C1-8DCA-43F6-967F-94439B8DAF47}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -188,6 +214,11 @@ Global {1FAE651D-29D8-437A-9864-47CE0D180016} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} {3CFEB7DB-12C6-46F3-89FC-1450F3016FFA} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} {8922428F-17C3-47A7-BFE9-570DEB2464DA} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} + {3429ACDA-F32F-4710-90F5-8C6DF4800304} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} + {AFF53804-115F-4E67-B81F-26265EA27880} = {83B4CBBA-547A-42F0-A7CD-8A67D93196CE} + {16F7DE32-0186-44B9-9345-0C20D1BF2422} = {AFF53804-115F-4E67-B81F-26265EA27880} + {23F09C45-950E-4DB7-A465-E937450FF008} = {AFF53804-115F-4E67-B81F-26265EA27880} + {440426C1-8DCA-43F6-967F-94439B8DAF47} = {AFF53804-115F-4E67-B81F-26265EA27880} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AA37ED9F-F8D6-468E-A101-658AD605B09A}