NickHugi / PyKotor

A Python library that can read and modify most file formats used by the game Knights of the Old Republic and its sequel.
GNU Lesser General Public License v3.0
11 stars 3 forks source link

Better nwnnsscomp handling #39

Closed th3w1zard1 closed 8 months ago

th3w1zard1 commented 8 months ago

Unify the annoyances with different versions of nwnnsscomp. Mainly this addresses:

When compiling a script in the nss editor, we will prompt a user whether to use the built-in compiler or nwnnsscomp if on Windows. If the user chooses nwnnsscomp and they are not running the tslpatcher, we will temporarily create/set the registry key:

r"HKEY_LOCAL_MACHINE\SOFTWARE\BioWare\SW\KOTOR", "Path"

If the registry key already contained a value, we set it back immediately after the script is compiled. This way the toolset won't ever break a user's setup. God knows enough kotor tools do enough registry manipulation incorrectly already (looking at you, Kotor tool...)

If an include script could not be found (we parse the nwnnsscomp message), we show a qfilebrowser dialog asking the user where to find the include file, then copy it over to the extractPath (where our temporary nss script is sitting) to compile it.

This should unify all nwnnsscomp versions and make handling of nwnnsscomp very easy for end users.