Skip to content

Commit

Permalink
Added copy action for recipe names
Browse files Browse the repository at this point in the history
  • Loading branch information
josdemmers committed Mar 20, 2022
1 parent 802db76 commit be17f88
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions NewWorldCompanion/ViewModels/Tabs/CraftingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,17 @@ private void CopyRecipeNameExecute(object obj)
try
{
var recipe = (CraftingRecipe)obj;

// Remove ':'
string recipeName = recipe.Localisation.Contains(':') ?
recipe.Localisation.Substring(recipe.Localisation.IndexOf(':') + 1) :
recipe.Localisation;

// Remove '''
recipeName = recipeName.Contains('\'') ?
recipeName.Substring(0, recipeName.IndexOf('\'')) :
recipeName;

System.Windows.Clipboard.SetText(recipeName.Trim());
}
catch (Exception) { }
Expand Down

0 comments on commit be17f88

Please sign in to comment.