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

Automatic icon loading for Spawnable doesn't work #273

Closed
dmchurch opened this issue Aug 28, 2022 · 0 comments · Fixed by #277
Closed

Automatic icon loading for Spawnable doesn't work #273

dmchurch opened this issue Aug 28, 2022 · 0 comments · Fixed by #277

Comments

@dmchurch
Copy link

The directions to simply place a .png in the mod directory don't work, because it looks in the wrong place, because AssetsFolder doesn't default to the mod directory.

Assembly.GetExecutingAssembly() is the wrong call here; at that instant, code from SMLHelper is running, so it will always return the SMLHelper directory.

https://github.com/SubnauticaModding/SMLHelper/blob/8dc2aae055f52cf0b9e2fdaf8a61dd768cc6bc17/SMLHelper/Assets/Spawnable.cs#L184

Leading to:

[SMLHelper/Error] Sprite for 'SurveyToolPrefab'
Did not find an image file at 'C:\Program Files (x86)\Steam\steamapps\common\Subnautica\QMods\Modding Helper\SurveyTool.png'

Presumably this wants to just reference the internal Mod field set by ModPrefab, yes?

https://github.com/SubnauticaModding/SMLHelper/blob/8dc2aae055f52cf0b9e2fdaf8a61dd768cc6bc17/SMLHelper/Assets/ModPrefab.cs#L81

@Metious Metious linked a pull request Sep 14, 2022 that will close this issue
@Metious Metious closed this as completed Nov 19, 2022
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

Successfully merging a pull request may close this issue.

2 participants