Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 24 additions & 13 deletions WheelWizard/Services/ModManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ private set
}
}

private bool _isProcessing;
private bool _isBatchUpdating;

private ModManager()
Expand Down Expand Up @@ -107,17 +106,23 @@ private void Mod_PropertyChanged(object sender, PropertyChangedEventArgs e)
if (_isBatchUpdating)
return;

if (
e.PropertyName != nameof(Mod.IsEnabled)
&& e.PropertyName != nameof(Mod.Title)
&& e.PropertyName != nameof(Mod.Author)
&& e.PropertyName != nameof(Mod.ModID)
&& e.PropertyName != nameof(Mod.Priority)
)
if (e.PropertyName == nameof(Mod.Priority))
{
SaveModsAsync();
SortModsByPriority();
return;
}

SaveModsAsync();
SortModsByPriority();
if (
e.PropertyName == nameof(Mod.IsEnabled)
|| e.PropertyName == nameof(Mod.Title)
|| e.PropertyName == nameof(Mod.Author)
|| e.PropertyName == nameof(Mod.ModID)
)
{
SaveModsAsync();
OnPropertyChanged(nameof(Mods));
}
}

private void SortModsByPriority()
Expand Down Expand Up @@ -207,12 +212,18 @@ await Task.Run(() =>

public void ToggleAllMods(bool enable)
{
foreach (var mod in Mods)
_isBatchUpdating = true;
try
{
foreach (var mod in Mods)
mod.IsEnabled = enable;
}
finally
{
mod.IsEnabled = enable;
_isBatchUpdating = false;
}

_isProcessing = !_isProcessing;
SaveModsAsync();
OnPropertyChanged(nameof(Mods));
}

Expand Down
40 changes: 20 additions & 20 deletions WheelWizard/Views/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,27 @@
<StyleInclude Source="Styles/Styles/SliderStyles.axaml" />

<!-- STANDARD COMPONENTS -->
<StyleInclude Source="Components/StandardLibrary/MultiColoredIcon.axaml" />
<StyleInclude Source="Components/StandardLibrary/MultiIconRadioButton.axaml" />
<StyleInclude Source="Components/StandardLibrary/IconLabel.axaml" />
<StyleInclude Source="Components/StandardLibrary/IconLabelButton.axaml" />
<StyleInclude Source="Components/StandardLibrary/Button.axaml" />
<StyleInclude Source="Components/StandardLibrary/OptionButton.axaml" />
<StyleInclude Source="Components/StandardLibrary/StateBox.axaml" />
<StyleInclude Source="Components/StandardLibrary/EmptyPageInfo.axaml" />
<StyleInclude Source="Components/StandardLibrary/FormFieldLabel.axaml" />
<StyleInclude Source="Components/StandardLibrary/LoadingIcon.axaml" />
<StyleInclude Source="Components/StandardLibrary/SidebarRadioButton.axaml" />
<StyleInclude Source="Components/StandardLibrary/PopupListButton.axaml" />
<StyleInclude Source="Components/StandardLibrary/MemeNumberState.axaml" />
<StyleInclude Source="Components/MultiColoredIcon.axaml" />
<StyleInclude Source="Components/MultiIconRadioButton.axaml" />
<StyleInclude Source="Components/IconLabel.axaml" />
<StyleInclude Source="Components/IconLabelButton.axaml" />
<StyleInclude Source="Components/Button.axaml" />
<StyleInclude Source="Components/OptionButton.axaml" />
<StyleInclude Source="Components/StateBox.axaml" />
<StyleInclude Source="Components/EmptyPageInfo.axaml" />
<StyleInclude Source="Components/FormFieldLabel.axaml" />
<StyleInclude Source="Components/LoadingIcon.axaml" />
<StyleInclude Source="Patterns/SidebarRadioButton.axaml" />
<StyleInclude Source="Components/PopupListButton.axaml" />
<StyleInclude Source="Components/MemeNumberState.axaml" />

<!-- PAGE/WHWZ SPECIFIC COMPONENTS -->
<StyleInclude Source="Components/WhWzLibrary/ModBrowserListItem.axaml" />
<StyleInclude Source="Components/WhWzLibrary/FriendsListItem.axaml" />
<StyleInclude Source="Components/WhWzLibrary/PlayerListItem.axaml" />
<StyleInclude Source="Components/WhWzLibrary/Badge.axaml" />
<StyleInclude Source="Components/WhWzLibrary/MiiBlock.axaml" />
<StyleInclude Source="Components/WhWzLibrary/WheelTrail.axaml" />
<StyleInclude Source="Components/WhWzLibrary/LeaderboardPodiumCard.axaml" />
<StyleInclude Source="Patterns/ModBrowserListItem.axaml" />
<StyleInclude Source="Patterns/FriendsListItem.axaml" />
<StyleInclude Source="Patterns/PlayerListItem.axaml" />
<StyleInclude Source="Components/Badge.axaml" />
<StyleInclude Source="Patterns/MiiBlock.axaml" />
<StyleInclude Source="Components/WheelTrail.axaml" />
<StyleInclude Source="Patterns/LeaderboardPodiumCard.axaml" />
</Application.Styles>
</Application>
8 changes: 8 additions & 0 deletions WheelWizard/Views/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using WheelWizard.Services;
using WheelWizard.Services.LiveData;
using WheelWizard.Services.UrlProtocol;
using WheelWizard.Views.Behaviors;
using WheelWizard.WheelWizardData;
using WheelWizard.WiiManagement;
using WheelWizard.WiiManagement.GameLicense;
Expand Down Expand Up @@ -38,6 +39,13 @@ public void SetServiceProvider(IServiceProvider serviceProvider)
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
InitializeBehaviorOverrides();
}

private void InitializeBehaviorOverrides()
{
//Behavior overrides are native components where we are overriding the behavior of
ToolTipBubbleBehavior.Initialize();
}

private static void OpenGameBananaModWindow()
Expand Down
Loading
Loading