Skip to content

Commit fdc4eb2

Browse files
authored
Add metadata, database, webserver (#62)
* add metadata support * read glens database and display it in editor * add basic http stuff * add basic webserver connection for online object viewing * add database and web server basics * cleaner webserver impl * make web server read from database instead of text filesgit add .git add .! * The Great Refactor * more namespace refactor and cleanup * log error when server cannot connect * add rate limiting * folder rename * update project references * add taglinks * working taglinks * add failed objects to index (just filename) * trim all s5 names, also write padded string back * add modpack tags * prevent reentrancy on object indexing * cleanup * fix object service/db * clean up ui a little with window styles * make wingui work again
1 parent ca0f3a2 commit fdc4eb2

File tree

212 files changed

+2775
-1137
lines changed

Some content is hidden

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

212 files changed

+2775
-1137
lines changed

AvaGui/AvaGui.csproj

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
<FileVersion>$(Version)</FileVersion>
1515
<AssemblyName>ObjectEditor</AssemblyName>
1616
<Product>$(AssemblyName) $(Version)</Product>
17+
<!-- This is a dummy version that is replaced with the real version either at runtime or at package build time -->
18+
<Version>1.2.3</Version>
1719
<Authors>LeftofZen</Authors>
1820
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
1921
</PropertyGroup>
@@ -23,16 +25,24 @@
2325
</ItemGroup>
2426

2527
<ItemGroup>
26-
<PackageReference Include="Avalonia" Version="11.1.1" />
27-
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="11.1.1" />
28-
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.1.1" />
29-
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.1.1" />
30-
<PackageReference Include="Avalonia.Desktop" Version="11.1.1" />
31-
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.1" />
32-
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.1" />
28+
<None Remove="version.txt" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<EmbeddedResource Include="version.txt" />
33+
</ItemGroup>
34+
35+
<ItemGroup>
36+
<PackageReference Include="Avalonia" Version="11.1.3" />
37+
<PackageReference Include="Avalonia.Controls.ColorPicker" Version="11.1.3" />
38+
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.1.3" />
39+
<PackageReference Include="Avalonia.Controls.ItemsRepeater" Version="11.1.3" />
40+
<PackageReference Include="Avalonia.Desktop" Version="11.1.3" />
41+
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.3" />
42+
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.3" />
3343
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
34-
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0" />
35-
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.1" />
44+
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.3" />
45+
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.3" />
3646
<PackageReference Include="bodong.Avalonia.PropertyGrid" Version="11.1.1.1" />
3747
<PackageReference Include="bodong.PropertyModels" Version="11.1.1.1" />
3848
<PackageReference Include="Material.Icons.Avalonia" Version="2.1.10" />
@@ -44,7 +54,8 @@
4454
</ItemGroup>
4555

4656
<ItemGroup>
47-
<ProjectReference Include="..\Core\Core.csproj" />
48-
<ProjectReference Include="..\Shared\Shared.csproj" />
57+
<ProjectReference Include="..\Dat\Dat.csproj" />
58+
<ProjectReference Include="..\DatabaseSchema\DatabaseSchema.csproj" />
59+
<ProjectReference Include="..\Common\Common.csproj" />
4960
</ItemGroup>
5061
</Project>

AvaGui/Models/FileSystemItemGroup.cs renamed to AvaGui/Models/FileSystemItems.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,28 @@
1-
using OpenLoco.ObjectEditor.Data;
2-
using OpenLoco.ObjectEditor.Objects;
1+
using OpenLoco.Dat.Data;
2+
using OpenLoco.Dat.Objects;
3+
using System;
34
using System.Collections.ObjectModel;
45

56
namespace AvaGui.Models
67
{
8+
[Flags]
9+
public enum FileLocation
10+
{
11+
Local,
12+
Online,
13+
}
14+
715
public abstract record FileSystemItemBase(string Path, string Name, ObservableCollection<FileSystemItemBase>? SubNodes = null)
816
{
917
public string NameComputed
1018
=> $"{Name}{(SubNodes == null ? string.Empty : $" ({SubNodes.Count})")}"; // nested interpolated string...what have i become
1119
}
1220

13-
public record FileSystemItem(string Path, string Name, SourceGame SourceGame)
21+
public record FileSystemItem(string Path, string Name, SourceGame SourceGame, FileLocation FileLocation)
1422
: FileSystemItemBase(Path, Name, null);
1523

16-
public record FileSystemDatGroup(string Path, DatFileType DatFileType, ObservableCollection<FileSystemItemBase> SubNodes)
17-
: FileSystemItemBase(Path, DatFileType.ToString(), SubNodes);
24+
//public record FileSystemDatGroup(string Path, DatFileType DatFileType, ObservableCollection<FileSystemItemBase> SubNodes)
25+
// : FileSystemItemBase(Path, DatFileType.ToString(), SubNodes);
1826

1927
public record FileSystemItemGroup(string Path, ObjectType ObjectType, ObservableCollection<FileSystemItemBase> SubNodes)
2028
: FileSystemItemBase(Path, ObjectType.ToString(), SubNodes);

AvaGui/Models/IUiObjectWithGraphics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using OpenLoco.ObjectEditor.Headers;
1+
using OpenLoco.Dat.Types;
22
using System.Collections.Generic;
33
using System.ComponentModel;
44

AvaGui/Models/LanguageTranslation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using OpenLoco.ObjectEditor.Data;
1+
using OpenLoco.Dat.Data;
22
using ReactiveUI;
33
using ReactiveUI.Fody.Helpers;
44

AvaGui/Models/NewObjectFormat.cs

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)