1.5.7965
End of Dec - RC2
C# Scripting - BlazorWindows - added NoActivate
Added very useful property called NoActivate, which, when set, makes it so the window will react to mouse clicks, but will not intercept user focus.
Meaning you can have an overlay with a bunch of controls, allowing user to easily disable and enable some functionality of your bot while game window will remain active.
/// <summary>
/// Gets or sets a value indicating whether the window should NOT be activated when clicked
/// </summary>
bool NoActivate { get; set; }
C# Scripting - BlazorWindows - added ComplexFileProvider
Added to IBlazorWindow one new property and one method. Both of those could be used to
provide custom providers for file data. You can pick whichever flavour you want - add your custom file provider either via RegisterFileProvider or by using AdditionalFileProvider and any file, which you will be referencing in your custom Blazor code, will have access to that file.
It could be runtime-generated styles, could be images, video or anything you may need to create a really dynamic user interfaces.
For now, I would recommend to use built-in:
ComplexFileProvider- allows to combine multiple FileProviders together, resolution will happen in order of additionInMemoryFileProvider- allows to store file data in-memory, files will be cached for better performanceInMemoryFileInfo- allows to create one in-memory file reference. The data is loaded as soon as FileInfo is constructedLazyInMemoryFileInfo- allows to create lazy file reference, which will be loaded only when accessed
which allow you to easily add new content to your pages.
/// <summary>
/// Gets or sets additional file provider which will be used by Blazor
/// </summary>
IFileProvider AdditionalFileProvider { get; set; }
/// <summary>
/// Adds additional file provider which will be used by Blazor. Added to the end of the list.
/// Removed on disposal
/// </summary>
IDisposable RegisterFileProvider(IFileProvider fileProvider);
Example of the code, which will load file from the disk and make it available for use in styles or HTML:
var fileProvider = new InMemoryFileProvider();
fileProvider.AddOrUpdate(new InMemoryFileInfo("hello.png", File.ReadAllBytes(@"D:\hello.png")));
Of course, you can generate the displayed data in runtime as well.
Bugfixes/Improvements
- [Scripting] Fixed problem with BlazorWindow Opacity not being set properly under some circumstances