-
Notifications
You must be signed in to change notification settings - Fork 237
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
Fix icon loading #3450
Fix icon loading #3450
Conversation
Improves overall code style and removes directly loading in of ui-related textures.
This allows us to send data to blueprints.lua
The pipeline works in terms of receiving the data at the right moment. But - no icon is rendered. Thoughts on what could be going wrong? I suspect it is the path. You can use this mod to see the logs happening, make sure it is activated: An example of how it works right now with the same unit, which is a path that starts at the folder in question (/textures/ui/something/something/strategicicons). Downside of current approach: if the sim would use this value in the blueprint for some reason then it would desync on the spot. I do not expect this to be the case however. I have not yet checked if it desyncs the game when multiply people have different ui mods that change the icons. |
I think I got it working reliably now, here you have a mod to test with: I can't check if it causes a desync in multiplayer - when testing locally both instances try to read the same prefs file and it causes one to lock out the other - so the other crashes. I need someone else to help test that. |
Keyser and I tested this PR tonight - it works! 🪂 |
And a few examples on how to work with this new approach to loading icons: With thanks to Balthazar for the discussions and the alternative icon set for ASI. |
A few notes on this PR:
|
Do I need change my icons file structure now? |
Not sure - if it is for a sim mod then I don't think so. If it is for a UI mod then yes, 100% certain. |
In particular, a lua parsing error does not appear to stop executing and therefore it not caught by the pcall we used. Instead, we're now checking if either values that we expect are set and if none of them are then we expect something to be at odds.
This branch will try to fix the icon loading procedure that was added during the 3721 patch. It is very broken from many perspectives, including:
These two combined can result in strange behavior, such as inactive mods interfering with the base game. An example as reported by FtGr is the following:
![image](https://user-images.githubusercontent.com/15778155/134799761-9daa0182-322b-4fdb-87e5-008d054b72b2.png)
![image](https://user-images.githubusercontent.com/15778155/134799767-6596f9e8-7919-4355-a0a3-a3ed3dd43d4c.png)
These are probably defined in some mod on his system. They override the default icons on the UI.