Release 1.10.5.0 - Autumn Update 2025
This commit is contained in:
@@ -170,8 +170,8 @@ namespace Barotrauma
|
||||
|
||||
public Submarine? Submarine { get; set; }
|
||||
|
||||
private readonly HashSet<Identifier> unlockedRecipes = new HashSet<Identifier>();
|
||||
public IEnumerable<Identifier> UnlockedRecipes => unlockedRecipes;
|
||||
private readonly HashSet<(CharacterTeamType team, Identifier identifier)> unlockedRecipes = new HashSet<(CharacterTeamType, Identifier)>();
|
||||
public IEnumerable<(CharacterTeamType, Identifier)> UnlockedRecipes => unlockedRecipes;
|
||||
|
||||
public CampaignDataPath DataPath { get; set; }
|
||||
|
||||
@@ -1499,25 +1499,32 @@ namespace Barotrauma
|
||||
#endif
|
||||
}
|
||||
|
||||
public void UnlockRecipe(Identifier identifier, bool showNotifications)
|
||||
public void UnlockRecipe(CharacterTeamType team, Identifier identifier, bool showNotifications)
|
||||
{
|
||||
if (unlockedRecipes.Add(identifier))
|
||||
if (unlockedRecipes.Add((team, identifier)))
|
||||
{
|
||||
#if CLIENT
|
||||
if (showNotifications)
|
||||
{
|
||||
foreach (var character in GetSessionCrewCharacters(CharacterType.Both))
|
||||
{
|
||||
if (character.TeamID != team) { continue; }
|
||||
LocalizedString recipeName = TextManager.Get($"entityname.{identifier}").Fallback(identifier.Value);
|
||||
character.AddMessage(TextManager.GetWithVariable("recipeunlockednotification", "[name]", recipeName).Value, GUIStyle.Yellow, playSound: true);
|
||||
}
|
||||
}
|
||||
#else
|
||||
GameMain.Server.UnlockRecipe(identifier);
|
||||
GameMain.Server.UnlockRecipe(team, identifier);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasUnlockedRecipe(Character character, Identifier itemIdentifier)
|
||||
{
|
||||
if (character == null) { return false; }
|
||||
return unlockedRecipes.Contains((character.TeamID, itemIdentifier));
|
||||
}
|
||||
|
||||
public static bool IsCompatibleWithEnabledContentPackages(IList<string> contentPackageNames, out LocalizedString errorMsg)
|
||||
{
|
||||
errorMsg = "";
|
||||
|
||||
Reference in New Issue
Block a user