Skip to content

Commit

Permalink
Fixed copy/paste music sheet names for trading post.
Browse files Browse the repository at this point in the history
  • Loading branch information
josdemmers committed Oct 29, 2022
1 parent bd153b5 commit 5a724b7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
20 changes: 15 additions & 5 deletions NewWorldCompanion/ViewModels/Tabs/CraftingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,26 +370,36 @@ private void VisitNwdbExecute(object url)

private void CopyRecipeNameExecute(object obj)
{
// Note: New World does not accept the following special characters when using copy/paste: ':', '''.
// Note: New World does not accept the following special characters when using copy/paste: ':', ''', '/'.
try
{
var recipe = (CraftingRecipe)obj;

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

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

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

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

// Replace '\n'
//recipeName = recipeName.Contains("\\n") ?
// recipeName.Replace("\\n"," ") :
// recipeName;

System.Windows.Clipboard.SetText(recipeName.Trim());
}
catch (Exception ex)
Expand Down
4 changes: 2 additions & 2 deletions NewWorldCompanion/common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<FileVersion>1.0.8.0</FileVersion>
<Version>1.0.8.0</Version>
<FileVersion>1.0.8.1</FileVersion>
<Version>1.0.8.1</Version>
<Copyright>Copyright © 2022</Copyright>
<TargetFramework>net6.0-windows</TargetFramework>
</PropertyGroup>
Expand Down

0 comments on commit 5a724b7

Please sign in to comment.