Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion CommandLine/CommandLine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions CoreSourceGenerator/CoreSourceGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="4.14.0">
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" />
<PackageReference Include="PolySharp" Version="*">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp"/>
<PackageReference Include="PolySharp">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions CrossPlatformUI.Browser/CrossPlatformUI.Browser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@
</Target>

<ItemGroup>
<PackageReference Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
<PackageReference Include="js65.browser" Version="$(Js65Version)" GeneratePathProperty="true" />
<PackageReference Include="Avalonia.Browser" />
<PackageReference Include="js65.browser" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 11 additions & 9 deletions CrossPlatformUI.Browser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,20 @@ private static Task Main(string[] args)

return BuildAvaloniaApp()
.WithInterFont()
.UseReactiveUI()
.AfterSetup(_ =>
{
App.ServiceContainer ??= new();
{
App.ServiceContainer ??= new();

App.ServiceContainer.AddSingleton<Hyrule.NewAssemblerFn>(MakeBrowserAssembler);
App.FileSystemService = new BrowserFileService();
App.ServiceContainer.AddSingleton<IFileSystemService>(x => App.FileSystemService);
App.ServiceContainer.AddSingleton<Hyrule.NewAssemblerFn>(MakeBrowserAssembler);
App.FileSystemService = new BrowserFileService();
App.ServiceContainer.AddSingleton<IFileSystemService>(x => App.FileSystemService);

SetTitle(App.Title);
})
.StartBrowserAppAsync("out");
SetTitle(App.Title);
})
.UseReactiveUI(_ =>
{
})
.StartBrowserAppAsync("out");
}


Expand Down
4 changes: 1 addition & 3 deletions CrossPlatformUI.Desktop/CrossPlatformUI.Desktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Desktop" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 4 additions & 2 deletions CrossPlatformUI.Desktop/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,7 @@ public static AppBuilder BuildAvaloniaApp()
App.Current!.LocateMaterialTheme<MaterialTheme>().BaseTheme = BaseThemeMode.Dark;
}
})
.UseReactiveUI();
}
.UseReactiveUI(_ =>
{
});
}
3 changes: 3 additions & 0 deletions CrossPlatformUI/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public sealed partial class App : Application // , IDisposable
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
#if DEBUG
this.AttachDeveloperTools();
#endif

var version = Assembly.GetExecutingAssembly().GetName().Version;
var versionString = version?.ToString(version.Revision > 0 ? 4 : 3);
Expand Down
20 changes: 14 additions & 6 deletions CrossPlatformUI/AppViewLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,20 @@ namespace CrossPlatformUI;
[RequiresUnreferencedCode("ReactiveUI uses reflection")]
public class AppViewLocator : IViewLocator
{
public IViewFor ResolveView<T>(T? viewModel, string? contract = null) => viewModel switch
private static IViewFor? CreateView(object viewModel) => viewModel switch
{
MainViewModel context => new MainView { DataContext = context },
RomFileViewModel context => new RomFileView { DataContext = context },
GenerateRomViewModel context => new GenerateRomView { DataContext = context },
RandomizerViewModel context => new RandomizerView { DataContext = context },
MainViewModel context => new MainView { ViewModel = context },
RomFileViewModel context => new RomFileView { ViewModel = context },
GenerateRomViewModel context => new GenerateRomView { ViewModel = context },
RandomizerViewModel context => new RandomizerView { ViewModel = context },
_ => throw new ArgumentOutOfRangeException(nameof(viewModel))
};
}

public IViewFor? ResolveView(object? viewModel, string? contract = null)
=> viewModel is null ? null : CreateView(viewModel);

