ContainerMenu
The Container Menu is used to move items between the Player and a Container.
AS3
var BGSCodeObj:Objectvar ButtonHintBar_mc:BSButtonHintBarvar CapsLabel_tf:TextFieldvar ContainerInventory_mc:MovieClipvar ContainerList_mc:ItemListvar ItemCard_mc:ItemCardvar PickpocketInfo_mc:MovieClipvar PlayerInventory_mc:MovieClipvar QuantityMenu_mc:MovieClipvar PlayerHasJunk:Booleanfunction get containerIsSelected():Booleanfunction get selectedIndex():intfunction set inspectingFeaturedItem(aValue:Boolean):*function set playFocusSounds(aValue:Boolean):*function set playerHasJunk(aValue:Boolean):*function onIntroAnimComplete():*function SetContainerInfo(strName:String, auiMode:uint):*function get playerListArray():Arrayfunction get containerListArray():Arrayfunction set sortButtonLabel(aStr:String):*function set messageBoxIsActive(aActive:Boolean):*function InvalidateLists():*function SwitchToContainerList(aPlaySound:Boolean = true):Booleanfunction onQuantityConfirm(event:Event):*function onAccept():*function onQuantityAccepted():*function onTakeAll():*function onEquipOrStore():*function onExitMenu():*function onQuantityCanceled():*function onInspect():*function onEndInspect():*function onKeyUp(event:KeyboardEvent):voidfunction ProcessUserEvent(strEventName:String, abPressed:Boolean):Booleanfunction UpdateEncumbranceAndCaps(aContainer:Boolean, aCurrWeight:uint, aMaxWeight:uint, aCaps:uint, aIncomingCaps:int):*function UpdatePickpocketInfo(aShow:Boolean, aTaking:Boolean, aSuccessPercent:uint):*function onQuantityModified(aEvent:Event):*function onToggleEquip():*function requestSort():*
BGSCodeObj
function PlaySound(name:String):voidfunction toggleSelectedItemEquipped(index:int, inContainer:Boolean):voidfunction confirmInvest():voidfunction inspectItem():voidfunction getSelectedItemEquipped(index:int, inContainer:Boolean):Booleanfunction onIntroAnimComplete():voidfunction getItemValue(index:int, inContainer:Boolean):*function getSelectedItemEquippable(index:int, inContainer:Boolean):Booleanfunction show3D(index:int, inContainer:Boolean):voidfunction sendYButton():voidfunction sendXButton():voidfunction updateItemPickpocketInfo(index:int, inContainer:Boolean):voidfunction sortItems(isPlayerInv:Boolean, indexFilter:uint, arg3:Boolean):voidfunction exitMenu():voidfunction transferItem(index:int, inContainer:Boolean):voidfunction takeAllItems():voidfunction updateSortButtonLabel(isPlayerInv:Boolean, indexFilter:uint):void
See Also
ContainerMenu.as Documentation
The ContainerMenu.as is an ActionScript file that defines a menu system used for managing items in a container within a game, such as Fallout 4.
This documentation provides an overview of its components and functionalities.
Components
The ContainerMenu class extends the IMenu class and contains several components to create the container inventory interface:
| Component | Type | Description |
|---|---|---|
ButtonHintBar_mc |
BSButtonHintBar |
A bar that displays various button hints for the user. |
CapsLabel_tf |
TextField |
A label displaying the number of caps (currency). |
ContainerInventory_mc |
MovieClip |
The container’s inventory display area. |
ContainerList_mc |
ItemList |
The list of items in the container. |
ItemCard_mc |
ItemCard |
A card displaying detailed information about the selected item. |
PickpocketInfo_mc |
MovieClip |
Information display for pickpocketing chances. |
PlayerInventory_mc |
MovieClip |
The player’s inventory display area. |
QuantityMenu_mc |
MovieClip |
Menu for selecting the quantity of items to transfer. |
PlayerHasJunk |
Boolean |
Indicates if the player has junk items. |
BGSCodeObj |
Object |
An object containing game-specific code. |
Buttons and Hints
The menu includes several button hints that prompt the user to perform actions:
| Button | Description |
|---|---|
SwitchToPlayerButton |
Switches the view to the player’s inventory. |
SwitchToContainerButton |
Switches the view to the container’s inventory. |
AcceptButton |
Confirms a selected action, such as transferring items. |
TakeAllButton |
Takes all items from the container. |
EquipOrStoreButton |
Equips or stores the selected item. |
SortButton |
Sorts the inventory list. |
InspectButton |
Inspects the selected item. |
ExitButton |
Exits the container menu. |
QuantityAcceptButton |
Accepts the selected quantity of items. |
QuantityCancelButton |
Cancels the quantity selection. |
Key Functions
The ContainerMenu class has several key functions that handle user interactions and updates to the menu:
PopulateButtonBar(): Sets up the button hint bar with the relevant buttons.SetContainerInfo(): Sets the name and mode of the container.InvalidateLists(): Updates the display of item lists.UpdateButtonHints(): Refreshes the visibility and text of button hints.SwitchToContainerList(): Changes focus to the container list.SwitchToPlayerList(): Changes focus to the player list.OpenQuantityMenu(): Opens the quantity selection menu.CloseQuantityMenu(): Closes the quantity selection menu.UpdateItemCard(): Updates the item card with details of the selected item.onItemPress(): Handles item selection events.onQuantityConfirm(): Confirms the selected quantity of items.onExitMenu(): Handles the event to exit the menu.
Event Listeners
The class listens to various events to handle user input and internal updates:
- Keyboard events to navigate the menu.
- Mouse events to interact with different components.
- Custom events related to item selection and quantity changes.
Usage
The ContainerMenu.as file is typically used within the UI framework of a game, where it manages the interaction between the player and items in a container.
It is responsible for displaying item information, transferring items between the player and the container, and handling user input.
Conclusion
The ContainerMenu class provides a comprehensive system for managing container inventories in a game, with a focus on user interaction and functionality.
It integrates various UI components and handles logic for item transfer, equipping, sorting, and inspecting.