Support 7.5 and Protected UI Mode #26
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a work in progress with some caveats:
This is not backwards compatible, it should, however, be possible to make it backwards compatible by introducing a shim for the old require paths.I have managed to implement this in a manner that should be entirely backwards compatible in most cases. As in, mods that are not updated to the new format (seesn_better_target_monitor) should still work, provided they're not otherwise broken by 7.5. There may be exceptions if they depend on some very specific load order behaviours.sn_mod_support_apisandsn_better_target_monitorto work with protected UI, however, they do work with it... mostly...These now work with protected UI.Working in protected UI appears to prevent you from usingI have replaced the globals with a very basic module system. The main purpose of it is to manage the initialisation functions asrequireon any user-defined scripts. This means that you cannot use that for dependency management. I primarily work in C# and am not familiar with lua so the only workaround i could find was to setup a global variable to replace thereturnstatement with. I've attempted to use the same naming fashion as the scripts as to help avoid collisions, but it's probably less foolproof than the old system.ui.xmlloads scripts significantly earlier than the mission director would have. This includes being on the main menu. This allows dependent mods avoid rewriting theirrequirestatements as they can use therequirefunction passed to them by thedefinefunction which will attempt to find the module from the module system and return that (after initialising it) instead of calling the nativerequirewhich silently fails (returnsnil) in protected UI mode.