public IViewFor<TViewModel>? ResolveView<TViewModel>(string? contract = null) where TViewModel : class
{
throw new NotImplementedException();
}
}
23 changes: 12 additions & 11 deletions CrossPlatformUI/CrossPlatformUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,21 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" />
<PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.Fonts.Inter" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
<PackageReference Include="DialogHost.Avalonia" Version="$(DialogHostAvaloniaVersion)" />
<PackageReference Include="Material.Avalonia" Version="$(MaterialAvaloniaVersion)" />
<PackageReference Include="Material.Icons.Avalonia" Version="$(MaterialIconsAvaloniaVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.3" />
<PackageReference Include="ReactiveUI.Avalonia" Version="11.3.8" />
<PackageReference Include="ReactiveUI.Validation" Version="6.0.18" />
<PackageReference Include="Aigamo.ResXGenerator" Version="4.3.0">
<PackageReference Include="AvaloniaUI.DiagnosticsSupport" />
<PackageReference Include="DialogHost.Avalonia" />
<PackageReference Include="Material.Avalonia" />
<PackageReference Include="Material.Icons.Avalonia" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="ReactiveUI" />
<PackageReference Include="ReactiveUI.Avalonia" />
<PackageReference Include="ReactiveUI.Validation" />
<PackageReference Include="Aigamo.ResXGenerator" >
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Xaml.Behaviors.Interactions" Version="11.3.9.5" />
<PackageReference Include="Xaml.Behaviors.Interactions" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions CrossPlatformUI/ViewModels/GenerateRomViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reactive;
using System.Reactive.Disposables;
Expand All @@ -7,15 +8,14 @@
using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using Avalonia.Threading;
using CrossPlatformUI.Services;
using Microsoft.Extensions.DependencyInjection;
using Avalonia.Input.Platform;
using Avalonia.Threading;
using ReactiveUI;
using ReactiveUI.Validation.Helpers;
using Z2Randomizer.RandomizerCore;
using Z2Randomizer.RandomizerCore.Sidescroll;
using System.Diagnostics.CodeAnalysis;
using System.Reactive.Disposables.Fluent;
using CrossPlatformUI.Services;

namespace CrossPlatformUI.ViewModels;

Expand Down
4 changes: 1 addition & 3 deletions CrossPlatformUI/ViewModels/RandomizerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
using System.Reactive.Subjects;
using System.Text.Json.Serialization;
using Microsoft.Extensions.DependencyInjection;
using Material.Colors;
using Avalonia.Controls;
using Avalonia.Media;
using Material.Styles.Themes;
using ReactiveUI;
using ReactiveUI.Validation.Extensions;
using ReactiveUI.Validation.Helpers;
Expand Down Expand Up @@ -212,6 +209,7 @@ private void OnActivate(CompositeDisposable disposables)

// flag updates from RandomizerConfiguration always overwrites our flag input
Main.FlagsObservable
.Do(x => FlagsValidSubject.OnNext(true))
.Subscribe(flags => FlagInput = flags)
.DisposeWith(disposables);

Expand Down
14 changes: 7 additions & 7 deletions CrossPlatformUI/Views/RandomizerView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<StackPanel Orientation="Vertical">
<Grid ColumnDefinitions="2*, *, 196" RowDefinitions="Auto" Margin="0">
<StackPanel Grid.Column="0" Margin="4 8 0 8">
<TextBox UseFloatingWatermark="True" Watermark="Paste Flags Here" p1:TextFieldAssist.Label="Flag String" Text="{Binding FlagInput}">
<TextBox UseFloatingPlaceholder="True" PlaceholderText="Paste Flags Here" p1:TextFieldAssist.Label="Flag String" Text="{Binding FlagInput}">
<TextBox.InnerRightContent>
<Button Name="PresetsButton" ToolTip.Tip="Presets" Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}">
<Button.Content>
<avalonia:MaterialIconExt Kind="OrderBoolAscendingVariant" Size="32"/>
<avalonia:MaterialIconExt Kind="OrderBoolAscendingVariant" IconSize="32"/>
</Button.Content>
<Button.Flyout>
<MenuFlyout>
Expand Down Expand Up @@ -122,18 +122,18 @@
</StackPanel>

