3ds-theme-parser

1.0.1 • Public • Published

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

ThemeInfo

Typedefs

ThemeInfoObject : Object

This is the top-level object containing the theme information

TopScreenObject : Object

Contains various information about the top screen

TopScreenBackgroundObject : Object

Contains information about the top screen background

BottomScreenObject : Object

Contains information about the bottom screen

BottomScreenBackgroundObject : Object

Information about the bottom screen background

ColorsObject : Object

This contains all of the colors used in the theme

CursorColor : Object

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

Folder3DModelColor : Object

This contains colors for the 3D folder model.

CartridgeColor : Object

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

PagerObject : Object

This contains colors that affect the the pager.

PagerButtonColor : Object

This contains colors that affect the buttons of the pager.

PagerArrowColor : Object

This contains colors that affect the arrows of the pager.

OpenCloseButtonObject : Object

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

OpenCloseButtonColor : Object

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

OpenCloseButtonTextColor : Object

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

ZoomedTextObject : Object

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

BottomScreenIconAreaObject : Object

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

FolderBackgroundObject : Object

Contains information related to the background of folders.

SettingsAndResizeObject : Object

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

ActivateCameraOverlayObject : Object

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

DemoUsesRemainingObject : Object

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

BottomScreenOuterAreaObject : Object

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

TexturesObject : Object
CWAVSObject : Object

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

RGBObject : Object

This describes a RGB color

RGBAObject : Object

This describes a RGBA color

TiledImageObject : Object

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

ThemeInfo

Kind: global class

new ThemeInfo(bodyBuffer)

The ThemeInfo constructor.

Param Type Description
bodyBuffer Buffer The 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

Param Type Description
[callback] function An optional node.js style callback

ThemeInfoObject : Object

This is the top-level object containing the theme information

Kind: global typedef
Properties

Name Type Description
enableBGM Boolean If background music is enabled
customSFX Boolean If custom sound effects are used
customFolders Boolean If custom folder images are used
customCartridgeColors Boolean If custom cartridge colors are used
customBorders Boolean If custom border images are used
customTopScreenBackground Boolean If the top screen has a custom background image
customBottomScreenBackground Boolean If the bottom screen has a custom background image
topScreen TopScreenObject An object containing information about the top screen
bottomScreen BottomScreenObject An object containing information about the bottom screen
colors ColorsObject An object containing information about all of the theme colors
textures TexturesObject An object containing all of the theme textures
cwavs CWAVSObject An object containing all of the theme sound effects

TopScreenObject : Object

Contains various information about the top screen

Kind: global typedef
Properties

Name Type Description
drawType Integer Top screen draw type: 0 = none, 1 = solid color, 2 = solid color with textured squares, 3 = texture.
frameType Integer | undefined Top screen frame type, when draw-type is 3: 0 = texture1 (regular scrolling speed), 1 = texture0 (no scroll), 3 = texture1 (slow scrolling speed).
topScreen.background TopScreenBackgroundObject Contains information about the top screen background
topScreen.squareOpacity Float Controls 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

Name Type Description
texture TiledImageObject | undefined The top screen texture when drawType allows it.
color RGBObject | undefined The top screen background color if drawType is set to either 1 or 2.
gradient Integer | undefined The 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

Name Type Description
background BottomScreenBackgroundObject Information about the bottom screen background
drawType Integer The bottom screen draw type: 0 = none, 1 = solid color(see below), 2 = invalid, 3 = texture.
framType Integer The 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

Name Type Description
texture TiledImageObject | undefined The bottom screen background image

ColorsObject : Object

This contains all of the colors used in the theme

Kind: global typedef
Properties

Name Type Description
cursor CursorColor | undefined Four RGB colors that affect the cursor as it expands and contracts.
folder3DModel Folder3DModelColor | undefined This contains colors for the 3D folder model.
cartridge CartridgeColor | undefined This contains colors that affect both the cart icon that appears for DSiWare, and the file graphic that appears in folders.
folderTopHighlight RGBObject | undefined The highlight used at the top of a folder icon
pager PagerObject | undefined This contains colors that affect the the pager.
openButton OpenCloseButtonObject | undefined Contains RGB data for the open button that appears on the bottom screen when an app is under the cursor.
closeButton OpenCloseButtonObject | undefined Contains RGB data for the close button that appears when home button pressed from within a app.
zoomedText ZoomedTextObject | undefined Contains color data that affects the text that appears above game icons when zoomed to the maximum level.
bottomScreenIconArea BottomScreenIconAreaObject | undefined Contains colors related to the bottom screen icon area. Used when the draw-type is set to solid color.
bottomScreenOuterArea BottomScreenOuterAreaObject | undefined Contains colors releated to the bottom screen outer area. Used when the draw-type is set to solid color.
folderBackground FolderBackgroundObject | undefined Contains information related to the background of folders.
settingsAndResize SettingsAndResizeObject | undefined Contains colors that affect the bottom screen icon-resize and settings buttons.
activateCameraOverlay ActivateCameraOverlayObject | undefined Contains colors for the "press to activate camera" overlay.
demoUsesRemaining DemoUsesRemainingObject | undefined Contains colors for the message that tells you how many demo uses you have remaining.
topScreenBackground RGBObject | undefined The 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

Name Type Description
border RGBObject The cursor border color
main RGBObject The cursor main color
unknown RGBObject An unknown color
expandedGlow RGBObject The glow of the expanded cursor

Folder3DModelColor : Object

