Developer information below
Contents
Mod Assistant expects to be built using at least Node 16.x, 18.x is preferred.
Mod Assistant requires Yarn to build. Note that for windows, you may have to run powershell as Administrator
to globally install it correctly
If using VSCode, the build files already exist, just press F5
to run the program. If running from the command line, use
Before running for the first time, you must build the dependencies. Run yarn in the repo folder.
# yarn
# .\node_modules\.bin\electron .
# npm run dist
This package provides a number of test cases:
# npm test
See if translation files match keys
# npm run lang_test
If translation files are mismatched, this will fix it (english is master)
# npm run lang_fix
This is for an automated system for checking dependency versions
# npm run depends
modAssist_main.js
: Master electron server process- F:
/build
: Build files (icons) - F:
/lib
: Custom libraries for master processddsLibrary.js
: DDS -> PNG conversionma-logger.js
: Logging classsavegame-parser.js
: Save game file/folder parsersingle-mod-checker.js
: Mod parsertranslate.js
: Localization library
- F:
/renderer
: User facing renderer files<window name>.html
: Render side HTML- F:
/img
: Image includes - F:
/inc
: 3rd Party scripts and CSS - F:
/preload
: Preload scripts, name is preload-<window name>.js, runs privileged - F:
/renderJS
: Render side script, name is _<window name>_ui.js`, runs sandboxedfsg_util.js
: Utility libraries, loaded everywhere (sandboxed)key_lookup_table.js
: Used to map keybindings to pretty text, detail screenselect_lib_ui.js
: Selection library, main screen
- F:
/test
: Test files and scripts - F:
/translations
: Localization files
The one exception to the naming scheme is main.html
uses assist_ui.js
-
getText(key)
: Insert localization HTML tag -
fsgUtil
led
: Giants LED operation stringsbyId(id)
: Get HTML element by IDquery(query)
: Run querySelectorAllgetIconSVG(type)
: Get named SVG IcongetIcon(type,cls)
: Get named SVG Icon encapsulated in classbuildSelectOpt(value, text, selected, disabled, title)
: Built HTML select optiongetAttribNullError(element, attrib)
: Get HTML attribute from element, throw error if it doesn't existgetAttribNullEmpty(element, attrib)
: Get HTML attribute from element, return null if it doesn't existbuildBS(name, value)
: Build a BootStrap date attribute name, with valuebytesToHR(inBytes,locale)
: Make byte value human readable using localebasename(name, sep = '\\')
: Renderer version of path.basename()iconMaker(icon)
: Return base64 icon or placeholder iconnotesDefault(notes, collection, key, defaultValue)
: Retrieve collection note detail if it exists.escapeDesc( text )
: Escape special characters in the mod descriptionescapeSpecial( text )
: Escape special charactersbadge : (color, name, fullName = false)
: Make localized badge using color class color, with name. If fullName is false, addmod_badge_
to name
Any pull request is fine, please try and squash atomic commits first, but it's not a deal breaker. Please be verbose in your description of what the pull request does.