<StackPanel Grid.Column="1">
<TextBox UseFloatingWatermark="True" Watermark="Paste Seed Here" p1:TextFieldAssist.Label="Seed" Text="{Binding Seed}">
<TextBox UseFloatingPlaceholder="True" PlaceholderText="Paste Seed Here" p1:TextFieldAssist.Label="Seed" Text="{Binding Seed}">
<TextBox.InnerRightContent>
<Button ToolTip.Tip="Generate a random number as your Seed" Classes="Flat" Padding="4" Width="{Binding $self.Bounds.Height}"
Content="{avalonia:MaterialIconExt Kind=DiceMultiple, Size=32}" Command="{Binding RerollSeed}" />
Content="{avalonia:MaterialIconExt Kind=DiceMultiple, IconSize=32}" Command="{Binding RerollSeed}" />
</TextBox.InnerRightContent>
</TextBox>
</StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
<Button HorizontalAlignment="Right" Width="128" Content="Generate" IsEnabled="{Binding CanGenerateObservable^}"
<Button HorizontalAlignment="Right" Width="112" Content="Generate" IsEnabled="{Binding CanGenerateObservable^}"
Command="{Binding Generate}" />
<Menu Padding="0" Margin="0" Width="64" ToolTip.Tip="Menu">
<MenuItem Height="48" Width="48" Header="{avalonia:MaterialIconExt Kind=Cog, Size=32}" Cursor="Hand">
<Menu Padding="0" Margin="0" Width="80" ToolTip.Tip="Menu">
<MenuItem Height="48" Width="64" Header="{avalonia:MaterialIconExt Kind=Cog, IconSize=32}" Cursor="Hand">
<MenuItem Header="{Binding AppVersion}" IsEnabled="false">
</MenuItem>
<MenuItem Header="Check For Updates" IsVisible="{Binding IsDesktop}" Command="{Binding CheckForUpdates}" >
Expand Down
5 changes: 2 additions & 3 deletions CrossPlatformUI/Views/SaveNewPresetView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
x:Class="CrossPlatformUI.Views.SaveNewPresetView">
<Grid RowDefinitions="*, Auto">
<StackPanel VerticalAlignment="Center">
<TextBox UseFloatingWatermark="True"
Name="PresetNameTextBox"
Watermark="Preset Name"
<TextBox Name="PresetNameTextBox"
UseFloatingPlaceholder="True" PlaceholderText="Preset Name"
assists:TextFieldAssist.Label="Enter a name for the preset"
Text="{Binding PresetName}" />
</StackPanel>
Expand Down
8 changes: 4 additions & 4 deletions Desktop.Common/Desktop.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
<ItemGroup>
<ProjectReference Include="..\CrossPlatformUI\CrossPlatformUI.csproj" />
<ProjectReference Include="..\RandomizerCore\RandomizerCore.csproj" />
<PackageReference Include="js65.clearscript" Version="$(Js65Version)" />
<PackageReference Include="js65.clearscript" />

