mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-11-02 16:27:04 +00:00
Refonte background
This commit is contained in:
parent
020ed61657
commit
712d449f46
3 changed files with 189 additions and 179 deletions
|
|
@ -8,7 +8,7 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
public class BackgroundViewModel : BaseViewModel
|
public class BackgroundViewModel : BaseViewModel
|
||||||
{
|
{
|
||||||
private BackgroundItem _Background = null;
|
private BackgroundItem _Background = null;
|
||||||
public BackgroundItem Background { get { return _Background; } set { SetProperty(ref _Background, value); OnPropertyChanged(nameof(BackgroundOrSubBackground)); } }
|
public BackgroundItem Background { get { return _Background; } set { SubBackground = null; SetProperty(ref _Background, value); OnPropertyChanged(nameof(BackgroundOrSubBackground)); } }
|
||||||
|
|
||||||
private SubBackgroundItem _SubBackground = null;
|
private SubBackgroundItem _SubBackground = null;
|
||||||
public SubBackgroundItem SubBackground { get { return _SubBackground; } set { SetProperty(ref _SubBackground, value); OnPropertyChanged(nameof(BackgroundOrSubBackground)); } }
|
public SubBackgroundItem SubBackground { get { return _SubBackground; } set { SetProperty(ref _SubBackground, value); OnPropertyChanged(nameof(BackgroundOrSubBackground)); } }
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
|
|
||||||
SelectedPlayerCharacter = new PlayerCharacterViewModel() { Background = new BackgroundViewModel(), Abilities = new AbilitiesViewModel() };
|
SelectedPlayerCharacter = new PlayerCharacterViewModel() { Background = new BackgroundViewModel(), Abilities = new AbilitiesViewModel() };
|
||||||
SelectedPlayerCharacter.PropertyChanged += SelectedPlayerCharacter_PropertyChanged;
|
SelectedPlayerCharacter.PropertyChanged += SelectedPlayerCharacter_PropertyChanged;
|
||||||
|
SelectedPlayerCharacter.Background.PropertyChanged += Background_PropertyChanged;
|
||||||
|
|
||||||
|
|
||||||
ResetAlignments();
|
ResetAlignments();
|
||||||
|
|
@ -43,26 +44,37 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
Classes = await Task.Run(async () => await LoadClassesAsync());
|
Classes = await Task.Run(async () => await LoadClassesAsync());
|
||||||
|
|
||||||
Backgrounds = await Task.Run(async () => await LoadBackgroundsAsync());
|
Backgrounds = await Task.Run(async () => await LoadBackgroundsAsync());
|
||||||
SelectedBackground = null;
|
//SelectedBackground = null;
|
||||||
//NotifySelectedBackground = new NotifyTaskCompletion<BackgroundItem>(null);
|
//NotifySelectedBackground = new NotifyTaskCompletion<BackgroundItem>(null);
|
||||||
SubBackgrounds = null;
|
SubBackgrounds = null;
|
||||||
SelectedSubBackground = null;
|
//SelectedSubBackground = null;
|
||||||
//NotifySelectedSubBackground = new NotifyTaskCompletion<SubBackgroundItem>(null);
|
//NotifySelectedSubBackground = new NotifyTaskCompletion<SubBackgroundItem>(null);
|
||||||
PersonalityTraits = null;
|
PersonalityTraits = null;
|
||||||
PersonalityIdeals = null;
|
PersonalityIdeals = null;
|
||||||
PersonalityLinks = null;
|
PersonalityLinks = null;
|
||||||
PersonalityDefects = null;
|
PersonalityDefects = null;
|
||||||
SelectedPersonalityTrait = null;
|
//SelectedPersonalityTrait = null;
|
||||||
SelectedPersonalityIdeal = null;
|
//SelectedPersonalityIdeal = null;
|
||||||
SelectedPersonalityLink = null;
|
//SelectedPersonalityLink = null;
|
||||||
SelectedPersonalityDefect = null;
|
//SelectedPersonalityDefect = null;
|
||||||
BackgroundSpecialties = null;
|
BackgroundSpecialties = null;
|
||||||
SubBackgroundSpecialties = null;
|
SubBackgroundSpecialties = null;
|
||||||
BackgroundSpecialty = null;
|
//BackgroundSpecialty = null;
|
||||||
BackgroundSkill = null;
|
BackgroundSkill = null;
|
||||||
SubBackgroundSkill = null;
|
SubBackgroundSkill = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void Background_PropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
switch(e.PropertyName)
|
||||||
|
{
|
||||||
|
case nameof(SelectedPlayerCharacter.Background.Background):
|
||||||
|
await LoadBackgroundAsync(SelectedPlayerCharacter.Background.Background);
|
||||||
|
//SubBackgrounds = await LoadSubBackgroundsAsync(SelectedPlayerCharacter.Background.Background);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public PlayerCharacterEditorViewModel()
|
public PlayerCharacterEditorViewModel()
|
||||||
{
|
{
|
||||||
ExecuteResetPlayerCharacterCommandAsync();
|
ExecuteResetPlayerCharacterCommandAsync();
|
||||||
|
|
@ -104,9 +116,6 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
|
|
||||||
SelectedPlayerCharacter.Abilities.Listen();
|
SelectedPlayerCharacter.Abilities.Listen();
|
||||||
break;
|
break;
|
||||||
case nameof(SelectedPlayerCharacter.Background):
|
|
||||||
SubBackgrounds = await LoadSubBackgroundsAsync(SelectedPlayerCharacter.Background.Background);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -290,20 +299,21 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
private BackgroundItem _SelectedBackground = null;
|
//private BackgroundItem _SelectedBackground = null;
|
||||||
public BackgroundItem SelectedBackground
|
//public BackgroundItem SelectedBackground
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _SelectedBackground;
|
// return _SelectedBackground;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _SelectedBackground, value);
|
// SetProperty(ref _SelectedBackground, value);
|
||||||
OnPropertyChanged(nameof(BackgroundOrSubBackground));
|
// OnPropertyChanged(nameof(BackgroundOrSubBackground));
|
||||||
//NotifySelectedBackground = new NotifyTaskCompletion<BackgroundItem>(Task.Run(() => LoadBackgroundAsync(_SelectedBackground)));
|
// SelectedPlayerCharacter.Background.Background = value;
|
||||||
}
|
// //NotifySelectedBackground = new NotifyTaskCompletion<BackgroundItem>(Task.Run(() => LoadBackgroundAsync(_SelectedBackground)));
|
||||||
}
|
// }
|
||||||
|
//}
|
||||||
//private NotifyTaskCompletion<BackgroundItem> _NotifySelectedBackground = null;
|
//private NotifyTaskCompletion<BackgroundItem> _NotifySelectedBackground = null;
|
||||||
//public NotifyTaskCompletion<BackgroundItem> NotifySelectedBackground
|
//public NotifyTaskCompletion<BackgroundItem> NotifySelectedBackground
|
||||||
//{
|
//{
|
||||||
|
|
@ -330,21 +340,21 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
if (background != null)
|
if (background != null)
|
||||||
{
|
{
|
||||||
SubBackgrounds = await LoadSubBackgroundsAsync(background);
|
SubBackgrounds = await LoadSubBackgroundsAsync(background);
|
||||||
SelectedSubBackground = null;
|
//SelectedSubBackground = null;
|
||||||
//NotifySelectedSubBackground = new NotifyTaskCompletion<SubBackgroundItem>(null);
|
//NotifySelectedSubBackground = new NotifyTaskCompletion<SubBackgroundItem>(null);
|
||||||
PersonalityTraits = await LoadPersonalityTraitsAsync(background);
|
PersonalityTraits = await LoadPersonalityTraitsAsync(background);
|
||||||
PersonalityIdeals = await LoadPersonalityIdealsAsync(background);
|
PersonalityIdeals = await LoadPersonalityIdealsAsync(background);
|
||||||
PersonalityLinks = await LoadPersonalityLinksAsync(background);
|
PersonalityLinks = await LoadPersonalityLinksAsync(background);
|
||||||
PersonalityDefects = await LoadPersonalityDefectsAsync(background);
|
PersonalityDefects = await LoadPersonalityDefectsAsync(background);
|
||||||
SelectedPersonalityTrait = null;
|
//SelectedPersonalityTrait = null;
|
||||||
SelectedPersonalityIdeal = null;
|
//SelectedPersonalityIdeal = null;
|
||||||
SelectedPersonalityLink = null;
|
//SelectedPersonalityLink = null;
|
||||||
SelectedPersonalityDefect = null;
|
//SelectedPersonalityDefect = null;
|
||||||
BackgroundSpecialties = await LoadBackgroundsSpecialtiesAsync(background);
|
BackgroundSpecialties = await LoadBackgroundsSpecialtiesAsync(background);
|
||||||
BackgroundSpecialty = null;
|
//BackgroundSpecialty = null;
|
||||||
SubBackgroundSpecialties = null;
|
//SubBackgroundSpecialties = null;
|
||||||
BackgroundSkill = await LoadSkillAsync(background);
|
BackgroundSkill = await LoadSkillAsync(background);
|
||||||
SubBackgroundSkill = null;
|
//SubBackgroundSkill = null;
|
||||||
ResetAlignments();
|
ResetAlignments();
|
||||||
}
|
}
|
||||||
return background;
|
return background;
|
||||||
|
|
@ -386,20 +396,20 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
private SubBackgroundItem _SelectedSubBackground = null;
|
//private SubBackgroundItem _SelectedSubBackground = null;
|
||||||
public SubBackgroundItem SelectedSubBackground
|
//public SubBackgroundItem SelectedSubBackground
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _SelectedSubBackground;
|
// return _SelectedSubBackground;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _SelectedSubBackground, value);
|
// SetProperty(ref _SelectedSubBackground, value);
|
||||||
OnPropertyChanged(nameof(BackgroundOrSubBackground));
|
// OnPropertyChanged(nameof(BackgroundOrSubBackground));
|
||||||
//NotifySelectedSubBackground = new NotifyTaskCompletion<SubBackgroundItem>(Task.Run(() => LoadSubBackgroundAsync(SelectedSubBackground)));
|
// //NotifySelectedSubBackground = new NotifyTaskCompletion<SubBackgroundItem>(Task.Run(() => LoadSubBackgroundAsync(SelectedSubBackground)));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
//private NotifyTaskCompletion<SubBackgroundItem> _NotifySelectedSubBackground = null;
|
//private NotifyTaskCompletion<SubBackgroundItem> _NotifySelectedSubBackground = null;
|
||||||
//public NotifyTaskCompletion<SubBackgroundItem> NotifySelectedSubBackground
|
//public NotifyTaskCompletion<SubBackgroundItem> NotifySelectedSubBackground
|
||||||
//{
|
//{
|
||||||
|
|
@ -420,7 +430,7 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
{
|
{
|
||||||
SubBackgroundSpecialties = null;
|
SubBackgroundSpecialties = null;
|
||||||
SubBackgroundSkill = null;
|
SubBackgroundSkill = null;
|
||||||
SubBackgroundSpecialty = null;
|
//SubBackgroundSpecialty = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -430,13 +440,13 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
return subbackground;
|
return subbackground;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BackgroundItem BackgroundOrSubBackground
|
//public BackgroundItem BackgroundOrSubBackground
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return SelectedSubBackground ?? SelectedBackground;
|
// return SelectedSubBackground ?? SelectedBackground;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private List<string> _PersonalityTraits = null;
|
private List<string> _PersonalityTraits = null;
|
||||||
public List<string> PersonalityTraits
|
public List<string> PersonalityTraits
|
||||||
|
|
@ -450,19 +460,19 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
SetProperty(ref _PersonalityTraits, value);
|
SetProperty(ref _PersonalityTraits, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _SelectedPersonalityTrait = null;
|
//private string _SelectedPersonalityTrait = null;
|
||||||
public string SelectedPersonalityTrait
|
//public string SelectedPersonalityTrait
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _SelectedPersonalityTrait;
|
// return _SelectedPersonalityTrait;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _SelectedPersonalityTrait, value);
|
// SetProperty(ref _SelectedPersonalityTrait, value);
|
||||||
SelectedPlayerCharacter.Background.PersonalityTrait = value;
|
// SelectedPlayerCharacter.Background.PersonalityTrait = value;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private List<string> _PersonalityIdeals = null;
|
private List<string> _PersonalityIdeals = null;
|
||||||
public List<string> PersonalityIdeals
|
public List<string> PersonalityIdeals
|
||||||
|
|
@ -476,19 +486,19 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
SetProperty(ref _PersonalityIdeals, value);
|
SetProperty(ref _PersonalityIdeals, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _SelectedPersonalityIdeal = null;
|
//private string _SelectedPersonalityIdeal = null;
|
||||||
public string SelectedPersonalityIdeal
|
//public string SelectedPersonalityIdeal
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _SelectedPersonalityIdeal;
|
// return _SelectedPersonalityIdeal;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _SelectedPersonalityIdeal, value);
|
// SetProperty(ref _SelectedPersonalityIdeal, value);
|
||||||
SelectedPlayerCharacter.Background.PersonalityIdeal = value;
|
// SelectedPlayerCharacter.Background.PersonalityIdeal = value;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private List<string> _PersonalityLinks = null;
|
private List<string> _PersonalityLinks = null;
|
||||||
public List<string> PersonalityLinks
|
public List<string> PersonalityLinks
|
||||||
|
|
@ -502,19 +512,19 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
SetProperty(ref _PersonalityLinks, value);
|
SetProperty(ref _PersonalityLinks, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _SelectedPersonalityLink = null;
|
//private string _SelectedPersonalityLink = null;
|
||||||
public string SelectedPersonalityLink
|
//public string SelectedPersonalityLink
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _SelectedPersonalityLink;
|
// return _SelectedPersonalityLink;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _SelectedPersonalityLink, value);
|
// SetProperty(ref _SelectedPersonalityLink, value);
|
||||||
SelectedPlayerCharacter.Background.PersonalityLink = value;
|
// SelectedPlayerCharacter.Background.PersonalityLink = value;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private List<string> _PersonalityDefects = null;
|
private List<string> _PersonalityDefects = null;
|
||||||
public List<string> PersonalityDefects
|
public List<string> PersonalityDefects
|
||||||
|
|
@ -528,19 +538,19 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
SetProperty(ref _PersonalityDefects, value);
|
SetProperty(ref _PersonalityDefects, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private string _SelectedPersonalityDefect = null;
|
//private string _SelectedPersonalityDefect = null;
|
||||||
public string SelectedPersonalityDefect
|
//public string SelectedPersonalityDefect
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _SelectedPersonalityDefect;
|
// return _SelectedPersonalityDefect;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _SelectedPersonalityDefect, value);
|
// SetProperty(ref _SelectedPersonalityDefect, value);
|
||||||
SelectedPlayerCharacter.Background.PersonalityDefect = value;
|
// SelectedPlayerCharacter.Background.PersonalityDefect = value;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private BackgroundSpecialtyItem _BackgroundSpecialties = null;
|
private BackgroundSpecialtyItem _BackgroundSpecialties = null;
|
||||||
public BackgroundSpecialtyItem BackgroundSpecialties
|
public BackgroundSpecialtyItem BackgroundSpecialties
|
||||||
|
|
@ -552,8 +562,8 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetProperty(ref _BackgroundSpecialties, value);
|
SetProperty(ref _BackgroundSpecialties, value);
|
||||||
OnPropertyChanged(nameof(PreferedBackgroundSpecialties));
|
OnPropertyChanged(nameof(BackgroundOrSubBackgroundSpecialties));
|
||||||
OnPropertyChanged(nameof(HasBackgroundSpecialties));
|
//OnPropertyChanged(nameof(HasBackgroundSpecialties));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private BackgroundSpecialtyItem _SubBackgroundSpecialties = null;
|
private BackgroundSpecialtyItem _SubBackgroundSpecialties = null;
|
||||||
|
|
@ -566,51 +576,51 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetProperty(ref _SubBackgroundSpecialties, value);
|
SetProperty(ref _SubBackgroundSpecialties, value);
|
||||||
OnPropertyChanged(nameof(PreferedBackgroundSpecialties));
|
OnPropertyChanged(nameof(BackgroundOrSubBackgroundSpecialties));
|
||||||
OnPropertyChanged(nameof(HasBackgroundSpecialties));
|
//OnPropertyChanged(nameof(HasBackgroundSpecialties));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public BackgroundSpecialtyItem PreferedBackgroundSpecialties
|
public BackgroundSpecialtyItem BackgroundOrSubBackgroundSpecialties
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return _SubBackgroundSpecialties ?? _BackgroundSpecialties;
|
return _SubBackgroundSpecialties ?? _BackgroundSpecialties;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool HasBackgroundSpecialties
|
//public bool HasBackgroundSpecialties
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return PreferedBackgroundSpecialties != null;
|
// return PreferedBackgroundSpecialties != null;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private string _BackgroundSpecialty = null;
|
//private string _BackgroundSpecialty = null;
|
||||||
public string BackgroundSpecialty
|
//public string BackgroundSpecialty
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _BackgroundSpecialty;
|
// return _BackgroundSpecialty;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _BackgroundSpecialty, value);
|
// SetProperty(ref _BackgroundSpecialty, value);
|
||||||
SelectedPlayerCharacter.Background.BackgroundSpecialty = BackgroundSpecialty;
|
// SelectedPlayerCharacter.Background.BackgroundSpecialty = BackgroundSpecialty;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
private string _SubBackgroundSpecialty = null;
|
//private string _SubBackgroundSpecialty = null;
|
||||||
public string SubBackgroundSpecialty
|
//public string SubBackgroundSpecialty
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return _SubBackgroundSpecialty;
|
// return _SubBackgroundSpecialty;
|
||||||
}
|
// }
|
||||||
set
|
// set
|
||||||
{
|
// {
|
||||||
SetProperty(ref _SubBackgroundSpecialty, value);
|
// SetProperty(ref _SubBackgroundSpecialty, value);
|
||||||
SelectedPlayerCharacter.Background.SubBackgroundSpecialty = SubBackgroundSpecialty;
|
// SelectedPlayerCharacter.Background.SubBackgroundSpecialty = SubBackgroundSpecialty;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
private SkillItem _BackgroundSkill = null;
|
private SkillItem _BackgroundSkill = null;
|
||||||
public SkillItem BackgroundSkill
|
public SkillItem BackgroundSkill
|
||||||
|
|
@ -622,8 +632,8 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetProperty(ref _BackgroundSkill, value);
|
SetProperty(ref _BackgroundSkill, value);
|
||||||
OnPropertyChanged(nameof(PreferedBackgroundSkill));
|
OnPropertyChanged(nameof(BackgroundOrSubBackgroundSkill));
|
||||||
OnPropertyChanged(nameof(HasBackgroundSkill));
|
//OnPropertyChanged(nameof(HasBackgroundSkill));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private SkillItem _SubBackgroundSkill = null;
|
private SkillItem _SubBackgroundSkill = null;
|
||||||
|
|
@ -636,24 +646,24 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetProperty(ref _SubBackgroundSkill, value);
|
SetProperty(ref _SubBackgroundSkill, value);
|
||||||
OnPropertyChanged(nameof(PreferedBackgroundSkill));
|
OnPropertyChanged(nameof(BackgroundOrSubBackgroundSkill));
|
||||||
OnPropertyChanged(nameof(HasBackgroundSkill));
|
//OnPropertyChanged(nameof(HasBackgroundSkill));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public SkillItem PreferedBackgroundSkill
|
public SkillItem BackgroundOrSubBackgroundSkill
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return _SubBackgroundSkill ?? _BackgroundSkill;
|
return _SubBackgroundSkill ?? _BackgroundSkill;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool HasBackgroundSkill
|
//public bool HasBackgroundSkill
|
||||||
{
|
//{
|
||||||
get
|
// get
|
||||||
{
|
// {
|
||||||
return PreferedBackgroundSkill != null;
|
// return PreferedBackgroundSkill != null;
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
public async Task<List<BackgroundItem>> LoadBackgroundsAsync()
|
public async Task<List<BackgroundItem>> LoadBackgroundsAsync()
|
||||||
{
|
{
|
||||||
using (var context = await StoreViewModel.GetLibraryContextAsync())
|
using (var context = await StoreViewModel.GetLibraryContextAsync())
|
||||||
|
|
@ -1298,10 +1308,10 @@ namespace AideDeJeu.ViewModels.PlayerCharacter
|
||||||
form.SetField("Alignement", SelectedPlayerCharacter?.Alignment?.Name ?? string.Empty);
|
form.SetField("Alignement", SelectedPlayerCharacter?.Alignment?.Name ?? string.Empty);
|
||||||
form.SetField("Historique", SelectedPlayerCharacter?.Background?.Background?.Name ?? string.Empty);
|
form.SetField("Historique", SelectedPlayerCharacter?.Background?.Background?.Name ?? string.Empty);
|
||||||
form.SetField("Trait de personnalité",
|
form.SetField("Trait de personnalité",
|
||||||
(SelectedPersonalityTrait ?? string.Empty) + "\n\n" +
|
(SelectedPlayerCharacter.Background.PersonalityTrait ?? string.Empty) + "\n\n" +
|
||||||
(SelectedPersonalityIdeal ?? string.Empty) + "\n\n" +
|
(SelectedPlayerCharacter.Background.PersonalityIdeal ?? string.Empty) + "\n\n" +
|
||||||
(SelectedPersonalityLink ?? string.Empty) + "\n\n" +
|
(SelectedPlayerCharacter.Background.PersonalityLink ?? string.Empty) + "\n\n" +
|
||||||
(SelectedPersonalityDefect ?? string.Empty)
|
(SelectedPlayerCharacter.Background.PersonalityDefect ?? string.Empty)
|
||||||
);
|
);
|
||||||
form.SetField("For Valeur", SelectedPlayerCharacter?.Abilities?.Strength?.Value?.ToString());
|
form.SetField("For Valeur", SelectedPlayerCharacter?.Abilities?.Strength?.Value?.ToString());
|
||||||
form.SetField("For MOD", SelectedPlayerCharacter?.Abilities?.Strength?.ModString);
|
form.SetField("For MOD", SelectedPlayerCharacter?.Abilities?.Strength?.ModString);
|
||||||
|
|
|
||||||
|
|
@ -20,52 +20,52 @@
|
||||||
<Label Text="{Binding NotifySelectedBackground.Status, StringFormat='NotifySelectedBackground.Status = {0}'}" />
|
<Label Text="{Binding NotifySelectedBackground.Status, StringFormat='NotifySelectedBackground.Status = {0}'}" />
|
||||||
<Label Text="{Binding NotifySelectedSubBackground.Status, StringFormat='NotifySelectedSubBackground.Status = {0}'}" />-->
|
<Label Text="{Binding NotifySelectedSubBackground.Status, StringFormat='NotifySelectedSubBackground.Status = {0}'}" />-->
|
||||||
|
|
||||||
<pickers:ItemPickerView BindingContext="{Binding}" Title="Historique" ItemsSource="{Binding Backgrounds}" SelectedItem="{Binding SelectedBackground, Mode=TwoWay}" />
|
<pickers:ItemPickerView BindingContext="{Binding}" Title="Historique" ItemsSource="{Binding Backgrounds}" SelectedItem="{Binding SelectedPlayerCharacter.Background.Background, Mode=TwoWay}" />
|
||||||
<pickers:ItemPickerView BindingContext="{Binding}" Title="Variante" ItemsSource="{Binding SubBackgrounds}" SelectedItem="{Binding SelectedSubBackground, Mode=TwoWay}" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" />
|
<pickers:ItemPickerView BindingContext="{Binding}" Title="Variante" ItemsSource="{Binding SubBackgrounds}" SelectedItem="{Binding SelectedPlayerCharacter.Background.SubBackground, Mode=TwoWay}" IsVisible="{Binding SubBackgrounds, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" />
|
||||||
|
|
||||||
<!-- test -->
|
<!-- test -->
|
||||||
<!--<views:StringPickerView BindingContext="{Binding}" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" Title="Compétences" SelectedItem="{Binding PreferedBackground.Abilities}" />-->
|
<!--<views:StringPickerView BindingContext="{Binding}" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" Title="Compétences" SelectedItem="{Binding PreferedBackground.Abilities}" />-->
|
||||||
|
|
||||||
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
||||||
<StackLayout Padding="0">
|
<StackLayout Padding="0">
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Compétences" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Compétences" />
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding BackgroundOrSubBackground.Abilities}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground.Abilities}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
||||||
<StackLayout Padding="0">
|
<StackLayout Padding="0">
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Outils maîtrisés" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Outils maîtrisés" />
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding BackgroundOrSubBackground.MasteredTools}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground.MasteredTools}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
||||||
<StackLayout Padding="0">
|
<StackLayout Padding="0">
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Langues maîtrisées" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Langues maîtrisées" />
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding BackgroundOrSubBackground.MasteredLanguages}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground.MasteredLanguages}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}">
|
||||||
<StackLayout Padding="0">
|
<StackLayout Padding="0">
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Équipement" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Équipement" />
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding BackgroundOrSubBackground.Equipment}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.Background.BackgroundOrSubBackground.Equipment}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding HasBackgroundSkill}">
|
<Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding BackgroundOrSubBackgroundSkill, Converter={StaticResource NullToFalseConverter}}">
|
||||||
<StackLayout Padding="0">
|
<StackLayout Padding="0">
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding PreferedBackgroundSkill.Name, StringFormat='# {0}'}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding BackgroundOrSubBackgroundSkill.Name, StringFormat='# {0}'}" />
|
||||||
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding PreferedBackgroundSkill.Description}" />
|
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding BackgroundOrSubBackgroundSkill.Description}" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
<pickers:StringPickerView BindingContext="{Binding}" IsVisible="{Binding HasBackgroundSpecialties}" Title="{Binding PreferedBackgroundSpecialties.Name}" Description="{Binding PreferedBackgroundSpecialties.Description}" ItemsSource="{Binding PreferedBackgroundSpecialties.BindableTable}" SelectedItem="{Binding BackgroundSpecialty, Mode=TwoWay}" />
|
<pickers:StringPickerView BindingContext="{Binding}" IsVisible="{Binding BackgroundSpecialties, Converter={StaticResource NullToFalseConverter}}" Title="{Binding BackgroundOrSubBackgroundSpecialties.Name}" Description="{Binding PreferedBackgroundSpecialties.Description}" ItemsSource="{Binding PreferedBackgroundSpecialties.BindableTable}" SelectedItem="{Binding SelectedPlayerCharacter.Background.BackgroundSpecialty, Mode=TwoWay}" />
|
||||||
|
|
||||||
<pickers:StringPickerView BindingContext="{Binding}" Title="Trait de personnalité" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityTraits}" SelectedItem="{Binding SelectedPersonalityTrait, Mode=TwoWay}" />
|
<pickers:StringPickerView BindingContext="{Binding}" Title="Trait de personnalité" IsVisible="{Binding SelectedPlayerCharacter.Background.Background, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityTraits}" SelectedItem="{Binding SelectedPlayerCharacter.Background.PersonalityTrait, Mode=TwoWay}" />
|
||||||
|
|
||||||
<pickers:StringPickerView BindingContext="{Binding}" Title="Idéal" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityIdeals}" SelectedItem="{Binding SelectedPersonalityIdeal, Mode=TwoWay}" />
|
<pickers:StringPickerView BindingContext="{Binding}" Title="Idéal" IsVisible="{Binding SelectedPlayerCharacter.Background.Background, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityIdeals}" SelectedItem="{Binding SelectedPlayerCharacter.Background.PersonalityIdeal, Mode=TwoWay}" />
|
||||||
|
|
||||||
<pickers:StringPickerView BindingContext="{Binding}" Title="Lien" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityLinks}" SelectedItem="{Binding SelectedPersonalityLink, Mode=TwoWay}" />
|
<pickers:StringPickerView BindingContext="{Binding}" Title="Lien" IsVisible="{Binding SelectedPlayerCharacter.Background.Background, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityLinks}" SelectedItem="{Binding SelectedPlayerCharacter.Background.PersonalityLink, Mode=TwoWay}" />
|
||||||
|
|
||||||
<pickers:StringPickerView BindingContext="{Binding}" Title="Défaut" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityDefects}" SelectedItem="{Binding SelectedPersonalityDefect, Mode=TwoWay}" />
|
<pickers:StringPickerView BindingContext="{Binding}" Title="Défaut" IsVisible="{Binding SelectedPlayerCharacter.Background.Background, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" ItemsSource="{Binding PersonalityDefects}" SelectedItem="{Binding SelectedPlayerCharacter.Background.PersonalityDefect, Mode=TwoWay}" />
|
||||||
|
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ScrollView>
|
</ScrollView>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue