AboutCustomFunction - cwtickle/danoniplus-docs GitHub Wiki

English | Japanese

| < Interrupt processing by custom js (skin js) | Custom functions specification | Colored objects specification > |

Custom functions specification

How to add a custom function (optional)

function anotherCustomFunction() {

}
// Add anotherCustomFunction to the main frame-by-frame process
g_customJsObj.mainEnterFrame.push(anotherCustomFunction); 

Overview

  • Please see Interrupt processing by custom js (skin js).
    We create a customizable range by interrupting an existing function.
  • The custom function object has properties defined for each insertion location,
    function as an element of an array and executes that group of functions together when the insertion location is reached.
  • The custom function object has properties defined for each insertion location, and the function is made to have the function as an element of an array, and when the insertion location is reached, the group of functions is executed together.

Example of execution in the main program

g_customJsObj.title.forEach(func => func());
// g_customJsObj.title = [customTitleInit, customTitleInit2];

g_customJsObj

  • This object stores functions defined in custom js. Introduced in ver25.3.0, existing functions are also defined here.
Property name Description Conventional function Specifiable arguments
preTitle Before displaying the title screen (initial) -
title After displaying the title screen (initial) customTitleInit
titleEnterFrame Title screen (process per frame) customTitleInitEnterFrame
option Setup screen (initial) customOptionInit
difficulty Setup screen (when selecting charts) customSetDifficulty _initFlg, _canLoadDifInfoFlg
settingsDisplay Display screen (initial) customSettingsDisplayInit
keyconfig Key configuration screen (initial) customKeyConfigInit
preloading At the start of loading customPreloadingInit
loading Loading screen customLoadingInit
progress Operation during sound source loading customLoadingProgress _event
main Playing screen (initial) customMainInit
makeArrow When generating arrows - _attrs, _arrowName, _name, _arrowCnt
makeFrzArrow When generating freeze arrows - _attrs, _arrowName, _name, _arrowCnt
dummyArrow When judging dummy arrows customJudgeDummyArrow
dummyFrz When judging dummy freeze-arrows customJudgeDummyFrz
judg_ii When judging "Perfect" customJudgeIi _difFrame
judg_shakin When judging "Great" customJudgeShakin _difFrame
judg_matari When judging "Good" customJudgeMatari _difFrame
judg_shobon When judging "Bad" customJudgeShobon _difFrame
judg_uwan When judging "Miss" customJudgeUwan _difFrame
judg_kita When judging "O.K." customJudgeKita _difFrame
judg_iknai When judging "N.G." customJudgeIknai _difFrame
judg_frzHit When hitting normal freeze-arrows - _difFrame
judg_dummyFrzHit When hitting dummy freeze-arrows - _difFrame
mainEnterFrame Playing screen (process per frame) customMainEnterFrame
result Result screen (initial) customResultInit
resultEnterFrame Result screen (process per frame) customResultEnterFrame

Arguments that can be used at the time of judgment

Argument name Description
_difFrame Number of frames from just timing (positive or negative)

Arguments available for g_customJsObj.difficulty (when selecting difficulty)

Argument name Description
_initFlg Initial display flag
_canLoadDifInfoFlg Flag to allow loading of initial chart information. If you don't want to initialize, set to false.

Arguments available for g_customJsObj.makeArrow / makeFrzArrow

Argument name Description
_attrs Arrow attributes. It has the following properties in object format:  pos: Arrow type arrivalFrame: Number of arrival frames  initY: Initial display position initBoostY: Additional initial display position when Motion is enabled motionFrame: Number of active animation frames
_arrowName Id name of arrow created
_name The type of arrow, either arrow or dummyArrow.
_arrowCnt Sequential number of arrows created

g_skinJsObj

  • This object stores functions defined in skinJs. Introduced in ver25.3.0, existing functions are also defined here.  
Property name Description Conventional function
title Title screen (initial) skinTitleInit
option Setup screen (initial) skinOptionInit
settingsDisplay Display screen (initial) skinSettingsDisplayInit
keyconfig Key configuration screen (initial) skinKeyConfigInit
preloading At the start of loading skinPreloadingInit
main Playing screen (initial) skinMainInit
result Result screen (initial) skinResultInit

更新履歴

Version 変更内容
v39.0.0 - Added interrupt processing when generating arrow or freeze arrow. (g_customJsObj.makeArrow, makeFrzArrow)
v31.7.0 - Added interrupt processing for freeze arrow hits (g_customJsObj.judg_frzHit, judg_dummyFrzHit)
v26.3.1 - Changed to allow custom functions to be inserted before the title screen is displayed. (g_customJsObj.preTitle)
v25.3.0 - Updated custom function definitions.