So... What are other modders doing in this regard? Am I missing some obvious built-in way to quickly reload the UI?
For what it helps... After getting a bit fed up today with it all after fiddling with the personnel info screen to add another column and testing out if it still looks fine after changing the UI scaling, I noticed the game actually reloads the UI and even shows a small banner about it when you confirm the change. And with that in mind, I managed to get this little hack going.
ui.xml (just the usual - btw, I can highly recommend using something like serpent for dumping Lua tables in readable format - unless I missed something obvious yet again
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<addon name="azaghal_modding_tests" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ui/core/addon.xsd">
<environment type="menus">
<file name="ui/serpent.lua"/>
<file name="ui/testing.lua"/>
<file name="ui/reload.lua"/>
<dependency name="ego_detailmonitor" />
<dependency name="ego_detailmonitorhelper" />
</environment>
</addon>
Code: Select all
local m = {}
function m.init()
m.menu = Helper.getMenu("HelpMenu")
m.originalFunctions = {}
m.originalFunctions.closeMenu = m.menu.closeMenu
m.menu.closeMenu = m.closeMenu
end
function m.closeMenu(...)
m.originalFunctions.closeMenu(...)
Helper.addDelayedOneTimeCallbackOnUpdate(function () ScheduleReloadUI() end, true, getElapsedTime() + 0.1)
Helper.getMenu("OptionsMenu").displayInit(ReadText(1001, 409))
end
m.init()
P.S.
I am going to be _super_ annoyed if this was a well-known thing, or somebody already posted a hack like this, but oh well


