Skip to content
Merged
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
26 changes: 13 additions & 13 deletions code/HellMapManager/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public override async void OnFrameworkInitializationCompleted()
{
// Avoid duplicate validations from both Avalonia and the CommunityToolkit.
// More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins
DisableAvaloniaDataAnnotationValidation();
// DisableAvaloniaDataAnnotationValidation();
AppUI.Main.MapDatabase = AppKernel.MapDatabase;
AppUI.Main.Desktop = desktop;
AppKernel.MapDatabase.SettingsUpdatedEvent += (sender, args) => { settingsHelper.Save(AppKernel.MapDatabase.Settings); };
Expand Down Expand Up @@ -82,19 +82,19 @@ private async void OnAppExit(object? sender, ControlledApplicationLifetimeExitEv
await APIServer.Instance.Stop();
}

[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
private void DisableAvaloniaDataAnnotationValidation()
{
// Get an array of plugins to remove
var dataValidationPluginsToRemove =
BindingPlugins.DataValidators.OfType<DataAnnotationsValidationPlugin>().ToArray();
// [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "<Pending>")]
// private void DisableAvaloniaDataAnnotationValidation()
// {
// // Get an array of plugins to remove
// var dataValidationPluginsToRemove =
// BindingPlugins.DataValidators.OfType<DataAnnotationsValidationPlugin>().ToArray();

// remove each entry found
foreach (var plugin in dataValidationPluginsToRemove)
{
BindingPlugins.DataValidators.Remove(plugin);
}
}
// // remove each entry found
// foreach (var plugin in dataValidationPluginsToRemove)
// {
// BindingPlugins.DataValidators.Remove(plugin);
// }
// }
public void ShowAbout(object? sender, EventArgs args)
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
Expand Down
16 changes: 8 additions & 8 deletions code/HellMapManager/HellMapManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.3.9" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.3.9" />
<PackageReference Include="Avalonia.Controls.PanAndZoom" Version="11.2.0" />
<PackageReference Include="Avalonia.Desktop" Version="11.3.9" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.9" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.9" />
<PackageReference Include="Avalonia" Version="12.0.1" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="12.0.0" />
<PackageReference Include="PanAndZoom" Version="12.0.0" />
<PackageReference Include="Avalonia.Desktop" Version="12.0.0" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="12.0.0" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="12.0.0" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Include="Avalonia.Diagnostics" Version="11.3.9">
<PackageReference Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.0" >
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
</PackageReference>
<PackageReference Include="AvaloniaGraphControl" Version="0.6.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.1" />
<PackageReference Include="MessageBox.Avalonia" Version="3.2.0" />
<PackageReference Include="MessageBox.Avalonia" Version="12.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="2.3.0" />
<PackageReference Include="System.CommandLine" Version="2.0.1" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion code/HellMapManager/Misc/AppVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace HellMapManager.Misc;

public class AppVersion(int major, int minor, int patch)
{
public static AppVersion Current { get; } = new(0, 20260420, 0);
public static AppVersion Current { get; } = new(0, 20260511, 0);
public int Major { get; } = major;
public int Minor { get; } = minor;
public int Patch { get; } = patch;
Expand Down
16 changes: 7 additions & 9 deletions doc/api/example/dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ local file=assert(io.open("hongchen.hmm","r"))
local data=file:read("*a")
file:close();
hmm:call("import",data)
-- npc不会使用的出口
local blacklist={"ask ","yell ","cross","jump ","enter "}

-- 当前位置
local blacklist={"ask ","yell ","cross","jump ","enter "}
local current="3431"

local search=hmmlib.SearchRooms.new()
Expand All @@ -37,8 +35,8 @@ local dilate=hmmlib.Dilate.new()
dilate.Source=yzrooms
-- 膨胀3步
dilate.Iterations=3
dilate.MapperOptions=hmmlib.MapperOptions.new()
dilate.MapperOptions.CommandNotContains=blacklist
dilate.Options=hmmlib.MapperOptions.new()
dilate.Options.CommandNotContains=blacklist
local rooms=json.decode(hmm:call("dilate",json.encode(dilate)))
print(json.encode(rooms))
local query=hmmlib.QueryPathAny.new()
Expand All @@ -54,16 +52,16 @@ allquery.Target=rooms
local allresult=json.decode(hmm:call("querypathall",json.encode(allquery)))
print(json.encode(allresult))


```

## python 代码

```python
import json
import hmmpy
## npc不会使用的出口

blacklist=["ask ","yell ","cross","jump ","enter "]
## 当前位置
current="3431"
hmm = hmmpy.HMMDll("./HellMapManager.so")
with open('hongchen.hmm', 'r', encoding='utf-8') as f:
Expand All @@ -78,8 +76,8 @@ dilate=hmmpy.Dilate()
dilate.Source=yzrooms
## 膨胀3步
dilate.Iterations=3
dilate.MapperOptions=hmmpy.MapperOptions()
dilate.MapperOptions.CommandNotContains=blacklist
dilate.Options=hmmpy.MapperOptions()
dilate.Options.CommandNotContains=blacklist
rooms=json.loads(hmm.call("dilate",hmm.encode(dilate)))
print(rooms)
query=hmmpy.QueryPathAny()
Expand Down