1.0.1 • Published 1 year ago

3ds-theme-parser v1.0.1

Weekly downloads
1
License
AGPL-3.0
Repository
github
Last release
1 year ago

3ds-theme-parser

Parses and extracts 3DS body_LZ.bin theme files.

CLI

Usage: 3ds-theme-parser body_lz_bin [output_directory] [options]

Options:
  --save-body, -B        Save the extracted body.bin                   [boolean]
  --pretty-json, -p      Format the JSON with indents                  [boolean]
  --save-json, -j, -A    Write JSON of the body_LZ data to data.json   [boolean]
  --output-json, -J      Write JSON of the body_LZ data to STDOUT      [boolean]
  --save-images, -i, -A  Save the images                               [boolean]
  --save-cwavs, -c, -A   Save the CWAV sound effects                   [boolean]
  --apply-alpha, -a      Apply alpha masks to the folder images        [boolean]
  --process-borders, -b  Process the icon border into a complete image [boolean]
  --json-textures        Include the textures in the output JSON
                         WARNING: RESULTS IN LARGE JSON!               [boolean]
  --json-cwavs           Include the CWAVs in the output JSON
                         WARNING: RESULTS IN LARGE JSON!               [boolean]

API Reference

Classes

Typedefs

ThemeInfo

Kind: global class

new ThemeInfo(bodyBuffer)

The ThemeInfo constructor.

ParamTypeDescription
bodyBufferBufferThe body_LZ.bin buffer to parse

themeInfo.getData(callback) ⇒ Promise.<ThemeInfoObject>

This is the main function, it will parse the body_LZ.bin data and output a javascript object.

Kind: instance method of ThemeInfo
Returns: Promise.<ThemeInfoObject> - The theme info

ParamTypeDescription
callbackfunctionAn optional node.js style callback

ThemeInfoObject : Object

This is the top-level object containing the theme information

Kind: global typedef
Properties

NameTypeDescription
enableBGMBooleanIf background music is enabled
customSFXBooleanIf custom sound effects are used
customFoldersBooleanIf custom folder images are used
customCartridgeColorsBooleanIf custom cartridge colors are used
customBordersBooleanIf custom border images are used
customTopScreenBackgroundBooleanIf the top screen has a custom background image
customBottomScreenBackgroundBooleanIf the bottom screen has a custom background image
topScreenTopScreenObjectAn object containing information about the top screen
bottomScreenBottomScreenObjectAn object containing information about the bottom screen
colorsColorsObjectAn object containing information about all of the theme colors
texturesTexturesObjectAn object containing all of the theme textures
cwavsCWAVSObjectAn object containing all of the theme sound effects

TopScreenObject : Object

Contains various information about the top screen

Kind: global typedef
Properties

NameTypeDescription
drawTypeIntegerTop screen draw type: 0 = none, 1 = solid color, 2 = solid color with textured squares, 3 = texture.
frameTypeInteger | undefinedTop screen frame type, when draw-type is 3: 0 = texture1 (regular scrolling speed), 1 = texture0 (no scroll), 3 = texture1 (slow scrolling speed).
topScreen.backgroundTopScreenBackgroundObjectContains information about the top screen background
topScreen.squareOpacityFloatControls the opacity of the squares that float in front of the background, ranges from 0 - 1.

TopScreenBackgroundObject : Object

Contains information about the top screen background

Kind: global typedef
Properties

NameTypeDescription
textureTiledImageObject | undefinedThe top screen texture when drawType allows it.
colorRGBObject | undefinedThe top screen background color if drawType is set to either 1 or 2.
gradientInteger | undefinedThe top screen background gradient (0=none, 255=fade all the way to white at the top)

BottomScreenObject : Object

Contains information about the bottom screen

Kind: global typedef
Properties

NameTypeDescription
backgroundBottomScreenBackgroundObjectInformation about the bottom screen background
drawTypeIntegerThe bottom screen draw type: 0 = none, 1 = solid color(see below), 2 = invalid, 3 = texture.
framTypeIntegerThe bottom screen frame type when draw-type is 3: 0 = texture4 (regular scroll), 1 = texture2 (no scroll), 2 = texture3 (flipbook scroll, 0 > 1 > 2 > 0), 3 = texture4 (slow scroll), 4 = texture3 (flipbook scroll, 0 > 1 > 2 > 1 > 0).

BottomScreenBackgroundObject : Object

Information about the bottom screen background

Kind: global typedef
Properties

NameTypeDescription
textureTiledImageObject | undefinedThe bottom screen background image

ColorsObject : Object

This contains all of the colors used in the theme

Kind: global typedef
Properties

