Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f4ddc5f
init
bynddark8 Jul 27, 2026
f87fba8
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Jul 27, 2026
8eabfab
whitespace
bynddark8 Jul 27, 2026
563bf37
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Jul 27, 2026
4357dcc
locale and weird namespace stuff
bynddark8 Jul 27, 2026
41fe104
namespace pt 2 and redundant guidebook entry
bynddark8 Jul 27, 2026
5f47d7e
Merge branch 'how-to-cook-for-40-spacemen' of https://github.com/bynd…
bynddark8 Jul 27, 2026
c31575e
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Jul 27, 2026
d83d17f
comment fixes and starlight namespace
bynddark8 Jul 30, 2026
aebe44a
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Jul 30, 2026
8f33d8f
partial class extension fix
bynddark8 Aug 2, 2026
530e607
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Aug 2, 2026
e5fd885
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Aug 2, 2026
260c47a
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Aug 4, 2026
cd4bb17
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Aug 7, 2026
1f951a4
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Aug 10, 2026
42e2907
starlight comment blocks correction
bynddark8 Aug 10, 2026
8740152
namespace + whitespace fixes
bynddark8 Aug 10, 2026
86416db
resharper
bynddark8 Aug 10, 2026
7c56261
Merge branch 'starlight-dev' into how-to-cook-for-40-spacemen
bynddark8 Aug 10, 2026
b45106a
test fail no 7
bynddark8 Aug 10, 2026
02443ca
whitespace + redundant tags
bynddark8 Aug 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 105 additions & 0 deletions Content.Client/Guidebook/Controls/GuideMicrowaveEmbed.xaml.cs
Comment thread
bynddark8 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using Content.Client.Guidebook.Richtext;
using Content.Client.Message;
using Content.Client.UserInterface.ControlExtensions;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.EntityEffects.Effects.EntitySpawning;
using Content.Shared.Kitchen;
using JetBrains.Annotations;
Comment thread
bynddark8 marked this conversation as resolved.
using Robust.Client.AutoGenerated;
Expand Down Expand Up @@ -197,4 +199,107 @@ private void GenerateControl(FoodRecipePrototype recipe)
GenerateCookTime(recipe);
GenerateDeviceType(recipe);
}

#region Starlight

public GuideMicrowaveEmbed(ReactionPrototype reaction) : this() => GenerateControl(reaction);

private void GenerateHeader(ReactionPrototype reaction)
{
if (TryGetPrimaryReactionResultEntity(reaction, out var resultEntity, out var amount))
{
RepresentedPrototype = resultEntity;
IconContainer.AddChild(new GuideEntityEmbed(resultEntity.ID, false, false));

var escapedResultName = FormattedMessage.EscapeText(resultEntity.Name);
ResultName.SetMarkup($"[bold]{escapedResultName}[/bold] x {amount}");
ResultDescription.SetMarkup(FormattedMessage.EscapeText(resultEntity.Description));
return;
}

ResultName.SetMarkup(FormattedMessage.EscapeText(reaction.ID));
ResultDescription.SetMarkup(string.Empty);
}

private bool TryGetPrimaryReactionResultEntity(ReactionPrototype reaction, out EntityPrototype resultEntity, out int amount)
{
foreach (var effect in reaction.Effects)
{
if (effect is not SpawnEntity spawn)
continue;

resultEntity = _prototype.Index<EntityPrototype>(spawn.Entity);
amount = Math.Max(1, spawn.Number);
return true;
}

resultEntity = default!;
amount = 0;
return false;
}

private void GenerateReactionIngredients(ReactionPrototype reaction)
{
foreach (var (reagentId, reactant) in reaction.Reactants.OrderByDescending(p => p.Value.Amount))
{
var reagent = _prototype.Index<ReagentPrototype>(reagentId);

var liquidColorMsg = new FormattedMessage();
liquidColorMsg.AddMarkupOrThrow(Loc.GetString("guidebook-microwave-reagent-color-display", ("color", reagent.SubstanceColor)));
liquidColorMsg.Pop();

var liquidColorLabel = new GuidebookRichPrototypeLink();
liquidColorLabel.SetMessage(liquidColorMsg);
liquidColorLabel.HorizontalAlignment = Control.HAlignment.Center;
liquidColorLabel.LinkedPrototype = reagent;
IngredientsGrid.AddChild(liquidColorLabel);

var liquidNameMsg = new FormattedMessage();
liquidNameMsg.AddMarkupOrThrow("[bold]");
liquidNameMsg.AddText(reagent.LocalizedName);
liquidNameMsg.AddMarkupOrThrow("[/bold]");
if (reactant.Catalyst)
{
liquidNameMsg.AddText(" ");
liquidNameMsg.AddText(Loc.GetString("guidebook-microwave-reagent-catalyst-label"));
}
Comment thread
bynddark8 marked this conversation as resolved.

var liquidNameLabel = new RichTextLabel();
liquidNameLabel.SetMessage(liquidNameMsg);
IngredientsGrid.AddChild(liquidNameLabel);

var liquidQuantityMsg = new FormattedMessage();
liquidQuantityMsg.AddMarkupOrThrow(Loc.GetString("guidebook-microwave-reagent-quantity-display", ("amount", reactant.Amount)));
liquidQuantityMsg.Pop();

var liquidQuantityLabel = new RichTextLabel();
liquidQuantityLabel.SetMessage(liquidQuantityMsg);
IngredientsGrid.AddChild(liquidQuantityLabel);
}
}

private void GenerateReactionCookTime()
{
var msg = new FormattedMessage();
msg.AddMarkupOrThrow(Loc.GetString("guidebook-microwave-cook-time", ("time", 0)));
msg.Pop();
CookTimeLabel.SetMessage(msg);
}

