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

Some widget icons are not loaded immediately #2

Open
jwty opened this issue Apr 9, 2020 · 1 comment
Open

Some widget icons are not loaded immediately #2

jwty opened this issue Apr 9, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@jwty
Copy link

jwty commented Apr 9, 2020

First of all, thank you for this amazing library. I am really enjoying the compatibility aspect of it and I hope modders more experienced than me will adapt it soon. However, I came upon an issue, which, while not game breaking, is quite annoying and I'm having trouble solving it, namely some of the icons I tried using in <Widget> section of inserted XMLs (in attached example it's Crafting\craft_icon) do not appear in modified GUI until they are loaded by their respective GUIs first (in attached example it's done by opening smithy GUI). I suppose it might be related to this part of the wiki:

Currently I haven't found a way to alter the very initial parsing of the prefabs, since it happens even before any user modules are loaded into the memory. I'm discouraged to modify game files, therefore the only way is to ask WidgetFactory to reload affected movies after hooks has been set up.

If that's the case and it's expected behaviour then please close this issue, if it's not then, well, maybe there's a way to load specific icons/sprites to memory when a module is loaded? I tried looking through various mods and Bannerlord libraries but since I am an utter noob when it comes to C# and Bannerlord modding I couldn't find anything helpful myself.

For what it's worth, you can reproduce this issue with HorseAmountIndicatorMod by changing Sprite attribute of Widget from HorseAmountIndicator.xml to other icon, like one of the Crafting\* icons.

Example video

@shdwp shdwp self-assigned this Apr 20, 2020
@shdwp shdwp added the enhancement New feature or request label Apr 20, 2020
@shdwp
Copy link
Owner

shdwp commented Apr 20, 2020

I need to review how sprite sheets are actually loaded and if it's something that has to do with XMLs I will make a set of patches to influence it. If it is done from code then it should be done from the code without further assistance from the library.

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

No branches or pull requests

2 participants