ObjectReferenceIndex - cwtickle/danoniplus-docs GitHub Wiki
English | Japanese
| < ID Reference | Object Reference | Object hierarchy > |
Object Reference
- Base Version: v48.5.1
This document covers the major objects and functions available via custom JS (through
g_customJsObj). In principle, internal-only processes are omitted.
Key Objects
Game Data
- g_rootObj — Raw chart data (dos data)
- g_headerObj — Configuration values after parsing the chart header
- g_keyObj — Key definitions (patterns, placements, colors, shuffle groups, etc.)
- g_stateObj — Various states during gameplay (speed, gauge, options, etc.)
- g_scoreObj — Chart placement data (arrows, freeze arrows, motions, etc.)
- g_detailObj — Detailed chart information (density, speed data, etc.)
- g_wordObj — Lyrics display state management
- g_attrObj — Attributes for individual arrows and freeze arrows (position, color, counters, etc.)
- g_workObj — Dynamic work variables for the main screen (step zone position, scroll direction, etc.)
- g_resultObj — Result data including judgment counters, score, and combo
- g_presetObj — Configuration values from the common settings file (
danoni_setting.js) - g_loadObj — File loading state management
Settings & Options
- g_settings — Management of various lists and cursor positions on the settings screen
- g_gaugeOptionObj — Gauge configuration options
- g_rankObj — Rank conditions and color definitions
- g_judgObj — Configuration values for judgment windows
UI & Display
- g_lblNameObj / g_lang_lblNameObj — Label string definitions (multilingual support)
- g_msgObj / g_lang_msgObj — Mouse-over and confirmation message definitions
- g_msgInfoObj — Warning and information message definitions
- g_errMsgObj — Error message management by screen
- g_cssObj — CSS class name constants
- g_hidSudObj / g_hidSudFunc — State and display management for Hidden+ / Sudden+
- g_graphColorObj — Color definitions for graphs and gauges
- g_emojiObj — Emoji constants
Shortcuts & Button Control
- g_shortcutObj — Shortcut key definitions by screen
- g_btnWaitFrame — Timing validation for enabling buttons and shortcuts
- g_btnPatterns — Major button lists by screen
- g_btnAddFunc / g_cxtAddFunc — Adding logic/processes to buttons
- g_btnDeleteFlg / g_cxtDeleteFlg — Disable flags for button logic
Custom Function Hooks
- g_customJsObj — Insertion points for Custom JS (Title, Main, Results, etc.)
- g_skinJsObj — Insertion points for Skin JS
Animation & Motion
- g_animationData — Animation type lists (
back,mask,style) - g_animationFunc — Animation creation and drawing functions (
.make,.draw,.drawMain) - g_shuffleFunc — Map of shuffle processing functions (
Mirror,Random, etc.) - g_motionFunc — Map of motion option processing functions
- g_playWindowFunc — Map of PlayWindow option processing functions
- g_stepAreaFunc — Map of StepArea option processing functions
- g_shakingFunc — Map of Shaking option processing functions
- g_effectFunc — Map of Effect option processing functions
- g_frzReturnFunc — Map of FrzReturn option processing functions
Conversions & Constants
- g_escapeStr — Definition collection of string replacement pairs
- g_kCd — KeyCode to display name mapping
- g_kCdN — KeyCode to
KeyboardEvent.codemapping - g_posObj — Step zone position and travel distance
- g_diffObj — Correction values for judgment positions and shortcut display locations
- g_imgObj — Image path management
- g_typeLists — Constants for arrow types, color changes, etc.
- g_limitObj — Constants for sizes and font sizes
- g_templateObj — Default definitions for result formats
- g_pointAllocation — Score point allocation definitions
Key Functions
Element & Attribute Manipulation
- $id (_id) — Returns
document.getElementById(_id).style - multiAppend (_baseObj, ...rest) — Appends multiple child elements at once
- setAttrs (_baseObj, { ...rest }) — Sets multiple attributes at once
- convertStrToVal (_str) — Expands
{variableName}within strings - wUnit (_val, _unitName=
px) — Returns a string appended with the specified unit
Value & Type Conversion
- hasVal (_data, ...strs) — Checks if a value exists (excluding
undefinedand empty strings) - hasValN (_data, ...strs) — Checks existence while also excluding
null - setVal (_checkStr, _default, _type) — Gets a value with type conversion applied
- setBoolVal (_val, _defaultVal) — Converts to a boolean type
- setIntVal (_val, _defaultVal) — Converts to an integer
- boolToSwitch (_condition) — Converts
true/falseto"ON"/"OFF" - toCapitalize (_str) — Capitalizes only the first letter
- roundZero (_num, _init) — Rounds values less than 0 up to
_init - nextPos (_basePos, _num, _length) — Calculates a circular index
- sumData (_array) — Returns the sum total of an array
- fillArray (_length, _val=0) — Creates an array filled with the specified value
- makeDedupliArray (_array1, ..._arrays) — Creates a deduplicated array
- checkDuplicatedObjects (_obj) — Creates a nested array if it doesn't exist; prevents duplicates if it does
- makeBaseArray (_array, _minLength, _defaultVal) — Creates an array ensuring a minimum length
- listMatching (_str, _list, { prefix, suffix }) — Partial match search
- fuzzyListMatching (_str, _headerList, _footerList) — Combined prefix and suffix match search
- replaceStr (_str, _pairs) — Performs batch string replacement
- escapeHtml (_str, _escapeList) — Escapes HTML characters
- escapeHtmlForEnabledTag (_str) — Escapes HTML while allowing specific tags
- unEscapeHtml (_str) — Unescapes escaped HTML strings
- splitLF (_str) — Converts a string into an array split by line feeds
- splitLF2 (_str, _delim) — Converts line feeds into delimiters and outputs an array
- getCurrentNo (_list, _target) — Returns the position within an array (returns 0 if not found)
Files & Links
- openLink (_url) — Opens an external link in a new tab
- loadScript2 (_url, _requiredFlg, _charset) — Asynchronously loads a JavaScript file
- importCssFile2 (_href) — Loads a CSS file
- preloadFile (_as, _href, _type, _crossOrigin) — Preloads resources
- getFilePath (_fileName, _directory) — Deconstructs a string into file paths and directories
- checkImage (_str) — Checks image file extensions
Colors & Gradients
- makeColorGradation (_colorStr, { _defaultColorgrd, _colorCdPaddingUse, _objType, _shadowFlg }) — Generates gradient CSS/strings
- colorToHex (_color) — Converts color names to color codes
- colorNameToCode (_color) — Converts color names via Canvas
- checkLightOrDark (_colorStr) — Determines if a color is light or dark
- isColorCd (_str) — Validates whether a string is a hex color code (starting with
#)
Fonts & Text
- getBasicFont (_priorityFont) — Generates the basic game font string
- getFontSize2 (_str, _maxWidth, { font, maxSiz, minSiz }) — Returns the maximum font size that fits the width
- getStrWidth (_str, _fontsize, _font) — Gets the rendering width of a string
- getStrHeight (_str, _fontsize, _font) — Gets the rendering height of a string
UI Element Creation
- createDivCss2Label (_id, _text, { x, y, w, h, siz, align, ...rest }, ..._classes) — Creates a div element with text
- createColorObject2 (_id, { x, y, w, h, rotate, styleName, ...rest }, ..._classes) — Creates a div element with arrows or mask images
- createEmptySprite (_parentObj, _newObjId, { x, y, w, h, title, ...rest }, ..._classes) — Creates an empty sprite (div)
- createCss2Button (_id, _text, _func, { x, y, w, h, siz, align, title, resetFunc, cxtFunc, ...rest }, ..._classes) — Creates a button element
- changeStyle (_id, { x, y, w, h, siz, align, title, ...rest }) — Mass updates styles of an existing element
- deleteChildspriteAll (_parentObjName) — Deletes all child elements (and clears event listeners)
- deleteDiv (_parentId, _idName) — Deletes a specified element
- createImg (_id, _imgPath, _x, _y, _width, _height) — Creates a div containing an img element
- createColorPicker (_parentObj, _id, _func, { x, y }) — Generates a color picker
- getTitleDivLabel (_id, _titlename, _x, _y) — Generates a title text label
- createDescDiv (_id, _str, { altId, siz }) — Generates a supplemental description label
- makePlayButton (_func) — Generates the PLAY button
Screen & Sprite Management
- clearWindow (_redrawFlg, _customDisplayName) — Clears screens and redraws backgrounds
- createMultipleSprite (_baseName, _num) — Generates layered sprites (e.g., back/maskSprite)
- makeBgCanvas (_ctx, { w, h }) — Draws the Canvas background
Transform & Coordinate Management
- addTransform (_id, _transformId, _transform, _priority) — Adds or modifies an element's transform
- delTransform (_id, _transformId) — Deletes a specified transform
- getTransform (_id, _transformId) — Gets the value of a specified transform
- addX (_id, _typeId, _x, { overwrite, priority }) — Adds coordinates in the X direction
- addY (_id, _typeId, _y, { overwrite, priority }) — Adds coordinates in the Y direction
- addXY (_id, _typeId, _x, _y, { overwrite, priority }) — Adds coordinates in both X and Y directions
- delX / delY / delXY (_id, _typeId) — Deletes added coordinates
- rotateXY (_x, _y, _angleDeg) — Rotates coordinate positions
Shortcuts & Key Operations
- setShortcutEvent (_displayName, _func, { displayFlg, dfEvtFlg }) — Enables a shortcut key
- createScText (_obj, _settingLabel, { displayName, dfLabel, targetLabel, x, y, w, siz }) — Creates a shortcut key display label
- commonKeyDown (_evt, _displayName, _func, _dfEvtFlg) — Generic processing on keydown events
- keyIsDown (_keyCode) — Checks the pressed state of a key
- keyIsShift () — Checks if the Shift key is pressed
Notifications & Messages
- makeWarningWindow (_text, { resetFlg, backBtnUse }) — Displays a warning window
- makeInfoWindow (_text, _animationName, { _backColor, _textColor, _pointerEvents }) — Displays an info/notice window
- copyTextToClipboard (_textVal, _msg) — Copies text to the clipboard
Time & Frame Conversion
- transFrameToTimer (_frame) — Converts frames to a
"MM:SS"string - transTimerToFrame (_str) — Converts a timer string to a frame count
- getQueryParamVal (_name) — Fetches URL query parameters
Settings Screen Assistance
- g_moveSettingWindow (_changePageFlg, _direction) — Navigates between setting screens
- setDifficulty (_initFlg) — Reconfigures settings when a chart is selected
- setSetting (_scrollNum, _settingName, { func, unitName, roundNum }) — Updates configuration values
- setGauge (_scrollNum, _gaugeInitFlg) — Switches gauge configurations
- gaugeFormat (_mode, _border, _rcv, _dmg, _init, _lifeValFlg) — Formats detailed gauge text
- getStgDetailName (_name) — Converts settings names for display (references
g_lblNameObj.u_*) - getKeyName (_key) — Gets the display name for a key label
- getKeyUnitName (_key) — Gets the key unit name (e.g.,
"key") - makeHighScore (_scoreId) — Updates the high score display
- changeAppearanceFilter (_num) — Redraws the Appearance filter
- drawSpeedGraph (_scoreId) — Renders the speed change graph
- drawDensityGraph (_scoreId) — Renders the density graph
- makeDifInfo (_scoreId) — Updates the difficulty information label
- getScoreBaseData (_scoreId) — Fetches base chart data (arrow count, APM, etc.)
- updateSettingSummary () — Updates the configuration summary display
Judgment & Scoring (Main Screen)
- judgeArrow (_j) — Processes arrow hit judgments
- lifeRecovery () — Increases the gauge life
- lifeDamage (_excessive) — Decreases the gauge life from damage
- changeLifeColor (_state) — Updates the gauge bar's color and numeric value
- displayDiff (_difFrame, _fjdg, _justFrames) — Displays Fast/Slow indicators
- quickRetry (_retryCondition) — Evaluates automatic retry conditions
- judgeIi / judgeShakin / judgeMatari / judgeShobon / judgeUwan (_difFrame, _j) — Processes individual criteria judgments
- judgeKita / judgeIknai (_difFrame, _j) — Processes freeze arrow judgments
- changeHitFrz (_j, _k, _name, _difFrame) — Updates graphics when hitting a freeze arrow
- changeFailedFrz (_j, _k) — Updates graphics when failing a freeze arrow
- makeFinishView (_text) — Displays Full Combo / Perfect animations
- finishViewing () — Checks state when all arrows have reached the target
Sprites & Color Changes (Main Screen)
- makeArrow (_attrs, _arrowCnt, _name, _color, _shadowColor) — Generates arrows
- makeFrzArrow (_attrs, _arrowCnt, _name, _normalColor, _barColor, _shadowColor) — Generates freeze arrows
- makeStepZone (_j, _keyCtrlPtn) — Generates the step zone
- appearStepZone (_j, _display, _alpha) — Toggles step zone visibility
- appearKeyTypes (_j, _targets, _alphas) — Controls partial key step zone visibility
- changeColors (_mkColor, _mkColorCd, _header, _name) — Applies individual or global color changes
- changeAppearanceBar (_num, _dirPlus) — Updates the appearance filter bar display
- safeExecuteCustomHooks (_hookName, _funcArray, ...args) — Safely executes custom function hooks
Results
- makeResultText (_format, { hashTag, musicTitle, ... }) — Formats result text output
- getSelectedSettingList (_orgShuffleFlg) — Fetches information on currently selected options
General Utilities
- safeExecuteCustomHooks (_hookName, _funcArray, ...args) — Safely executes functions within
g_customJsObjsequentially - getHeader (_obj, ..._params) — Fetches header values with priority given to locales
- getShadowColor (_colorPos, _arrowColor) — Fetches the shadow color for arrows
- getKeyInfo () — Gets basic configuration info for the current key pattern (
keyCtrlPtn,keyNum, etc.) - setPlayingShortcut () — Updates shortcut keys active during gameplay
- getShuffleName () — Gets the active shuffle display name
- getOrgShuffleFlg () — Checks if shuffle options are set to default
- getTransKeyName (_spaceFlg) — Gets the display name for alternative key modes
- getStorageKeyName (_key, _transName, _assistFlg, _mirrorName, _scoreId) — Gets the storage key name for high scores
- parseStorageData (_keyName, _default) — Parses LocalStorage data
- getQueryParamVal (_name) — Fetches URL query parameters
| < ID Reference | Object Reference | Object hierarchy > |