Skip to content

Commit 1656224

Browse files
authored
Rewrite with AvaloniaUI (#40)
* try avalonia ui * add veldrid/imgui and maui experiments as well * ava progress * make veldridgui compile * progress * actually a partial working ui... * remove old ui experiments, get avagui working * add treeview * get treeview showing icons * add vehicle icons, polish * working view-per-object * try using propertygrid * some kind of bastardized stringtable viewing * dictioanry experimenting * add yet another avalonia experiment with datagrids. this one actually seems to have working bindings... * update packages * working string table * progress * also try maui again * working maui, avagui file viewer additions * start menuing * attempt to get menus working * add logging viewer * fix menu bug * fix old gui after merge * working avalonia image table * misc fixes, stop initialisation of null image table * code warnings fixes * remove outdated projects * at least display strings * add support for displaying and loading object/data directories * start work on new object format * start adding sc5/sv5 file support * add gamestate object and work towards a workinf implementation * more attributes * split sc/v file structs, undo uint index changes * add working scv5 loading * sc/v5 parsing mostly works now * start using data templates for the object views * cleanup repo * add missing png assets to the repo * re-enable images previously disabled * add validate method to s5header * working file->load dir * add 'open settings folder' button', allow adding of new obj dirs * add version checking * attempt to add delete objdir functionality but avalonia prevents it * small ui cleanups * remove old avaguistringtable project * add some UI tweaks * add object reload functionality, and pencil in save functionality * use expander for logs tab * add image export and import * update some objects from openloco updates * fix bug in industry save
1 parent 1be5b19 commit 1656224

File tree

116 files changed

+3374
-407
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+3374
-407
lines changed

.editorconfig

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ charset = utf-8
99
end_of_line = crlf
1010
insert_final_newline = true
1111
trim_trailing_whitespace = true
12+
dotnet_style_prefer_collection_expression = when_types_loosely_match:suggestion
13+
dotnet_style_namespace_match_folder = true:suggestion
1214

1315
# C# files
1416
[*.csproj]
@@ -421,18 +423,6 @@ dotnet_diagnostic.SA1602.severity = none
421423
dotnet_diagnostic.SA1649.severity = none
422424
dotnet_diagnostic.SA1633.severity = none
423425

424-
dotnet_diagnostic.WTG1001.severity = warning
425-
dotnet_diagnostic.WTG1002.severity = warning
426-
dotnet_diagnostic.WTG1011.severity = warning
427-
dotnet_diagnostic.WTG1009.severity = none
428-
dotnet_diagnostic.WTG1012.severity = warning
429-
dotnet_diagnostic.WTG1013.severity = none
430-
dotnet_diagnostic.WTG3001.severity = warning
431-
dotnet_diagnostic.WTG3002.severity = warning
432-
dotnet_diagnostic.WTG3003.severity = warning
433-
dotnet_diagnostic.WTG3005.severity = warning
434-
dotnet_diagnostic.WTG3006.severity = warning
435-
dotnet_diagnostic.WTG3008.severity = warning
436-
dotnet_diagnostic.WTG3011.severity = warning
426+
dotnet_diagnostic.RCS1217.severity = none
437427

438428
dotnet_diagnostic.RS0030.severity = error

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,4 +351,3 @@ MigrationBackup/
351351

352352
# MonoGame
353353
*.xnb
354-
*.png

AvaGui/App.axaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<Application xmlns="https://github.com/avaloniaui"
2+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
x:Class="AvaGui.App"
4+
xmlns:local="using:AvaGui"
5+
RequestedThemeVariant="Default">
6+
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
7+
8+
<Application.DataTemplates>
9+
<local:ViewLocator/>
10+
</Application.DataTemplates>
11+
12+
<Application.Styles>
13+
<FluentTheme />
14+
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>
15+
</Application.Styles>
16+
17+
</Application>

AvaGui/App.axaml.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
using AvaGui.ViewModels;
2+
using AvaGui.Views;
3+
using Avalonia;
4+
using Avalonia.Controls.ApplicationLifetimes;
5+
using Avalonia.Markup.Xaml;
6+
7+
namespace AvaGui
8+
{
9+
public partial class App : Application
10+
{
11+
public override void Initialize()
12+
{
13+
AvaloniaXamlLoader.Load(this);
14+
}
15+
16+
public override void OnFrameworkInitializationCompleted()
17+
{
18+
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
19+
{
20+
desktop.MainWindow = new MainWindow
21+
{
22+
DataContext = new MainWindowViewModel(),
23+
};
24+
}
25+
26+
base.OnFrameworkInitializationCompleted();
27+
}
28+
}
29+
}

AvaGui/Assets/loco_icon.ico

121 KB
Binary file not shown.
23.6 KB
Loading
5.21 KB
Loading

AvaGui/Assets/palette.png

694 Bytes
Loading

AvaGui/Assets/vanilla.png

440 Bytes
Loading

AvaGui/AvaGui.csproj

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<OutputType>WinExe</OutputType>
4+
<TargetFramework>net8.0</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
7+
<ApplicationManifest>app.manifest</ApplicationManifest>
8+
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
9+
<StartupObject>AvaGui.Program</StartupObject>
10+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<AvaloniaResource Include="Assets\**" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<None Remove="version.txt" />
19+
</ItemGroup>
20+
21+
<ItemGroup>
22+
<EmbeddedResource Include="version.txt" />
23+
</ItemGroup>
24+
25+
26+
<ItemGroup>
27+
<PackageReference Include="Avalonia" Version="11.0.11" />
28+
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.0.11" />
29+
<PackageReference Include="Avalonia.Desktop" Version="11.0.11" />
30+
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.11" />
31+
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.11" />
32+
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
33+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.11" />
34+
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.11" />
35+
<PackageReference Include="bodong.Avalonia.PropertyGrid" Version="11.0.10.1" />
36+
<PackageReference Include="bodong.PropertyModels" Version="11.0.10.1" />
37+
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
38+
<PackageReference Include="ReactiveUI.Validation" Version="4.0.9" />
39+
<PackageReference Include="Zenith.Core" Version="1.0.20" />
40+
</ItemGroup>
41+
42+
43+
<ItemGroup>
44+
<ProjectReference Include="..\Core\Core.csproj" />
45+
<ProjectReference Include="..\Shared\Shared.csproj" />
46+
</ItemGroup>
47+
48+
49+
<ItemGroup>
50+
<Compile Update="Views\VehicleView.axaml.cs">
51+
<DependentUpon>VehicleView.axaml</DependentUpon>
52+
</Compile>
53+
</ItemGroup>
54+
</Project>

0 commit comments

Comments
 (0)