A tool allowing modders to easily add a visual preview in MCM for the position of on-screen widgets. NOT A GAMEPLAY ADDON.
THIS IS NOT A GAMEPLAY ADDON. IT DOES NOTHING ON ITS OWN. IT IS A TOOL FOR MOD DEVELOPMENT, AND IT IS PROVIDED AS-IS.
This tool allows any modder to add a preview in MCM that lets their users visualize the position of an on-screen widget based on its XY canvas coordinates. Extremely flexible and customizable, allowing you to provide your own custom images and fine-tune the behavior for your addon.
Why is this useful?
The XY coordinates of screen elements in Anomaly are canvas coordinates, not screen coordinates. In other words, the XY coordinates will always be in 1024x768, and these coordinates get translated by the game engine into the user's screen coordinates.
This can make it very difficult to get an on-screen widget or indicator positioned exactly where the user wants it, often requiring a lot of trial-and-error with picking a value, seeing how it looks in-game, then going back to MCM again and again to adjust it.
The previewer lets them see a preview of exactly where on the screen the element would appear based on the XY coordinates they set in MCM, which updates live as each change is made. They can select between four different aspect ratios (16:9, 16:10, 21:9, and 4:3) and the preview will change to simulate a screen with the chosen aspect.
Almost none of this work needs to be done by the modder. For the most part, all that is necessary other than including the main installation is to add a small amount of code and attributes to your MCM script.
This is provided as-is. Please don't ask me to explain how to use it--the code is very thoroughly documented, in the comments, a how-to demo is included and I just don't have the time to teach people how to mod.
Update history:
1.2: Corrected version number (shipped as 1.1 but filename was 1.0) and a misleading typo in the header documentation for the texture prefix. No functional change.
The 1.0 version had a minor typo in the header comments that noted the wrong default value for the texture prefix. No functional change, it just might've confused someone.
This isn't game changing yet, but this is modding-changing for sure, I cant wait to see this in use, will definitely make adjusting stuff better for consumers of the addons.
I might even try to apply this to some other mods, see if I can share edits with compatibility for this without taking any credit
Bravo!