Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: StandardWindow.Emblem can not handle AsyncTexture2D from GameService.Content.DatAssetCache.TryGetTextureFromAssetId #899

Open
Taschenbuch opened this issue Aug 8, 2023 · 1 comment

Comments

@Taschenbuch
Copy link
Contributor

StandardWindow.Emblem is of type Texture2D and can not handle AsyncTexture2D from GameService.Content.DatAssetCache.TryGetTextureFromAssetId. This results in the window emblem not being displayed. Example code

GameService.Content.DatAssetCache.TryGetTextureFromAssetId(603447, out AsyncTexture2D mugTexture);

new StandardWindow(
    _windowBackgroundTexture,
    new Rectangle(40, 26, 913, 691),
    new Rectangle(70, 71, 839, 605))
{
    Parent        = GameService.Graphics.SpriteScreen,
    Title         = "Example Window Title",
    Emblem        = mugTexture,
    Subtitle      = "Example Subtitle",
    Location      = new Point(300, 300),
    SavesPosition = true,
    // Id has to be unique not only in your module but also within blish core and any other module
    Id = $"{nameof(ExampleModule)}_My_Unique_ID_123" 
};
            
_exampleWindow.Show(new OverlaySettingsView());
@dlamkins
Copy link
Member

We actually tried to fix this a while back but realized it was, unfortunately, a breaking change that caused some issues and had to be reverted. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants