From be495f274c78241802081d94aeff0d05fd1078b9 Mon Sep 17 00:00:00 2001 From: Ed <96445749+TheShuEd@users.noreply.github.com> Date: Wed, 14 May 2025 12:43:43 +0300 Subject: [PATCH 01/47] Skill progression system (#1263) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * delete skill trees * Revert "delete skill trees" This reverts commit 9d7fae73c4c0cc46df5a82dfecb385fd86509638. * learning refactor * UI tweaks * sword mastery skill * telegraphy * rapier mastery * research table ui * finish studing * polish UI researching * pyrokinetic * more skill tree working * heat adapt * alchemist and metamagic update * skill multiple effects support + metamagic bugg manapool * impossible 😢 * skimitar gaming * skimidi * blacksmithing branch * remove research restrictions * remove species magic buff * fix loc * Update thaumaturgy.yml * pip * Delete skill_tree.yml --- .../CP14ResearchRecipeControl.xaml | 14 ++ .../CP14ResearchRecipeControl.xaml.cs | 60 +++++ .../CP14ResearchTableBoundUserInterface.cs | 34 +++ .../CP14ResearchTableWindow.xaml | 72 ++++++ .../CP14ResearchTableWindow.xaml.cs | 235 ++++++++++++++++++ .../Skill/Ui/CP14SkillTreeButtonControl.xaml | 10 +- .../Ui/CP14SkillTreeButtonControl.xaml.cs | 13 +- .../Systems/Skill/CP14SkillUIController.cs | 43 ++-- .../Systems/Skill/Window/CP14SkillWindow.xaml | 5 - .../CP14WorkbenchRecipeControl.xaml.cs | 50 ++-- .../CP14WorkbenchRequirementControl.cs | 49 ++++ .../CP14WorkbenchRequirementControl.xaml.cs | 65 ----- .../_CP14/Workbench/CP14WorkbenchWindow.xaml | 6 +- .../_CP14/ResearchTable/CP14ResearchSystem.cs | 199 +++++++++++++++ .../_CP14/Workbench/CP14WorkbenchSystem.UI.cs | 5 +- .../_CP14/Workbench/CP14WorkbenchSystem.cs | 4 +- .../Preferences/Loadouts/LoadoutPrototype.cs | 2 +- .../Station/SharedStationSpawningSystem.cs | 4 +- .../SharedCP14MagicEnergySystem.cs | 24 +- .../CP14MagicManacostModifyComponent.cs | 3 + .../CP14MagicManacostModifySystem.cs | 15 +- .../CP14ResearchTableComponent.cs | 17 ++ .../ResearchTable/CP14SharedResearchSystem.cs | 19 ++ .../_CP14/Skill/CP14LearnSkillsSpecial.cs | 22 ++ .../_CP14/Skill/CP14ResearchTableUI.cs | 61 +++++ .../_CP14/Skill/CP14SharedSkillSystem.cs | 104 +++----- .../_CP14/Skill/CP14SkillSystem.Admin.cs | 45 ---- .../_CP14/Skill/CP14SkillSystem.Checks.cs | 75 ++++++ .../_CP14/Skill/CP14SkillSystem.Learning.cs | 48 ---- .../CP14MeleeWeaponSkillRequiredComponent.cs | 31 +++ .../Components/CP14SkillStorageComponent.cs | 17 +- .../_CP14/Skill/Effects/AddAction.cs | 3 +- .../_CP14/Skill/Effects/AddComponents.cs | 31 +++ .../_CP14/Skill/Effects/AddMaxMana.cs | 33 +++ .../_CP14/Skill/Effects/CP14SkillEffect.cs | 3 +- .../_CP14/Skill/Effects/ModifyManacost.cs | 78 ++++++ .../_CP14/Skill/Effects/ReplaceAction.cs | 3 +- .../_CP14/Skill/Effects/UnlockRecipes.cs | 65 +++++ .../Skill/Prototypes/CP14SkillPrototype.cs | 6 +- .../Restrictions/CP14SkillRestriction.cs | 3 +- .../_CP14/Skill/Restrictions/Impossible.cs | 18 ++ .../Skill/Restrictions/NeedPrerequisite.cs | 2 +- .../_CP14/Skill/Restrictions/Researched.cs | 26 ++ .../Skill/Restrictions/SpeciesWhitelist.cs | 3 +- ...System.cs => CP14SharedWorkbenchSystem.cs} | 2 +- .../Requirements/MaterialResource.cs | 3 +- .../Workbench/Requirements/ProtoIdResource.cs | 3 +- ...{KnowledgeRequired.cs => SkillRequired.cs} | 3 +- .../Requirements/StackGroupResource.cs | 3 +- .../Workbench/Requirements/StackResource.cs | 3 +- .../Workbench/Requirements/TagResource.cs | 3 +- .../Workbench/WorkbenchCraftRequirement.cs | 3 +- Resources/Locale/en-US/_CP14/recipe/title.ftl | 1 + .../Locale/en-US/_CP14/skill/requirements.ftl | 6 +- .../Locale/en-US/_CP14/skill/skill_issue.ftl | 3 + .../Locale/en-US/_CP14/skill/skill_meta.ftl | 34 +++ .../Locale/en-US/_CP14/skill/skill_tree.ftl | 23 +- Resources/Locale/en-US/_CP14/skill/ui.ftl | 12 +- Resources/Locale/ru-RU/_CP14/recipe/title.ftl | 1 + .../Locale/ru-RU/_CP14/skill/requirements.ftl | 6 +- .../Locale/ru-RU/_CP14/skill/skill_issue.ftl | 3 + .../Locale/ru-RU/_CP14/skill/skill_meta.ftl | 34 +++ .../Locale/ru-RU/_CP14/skill/skill_tree.ftl | 11 + Resources/Locale/ru-RU/_CP14/skill/ui.ftl | 12 +- Resources/Maps/_CP14/Frigid_Coast.yml | 7 - .../_CP14/Catalog/Fills/closets.yml | 1 - .../_CP14/Catalog/Fills/dresser.yml | 4 - .../Actions/Spells/Fire/fire_rune.yml | 98 -------- .../Entities/Actions/Spells/Fire/fireball.yml | 3 +- .../Actions/Spells/Fire/flame_creation.yml | 1 + .../Actions/Spells/Fire/hell_ballade.yml | 1 + .../Spells/Fire/tiefling_inner_fire.yml | 1 + .../Life/{T0_cure_heat.yml => cure_heat.yml} | 1 + .../{T0_cure_poison.yml => cure_poison.yml} | 1 + .../{T0_cure_wounds.yml => cure_wounds.yml} | 1 + .../{T0_heal_ballade.yml => heal_ballade.yml} | 1 + .../Spells/Life/magical_acceleration.yml | 1 + ...T0_peace_ballade.yml => peace_ballade.yml} | 1 + .../{T0_plant_growth.yml => plant_growth.yml} | 1 + .../resurrection.yml} | 1 + .../Actions/Spells/Life/sheep_polymorph.yml | 1 + ...T0_speed_ballade.yml => speed_ballade.yml} | 1 + .../{T1_flash_light.yml => flash_light.yml} | 1 + .../{T1_signal_light.yml => signal_light.yml} | 1 + ...phere_of_light.yml => sphere_of_light.yml} | 1 + .../Actions/Spells/Water/beer_creation.yml | 1 + .../Entities/Actions/Spells/Water/freeze.yml | 1 + .../Actions/Spells/Water/ice_arrow.yml | 9 +- .../Actions/Spells/Water/ice_dagger.yml | 5 +- .../Actions/Spells/Water/ice_shards.yml | 1 + .../Actions/Spells/Water/water_creation.yml | 1 + .../_CP14/Entities/Mobs/Species/carcat.yml | 3 - .../_CP14/Entities/Mobs/Species/elf.yml | 3 - .../_CP14/Entities/Mobs/Species/silva.yml | 3 - .../_CP14/Entities/Mobs/Species/tiefling.yml | 3 - .../Objects/ModularTools/Blade/skimitar.yml | 78 ++++++ .../Objects/Specific/Thaumaturgy/crystal.yml | 3 + .../Structures/Furniture/research_table.yml | 57 +++++ .../_CP14/Loadouts/role_loadouts.yml | 10 - .../Prototypes/_CP14/Loadouts/skill_tree.yml | 119 --------- .../_CP14/ModularCraft/Blade/rapier.yml | 5 +- .../_CP14/ModularCraft/Blade/sickle.yml | 2 +- .../_CP14/ModularCraft/Blade/skimitar.yml | 87 +++++++ .../_CP14/ModularCraft/Blade/spear.yml | 1 + .../_CP14/ModularCraft/Blade/sword.yml | 3 + .../_CP14/Recipes/Workbench/Anvil/misc.yml | 77 ++++++ .../Workbench/Anvil/modular_aventail.yml | 24 ++ .../Recipes/Workbench/Anvil/modular_blade.yml | 216 +++++++++++++++- .../Workbench/Anvil/modular_breastplate.yml | 36 +++ .../Workbench/Anvil/modular_cuisses.yml | 24 ++ .../Recipes/Workbench/Anvil/modular_garde.yml | 24 ++ .../Workbench/Anvil/modular_greave.yml | 24 ++ .../Workbench/Anvil/modular_helmet.yml | 24 ++ .../Recipes/Workbench/Anvil/modular_tip.yml | 12 + .../Recipes/Workbench/Anvil/modular_visor.yml | 24 ++ .../_CP14/Recipes/Workbench/furnace.yml | 39 +++ .../_CP14/Roles/Jobs/Artisan/alchemist.yml | 7 + .../_CP14/Roles/Jobs/Artisan/apprentice.yml | 5 + .../_CP14/Roles/Jobs/Artisan/blacksmith.yml | 8 + Resources/Prototypes/_CP14/Skill/atlethic.yml | 9 +- .../Prototypes/_CP14/Skill/blacksmithing.yml | 69 +++++ .../Prototypes/_CP14/Skill/dimension.yml | 63 ++--- Resources/Prototypes/_CP14/Skill/healing.yml | 166 +++++++++---- .../Prototypes/_CP14/Skill/hydrosophistry.yml | 113 +++++++-- Resources/Prototypes/_CP14/Skill/illusion.yml | 118 +++++++-- .../Prototypes/_CP14/Skill/martial_arts.yml | 29 +++ .../Prototypes/_CP14/Skill/metamagic.yml | 101 ++++++-- .../Prototypes/_CP14/Skill/pyrokinetic.yml | 94 ++++++- .../Prototypes/_CP14/Skill/skill_tree.yml | 35 ++- .../Prototypes/_CP14/Skill/thaumaturgy.yml | 15 ++ Resources/Prototypes/_CP14/tags.yml | 3 + .../_CP14/Actions/skill_tree.rsi/heal.png | Bin 299 -> 285 bytes .../_CP14/Actions/skill_tree.rsi/heal2.png | Bin 0 -> 323 bytes .../_CP14/Actions/skill_tree.rsi/heal3.png | Bin 0 -> 497 bytes .../_CP14/Actions/skill_tree.rsi/light.png | Bin 248 -> 265 bytes .../_CP14/Actions/skill_tree.rsi/light2.png | Bin 0 -> 272 bytes .../_CP14/Actions/skill_tree.rsi/light3.png | Bin 0 -> 363 bytes .../_CP14/Actions/skill_tree.rsi/martial.png | Bin 0 -> 490 bytes .../_CP14/Actions/skill_tree.rsi/meta.json | 33 +++ .../_CP14/Actions/skill_tree.rsi/meta.png | Bin 503 -> 392 bytes .../_CP14/Actions/skill_tree.rsi/meta2.png | Bin 0 -> 503 bytes .../_CP14/Actions/skill_tree.rsi/meta3.png | Bin 0 -> 704 bytes .../_CP14/Actions/skill_tree.rsi/pyro2.png | Bin 0 -> 453 bytes .../_CP14/Actions/skill_tree.rsi/pyro3.png | Bin 0 -> 604 bytes .../_CP14/Actions/skill_tree.rsi/water.png | Bin 332 -> 274 bytes .../_CP14/Actions/skill_tree.rsi/water2.png | Bin 0 -> 332 bytes .../_CP14/Actions/skill_tree.rsi/water3.png | Bin 0 -> 477 bytes .../Objects/Bureaucracy/inkwell.rsi/icon.png | Bin 296 -> 286 bytes .../Blade/Rapier/metall_rapier.rsi/meta.json | 3 + .../Rapier/metall_rapier.rsi/preview.png | Bin 0 -> 426 bytes .../metall_skimitar.rsi/equipped-BELT1.png | Bin 0 -> 377 bytes .../metall_skimitar.rsi/equipped-BELT2.png | Bin 0 -> 356 bytes .../metall_skimitar.rsi/equipped-NECK.png | Bin 0 -> 316 bytes .../Skimitar/metall_skimitar.rsi/icon.png | Bin 0 -> 443 bytes .../metall_skimitar.rsi/inhand-left.png | Bin 0 -> 655 bytes .../metall_skimitar.rsi/inhand-right.png | Bin 0 -> 657 bytes .../Skimitar/metall_skimitar.rsi/meta.json | 45 ++++ .../Skimitar/metall_skimitar.rsi/preview.png | Bin 0 -> 527 bytes .../wielded-inhand-left.png | Bin 0 -> 682 bytes .../wielded-inhand-right.png | Bin 0 -> 674 bytes .../Blade/Sword/metall_sword.rsi/meta.json | 3 + .../Blade/Sword/metall_sword.rsi/preview.png | Bin 0 -> 581 bytes .../Furniture/workbench.rsi/furnace.png | Bin 412 -> 0 bytes .../Furniture/workbench.rsi/meta.json | 4 +- .../workbench.rsi/research_table.png | Bin 0 -> 1516 bytes 165 files changed, 2987 insertions(+), 778 deletions(-) create mode 100644 Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml create mode 100644 Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml.cs create mode 100644 Content.Client/_CP14/ResearchTable/CP14ResearchTableBoundUserInterface.cs create mode 100644 Content.Client/_CP14/ResearchTable/CP14ResearchTableWindow.xaml create mode 100644 Content.Client/_CP14/ResearchTable/CP14ResearchTableWindow.xaml.cs create mode 100644 Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.cs delete mode 100644 Content.Client/_CP14/Workbench/CP14WorkbenchRequirementControl.xaml.cs create mode 100644 Content.Server/_CP14/ResearchTable/CP14ResearchSystem.cs create mode 100644 Content.Shared/_CP14/ResearchTable/CP14ResearchTableComponent.cs create mode 100644 Content.Shared/_CP14/ResearchTable/CP14SharedResearchSystem.cs create mode 100644 Content.Shared/_CP14/Skill/CP14LearnSkillsSpecial.cs create mode 100644 Content.Shared/_CP14/Skill/CP14ResearchTableUI.cs create mode 100644 Content.Shared/_CP14/Skill/CP14SkillSystem.Checks.cs delete mode 100644 Content.Shared/_CP14/Skill/CP14SkillSystem.Learning.cs create mode 100644 Content.Shared/_CP14/Skill/Components/CP14MeleeWeaponSkillRequiredComponent.cs create mode 100644 Content.Shared/_CP14/Skill/Effects/AddComponents.cs create mode 100644 Content.Shared/_CP14/Skill/Effects/AddMaxMana.cs create mode 100644 Content.Shared/_CP14/Skill/Effects/ModifyManacost.cs create mode 100644 Content.Shared/_CP14/Skill/Effects/UnlockRecipes.cs create mode 100644 Content.Shared/_CP14/Skill/Restrictions/Impossible.cs create mode 100644 Content.Shared/_CP14/Skill/Restrictions/Researched.cs rename Content.Shared/_CP14/Workbench/{SharedCP14WorkbenchSystem.cs => CP14SharedWorkbenchSystem.cs} (90%) rename Content.Shared/_CP14/Workbench/Requirements/{KnowledgeRequired.cs => SkillRequired.cs} (95%) create mode 100644 Resources/Locale/en-US/_CP14/skill/skill_issue.ftl create mode 100644 Resources/Locale/en-US/_CP14/skill/skill_meta.ftl create mode 100644 Resources/Locale/ru-RU/_CP14/skill/skill_issue.ftl create mode 100644 Resources/Locale/ru-RU/_CP14/skill/skill_meta.ftl delete mode 100644 Resources/Prototypes/_CP14/Entities/Actions/Spells/Fire/fire_rune.yml rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/{T0_cure_heat.yml => cure_heat.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/{T0_cure_poison.yml => cure_poison.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/{T0_cure_wounds.yml => cure_wounds.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/{T0_heal_ballade.yml => heal_ballade.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/{T0_peace_ballade.yml => peace_ballade.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/{T0_plant_growth.yml => plant_growth.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/{Death/T1_resurrection.yml => Life/resurrection.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Life/{T0_speed_ballade.yml => speed_ballade.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Light/{T1_flash_light.yml => flash_light.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Light/{T1_signal_light.yml => signal_light.yml} (99%) rename Resources/Prototypes/_CP14/Entities/Actions/Spells/Light/{T0_sphere_of_light.yml => sphere_of_light.yml} (99%) create mode 100644 Resources/Prototypes/_CP14/Entities/Objects/ModularTools/Blade/skimitar.yml create mode 100644 Resources/Prototypes/_CP14/Entities/Structures/Furniture/research_table.yml delete mode 100644 Resources/Prototypes/_CP14/Loadouts/skill_tree.yml create mode 100644 Resources/Prototypes/_CP14/ModularCraft/Blade/skimitar.yml create mode 100644 Resources/Prototypes/_CP14/Skill/blacksmithing.yml create mode 100644 Resources/Prototypes/_CP14/Skill/martial_arts.yml create mode 100644 Resources/Prototypes/_CP14/Skill/thaumaturgy.yml create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/heal2.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/heal3.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/light2.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/light3.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/martial.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/meta2.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/meta3.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/pyro2.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/pyro3.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/water2.png create mode 100644 Resources/Textures/_CP14/Actions/skill_tree.rsi/water3.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Rapier/metall_rapier.rsi/preview.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/equipped-BELT1.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/equipped-BELT2.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/equipped-NECK.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/icon.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/inhand-left.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/inhand-right.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/meta.json create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/preview.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/wielded-inhand-left.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Skimitar/metall_skimitar.rsi/wielded-inhand-right.png create mode 100644 Resources/Textures/_CP14/Objects/ModularTools/Blade/Sword/metall_sword.rsi/preview.png delete mode 100644 Resources/Textures/_CP14/Structures/Furniture/workbench.rsi/furnace.png create mode 100644 Resources/Textures/_CP14/Structures/Furniture/workbench.rsi/research_table.png diff --git a/Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml b/Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml new file mode 100644 index 0000000000..de13384bfd --- /dev/null +++ b/Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml @@ -0,0 +1,14 @@ + + + diff --git a/Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml.cs b/Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml.cs new file mode 100644 index 0000000000..99b9de4a7d --- /dev/null +++ b/Content.Client/_CP14/ResearchTable/CP14ResearchRecipeControl.xaml.cs @@ -0,0 +1,60 @@ +using Content.Shared._CP14.Skill; +using Content.Shared._CP14.Skill.Prototypes; +using Robust.Client.AutoGenerated; +using Robust.Client.GameObjects; +using Robust.Client.UserInterface; +using Robust.Client.UserInterface.XAML; +using Robust.Shared.Prototypes; + +namespace Content.Client._CP14.ResearchTable; + +[GenerateTypedNameReferences] +public sealed partial class CP14ResearchRecipeControl : Control +{ + [Dependency] private readonly IEntityManager _entity = default!; + [Dependency] private readonly IPrototypeManager _prototype = default!; + + public event Action? OnResearch; + + private readonly SpriteSystem _sprite; + private readonly CP14SharedSkillSystem _skillSystem; + + private readonly CP14SkillPrototype _skillPrototype; + private readonly bool _craftable; + + public CP14ResearchRecipeControl(CP14ResearchUiEntry entry) + { + RobustXamlLoader.Load(this); + IoCManager.InjectDependencies(this); + + _sprite = _entity.System(); + _skillSystem = _entity.System(); + + _skillPrototype = _prototype.Index(entry.ProtoId); + _craftable = entry.Craftable; + + Button.OnPressed += _ => OnResearch?.Invoke(entry, _skillPrototype); + + UpdateColor(); + UpdateName(); + UpdateView(); + } + + private void UpdateColor() + { + if (_craftable) + return; + + Button.ModulateSelfOverride = Color.FromHex("#302622"); + } + + private void UpdateName() + { + Name.Text = $"{Loc.GetString(_skillSystem.GetSkillName(_skillPrototype))}" ; + } + + private void UpdateView() + { + View.Texture =_sprite.Frame0(_skillPrototype.Icon); + } +} diff --git a/Content.Client/_CP14/ResearchTable/CP14ResearchTableBoundUserInterface.cs b/Content.Client/_CP14/ResearchTable/CP14ResearchTableBoundUserInterface.cs new file mode 100644 index 0000000000..119e5d6063 --- /dev/null +++ b/Content.Client/_CP14/ResearchTable/CP14ResearchTableBoundUserInterface.cs @@ -0,0 +1,34 @@ +using Content.Shared._CP14.Skill; +using Robust.Client.UserInterface; + +namespace Content.Client._CP14.ResearchTable; + +public sealed class CP14ResearchTableBoundUserInterface : BoundUserInterface +{ + private CP14ResearchTableWindow? _window; + + public CP14ResearchTableBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) + { + } + + protected override void Open() + { + base.Open(); + + _window = this.CreateWindow(); + + _window.OnResearch += entry => SendMessage(new CP14ResearchMessage(entry.ProtoId)); + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + base.UpdateState(state); + + switch (state) + { + case CP14ResearchTableUiState recipesState: + _window?.UpdateState(recipesState); + break; + } + } +} diff --git a/Content.Client/_CP14/ResearchTable/CP14ResearchTableWindow.xaml b/Content.Client/_CP14/ResearchTable/CP14ResearchTableWindow.xaml new file mode 100644 index 0000000000..59a2e789bb --- /dev/null +++ b/Content.Client/_CP14/ResearchTable/CP14ResearchTableWindow.xaml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +