mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-11-02 16:27:04 +00:00
Recherche multilingue
This commit is contained in:
parent
64fb8082de
commit
6882a31d12
3 changed files with 20 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
namespace AideDeJeuLib
|
namespace AideDeJeuLib
|
||||||
|
|
@ -17,6 +18,15 @@ namespace AideDeJeuLib
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string NameVO { get; set; }
|
public string NameVO { get; set; }
|
||||||
|
public string NameVOText
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var regex = new Regex("\\[(?<text>.*?)\\]");
|
||||||
|
var match = regex.Match(NameVO ?? string.Empty);
|
||||||
|
return match.Groups["text"].Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Properties Properties { get; set; }
|
public Properties Properties { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,10 @@ namespace AideDeJeu.ViewModels
|
||||||
spell.Source.Contains(source) &&
|
spell.Source.Contains(source) &&
|
||||||
spell.Source.Contains(classe) &&
|
spell.Source.Contains(classe) &&
|
||||||
spell.Rituel.Contains(rituel) &&
|
spell.Rituel.Contains(rituel) &&
|
||||||
Helpers.RemoveDiacritics(spell.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower());
|
(
|
||||||
|
(Helpers.RemoveDiacritics(spell.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) ||
|
||||||
|
(Helpers.RemoveDiacritics(spell.NameVOText ?? string.Empty).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower()))
|
||||||
|
);
|
||||||
}).OrderBy(spell => spell.Name)
|
}).OrderBy(spell => spell.Name)
|
||||||
.AsEnumerable();
|
.AsEnumerable();
|
||||||
}, token);
|
}, token);
|
||||||
|
|
@ -379,7 +382,10 @@ namespace AideDeJeu.ViewModels
|
||||||
monster.Source.Contains(source) &&
|
monster.Source.Contains(source) &&
|
||||||
powerComparer.Compare(monster.Challenge, minPower) >= 0 &&
|
powerComparer.Compare(monster.Challenge, minPower) >= 0 &&
|
||||||
powerComparer.Compare(monster.Challenge, maxPower) <= 0 &&
|
powerComparer.Compare(monster.Challenge, maxPower) <= 0 &&
|
||||||
Helpers.RemoveDiacritics(monster.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower());
|
(
|
||||||
|
(Helpers.RemoveDiacritics(monster.Name).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower())) ||
|
||||||
|
(Helpers.RemoveDiacritics(monster.NameVOText ?? string.Empty).ToLower().Contains(Helpers.RemoveDiacritics(SearchText ?? string.Empty).ToLower()))
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.OrderBy(monster => monster.Name)
|
.OrderBy(monster => monster.Name)
|
||||||
.AsEnumerable();
|
.AsEnumerable();
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,9 @@
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<ViewCell>
|
<ViewCell>
|
||||||
<StackLayout Padding="10">
|
<StackLayout Padding="10" Orientation="Vertical">
|
||||||
<Label Text="{Binding Name}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="16" />
|
<Label Text="{Binding Name}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="16" />
|
||||||
|
<Label Text="{Binding NameVOText}" LineBreakMode="NoWrap" Style="{DynamicResource subsubsection}" FontSize="12" />
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ViewCell>
|
</ViewCell>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue