Module 00_Utility
Random helper functions that don't really belong anywhere else.
Functions
get43size (size4_3) | Scale a number to 4:3 resolution |
getAutoplay () | Returns current autoplay type. |
isWindowed () | Returns true if windowed mode is on |
getTrueX (element) | Get the actor's real X (Not relative to the parent like self:GetX()) by recursively grabbing the parents' position |
getTrueY (element) | Get the actor's real Y (Not relative to the parent like self:GetY()) by recursively grabbing the parents' position |
isOver (element) | Checks whether the mouse is over an actor |
tableContains (table, key) | returns true if the table contains the key. |
getTableSize (table) | for non-array tables. |
MD5FileHex (sPath) | returns the hexadecimal representaion of the MD5 hash. |
SHA1FileHex (sPath) | Returns the hexadecimal representation of the SHA-1 hash for the file. |
MD5StringHex (str) | Returns the hexadecimal representaion of the MD5 hash for the string. |
SHA1StringHex (str) | Returns the hexadecimal representation of the SHA-1 hash for the string |
filterFileList (fileList, fileTypes) | Given a table of file paths/names in a fileList filters out files from fileList that aren't in the type in fileTypes both function parameters are passed on as tables |
isScoreValid (pn, steps, score) | Just something to get rid of scores where the player quit out early. |
disqualifyScore () | Should make the currently played sscore not save Doesn't work for some reason rip- |
getNoteFieldScale (pn_old_deprecated) | Values based on ArrowEffects.cpp Gets the note scale from the mini mod being used. |
getNoteFieldWidth (pn_old_deprecated) | Gets the width of the note assuming the base width is 64. |
getNoteFieldPos (pn_old_deprecated) | Gets the center X position of the notefield. |
getCommonBPM (bpmChanges, lastBeat) | Get the most common BPM in a list of BPMChanges Should check for correctness later. |
getBPMChangeCount (bpmChanges) | Get number of bpm changes in a bpm changes array DDreamStudio adds small, indetectable bpm changes which make #bpmChanges not accurate |
getCurrentKeyMode () | Returns a string of the form "(KeyCount)K" like "4K" Uses GAMESTATE:GetCurrentSteps():GetStepsType() |
getModifierTranslations (raw) | Returns translated modifiers given a raw string of modifiers |
Functions
- get43size (size4_3)
-
Scale a number to 4:3 resolution
Parameters:
- size4_3 number the size to scale
Returns:
-
number
4:3 scaled value
- getAutoplay ()
-
Returns current autoplay type. returns a integer between 0~2 corresponding to
human, autoplay and autoplay cpu respectively.
Returns:
-
number
- isWindowed ()
-
Returns true if windowed mode is on
Returns:
-
boolean
- getTrueX (element)
-
Get the actor's real X (Not relative to the parent like self:GetX()) by recursively grabbing the parents' position
Parameters:
- element actor the actor
Returns:
-
number
- getTrueY (element)
-
Get the actor's real Y (Not relative to the parent like self:GetY()) by recursively grabbing the parents' position
Parameters:
- element actor the actor
Returns:
-
number
- isOver (element)
-
Checks whether the mouse is over an actor
Parameters:
- element actor the actor
Returns:
-
bool
true if the mouse is over the actor
- tableContains (table, key)
-
returns true if the table contains the key.
Parameters:
- table table
- key any
Returns:
-
bool
- getTableSize (table)
-
for non-array tables.
Parameters:
- table table
Returns:
-
int
- MD5FileHex (sPath)
-
returns the hexadecimal representaion of the MD5 hash.
Parameters:
- sPath string
Returns:
-
string or 0
0 if invalid
- SHA1FileHex (sPath)
-
Returns the hexadecimal representation of the SHA-1 hash for the file.
Parameters:
- sPath string
Returns:
-
string or 0
0 if invalid
- MD5StringHex (str)
-
Returns the hexadecimal representaion of the MD5 hash for the string.
Parameters:
- str string
Returns:
-
string or 0
0 if invalid
- SHA1StringHex (str)
-
Returns the hexadecimal representation of the SHA-1 hash for the string
Parameters:
- str string
Returns:
-
string or 0
0 if invalid
- filterFileList (fileList, fileTypes)
-
Given a table of file paths/names in a fileList
filters out files from fileList that aren't in the type in fileTypes
both function parameters are passed on as tables
Parameters:
- isScoreValid (pn, steps, score)
-
Just something to get rid of scores where the player quit out early.
dead because chord cohesion removal -mina
always returns true now
Parameters:
- pn
- steps
- score
- disqualifyScore ()
- Should make the currently played sscore not save Doesn't work for some reason rip-
- getNoteFieldScale (pn_old_deprecated)
-
Values based on ArrowEffects.cpp
Gets the note scale from the mini mod being used.
Do not use pnolddeprecated
Parameters:
- pn_old_deprecated
- getNoteFieldWidth (pn_old_deprecated)
-
Gets the width of the note assuming the base width is 64.
Do not use pnolddeprecated
Parameters:
- pn_old_deprecated
- getNoteFieldPos (pn_old_deprecated)
-
Gets the center X position of the notefield.
Do not use pnolddeprecated
Parameters:
- pn_old_deprecated
- getCommonBPM (bpmChanges, lastBeat)
-
Get the most common BPM in a list of BPMChanges
Should check for correctness later.
Parameters:
- bpmChanges {{number}} table of {row, bpm}
- lastBeat int
Returns:
-
int
maxBPM
- getBPMChangeCount (bpmChanges)
-
Get number of bpm changes in a bpm changes array
DDreamStudio adds small, indetectable bpm changes which make
#bpmChanges not accurate
Parameters:
- bpmChanges {{number}} table of {row, bpm}
Returns:
-
int
BPMChangeCount
- getCurrentKeyMode ()
-
Returns a string of the form "(KeyCount)K" like "4K"
Uses GAMESTATE:GetCurrentSteps():GetStepsType()
Returns:
-
string
keymode
- getModifierTranslations (raw)
-
Returns translated modifiers given a raw string of modifiers
Parameters:
- raw {string} string of modifiers
Returns:
-
{string}
translated string of modifiers