NameTypeDescription
cursorCursorColor | undefinedFour RGB colors that affect the cursor as it expands and contracts.
folder3DModelFolder3DModelColor | undefinedThis contains colors for the 3D folder model.
cartridgeCartridgeColor | undefinedThis contains colors that affect both the cart icon that appears for DSiWare, and the file graphic that appears in folders.
folderTopHighlightRGBObject | undefinedThe highlight used at the top of a folder icon
pagerPagerObject | undefinedThis contains colors that affect the the pager.
openButtonOpenCloseButtonObject | undefinedContains RGB data for the open button that appears on the bottom screen when an app is under the cursor.
closeButtonOpenCloseButtonObject | undefinedContains RGB data for the close button that appears when home button pressed from within a app.
zoomedTextZoomedTextObject | undefinedContains color data that affects the text that appears above game icons when zoomed to the maximum level.
bottomScreenIconAreaBottomScreenIconAreaObject | undefinedContains colors related to the bottom screen icon area. Used when the draw-type is set to solid color.
bottomScreenOuterAreaBottomScreenOuterAreaObject | undefinedContains colors releated to the bottom screen outer area. Used when the draw-type is set to solid color.
folderBackgroundFolderBackgroundObject | undefinedContains information related to the background of folders.
settingsAndResizeSettingsAndResizeObject | undefinedContains colors that affect the bottom screen icon-resize and settings buttons.
activateCameraOverlayActivateCameraOverlayObject | undefinedContains colors for the "press to activate camera" overlay.
demoUsesRemainingDemoUsesRemainingObject | undefinedContains colors for the message that tells you how many demo uses you have remaining.
topScreenBackgroundRGBObject | undefinedThe top screen background color if drawType is set to either 1 or 2.

CursorColor : Object

Four RGB colors that affect the cursor as it expands and contracts.

Kind: global typedef
Properties

NameTypeDescription
borderRGBObjectThe cursor border color
mainRGBObjectThe cursor main color
unknownRGBObjectAn unknown color
expandedGlowRGBObjectThe glow of the expanded cursor

Folder3DModelColor : Object

This contains colors for the 3D folder model.

Kind: global typedef
Properties

NameTypeDescription
mainRGBObjectThe main color
shadowedRGBObjectThe shadowed color

CartridgeColor : Object

This contains colors that affect both the cart icon that appears for DSiWare, and the file graphic that appears in folders.

Kind: global typedef
Properties

NameTypeDescription
mainRGBObjectThe main color
bottomShadowRGBObjectThe bottom shadow color

PagerObject : Object

This contains colors that affect the the pager.

Kind: global typedef
Properties

NameTypeDescription
buttonPagerButtonColor | undefinedThis contains colors that affect the button of the pager
arrowPagerArrowColor | undefinedThis contains colors that affect the arrows of the pager

PagerButtonColor : Object

This contains colors that affect the buttons of the pager.

Kind: global typedef
Properties

NameTypeDescription
downwardSheenRGBObjectThe downward sheen color
mainRGBObjectThe main color
leftwardSheenRGBObjectThe leftward sheen color

PagerArrowColor : Object

This contains colors that affect the arrows of the pager.

Kind: global typedef
Properties

NameTypeDescription
edgeRGBObjectThe edge color
unpressedRGBObjectThe unpressed color
pressedRGBObjectThe pressed color

OpenCloseButtonObject : Object

Contains RGB data for the open and close buttons that appear on the bottom screen.

Kind: global typedef
Properties

NameTypeDescription
buttonOpenCloseButtonColorThe colors for the button
textOpenCloseButtonTextColorThe colors for the button text

OpenCloseButtonColor : Object

Contains three colors that are used for the open/close button color

Kind: global typedef
Properties

NameTypeDescription
pressedRGBObjectThe button background when pressed
unpressedRGBObjectThe button background when not pressed
borderRGBObjectThe button border color

OpenCloseButtonTextColor : Object

Contains three colors that are used for the open/close button text color

Kind: global typedef
Properties

NameTypeDescription
pressedRGBObjectThe pressed text color
unpressedRGBObjectThe unpressed text color
shadoowRGBObjectThe text shadow color

ZoomedTextObject : Object

Contains color data that affects the text that appears above game icons when zoomed to the maximum level.

Kind: global typedef
Properties

NameTypeDescription
backgroundRGBObjectThe background color
textRGBObjectThe text color

BottomScreenIconAreaObject : Object

Contains information related to the bottom screen icon area. Used when the draw-type is set to solid color.

Kind: global typedef
Properties

NameTypeDescription
emptySlotShadowRGBObjectThe shadow color at the top of an empty slot
backgroundRGBObjectThe background color
emptySlotBorderRGBObjectThe empty slot border color
folderGlowRGBAObjectThe shadow / glow around the folder area

FolderBackgroundObject : Object

Contains information related to the background of folders.

