UI Modding Tools - LaughingLeader-DOS2-Mods/LeaderLib GitHub Wiki

Links

The Adobe link will need the required playerglobal.swc and Flash CS3 libraries placed in flex_sdk_4.6\frameworks like so:

flex_sdk_4.6\frameworks\libs\player\10.3\playerglobal.swc
flex_sdk_4.6\frameworks\libs\flash.swc
flex_sdk_4.6\frameworks\libs\ik.swc
flex_sdk_4.6\frameworks\libs\PffLib.swc
flex_sdk_4.6\frameworks\libs\tlfruntime.swc

The last 4 swc files are files included with an older Flash installation at a location like so:

FlashProCS6\Adobe Flash CS6\Common\Configuration\ActionScript 3.0\libs
  • Extracted GUI files. Use lslib.
    All the game's various GUI files need to be extracted from Game.pak. Ultimately you may want to extract every pak in patch order since a patch may have updated one of these (such as the gift bag updates). The GUI files are located under Public/Game/GUI.

Setting up JPEXS

  1. Open JPEXS.
  2. Click the Settings tab, then the Advanced Settings button.
  3. Configure the following script settings:
    Script Settings
    Register variable format is what determines what local variable names are. I prefer var1/var2 etc instead of _loc_1.
  4. Set your pathways to the swc and projectors like so:
    Path Settings
  5. Clock "OK" so your settings are saved. The main thing needed here was the swc as you need the right flash version.

Setting up VSCode

The ActionScript & MXML vscode extension will allow you to have syntax highlighting and error checking with your scripts.

  1. Install Visual Studio Code if you haven't already, then install the extension (you can do this from the extension tab if you search for Actionscript).
  2. Click the cog next to the extension entry, then click Extension Settings. Extension Settings Access
  3. Scroll down to the option named As3mxml › Sdk: Framework and click Edit in settings.json.
  4. Set the value to your flex sdk folder, making sure to escape back slashes, like so:
"as3mxml.sdk.framework": "D:\\Modding\\DOS2DE\\UI_Modding\\flex_sdk_4.6"

Creating an asconfig.json

This part is more for when you have a project with scripts set up, but the final requirement the extension needs is a config file to specify the flash version and project type. Create a file named asconfig.json in your workspace and add the following text to it:

{
	"mainClass": "MainTimeline",
	"compilerOptions": {
		"source-path": ["src"],
		"target-player": "10.3"
	},
	"files": [
		"src/MainTimeline.as"
	]
}

The source-path entry should be the folder that includes your scripts (this can be relative or an absolute path). The "files" part here is only really necessary if you use a relative path and the extension complains about no files being included.
With this your Actionscript 3 scripts should be automatically checked for errors.

JPEXS Commandline Commands

Batch Export to FLA

Using the commandline, JPEXS can extract every GUI file in one go, saving a ton of time compared to manually extracting each through the UI. The fla format will allow you to open each UI file in Flash.

Simple enter this command in the command prompt:

ffdec.bat -export fla OutputFolder InputFolder -format fla:cs6 -cli
Param Description
ffdec.bat This should be the path to ffdec.bat included in the JPEXS release.
OutputFolder This is the folder path you want the GUI fla files exported to. They will go in their own individual folders.
InputFolder This is the input folder containing the GUI files, i.e. Public/Game/GUI, Public/Game/GUI/GM

Batch Replace Scripts

JPEXS allows you to replace scripts and symbols inside of existing swf files, without needing to export it to fla and break the ImportAssets2 tags by publishing it through flash.
Most of the time this isn't necessary, but LeaderLib does utilize this to extend the functionality of optionsSettings beyond what's available.

ffdec.bat -replace SourceSwf OutputSwf className scriptFile className2 scriptFile2
Param Description
ffdec.bat This should be the path to ffdec.bat included in the JPEXS release.
SourceSwf This is the swf you're wanting to modify. This won't actually be modified, but instead copied to the OutputSwf path with your changes.
OutputSwf This is the output file path.
className The class of the script you want to replace, such as optionsSettings_c_fla.MainTimeline. You can get the names with the -dumpAS3 <infile> JPEXS command.
scriptFile The path to the script file to replace the className with.

You can replace multiple scripts with this method, including each className scriptFile option after the last.

⚠️ **GitHub.com Fallback** ⚠️