This contains colors for the 3D folder model.

Kind: global typedef
Properties

Name Type Description
main RGBObject The main color
shadowed RGBObject The 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

Name Type Description
main RGBObject The main color
bottomShadow RGBObject The bottom shadow color

PagerObject : Object

This contains colors that affect the the pager.

Kind: global typedef
Properties

Name Type Description
button PagerButtonColor | undefined This contains colors that affect the button of the pager
arrow PagerArrowColor | undefined This 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

Name Type Description
downwardSheen RGBObject The downward sheen color
main RGBObject The main color
leftwardSheen RGBObject The leftward sheen color

PagerArrowColor : Object

This contains colors that affect the arrows of the pager.

Kind: global typedef
Properties

Name Type Description
edge RGBObject The edge color
unpressed RGBObject The unpressed color
pressed RGBObject The pressed color

OpenCloseButtonObject : Object

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

Kind: global typedef
Properties

Name Type Description
button OpenCloseButtonColor The colors for the button
text OpenCloseButtonTextColor The colors for the button text

OpenCloseButtonColor : Object

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

Kind: global typedef
Properties

Name Type Description
pressed RGBObject The button background when pressed
unpressed RGBObject The button background when not pressed
border RGBObject The button border color

OpenCloseButtonTextColor : Object

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

Kind: global typedef
Properties

Name Type Description
pressed RGBObject The pressed text color
unpressed RGBObject The unpressed text color
shadoow RGBObject The 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

Name Type Description
background RGBObject The background color
text RGBObject The 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

Name Type Description
emptySlotShadow RGBObject The shadow color at the top of an empty slot
background RGBObject The background color
emptySlotBorder RGBObject The empty slot border color
folderGlow RGBAObject The shadow / glow around the folder area

FolderBackgroundObject : Object

Contains information related to the background of folders.

Kind: global typedef
Properties

Name Type Description
emptySlotShadow RGBObject The empty slot shadow color
background RGBObject The background color
border RGBObject The border color

SettingsAndResizeObject : Object

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

Kind: global typedef
Properties

Name Type Description
leftBoxShadow RGBObject The left box shadow (subtle)
background RGBObject The background color
border RGBObject The border color
iconGradient Array.<RGBObject> A two value array that contains the color values for the icon gradient.
pressed RGBObject The pressed color
rightBoxShadow RGBObject The color right shadow (subtle)

ActivateCameraOverlayObject : Object

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

Kind: global typedef
Properties

Name Type Description
background RGBObject The background color
text RGBObject The text color

DemoUsesRemainingObject : Object

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

Kind: global typedef
Properties

Name Type Description
background RGBObject The background color
text RGBObject The 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

Name Type Description
striped RGBObject The striped color
background RGBObject The background color
edgeGlow RGBObject The edge glow color

TexturesObject : Object

Kind: global typedef
Properties

Name Type Description
topBackground TiledImageObject | undefined This is the texture used for the top-screen background when topScreen.frameType = 1, Used for backgrounds that don't scroll.
topScrollingBackground TiledImageObject | undefined This is the texture used for the top-screen background when topScreen.frameType = 0 or 3, Used for backgrounds that scroll.
bottomBackground TiledImageObject | undefined This is the texture used for the bottom-screen background when bottomScreen.frameType = 1, Used for backgrounds that don't scroll.
bottomFlipbookBackground TiledImageObject | undefined This 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.
bottomScrollingBackground TiledImageObject | undefined This is the texture used for the bottom-screen background when bottomScreen.frameType = 0 or 3, Used for backgrounds that scroll.
movingPattern TiledImageObject | undefined 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 moving pattern, it is rotated 90 degrees.
stillPattern TiledImageObject | undefined textures.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.
closedFolder TiledImageObject | undefined This is used for closed folders on the main menu.
openFolder TiledImageObject | undefined This is used for open folders on the main menu.
largeIconBorder TiledImageObject | undefined This is used for 48x48 icon borders on the main menu.
smallIconBorder TiledImageObject | undefined This 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

Name Type Description
cursor Buffer | undefined The sound for cusor movement
Launch Buffer | undefined The sound for application launch
folder Buffer | undefined The sound for folder buttons
cancel Buffer | undefined The sound for cancel buttons
frame0 Buffer | undefined
frame1 Buffer | undefined
frame2 Buffer | undefined
openLid Buffer | undefined The sound for when the lid is opened

RGBObject : Object

This describes a RGB color

Kind: global typedef
Properties

Name Type Description
r Integer Red channel from 0 - 255
g Integer Green channel from 0 - 255
b Integer Blue channel from 0 - 255

RGBAObject : Object

This describes a RGBA color

Kind: global typedef
Properties

Name Type Description
r Integer Red channel from 0 - 255
g Integer Green channel from 0 - 255
b Integer Blue channel from 0 - 255
a Integer Alpha channel from 0 - 255

TiledImageObject : Object

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

Kind: global typedef
Properties

Name Type Description
data Buffer The image bitmap data buffer
width Integer The image width
height Integer The image height
cropWidth Integer The image crop width
cropHeight Integer The image crop height
type String The image type, one of the following: rgb565, bgr888, a8
tag String A string identifying the image, see TextureKind.js

Readme

Keywords

Package Sidebar

Install

npm i 3ds-theme-parser

Weekly Downloads

0

Version

1.0.1

License

AGPL-3.0

Unpacked Size

149 kB

Total Files

11

Last publish

Collaborators

  • dantheman827