Kind: global typedef
Properties

NameTypeDescription
emptySlotShadowRGBObjectThe empty slot shadow color
backgroundRGBObjectThe background color
borderRGBObjectThe border color

SettingsAndResizeObject : Object

Contains colors that affect the bottom screen icon-resize and settings buttons.

Kind: global typedef
Properties

NameTypeDescription
leftBoxShadowRGBObjectThe left box shadow (subtle)
backgroundRGBObjectThe background color
borderRGBObjectThe border color
iconGradientArray.<RGBObject>A two value array that contains the color values for the icon gradient.
pressedRGBObjectThe pressed color
rightBoxShadowRGBObjectThe color right shadow (subtle)

ActivateCameraOverlayObject : Object

Contains colors for the "press to activate camera" overlay.

Kind: global typedef
Properties

NameTypeDescription
backgroundRGBObjectThe background color
textRGBObjectThe text color

DemoUsesRemainingObject : Object

Contains colors for the message that tells you how many demo uses you have remaining.

Kind: global typedef
Properties

NameTypeDescription
backgroundRGBObjectThe background color
textRGBObjectThe text color

BottomScreenOuterAreaObject : Object

Contains colors related to the bottom screen outer area. Used when the draw-type is set to solid color.

Kind: global typedef
Properties

NameTypeDescription
stripedRGBObjectThe striped color
backgroundRGBObjectThe background color
edgeGlowRGBObjectThe edge glow color

TexturesObject : Object

Kind: global typedef
Properties

NameTypeDescription
topBackgroundTiledImageObject | undefinedThis is the texture used for the top-screen background when topScreen.frameType = 1, Used for backgrounds that don't scroll.
topScrollingBackgroundTiledImageObject | undefinedThis is the texture used for the top-screen background when topScreen.frameType = 0 or 3, Used for backgrounds that scroll.
bottomBackgroundTiledImageObject | undefinedThis is the texture used for the bottom-screen background when bottomScreen.frameType = 1, Used for backgrounds that don't scroll.
bottomFlipbookBackgroundTiledImageObject | undefinedThis is the texture used for the bottom-screen background when bottomScreen.frameType = 2 or 4, Split into three separate 320x240 textures that it jumps through like a flipbook.
bottomScrollingBackgroundTiledImageObject | undefinedThis is the texture used for the bottom-screen background when bottomScreen.frameType = 0 or 3, Used for backgrounds that scroll.
movingPatternTiledImageObject | undefinedThis is used with the top screen when topScreen.drawType = 2, see above. Used to tile the top screen in much the same way as the white squares that appear when no theme is selected, this is the moving pattern, it is rotated 90 degrees.
stillPatternTiledImageObject | undefinedtextures.movingPattern This is used with the top screen when topScreen.drawType = 2, see above. Used to tile the top screen in much the same way as the white squares that appear when no theme is selected, this is the still pattern, it is rotated 90 degrees.
closedFolderTiledImageObject | undefinedThis is used for closed folders on the main menu.
openFolderTiledImageObject | undefinedThis is used for open folders on the main menu.
largeIconBorderTiledImageObject | undefinedThis is used for 48x48 icon borders on the main menu.
smallIconBorderTiledImageObject | undefinedThis is used for 24x24 icon borders on the main menu.

CWAVSObject : Object

Contains buffers of CWAV data for all of the sound effects.

Kind: global typedef
Properties

NameTypeDescription
cursorBuffer | undefinedThe sound for cusor movement
LaunchBuffer | undefinedThe sound for application launch
folderBuffer | undefinedThe sound for folder buttons
cancelBuffer | undefinedThe sound for cancel buttons
frame0Buffer | undefined
frame1Buffer | undefined
frame2Buffer | undefined
openLidBuffer | undefinedThe sound for when the lid is opened

RGBObject : Object

This describes a RGB color

Kind: global typedef
Properties

NameTypeDescription
rIntegerRed channel from 0 - 255
gIntegerGreen channel from 0 - 255
bIntegerBlue channel from 0 - 255

RGBAObject : Object

This describes a RGBA color

Kind: global typedef
Properties

NameTypeDescription
rIntegerRed channel from 0 - 255
gIntegerGreen channel from 0 - 255
bIntegerBlue channel from 0 - 255
aIntegerAlpha channel from 0 - 255

TiledImageObject : Object

An object with the tiled image bitmap data, size, and crop dimensions.

Kind: global typedef
Properties

NameTypeDescription
dataBufferThe image bitmap data buffer
widthIntegerThe image width
heightIntegerThe image height
cropWidthIntegerThe image crop width
cropHeightIntegerThe image crop height
typeStringThe image type, one of the following: rgb565, bgr888, a8
tagStringA string identifying the image, see TextureKind.js