private void GenerateReactionDeviceType()
{
var msg = new FormattedMessage();
msg.AddMarkupOrThrow(Loc.GetString("guidebook-microwave-device-type", ("type", "Chemistry")));
msg.Pop();
DeviceTypeLabel.SetMessage(msg);
}

private void GenerateControl(ReactionPrototype reaction)
{
GenerateHeader(reaction);
GenerateReactionIngredients(reaction);
GenerateReactionCookTime();
GenerateReactionDeviceType();
}
#endregion
}
14 changes: 13 additions & 1 deletion Content.Client/Guidebook/Controls/GuideMicrowaveGroupEmbed.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Client.Guidebook.Richtext;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Kitchen;
using JetBrains.Annotations;
using Robust.Client.UserInterface.Controls;
Expand Down Expand Up @@ -59,5 +60,16 @@ private void CreateEntries(string group)
var embed = new GuideMicrowaveEmbed(recipe);
AddChild(embed);
}
}
//startlight start

var reactions = _prototype.EnumeratePrototypes<ReactionPrototype>()
.Where(r => r.InGuidebookGroup(group))
.OrderBy(r => r.ID);

foreach (var reaction in reactions)
{
AddChild(new GuideMicrowaveEmbed(reaction));
}
// starlight end
Comment thread
bynddark8 marked this conversation as resolved.
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Robust.Shared.Serialization;

// ReSharper disable once CheckNamespace
namespace Content.Shared.Chemistry.Reaction;

public sealed partial class ReactionPrototype
Comment thread
bynddark8 marked this conversation as resolved.
{
[DataField]
public string? GuidebookGroup;

[DataField]
public List<string> GuidebookGroups = [];

public bool InGuidebookGroup(string group)
{
if (string.Equals(GuidebookGroup, group, StringComparison.OrdinalIgnoreCase))
return true;

foreach (var guidebookGroup in GuidebookGroups)
{
if (string.Equals(guidebookGroup, group, StringComparison.OrdinalIgnoreCase))
return true;
}

return false;
}
}
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_Starlight/guidebook/cooking.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
guidebook-microwave-reagent-catalyst-label = (catalyst)
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_Starlight/guidebook/guides.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ guide-entry-terror-spiders = Terror Spiders
guide-entry-devil = Devil

guide-entry-sl-deepfried-recipes = Deep Fried
guide-entry-sl-dough-recipes = Dough
guide-entry-sl-ice-cream-recipes = Ice Cream Maker

# Plumbing guides
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Guidebook/references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- PizzaRecipes
- SavoryRecipes
- BreadRecipes
- DoughRecipes # Starlight-edit
- BreakfastRecipes
- MothRecipes
- PastaRecipes
Expand Down
15 changes: 15 additions & 0 deletions Resources/Prototypes/Recipes/Reactions/food.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

- type: reaction
id: CreateDough
guidebookGroups: # Starlight-edit
- Dough
impact: Low
quantized: true
conserveEnergy: false
Expand All @@ -44,6 +46,8 @@

- type: reaction
id: CreateCornmealDough
guidebookGroups: # Starlight-edit
- Dough
impact: Low
quantized: true
conserveEnergy: false
Expand All @@ -60,6 +64,8 @@

- type: reaction
id: CreateTortillaDough
guidebookGroups: # Starlight-edit
- Dough
impact: Low
quantized: true
conserveEnergy: false
Expand All @@ -74,6 +80,9 @@

- type: reaction
id: CreateDoughCotton
guidebookGroups: # Starlight-edit
- Dough
- Moth
impact: Low
quantized: true
conserveEnergy: false
Expand All @@ -90,6 +99,9 @@

- type: reaction
id: CreateCakeBatter
guidebookGroups: # Starlight-edit
- Dough
- Cake
impact: Low
quantized: true
conserveEnergy: false
Expand Down Expand Up @@ -123,6 +135,9 @@

- type: reaction
id: CreatePieDough
guidebookGroups: # Starlight-edit
- Dough
- Pie
impact: Low
quantized: true
conserveEnergy: false
Expand Down
6 changes: 6 additions & 0 deletions Resources/Prototypes/_Starlight/Guidebook/references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
name: guide-entry-sl-ice-cream-recipes
text: "/ServerInfo/_Starlight/Guidebook/Service/IceCreamMakerRecipes.xml"
filterEnabled: True

- type: guideEntry
id: DoughRecipes # Starlight-add
name: guide-entry-sl-dough-recipes
text: "/ServerInfo/_Starlight/Guidebook/Service/DoughRecipes.xml"
filterEnabled: True
6 changes: 6 additions & 0 deletions Resources/Prototypes/_Starlight/Recipes/reactions.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
- type: reaction
id: CreateMothBatter
# Starlight-start
guidebookGroups:
- Dough
- Moth
- Cake
# Starlight-end
impact: Low
quantized: true
conserveEnergy: false
Expand Down
3 changes: 3 additions & 0 deletions Resources/ServerInfo/Guidebook/Service/FoodRecipes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ This is the latest published version of NanoTrasen Central Command Kitchen de Cu
<GuideMicrowaveGroupEmbed Group="Salad"/>

<!-- Starlight start -->
## Dough
<GuideMicrowaveGroupEmbed Group="Dough"/>

## Deep Fried
<GuideDeepFryerGroupEmbed Group="TP14-Deep-Fry"/>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Document>

# Dough

The basis of many baked goods. Simply combine the required components in a beaker.

<GuideMicrowaveGroupEmbed Group="Dough"/>

</Document>
Loading