-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into thumbnails-in-pages
- Loading branch information
Showing
39 changed files
with
527 additions
and
59 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
.../LeftMenu/Items/ILaunchButtonViewModel.cs → ...ms/ApplyControl/ILaunchButtonViewModel.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...App.UI/LeftMenu/ILeftMenuItemViewModel.cs → .../LeftMenu/Items/ILeftMenuItemViewModel.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
5 changes: 2 additions & 3 deletions
5
...nu/Loadout/LeftMenuCollectionViewModel.cs → .../Items/LeftMenuCollectionItemViewModel.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
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
33 changes: 33 additions & 0 deletions
33
src/NexusMods.App.UI/Overlays/UpgradeToPremium/UpgradeToPremiumView.axaml
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,33 @@ | ||
<reactive:ReactiveUserControl | ||
x:TypeArguments="local:IUpgradeToPremiumViewModel" | ||
xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:reactive="http://reactiveui.net" | ||
xmlns:local="clr-namespace:NexusMods.App.UI.Overlays" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
xmlns:base="clr-namespace:NexusMods.App.UI.Overlays.Generic.MessageBox.Base" | ||
x:Class="NexusMods.App.UI.Overlays.UpgradeToPremiumView"> | ||
|
||
<base:MessageBoxBackground> | ||
<base:MessageBoxBackground.TopContent> | ||
<StackPanel Orientation="Vertical" Margin="16, 24, 24, 24" Classes="Spacing-3_5"> | ||
<reactive:ViewModelViewHost x:Name="ViewModelViewHostMarkdownRenderer"/> | ||
</StackPanel> | ||
</base:MessageBoxBackground.TopContent> | ||
|
||
<base:MessageBoxBackground.BottomContent> | ||
<StackPanel Orientation="Horizontal" Margin="24" HorizontalAlignment="Right" Classes="Spacing-2"> | ||
<Button x:Name="ButtonCancel" Classes="Standard Tertiary" HorizontalAlignment="Stretch"> | ||
<TextBlock Text="Cancel"/> | ||
</Button> | ||
<Button x:Name="ButtonUpgrade" Classes="Standard Primary" HorizontalAlignment="Stretch"> | ||
<TextBlock Text="Upgrade to Premium"/> | ||
</Button> | ||
</StackPanel> | ||
</base:MessageBoxBackground.BottomContent> | ||
</base:MessageBoxBackground> | ||
|
||
</reactive:ReactiveUserControl> | ||
|
29 changes: 29 additions & 0 deletions
29
src/NexusMods.App.UI/Overlays/UpgradeToPremium/UpgradeToPremiumView.axaml.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,29 @@ | ||
using System.Reactive.Disposables; | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Markup.Xaml; | ||
using Avalonia.ReactiveUI; | ||
using ReactiveUI; | ||
|
||
namespace NexusMods.App.UI.Overlays; | ||
|
||
public partial class UpgradeToPremiumView : ReactiveUserControl<IUpgradeToPremiumViewModel> | ||
{ | ||
public UpgradeToPremiumView() | ||
{ | ||
InitializeComponent(); | ||
|
||
this.WhenActivated(disposables => | ||
{ | ||
this.BindCommand(ViewModel, vm => vm.CommandCancel, view => view.ButtonCancel) | ||
.DisposeWith(disposables); | ||
|
||
this.BindCommand(ViewModel, vm => vm.CommandUpgrade, view => view.ButtonUpgrade) | ||
.DisposeWith(disposables); | ||
|
||
this.OneWayBind(ViewModel, vm => vm.MarkdownRendererViewModel, view => view.ViewModelViewHostMarkdownRenderer.ViewModel) | ||
.DisposeWith(disposables); | ||
}); | ||
} | ||
} | ||
|
51 changes: 51 additions & 0 deletions
51
src/NexusMods.App.UI/Overlays/UpgradeToPremium/UpgradeToPremiumViewModel.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,51 @@ | ||
using NexusMods.Abstractions.Telemetry; | ||
using NexusMods.Abstractions.UI; | ||
using NexusMods.App.UI.Controls.MarkdownRenderer; | ||
using NexusMods.CrossPlatform.Process; | ||
using R3; | ||
|
||
namespace NexusMods.App.UI.Overlays; | ||
|
||
public interface IUpgradeToPremiumViewModel : IOverlayViewModel | ||
{ | ||
public IMarkdownRendererViewModel MarkdownRendererViewModel { get; } | ||
|
||
public ReactiveCommand<Unit> CommandCancel { get; } | ||
|
||
public ReactiveCommand<Unit> CommandUpgrade { get; } | ||
} | ||
|
||
public class UpgradeToPremiumViewModel : AOverlayViewModel<IUpgradeToPremiumViewModel>, IUpgradeToPremiumViewModel | ||
{ | ||
public UpgradeToPremiumViewModel( | ||
IOSInterop osInterop, | ||
IMarkdownRendererViewModel markdownRendererViewModel) | ||
{ | ||
MarkdownRendererViewModel = markdownRendererViewModel; | ||
MarkdownRendererViewModel.Contents = $""" | ||
### Upgrade to Premium to unlock 1 click downloads | ||
Download all mods in a collection at full speed with 1 click and without leaving the app. | ||
No more visiting every mod page in the browser. | ||
Premium users also get: | ||
* **Uncapped downloads** - Download all mods without any speed limits. | ||
* **No Ads - For Life!** - Never see ads again on the website, even if you cancel! | ||
* **Support authors** - Premium memberships allow Nexus Mods to reward mod authors. | ||
[Learn more about Premium]({ NexusModsUrlBuilder.LearAboutPremiumUri }) | ||
"""; | ||
|
||
CommandCancel = new ReactiveCommand(_ => base.Close()); | ||
CommandUpgrade = new ReactiveCommand( | ||
executeAsync: async (_, cancellationToken) => await osInterop.OpenUrl(NexusModsUrlBuilder.UpgradeToPremiumUri, cancellationToken: cancellationToken), | ||
awaitOperation: AwaitOperation.Parallel, | ||
configureAwait: false | ||
); | ||
} | ||
|
||
public IMarkdownRendererViewModel MarkdownRendererViewModel { get; } | ||
public ReactiveCommand<Unit> CommandCancel { get; } | ||
public ReactiveCommand<Unit> CommandUpgrade { get; } | ||
} |
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
Oops, something went wrong.