-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HaCreator] quest editor: exclude chaos update related items from que…
…st act and checks (disabled in UI)
- Loading branch information
1 parent
6230de5
commit fca7e4d
Showing
5 changed files
with
213 additions
and
14 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
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
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
41 changes: 41 additions & 0 deletions
41
HaSharedLibrary/Converter/MultiBooleanToVisibility2Converter.cs
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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
using System.Windows; | ||
|
||
namespace HaSharedLibrary.Converter | ||
{ | ||
/// <summary> | ||
/// All must be true to be visible. | ||
/// </summary> | ||
public class MultiBooleanToVisibility2Converter : IMultiValueConverter | ||
{ | ||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
if (values == null || values.Any(v => v == DependencyProperty.UnsetValue)) | ||
return Visibility.Collapsed; | ||
|
||
// Check if all values are boolean and true | ||
bool visible = values.All(v => v is bool && (bool)v); | ||
|
||
// Invert logic if parameter is provided and true | ||
if (parameter is bool invertLogic && invertLogic) | ||
{ | ||
/*<MultiBinding.ConverterParameter> | ||
<sys:Boolean>true</sys:Boolean> | ||
</MultiBinding.ConverterParameter>*/ | ||
visible = !visible; | ||
} | ||
|
||
return visible ? Visibility.Visible : Visibility.Collapsed; | ||
} | ||
|
||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
HaSharedLibrary/Converter/MultiBooleanToVisibilityConverter.cs
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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Data; | ||
using System.Windows; | ||
|
||
namespace HaSharedLibrary.Converter | ||
{ | ||
/// <summary> | ||
/// All must be false to be visible. | ||
/// </summary> | ||
public class MultiBooleanToVisibilityConverter : IMultiValueConverter | ||
{ | ||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
if (values == null || values.Any(v => v == DependencyProperty.UnsetValue)) | ||
return Visibility.Collapsed; | ||
|
||
// Check if all values are boolean and true | ||
bool visible = values.All(v => v is bool && (bool)v); | ||
|
||
// Invert logic if parameter is provided and true | ||
if (parameter is bool invertLogic && invertLogic) | ||
{ | ||
/*<MultiBinding.ConverterParameter> | ||
* <sys:Boolean>true</sys:Boolean> | ||
* </MultiBinding.ConverterParameter>*/ | ||
visible = !visible; | ||
} | ||
|
||
return visible ? Visibility.Collapsed : Visibility.Visible; | ||
} | ||
|
||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |