Need help with a small UI mod

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

Hellglaiver
Posts: 3
Joined: Tue, 14. Apr 26, 01:09

Need help with a small UI mod

Post by Hellglaiver »

I wanted to make a small UI mod that prevents Left Mouse Button from interacting with message ticker box and target monitor box. I managed to find a file which is responsible for this interaction-- monitors.lua and lines of code (for example):

function onMouseClickMessageTickerFooter(_, delayed)

if delayed then

return -- only perform action, if not delayed

end



C.QuickMenuAccess("logbookmenu")

end



function onMouseClickMessageTickerNotification(_, delayed)

if delayed then

return -- only perform action, if not delayed

end



C.QuickMenuAccess("messagemenu")

end



function onMouseClickMessageTickerChatNotification(_, delayed)

if delayed then

return -- only perform action, if not delayed

end



C.QuickMenuAccess("chat")

end



function onMouseClickMessageTickerRow1(_, delayed)

-- #coreUIMed - maybe add a check to see if at the point of evaluating the click event we still have an active display of the "inactive missions" line (i.e. prevent cases where in the same frame the inactive mission line was removed)

if delayed then

return -- only perform action, if not delayed

end



C.QuickMenuAccess("missionmanagermenu")

end

But even when I delete all these lines of code or make them into comments, create my mod folder in extensions, put this file there and create context.xml, my mod does not work. Protected UI Mode is off and I can see my mod in the list.
I dont know if I am editing my code wrong or deploying the mod wrong. If you could give me some advice it would be greatly appreciated.
User avatar
ChemODun
Posts: 612
Joined: Mon, 12. Feb 07, 21:58
x4

Re: Need help with a small UI mod

Post by ChemODun »

I saw recommendation for to look on kuertee UI Extension and HUD.
You have to use the same approach:
  • Changed by you files you have to put into appropriate subfolders (ui/...) but with xpl extension, not lua
  • Make not only content.xml but in addition ui.xml, again you can take a kuertee file as example. Name package in ui can be differ from content.xml but patches should comply with real ones
  • Copy ui folder, conten.xml, ui.xml in your mod folder in folder extensions in game folder
  • Copy to XRCatTool.exe to a game folder
  • Take dev-make-cat-file.bat from kuertee mod and adopt it for your mod folder
  • Execute a bat
  • It has to produce subst01.cat/dat files, check content of cat, if right files are listed
And then try to run. And for sure - UI Extensions and HUD has not be installed. SWI should not be installed.
Multiply entropy by absolute zero

Freedom in space
Hellglaiver
Posts: 3
Joined: Tue, 14. Apr 26, 01:09

Re: Need help with a small UI mod

Post by Hellglaiver »

It actually worked! Thank you, ChemODun!
User avatar
ChemODun
Posts: 612
Joined: Mon, 12. Feb 07, 21:58
x4

Re: Need help with a small UI mod

Post by ChemODun »

Welcome!
Multiply entropy by absolute zero

Freedom in space

Return to “X4: Foundations - Scripts and Modding”