<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="7.5.0" Condition="$([MSBuild]::IsOsPlatform('Linux')) and '$(TargetFramework)' != 'net10.0-browser'" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.osx-arm64" Version="7.5.0" Condition="$([MSBuild]::IsOsPlatform('OSX')) and '$(TargetFramework)' != 'net10.0-browser'" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.5.0" Condition="$([MSBuild]::IsOsPlatform('Windows')) and '$(TargetFramework)' != 'net10.0-browser'" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.linux-x64" Condition="$([MSBuild]::IsOsPlatform('Linux')) and '$(TargetFramework)' != 'net10.0-browser'" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.osx-arm64" Condition="$([MSBuild]::IsOsPlatform('OSX')) and '$(TargetFramework)' != 'net10.0-browser'" />
<PackageReference Include="Microsoft.ClearScript.V8.Native.win-x64" Condition="$([MSBuild]::IsOsPlatform('Windows')) and '$(TargetFramework)' != 'net10.0-browser'" />
</ItemGroup>
</Project>
6 changes: 0 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<Js65Version>1.0.7</Js65Version>
<AvaloniaVersion>11.3.12</AvaloniaVersion>
<DialogHostAvaloniaVersion>0.10.4</DialogHostAvaloniaVersion>
<MaterialAvaloniaVersion>3.13.4</MaterialAvaloniaVersion>
<MaterialIconsAvaloniaVersion>2.4.1</MaterialIconsAvaloniaVersion>
<SkiaSharpVersion>2.88.9</SkiaSharpVersion> <!-- Match version used by Avalonia internally -->
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
Expand Down
64 changes: 64 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally Condition="'$(MSBuildProjectName)' != 'FtRandoLib'">true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
<RoslynVersion>5.3.0</RoslynVersion>
<ClearScriptVersion>7.5.1</ClearScriptVersion>
<Js65Version>1.0.7</Js65Version>
<AvaloniaVersion>12.0.3</AvaloniaVersion>
<SkiaSharpVersion>3.119.4-preview.1.1</SkiaSharpVersion>
</PropertyGroup>
<ItemGroup>
<!-- Core -->
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.8" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="$(RoslynVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="$(RoslynVersion)" />
<PackageVersion Include="PolySharp" Version="1.15.0" />
<!-- ClearScript -->
<PackageVersion Include="Microsoft.ClearScript" Version="$(ClearScriptVersion)" />
<PackageVersion Include="Microsoft.ClearScript.Core" Version="$(ClearScriptVersion)" />
<PackageVersion Include="Microsoft.ClearScript.V8" Version="$(ClearScriptVersion)" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="$(ClearScriptVersion)" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.osx-arm64" Version="$(ClearScriptVersion)" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.win-x64" Version="$(ClearScriptVersion)" />
<!-- js65 -->
<PackageVersion Include="js65.browser" Version="$(Js65Version)" />
<PackageVersion Include="js65.clearscript" Version="$(Js65Version)" />
<PackageVersion Include="js65.interop" Version="$(Js65Version)" />
<!-- Avalonia -->
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Browser" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
<PackageVersion Include="Avalonia.Fonts.Inter" Version="$(AvaloniaVersion)" />
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.1" />
<PackageVersion Include="DialogHost.Avalonia" Version="0.12.2" />
<!-- Material Avalonia -->
<PackageVersion Include="Material.Avalonia" Version="3.17.0" />
<PackageVersion Include="Material.Icons.Avalonia" Version="3.0.2" />
<!-- Skia -->
<PackageVersion Include="SkiaSharp" Version="$(SkiaSharpVersion)" />
<!-- ReactiveUI -->
<PackageVersion Include="DynamicData" Version="9.4.31" />
<PackageVersion Include="ReactiveUI" Version="23.2.27" />
<PackageVersion Include="ReactiveUI.Avalonia" Version="12.0.1" />
<PackageVersion Include="ReactiveUI.Validation" Version="7.0.5" />
<!-- Misc -->
<PackageVersion Include="Aigamo.ResXGenerator" Version="4.3.0" />
<PackageVersion Include="NLog" Version="6.1.3" />
<PackageVersion Include="SD.Tools.Algorithmia" Version="1.4.0" />
<PackageVersion Include="Xaml.Behaviors.Interactions" Version="12.0.0.1" />
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="5.1.0" />
<!-- Statistics -->
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="10.0.8" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.8" />
<PackageVersion Include="SQLite" Version="3.13.0" />
<PackageVersion Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageVersion Include="System.Data.SQLite" Version="2.0.3" />
<!-- Test -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageVersion Include="MSTest.TestAdapter" Version="4.2.3" />
<PackageVersion Include="MSTest.TestFramework" Version="4.2.3" />
<PackageVersion Include="FluentAssertions" Version="8.10.0" />
<PackageVersion Include="coverlet.collector" Version="10.0.1" />
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions RandomizerCore/Overworld/Climate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using SD.Tools.Algorithmia.GeneralDataStructures;
using System;
using System;
using System.Collections.Generic;
using System.Linq;

Expand Down
12 changes: 5 additions & 7 deletions RandomizerCore/RandomizerCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DynamicData" Version="9.4.1" />
<!-- <PackageReference Include="js65.interop" Version="1.0.0-alpha3" />-->
<!-- <ProjectReference Include="..\..\js65\integrations\dotnet\js65\js65.csproj" />-->
<PackageReference Include="js65.interop" Version="$(Js65Version)" />
<PackageReference Include="SD.Tools.Algorithmia" Version="1.4.0" />
<PackageReference Include="NLog" Version="6.1.1" />
<PackageReference Include="DynamicData" />
<PackageReference Include="js65.interop" />
<PackageReference Include="NLog" />
<PackageReference Include="SD.Tools.Algorithmia" />
<PackageReference Include="SkiaSharp" />
<ProjectReference Include="..\CoreSourceGenerator\CoreSourceGenerator.csproj" ReferenceOutputAssembly="false" OutputItemType="Analyzer" />
<ProjectReference Include="..\FtRandoLib\FtRandoLib.csproj" NoWarn="IL2026;IL2091" />
<TrimmerRootAssembly Include="FtRandoLib" />
<TrimmerRootAssembly Include="CoreSourceGenerator" />
<PackageReference Include="SkiaSharp" Version="$(SkiaSharpVersion)" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading