-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/imchillin/Anamnesis
- Loading branch information
Showing
8 changed files
with
384 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// © Anamnesis. | ||
// Licensed under the MIT license. | ||
|
||
namespace Anamnesis.Converters; | ||
|
||
using System; | ||
using System.Globalization; | ||
using System.Windows; | ||
using System.Windows.Data; | ||
using Anamnesis.Memory; | ||
|
||
public class NpcFaceWarningConverter : IMultiValueConverter | ||
{ | ||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (values.Length != 2) | ||
throw new ArgumentException(); | ||
|
||
if (values[0] is ActorTypes type && values[1] is byte head) | ||
{ | ||
if (type == ActorTypes.BattleNpc || type == ActorTypes.EventNpc) | ||
return Visibility.Collapsed; | ||
|
||
if (head > 5) | ||
return Visibility.Visible; | ||
|
||
return Visibility.Collapsed; | ||
} | ||
else | ||
{ | ||
return Visibility.Collapsed; | ||
} | ||
} | ||
|
||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotSupportedException("NpcFaceWarningConverter is a OneWay converter."); | ||
} | ||
} |
Oops, something went wrong.