### JSON Example: Menu Content with Sections and Text Source: https://github.com/neanka/mcm_0.1_as3/wiki/Menu-Layout Illustrates the structure for defining the content of an MCM menu, including sections and text elements. This example shows how to organize menu items hierarchically for better user experience. ```JSON { "content": [ { "text": "Hello World!", "type": "section" }, { "text": "Welcome to the Fallout 4 Mod Configuration Menu!", "type": "text" } ] } ``` -------------------------------- ### DropdownFiles Control Example Source: https://github.com/neanka/mcm_0.1_as3/blob/master/KNOW ISSUES.txt Demonstrates the 'dropdownFiles' control which allows selection from files matching a specified path and mask. It includes an example action to display a message box with the selected value. This control is useful for selecting configuration files. ```json { "id": "sConfigFile:Main", "type": "dropdownFiles", "text": "dropdownFiles control!", "valueOptions": { "path": "Data/Interface/DEF_CONF", "mask": "DEF_HUD*.xml", "sourceType": "ModSettingString" }, "action": { "type": "CallGlobalFunction", "script": "Debug", "function": "MessageBox", "params": ["Loading {value}!"] } } ``` -------------------------------- ### TXT Translation File Example (English) Source: https://github.com/neanka/mcm_0.1_as3/wiki/Translations---i18n An example of a translation file for the English language (MyInternationalMod_en.TXT). Each line contains a placeholder key (prefixed with '$') followed by a tab and its corresponding translation. This file must be UTF-16 LE encoded. ```plaintext $generalSettings General Settings $isEnabled Enable My International Mod $isEnabled_help Turn this off to disable My International Mod ``` -------------------------------- ### JSON Example: Basic MCM Configuration Source: https://github.com/neanka/mcm_0.1_as3/wiki/Menu-Layout A foundational example of an MCM configuration file in JSON format. It includes essential fields like modName, displayName, and content structure, illustrating how to define a mod's identity and menu elements. ```JSON { "modName": "MyAwesomeMod", // Your plugin name, without the extension. "displayName": "My Awesome Mod", // The name to be displayed in the MCM menu. "minMcmVersion": 1, // (Optional) The minimum required MCM version. "pluginRequirements": [], // (Optional) A list of required plugins. "content": [], // The contents of the mod configuration menu. "pages": [] // (Optional) Subpages of the config menu. } ``` -------------------------------- ### JSON Example: Multi-Page Configuration Menu Source: https://github.com/neanka/mcm_0.1_as3/wiki/Menu-Layout Shows how to structure an MCM configuration file with multiple sub-pages. Each page can have its own display name and content, allowing for a more organized and complex menu system. ```JSON { "pages": [ { "pageDisplayName": "Page 1", "content": [ { "text": "This text is on page 1.", "type": "text" } ] }, { "pageDisplayName": "Page 2", "content": [ { "text": "This text is on page 2.", "type": "text" } ] } ] } ``` -------------------------------- ### JSON Example: Plugin Requirements Source: https://github.com/neanka/mcm_0.1_as3/wiki/Menu-Layout Demonstrates how to specify plugin dependencies within an MCM configuration file. This ensures that all necessary mods are active before the configuration menu is accessed, preventing potential conflicts or errors. ```JSON { "pluginRequirements": ["SomeMod.esp", "AnotherMod.esp"] } ``` -------------------------------- ### TextInput Control Examples (String, Int, Float) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/KNOW ISSUES.txt Provides examples for 'textinput', 'textinputInt', and 'textinputFloat' controls. These controls allow users to input string, integer, or float values respectively, often linked to specific properties in external files or game data. The 'refreshMenu' option can be used to update the menu after input. ```json { "text": "textinput", "type": "textinput", "valueOptions": { "sourceType": "PropertyValueString", "sourceForm": "DEF_WIDGETS_SURVIVAL1.esp|F99", "propertyName": "PropertyName" } } ``` ```json { "text": "textinputInt", "type": "textinputInt", "refreshMenu": true, "valueOptions": { "sourceType": "PropertyValueInt", "sourceForm": "DEF_WIDGETS_SURVIVAL1.esp|F99", "propertyName": "_conf_icon" } } ``` ```json { "text": "textinputFloat", "type": "textinputFloat", "refreshMenu": true, "valueOptions": { "precision": 3, "sourceType": "PropertyValueFloat", "sourceForm": "DEF_WIDGETS_SURVIVAL1.esp|F99", "propertyName": "_y" } } ``` -------------------------------- ### MCM Hotkey Configuration JSON Example Source: https://github.com/neanka/mcm_0.1_as3/wiki/Hotkeys Example JSON structure for defining mod hotkeys in MCM. This includes mod name, and a list of keybinds, each with an ID, description, and a defined action. Actions can be function calls, global function calls, console commands, or event sends. ```json { "modName": "MCM_Demo", "keybinds": [ { "id": "demoHotkey1", "desc": "Display Messagebox via CallFunction", "action": { "type": "CallFunction", "form": "MCM_Demo.esp|800", "function": "ShowMessageBox", "params": ["Hello world!"] } }, { "id": "demoHotkey2", "desc": "Display Messagebox via CallGlobalFunction", "action": { "type": "CallGlobalFunction", "script": "Debug", "function": "Messagebox", "params": ["Hello world! (via global function)"] } }, { "id": "demoHotkey3", "desc": "Toggle Menu Display", "action": { "type": "RunConsoleCommand", "command": "ToggleMenus" } }, { "id": "demoHotkey4", "desc": "Notification Demo", "action": { "type": "SendEvent", "form": "MCM_Demo.esp|800" } } ] } ``` -------------------------------- ### JSON Configuration for MCM Internationalization Source: https://github.com/neanka/mcm_0.1_as3/wiki/Translations---i18n Example of a config.json file structured for MCM internationalization. It uses '$' prefixed placeholders for text that needs translation, such as section titles and item descriptions. This file defines the mod's name and its configurable elements. ```json { "modName": "MyInternationalMod", "displayName": "My International Mod", "minMcmVersion": 1, "content": [ { "type": "section", "text": "$generalSettings" }, { "id": "bIsEnabled:general", "text": "$isEnabled", "type": "switcher", "help": "$isEnabled_help", "valueOptions": { "sourceType": "ModSettingBool" } } ] } ``` -------------------------------- ### Workaround Flash Player GET Parameter Bug (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Implemented a workaround for an older Flash Player bug (e.g., 10.0.12.36 in Firefox) that omitted the '?' when GET parameters were appended to a URL already containing a '?'. This ensures proper URL parameter handling. ```actionscript // Workaround for Flash Player bug omitting '?' in GET parameters. ``` -------------------------------- ### LoaderMax: Honoring POST method for file size audits Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt In version 1.855, LoaderMax now correctly honors the 'POST' method when a URLRequest is defined for a loader. Previously, file size audits always assumed the 'GET' method, which could lead to inaccurate results for POST requests. This ensures more accurate file size auditing. ```actionscript var request:URLRequest = new URLRequest("http://example.com/upload"); request.method = URLRequestMethod.POST; var loader:URLLoader = new URLLoader(); loader.load(request); ``` -------------------------------- ### Handle SendEvent Hotkey Actions in Papyrus Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt Papyrus scripts can handle hotkey actions defined using `SendEvent`. The provided example demonstrates how to detect key press and release events for a specific control ID, allowing for custom in-game responses. ```papyrus Event OnControlDown(string control) If control == "detectKeyHeld" Debug.Notification("Key pressed!") EndIf EndEvent Event OnControlUp(string control) If control == "detectKeyHeld" Debug.Notification("Key released!") EndIf EndEvent ``` -------------------------------- ### Workaround URLRequest GET Variable Separator Bug (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Addressed a bug in Flash's URLRequest where it failed to correctly append URLVariables to a URL already containing GET variables, neglecting the '&' separator. This workaround ensures proper URL construction, especially when dealing with existing parameters. ```actionscript // Workaround for URLRequest bug not appending '&' separator for GET variables. ``` -------------------------------- ### Papyrus Mod Setting Access Functions Source: https://github.com/neanka/mcm_0.1_as3/wiki/Setting-Types,-Storage-and-Persistence Provides native Papyrus functions for interacting with Mod Settings. Includes functions to get integer, boolean, float, and string values, as well as functions to set these values for a specified mod name and setting name. These are essential for managing Mod Settings from within Papyrus scripts. ```Papyrus ; Obtains the value of a mod setting. int Function GetModSettingInt(string asModName, string asSetting) native global bool Function GetModSettingBool(string asModName, string asSetting) native global float Function GetModSettingFloat(string asModName, string asSetting) native global string Function GetModSettingString(string asModName, string asSetting) native global ; Sets the value of a mod setting. Function SetModSettingInt(string asModName, string asSettingName, int aiValue) native global Function SetModSettingBool(string asModName, string asSettingName, bool abValue) native global Function SetModSettingFloat(string asModName, string asSettingName, float afValue) native global Function SetModSettingString(string asModName, string asSettingName, string asValue) native global ``` -------------------------------- ### XMLLoader: Prepending URLs Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt XMLLoader now supports 'prependURLs' and 'recursivePrependURLs' properties. These allow for prepending base URLs to all LoaderMax-related loader URLs parsed within an XML file, and recursively for nested XML files, simplifying URL management. ```actionscript // Prepend URLs for loaders in the current XML var xmlLoader:XMLLoader = new XMLLoader("config.xml", { prependURLs: true }); // Recursively prepend URLs for loaders in nested XML files var recursiveLoader:XMLLoader = new XMLLoader("main.xml", { recursivePrependURLs: true }); ``` -------------------------------- ### VideoLoader Cue Point Methods (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Introduces `gotoVideoCuePoint()` and `getCuePointTime()` methods to the VideoLoader class. These methods enhance video control by allowing seeking to specific cue points and retrieving their timestamps. ```actionscript /** * Added gotoVideoCuePoint() method to VideoLoader */ ``` ```actionscript /** * Added getCuePointTime() method to VideoLoader */ ``` ```actionscript /** * Minor internal optimizations in VideoLoader */ ``` -------------------------------- ### Configure Hotkey Controls in JSON Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt The `config.json` file integrates hotkey controls into the game menu. It allows for defining sections, display names, and individual hotkey elements with descriptions and help text. It also supports options like allowing modifier keys. ```json { "modName": "MyAwesomeMod", "displayName": "My Awesome Mod", "content": [ { "text": "Hotkeys", "type": "section" }, { "id": "toggleGodMode", "text": "Toggle God Mode", "type": "hotkey", "help": "Press this key to toggle invincibility", "valueOptions": { "allowModifierKeys": true } }, { "id": "quickHeal", "text": "Quick Heal", "type": "hotkey", "help": "Instantly restore health", "valueOptions": { "allowModifierKeys": false } } ] } ``` -------------------------------- ### Integrate MCM Settings with Papyrus Script (Papyrus) Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt This Papyrus script demonstrates how to integrate with MCM by exposing properties and functions that MCM can interact with. It includes event handlers for MCM opening and setting changes, functions to apply settings like God Mode, and custom functions triggered by MCM controls, such as `OnAggressionChanged`. The script also handles player loading events to ensure settings are applied consistently. ```papyrus Scriptname MyAwesomeModScript extends Quest ; Auto properties exposed to MCM int Property iAggressionLevel = 50 Auto bool Property bGodModeEnabled = False Auto Actor Property PlayerRef Auto Event OnQuestInit() PlayerRef = Game.GetPlayer() RegisterForRemoteEvent(PlayerRef, "OnPlayerLoadGame") RegisterCustomEvents() ApplySettings() EndEvent Event Actor.OnPlayerLoadGame(Actor akSender) RegisterCustomEvents() ApplySettings() EndEvent Function RegisterCustomEvents() RegisterForExternalEvent("OnMCMOpen", "OnMCMOpen") RegisterForExternalEvent("OnMCMSettingChange|MyAwesomeMod", "OnMCMSettingChange") EndFunction Function OnMCMOpen() ; Refresh properties when menu opens MCM.RefreshMenu() Debug.Notification("MyAwesomeMod settings opened") EndFunction Function OnMCMSettingChange(string modName, string id) If modName == "MyAwesomeMod" Debug.Notification("Setting changed: " + id) ApplySettings() EndIf EndFunction Function OnAggressionChanged(int newValue) iAggressionLevel = newValue Debug.Notification("Aggression set to: " + newValue) ; Apply aggression changes to AI EndFunction Function ApplySettings() ; Apply all settings to game systems If bGodModeEnabled PlayerRef.SetGhost(true) Else PlayerRef.SetGhost(false) EndIf EndFunction ``` -------------------------------- ### Standalone DisplayObjectLoader Usage (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Provides guidance on using DisplayObjectLoader in a standalone fashion, typically used as a base class. While not recommended for general use, it offers minimal file size for specific needs, sacrificing advanced features of SWFLoader and ImageLoader. ```actionscript /** * Added a very small amount of code to DisplayObjectLoader to make it easier to use it in a standalone fashion * (typically it is used only as a base class for SWFLoader and ImageLoader). Again, it isn't recommended to use * DisplayObjectLoader on its own, but if you need absolute minimum file size and can do without the bells & whistles * of SWFLoader and ImageLoader, you could do it. */ ``` -------------------------------- ### Define Basic MCM Menu Structure (JSON) Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt This JSON file defines the structure and controls for a basic MCM configuration menu. It specifies the mod name, display name, minimum MCM version, and a list of UI elements such as sections, switchers, sliders, and dropdowns, along with their associated data sources (e.g., ModSettingBool, ModSettingFloat). ```json { "modName": "MyAwesomeMod", "displayName": "My Awesome Mod", "minMcmVersion": 2, "pluginRequirements": ["MyAwesomeMod.esp"], "content": [ { "text": "General Settings", "type": "section" }, { "text": "Enable Mod Features", "type": "switcher", "help": "Toggle core mod functionality on/off", "id": "bModEnabled:Main", "valueOptions": { "sourceType": "ModSettingBool" } }, { "text": "Damage Multiplier", "type": "slider", "help": "Adjust damage scaling (1.0 = normal)", "id": "fDamageMultiplier:Main", "valueOptions": { "min": 0.5, "max": 3.0, "step": 0.1, "sourceType": "ModSettingFloat" } }, { "text": "Difficulty Preset", "type": "dropdown", "help": "Select a difficulty preset", "id": "iDifficulty:Main", "valueOptions": { "options": ["Easy", "Normal", "Hard", "Very Hard"], "sourceType": "ModSettingInt" } } ] } ``` -------------------------------- ### MCM Slider Control with ModSetting Float Source Source: https://github.com/neanka/mcm_0.1_as3/wiki/Setting-Types,-Storage-and-Persistence A JSON configuration for an MCM slider control. It uses 'ModSettingFloat' as the source type, indicating that the slider's value should be read from and written to a mod setting of type float. This is suitable for settings that should persist across game installations and can be shared. ```JSON { "id": "fSliderValue:Main", "text": "Demo Slider", "type": "slider", "help": "A standard slider with constraints. Range: 1-100, Step: 1.", "valueOptions": { "min": 1, "max": 100, "step": 1, "sourceType": "ModSettingFloat" } } ``` -------------------------------- ### Define Hotkey Actions in JSON Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt The `keybinds.json` file defines various hotkey actions. Each action is identified by an ID and can trigger a function call, run a console command, or send an event. This configuration is crucial for mapping user inputs to in-game functionalities. ```json { "modName": "MyAwesomeMod", "keybinds": [ { "id": "toggleGodMode", "desc": "Toggle God Mode", "action": { "type": "CallFunction", "form": "MyAwesomeMod.esp|800", "function": "ToggleGodMode", "params": [] } }, { "id": "quickHeal", "desc": "Quick Heal", "action": { "type": "CallGlobalFunction", "script": "Debug", "function": "MessageBox", "params": ["Healing player..."] } }, { "id": "toggleHUD", "desc": "Toggle HUD Display", "action": { "type": "RunConsoleCommand", "command": "tm" } }, { "id": "detectKeyHeld", "desc": "Detect Key Press/Release", "action": { "type": "SendEvent", "form": "MyAwesomeMod.esp|800" } } ] } ``` -------------------------------- ### Configure Multi-Page Menu and Settings Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt Defines the structure and behavior of a multi-page Mod Configuration Menu (MCM). It specifies module information, menu sections, individual settings with their types and IDs, and advanced page layouts. Conditional display logic is implemented using `groupCondition` to manage visibility of settings based on user choices. ```json { "modName": "MyAwesomeMod", "displayName": "My Awesome Mod", "minMcmVersion": 2, "content": [ { "text": "Main Settings", "type": "section" }, { "text": "Show Advanced Options", "type": "switcher", "help": "Display advanced configuration options", "groupControl": 1, "id": "bShowAdvanced:Main", "valueOptions": { "sourceType": "ModSettingBool" } }, { "text": "Advanced Configuration", "type": "section", "groupCondition": 1 }, { "text": "Debug Logging Enabled", "type": "switcher", "help": "Enable detailed debug logs", "groupCondition": 1, "id": "bDebugMode:Main", "valueOptions": { "sourceType": "ModSettingBool" } }, { "text": "Show Expert Options", "type": "switcher", "help": "Display expert-only settings (requires Advanced Options)", "groupControl": 2, "groupCondition": 1, "id": "bShowExpert:Main", "valueOptions": { "sourceType": "ModSettingBool" } }, { "text": "Expert Settings - Use with Caution!", "type": "section", "groupCondition": {"AND": [1, 2]} }, { "text": "Memory Pool Size (MB)", "type": "slider", "help": "Adjust memory allocation (experts only)", "groupCondition": {"AND": [1, 2]}, "id": "iMemoryPool:Main", "valueOptions": { "min": 128, "max": 2048, "step": 128, "sourceType": "ModSettingInt" } } ], "pages": [ { "pageDisplayName": "Combat Settings", "pluginRequirements": ["CombatModule.esp"], "content": [ { "text": "Combat AI Behavior", "type": "section" }, { "text": "AI Response Time (ms)", "type": "slider", "help": "Delay before AI reacts to threats", "id": "iAIResponseTime:Combat", "valueOptions": { "min": 0, "max": 1000, "step": 50, "sourceType": "ModSettingInt" } }, { "text": "Combat Style", "type": "stepper", "help": "Select AI combat behavior pattern", "id": "iCombatStyle:Combat", "valueOptions": { "options": ["Aggressive", "Defensive", "Tactical", "Berserker"], "sourceType": "ModSettingInt" } } ] }, { "pageDisplayName": "Visual Settings", "content": [ { "text": "UI Customization", "type": "section" }, { "type": "image", "libName": "MyAwesomeMod", "className": "PreviewImage", "width": 300, "height": 200 }, { "text": "HUD Opacity", "type": "slider", "help": "Adjust HUD transparency (0 = invisible, 1 = opaque)", "id": "fHUDOpacity:Visual", "valueOptions": { "min": 0.0, "max": 1.0, "step": 0.05, "sourceType": "ModSettingFloat" } } ] } ] } ``` -------------------------------- ### XMLLoader: Apply common properties to children with childrenVars Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt XMLLoader now supports a 'childrenVars' attribute in nodes. This allows you to specify a comma-separated list of properties and their values that will be applied to all child loaders within that LoaderMax instance. This is useful for setting common configurations like dimensions, scale modes, or cropping. ```actionscript ``` -------------------------------- ### Configure Interactive Buttons with Dynamic Parameters in JSON Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt Sets up interactive buttons within MCM that can trigger Papyrus functions with dynamic parameters. This JSON defines buttons for applying intensity changes, resetting values, showing debug info, and enabling debug modes, utilizing placeholders like {value} and type prefixes for parameter casting. ```json { "modName": "MyAwesomeMod", "displayName": "My Awesome Mod", "content": [ { "text": "Current Intensity", "type": "slider", "help": "Adjust effect intensity", "id": "fIntensity:Main", "valueOptions": { "min": 0.0, "max": 100.0, "step": 1.0, "sourceType": "ModSettingFloat" } }, { "text": "Apply Intensity Changes", "type": "button", "help": "Apply the intensity value immediately", "action": { "type": "CallFunction", "form": "MyAwesomeMod.esp|800", "scriptName": "MyAwesomeModScript", "function": "SetIntensity", "params": ["{value}"] } }, { "text": "Reset to Default (50.0)", "type": "button", "help": "Reset intensity to default value", "action": { "type": "CallFunction", "form": "MyAwesomeMod.esp|800", "function": "SetIntensity", "params": ["{f}50.0"] } }, { "text": "Show Debug Info", "type": "button", "help": "Display current settings in console", "action": { "type": "CallGlobalFunction", "script": "Debug", "function": "MessageBox", "params": ["Current Intensity: {value}"] } }, { "text": "Enable Debug Mode", "type": "button", "help": "Toggle debug logging with typed parameter", "action": { "type": "CallFunction", "form": "MyAwesomeMod.esp|800", "function": "SetDebugMode", "params": ["{b}true"] } } ] } ``` -------------------------------- ### Correct LoaderMax.defaultContext for Local SWF Loading (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Fixes an issue where `LoaderMax.defaultContext` was not taking effect when SWFs were run locally. This ensures that the default context is correctly applied for local SWF loading scenarios. ```actionscript /** * Corrected an issue that prevented the LoaderMax.defaultContext from taking effect when the swf was run locally */ ``` -------------------------------- ### Read and Write Papyrus Mod Settings with MCM Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt Demonstrates how to use MCM functions in Papyrus scripts to load, update, and reset boolean, integer, float, and string mod settings. These functions interact with the MCM interface to manage user-configurable options. ```papyrus Scriptname MyAwesomeModUtils extends Quest Function LoadModSettings() ; Read various setting types bool isEnabled = MCM.GetModSettingBool("MyAwesomeMod", "bModEnabled:Main") int difficulty = MCM.GetModSettingInt("MyAwesomeMod", "iDifficulty:Main") float damageMultiplier = MCM.GetModSettingFloat("MyAwesomeMod", "fDamageMultiplier:Main") string customText = MCM.GetModSettingString("MyAwesomeMod", "sCustomMessage:Main") Debug.Notification("Mod Enabled: " + isEnabled) Debug.Notification("Difficulty: " + difficulty) Debug.Notification("Damage Multiplier: " + damageMultiplier) EndFunction Function UpdateModSettings() ; Write various setting types MCM.SetModSettingBool("MyAwesomeMod", "bModEnabled:Main", True) MCM.SetModSettingInt("MyAwesomeMod", "iDifficulty:Main", 2) MCM.SetModSettingFloat("MyAwesomeMod", "fDamageMultiplier:Main", 1.5) MCM.SetModSettingString("MyAwesomeMod", "sCustomMessage:Main", "Hello World") ; Force MCM to refresh display if menu is open MCM.RefreshMenu() EndFunction Function ResetToDefaults() ; Load default values from settings.ini MCM.SetModSettingBool("MyAwesomeMod", "bModEnabled:Main", True) MCM.SetModSettingInt("MyAwesomeMod", "iDifficulty:Main", 1) MCM.SetModSettingFloat("MyAwesomeMod", "fDamageMultiplier:Main", 1.0) MCM.RefreshMenu() EndFunction ``` -------------------------------- ### MP3Loader: Workaround for sound capabilities check Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Version 1.854 provides a workaround for MP3Loader to prevent errors when playSound() is called on playback devices lacking sound capabilities. This ensures smoother operation in environments where sound might not be available. ```actionscript // No specific code change is needed by the user; the fix is internal to MP3Loader. // The following is a conceptual example of how MP3Loader might be used: var mp3:MP3Loader = new MP3Loader("audio.mp3"); mp3.addEventListener(LoaderEvent.COMPLETE, function(e:LoaderEvent):void { mp3.playSound(); }); mp3.load(); ``` -------------------------------- ### Add static defaultContext to LoaderMax (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Introduced a static 'defaultContext' property to LoaderMax, allowing for the definition of a default LoaderContext. This simplifies setting up consistent loading contexts across multiple loaders. ```actionscript LoaderMax.defaultContext = new LoaderContext(); ``` -------------------------------- ### Fix Video Resizing Issue (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Corrected a problem where a video might briefly display at a default size (320x160) before being resized according to the width and height specified in the constructor's vars parameter. ```actionscript // Fixed issue causing brief display of video at 320x160 before correct resizing. ``` -------------------------------- ### Define Default Mod Settings in settings.ini Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt Specifies default configuration values for a mod in an INI file. This file is used to set initial states for various mod settings, such as enabling features, difficulty levels, and visual preferences. ```ini [Main] bModEnabled=True iDifficulty=1 fDamageMultiplier=1.0 sCustomMessage=Welcome to My Awesome Mod [Combat] iAIResponseTime=200 iCombatStyle=0 [Visual] fHUDOpacity=1.0 ``` -------------------------------- ### SWFLoader Internal Loader Handling for Stage References (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Modifies how SWFLoader handles its internal Loader. It is now temporarily added to the ContentDisplay's display list during loading, preventing null reference errors for 'stage' in child SWFs. Upon initialization and if no script access errors occur, the child SWF's root is added to the ContentDisplay. ```actionscript /** * Changed the way SWFLoader handles the Loader internally so that it temporarily adds it to the ContentDisplay object's display list while it loads initially so that any code that references "stage" in the child swf doesn't throw null object reference errors (as long as you've added the ContentDisplay to the display list, like by defining a "container" in the vars parameter). As soon as the swf inits (and as long as no script access denied errors occur), the swf's root is added to the ContentDisplay instead. */ ``` -------------------------------- ### Handle LoaderMax COMPLETE Event with VideoLoader Buffer Changes (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Fixes an issue where LoaderMax might not dispatch the COMPLETE event if a VideoLoader changes its bufferMode during completion. This ensures reliable event dispatching in complex loading scenarios involving video. ```actionscript /** * Fixes an issue that could cause a LoaderMax not to dispatch its COMPLETE event * if it has a VideoLoader that changes its bufferMode from true to false upon its completion * while the LoaderMax is loading. */ ``` -------------------------------- ### Link MCM Controls to Papyrus Properties and Functions (JSON) Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt This JSON configures MCM controls to directly interact with Papyrus script properties and functions. It uses `sourceType: "PropertyValueInt"` and `sourceType: "PropertyValueBool"` to link to specific forms and properties, and `action: { type: "CallFunction" }` to trigger Papyrus functions when controls are manipulated. This enables dynamic updates and actions within the game based on user settings. ```json { "modName": "MyAwesomeMod", "displayName": "My Awesome Mod", "minMcmVersion": 2, "content": [ { "text": "AI Aggression Level", "type": "slider", "help": "Controls enemy aggression (requires game reload)", "valueOptions": { "min": 0, "max": 100, "step": 5, "sourceType": "PropertyValueInt", "sourceForm": "MyAwesomeMod.esp|800", "propertyName": "iAggressionLevel" }, "action": { "type": "CallFunction", "form": "MyAwesomeMod.esp|800", "function": "OnAggressionChanged", "params": ["{value}"] } }, { "text": "God Mode Active", "type": "switcher", "valueOptions": { "sourceType": "PropertyValueBool", "sourceForm": "MyAwesomeMod.esp|800", "propertyName": "bGodModeEnabled" } }, { "text": "Apply Settings", "type": "button", "help": "Save and apply all changes", "action": { "type": "CallFunction", "form": "MyAwesomeMod.esp|800", "function": "ApplySettings", "params": [] } } ] } ``` -------------------------------- ### Integrate GlobalValues for Savegame-Persisted Settings in JSON Source: https://context7.com/neanka/mcm_0.1_as3/llms.txt Configures MCM settings that persist across savegames using Skyrim's GlobalValues. This JSON structure defines sliders and steppers that link to specific GlobalValues, allowing for character-specific settings like game time, level multipliers, and companion limits. ```json { "modName": "MyAwesomeMod", "displayName": "My Awesome Mod", "content": [ { "text": "Current Game Time", "type": "slider", "help": "Adjust the in-game time of day (0-23 hours)", "valueOptions": { "min": 0, "max": 23, "step": 1, "sourceType": "GlobalValue", "sourceForm": "Fallout4.esm|38" } }, { "text": "Player Level Multiplier", "type": "slider", "help": "Saved with character, affects level scaling", "valueOptions": { "min": 0.5, "max": 2.0, "step": 0.1, "sourceType": "GlobalValue", "sourceForm": "MyAwesomeMod.esp|801" } }, { "text": "Companion Limit", "type": "stepper", "help": "Maximum active companions (saved per character)", "valueOptions": { "options": ["1", "2", "3", "4", "Unlimited"], "sourceType": "GlobalValue", "sourceForm": "MyAwesomeMod.esp|802" } } ] } ``` -------------------------------- ### Fix SWFLoader rawContent Scaling with Denied Script Access (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Addresses an issue where a SWFLoader's rawContent might not scale or position correctly when script access is denied (e.g., AS2 SWFs or cross-domain loading without proper crossdomain.xml). This ensures proper rendering even in restricted environments when width/height are defined. ```actionscript /** * Fixed issue that could cause a SWFLoader's rawContent to not scale/position properly if script access was denied (like if the subloaded swf was AS2 or cross-loaded from another domain that didn't have the appropriate crossdomain.xml file in place) and a width/height was defined in the SWFLoader's vars parameter. */ ``` -------------------------------- ### Fix alternateURL with auditSize (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Resolved an issue where 'alternateURL' might not function correctly on child loaders within a LoaderMax instance when 'auditSize' was set to true. This ensures alternative URLs are respected under these conditions. ```actionscript // Fixed issue with alternateURL not functioning on children when auditSize is true. ``` -------------------------------- ### Papyrus Control Action with Value Substitution Source: https://github.com/neanka/mcm_0.1_as3/wiki/Advanced-Papyrus-Integration Demonstrates how to use the `{value}` keyword in a Papyrus action to pass the current value of an MCM control to a function. The data type of the parameter automatically matches the control's value type. Optional type casting can be achieved using `{i}`, `{b}`, `{f}`, or `{s}` prefixes. ```json { "action": { "type": "CallFunction", "form": "MCM_Demo.esp|800", "function": "OnSliderValueChanged", "params": ["{value}"] } } ``` -------------------------------- ### Make XMLLoader Tag Recognition Case-Insensitive (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Enhanced XMLLoader to make its recognition of LoaderMax-related tags (e.g., , ) case-insensitive. This provides greater flexibility when defining loader configurations in XML. ```actionscript // Enhanced XMLLoader to ignore case for LoaderMax tag recognition (e.g., , ). ``` -------------------------------- ### VideoLoader: Delaying NetStream attachment for memory efficiency Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt To optimize memory usage, VideoLoader in version 1.854 now delays attaching the NetStream to its Video object until the video is added to the stage. This is particularly beneficial for videos loading in the background, as Flash only fully decodes video content when it's attached, thus improving performance and reducing initial memory footprint. ```actionscript // The improved memory management is handled internally by VideoLoader. // Usage remains similar: var video:VideoLoader = new VideoLoader("myVideo.flv"); // video.content is the Video object // The NetStream is attached to video.content only when video is added to the display list. ``` -------------------------------- ### Fix XMLLoader Context Recognition in SWFLoader Nodes (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Corrected a problem where XMLLoader failed to recognize the 'context' special attribute within nodes. This ensures that context information provided in XML for SWFLoaders is properly processed. ```actionscript // Fixed XMLLoader not recognizing 'context' attribute in nodes. ``` -------------------------------- ### LoaderMax: getChildAt() method for accessing loaders Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt LoaderMax version 1.86 introduced the getChildAt() method, allowing direct access to a loader item at a specific index within the LoaderMax queue. This facilitates programmatic manipulation or inspection of individual loaders managed by LoaderMax. ```actionscript var specificLoader:LoaderItem = loaderMaxInstance.getChildAt(0); // Gets the first loader in the queue ``` -------------------------------- ### Facilitate Method Chaining in Vars Classes (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Refactored various vars classes (e.g., CSSLoaderVars, DataLoaderVars) to support method chaining. This allows for more concise inline initialization of loader properties, reducing code verbosity. No external dependencies are required for this refactoring. ```actionscript new ImageLoaderVars().name("image1").estimatedBytes(12420).width(200).height(100); ``` -------------------------------- ### Papyrus Event Registration for MCM Menu Events Source: https://github.com/neanka/mcm_0.1_as3/wiki/Advanced-Papyrus-Integration Provides Papyrus code for registering and handling MCM events. It shows how to register for `OnMCMOpen` to refresh the menu and display a notification, and `OnMCMSettingChange` to detect changes in specific control IDs, optionally filtered by mod name. ```papyrus Event OnQuestInit() playerref = Game.GetPlayer() RegisterForRemoteEvent(playerref, "OnPlayerLoadGame") RegisterCustomEvents() Update() EndEvent Event Actor.OnPlayerLoadGame(Actor akSender) RegisterCustomEvents() Update() EndEvent Function RegisterCustomEvents() RegisterForExternalEvent("OnMCMOpen", "OnMCMOpen"); RegisterForExternalEvent("OnMCMSettingChange|MCM_Demo", "OnMCMSettingChange") EndFunction Function Update() ;update whatever variables and properties that are needed by MCM: ;(1) when the user loads a saved game, or ;(2) when MCM changes your global variables or script properties via controls EndFunction Function OnMCMOpen() Update() MCM.RefreshMenu() Debug.Notification("MCM Menu was opened") EndFunction Function OnMCMSettingChange(string modName, string id) If (modName == "MCM_Demo") ; if you registered with OnMCMSettingChange|MCM_Demo this should always be true If (id == "control_id") Debug.Notification("control_id value was changed!") EndIf EndIf EndFunction ; Can be added to the config.json as an action/CallFunction to update internal properties and variables after MCM changes any of them Function MCMApply() Update() EndFunction ``` -------------------------------- ### VideoLoader Event Handling Fix Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt This fix addresses an issue where VideoLoader would not dispatch PROGRESS and COMPLETE events if its bufferMode was initially set to true and then changed to false within its onComplete handler. The updated code ensures these events are dispatched correctly under such conditions. ```actionscript var videoLoader:VideoLoader = new VideoLoader("video.mp4", { bufferMode: true, onComplete: function():void { // Original issue: events might not dispatch if bufferMode is changed here this.bufferMode = false; trace("Video loaded and complete."); } }); ``` -------------------------------- ### Fix SWFLoader Garbage Collection Issue (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Corrects a minor garbage collection issue in SWFLoader where a LoaderMax instance could remain in memory if sub-loaders had `requireWithRoot` set to the SWFLoader's root and the SWFLoader was disposed. This prevents unnecessary memory consumption. ```actionscript /** * Fixed a small gc issue with SWFLoader - if there were sub-loaders inside the SWFLoader that had requireWithRoot set to that swf's root and then the SWFLoader was disposed, a LoaderMax instance could remain behind (it wouldn't hurt anything, but it would consume a small amount of memory) */ ``` -------------------------------- ### Fix SWFLoader Recognition with TLF (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Addressed an issue where a subloaded SWF using TLF might not correctly recognize LoaderMax-related loaders when 'requireWithRoot' was set to the SWF's root. This fix works around a bug in Adobe's Loader class. ```actionscript // Fix for SWFLoader recognition issue with TLF and requireWithRoot ``` -------------------------------- ### Switcher Control Configuration Source: https://github.com/neanka/mcm_0.1_as3/wiki/Control-Types Configures a switcher control, which is a two-state ON/OFF toggle. It includes an optional 'help' text for user guidance. ```json { "text": "Mod Enabled", "type": "switcher", "help": "Controls whether the mod is enabled." } ``` -------------------------------- ### Consolidate Filter Vars Classes (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Consolidated several old vars-related classes, such as BlurFilterVars and ColorMatrixFilterVars, into the TweenLiteVars and TweenMaxVars classes. The original dedicated filter vars classes have been removed. This simplifies the class structure for managing filter properties. ```actionscript // Old classes like BlurFilterVars, ColorMatrixFilterVars were deleted // and their functionality integrated into TweenLiteVars and TweenMaxVars. ``` -------------------------------- ### SWFLoader and Nested Loader Failure Handling Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt SWFLoader's behavior has been altered to correctly handle scenarios where a child loader within the SWF fails. If a child loader with 'requireWithRoot' set to the SWF's root fails, the SWFLoader will dispatch a FAIL event but will not reset the progress to 0 or clear the subloading queue, allowing access to getChildren(). ```actionscript var swfLoader:SWFLoader = new SWFLoader("myMovie.swf", { onFail: function(event:LoaderEvent):void { trace("SWF loading failed: " + event.text); // Subloading queue is not cleared, getChildren() is still accessible var children:Array = swfLoader.getChildren(); } }); ``` -------------------------------- ### Button Control Configuration Source: https://github.com/neanka/mcm_0.1_as3/wiki/Control-Types Configures a button control that performs an action when clicked. Actions can be 'CallFunction' on a form or 'CallGlobalFunction' on a script, with optional parameters. ```json { "text": "Demo Button", "type": "button", "help": "This button sets the intensity to 50.", "action": { "type": "CallFunction", "form": "MCM_Demo.esp|800", "scriptName": "MyScript", "function": "SetIntensity", "params": [50.0] } } ``` ```json { "text": "Another Demo Button", "type": "button", "help": "Displays a messagebox via a CallGlobalFunction action.", "action": { "type": "CallGlobalFunction", "script": "Debug", "function": "MessageBox", "params": ["Hello world!"] } } ``` -------------------------------- ### Fix SWFLoader Cropping Issue (ActionScript 3) Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt Corrected an issue that could prevent a SWFLoader's content from being properly cropped when 'crop' was set to true and specific properties were changed more than once. This ensures consistent cropping behavior. ```actionscript // Fixed issue with SWFLoader content not cropping properly after multiple property changes. ``` -------------------------------- ### SWFLoader: UNCAUGHT_ERROR event handling and suppression Source: https://github.com/neanka/mcm_0.1_as3/blob/master/com/greensock/loading/changelog.txt SWFLoader (versions 1.87 and later, for Flash Player 10.1+) now supports handling uncaught errors. This includes dispatching a new UNCAUGHT_ERROR event and providing 'onUncaughtError' and 'suppressUncaughtErrors' properties to manage error reporting and behavior. SWFLoaderVars also includes corresponding methods for these new properties. ```actionscript // Example of handling UNCAUGHT_ERROR event loaderMaxInstance.addEventListener(LoaderEvent.UNCAUGHT_ERROR, handleUncaughtError); function handleUncaughtError(event:LoaderEvent):void { trace("Uncaught error detected:", event.text); } // Example of suppressing uncaught errors SWFLoaderVars.suppressUncaughtErrors = true; ``` -------------------------------- ### Text Control Configuration Source: https://github.com/neanka/mcm_0.1_as3/wiki/Control-Types Configures a text control to display text content. Supports plain text and basic HTML tags when the 'html' property is set to true. ```json { "text": "My text here", "type": "text" } ``` ```json { "text": "This is bold text. This is in italics. This word is underlined.", "type": "text", "html": true } ```