From 5a724b744aefff60707481b7de69f10a902faff9 Mon Sep 17 00:00:00 2001 From: Jos Demmers Date: Sat, 29 Oct 2022 10:00:28 +0200 Subject: [PATCH] Fixed copy/paste music sheet names for trading post. --- .../ViewModels/Tabs/CraftingViewModel.cs | 20 ++++++++++++++----- NewWorldCompanion/common.props | 4 ++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/NewWorldCompanion/ViewModels/Tabs/CraftingViewModel.cs b/NewWorldCompanion/ViewModels/Tabs/CraftingViewModel.cs index b89b81f..29c26ac 100644 --- a/NewWorldCompanion/ViewModels/Tabs/CraftingViewModel.cs +++ b/NewWorldCompanion/ViewModels/Tabs/CraftingViewModel.cs @@ -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) diff --git a/NewWorldCompanion/common.props b/NewWorldCompanion/common.props index 6a53a1b..662813b 100644 --- a/NewWorldCompanion/common.props +++ b/NewWorldCompanion/common.props @@ -1,7 +1,7 @@ - 1.0.8.0 - 1.0.8.0 + 1.0.8.1 + 1.0.8.1 Copyright © 2022 net6.0-windows