CoolUtil
| Kind | class |
| Package | backend |
| Full name | backend.CoolUtil |
| Source | source/backend/CoolUtil.hx |
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
defaultDifficulties | Array<String> | yes | ['Easy', 'Normal', 'Hard'] | — |
defaultDifficultiesFull | Array<String> | yes | ['Easy', 'Normal', 'Hard', 'Erect', 'Nightmare'] | — |
defaultDifficulty | String | yes | 'Normal' | — |
defaultDifficultyThings | Array<String> | yes | ['Normal', 'normal'] | — |
difficulties | Array<String> | yes | [] | — |
currentDifficulty | String | yes | 'Normal' | — |
defaultSongs | Array<String> | yes | [ | — |
defaultSongsFormatted | Array<String> | yes | ['dad-battle', 'philly-nice', 'satin-panties', 'winter-horrorland', 'lit-up'] | — |
defaultCharacters | Array<String> | yes | [ | — |
resW | Float | yes | 1 | #if desktop && !air · Resolution scaling is used with native resizable windows, not AIR's window model. |
resH | Float | yes | 1 | #if desktop && !air |
baseW | Float | yes | 1 | #if desktop && !air |
baseH | Float | yes | 1 | #if desktop && !air |
getUsername | — | yes | CoolSystemStuff.getUsername | — |
getUserPath | — | yes | CoolSystemStuff.getUserPath | — |
getTempPath | — | yes | CoolSystemStuff.getTempPath | — |
beats | Array<Int> | yes | [ | final |
Public methods
quantize
static inline function quantize(f:Float, snap:Float)
| Parameter | Type | Default |
|---|---|---|
f | Float | — |
snap | Float | — |
isVersionNewer
static function isVersionNewer(versionA:String, versionB:String):Bool
| Parameter | Type | Default |
|---|---|---|
versionA | String | — |
versionB | String | — |
resetResScale
static inline function resetResScale(wid:Int = 1280, height:Int = 720)
Only compiled when #if desktop && !air.
| Parameter | Type | Default |
|---|---|---|
wid (optional) | Int | 1280 |
height (optional) | Int | 720 |
selfDestruct
static function selfDestruct():Void // this function instantly deletes your JS Engine build. i stole this from vs marcello source so if this gets used for malicious purposes im removing it
checkForOBS
static function checkForOBS():Bool
hasVersion
static function hasVersion(vers:String):Bool
Can be used to check if your using a specific version of an OS (or if your using a certain OS).
| Parameter | Type | Default |
|---|---|---|
vers | String | — |
getSongDuration
static function getSongDuration(musicTime:Float, musicLength:Float, precision:Int = 0):String
| Parameter | Type | Default |
|---|---|---|
musicTime | Float | — |
musicLength | Float | — |
precision (optional) | Int | 0 |
formatTime
static function formatTime(musicTime:Float, precision:Int = 0):String
| Parameter | Type | Default |
|---|---|---|
musicTime | Float | — |
precision (optional) | Int | 0 |
formatCompactNumber
static function formatCompactNumber(number:Float):String
| Parameter | Type | Default |
|---|---|---|
number | Float | — |
zeroFill
static function zeroFill(value:Int, digits:Int)
| Parameter | Type | Default |
|---|---|---|
value | Int | — |
digits | Int | — |
getHealthColors
static function getHealthColors(char:Character):Array<Int>
| Parameter | Type | Default |
|---|---|---|
char | Character | — |
checkNoteQuant
static function checkNoteQuant(note:Note, timeToCheck:Float, ?rgbShader:RGBShaderReference)
| Parameter | Type | Default |
|---|---|---|
note | Note | — |
timeToCheck | Float | — |
rgbShader (optional) | RGBShaderReference | — |
getDifficultyFilePath
static function getDifficultyFilePath(num:Null<Int> = null)
| Parameter | Type | Default |
|---|---|---|
num (optional) | Null<Int> | null |
difficultyString
static function difficultyString():String
getMinAndMax
static function getMinAndMax(value1:Float, value2:Float):Array<Float>
| Parameter | Type | Default |
|---|---|---|
value1 | Float | — |
value2 | Float | — |
boundTo
static inline function boundTo(value:Float, min:Float, max:Float):Float
| Parameter | Type | Default |
|---|---|---|
value | Float | — |
min | Float | — |
max | Float | — |
clamp
static inline function clamp(value:Float, min:Float, max:Float):Float
| Parameter | Type | Default |
|---|---|---|
value | Float | — |
min | Float | — |
max | Float | — |
coolTextFile
static inline function coolTextFile(path:String):Array<String>
| Parameter | Type | Default |
|---|---|---|
path | String | — |
colorFromString
static inline function colorFromString(color:String):FlxColor
| Parameter | Type | Default |
|---|---|---|
color | String | — |
listFromString
static inline function listFromString(string:String):Array<String>
| Parameter | Type | Default |
|---|---|---|
string | String | — |
floorDecimal
static function floorDecimal(value:Float, decimals:Int):Float
| Parameter | Type | Default |
|---|---|---|
value | Float | — |
decimals | Int | — |
dominantColor
static function dominantColor(sprite:flixel.FlxSprite):Int
| Parameter | Type | Default |
|---|---|---|
sprite | flixel.FlxSprite | — |
coolError
static function coolError(message:Null<String> = null, title:Null<String> = null):Void
Funny handler for Application.current.window.alert that doesn't crash on Linux and shit.
@param message Message of the error.
@param title Title of the error.
@author Leather128
| Parameter | Type | Default |
|---|---|---|
message (optional) | Null<String> | null |
title (optional) | Null<String> | null |
numberArray
static function numberArray(max:Int, min = 0):Array<Int>
| Parameter | Type | Default |
|---|---|---|
max | Int | — |
min (optional) | Dynamic | 0 |
browserLoad
static function browserLoad(site:String)
| Parameter | Type | Default |
|---|---|---|
site | String | — |
getNoteAmount
static function getNoteAmount(song:SwagSong, bothSides:Bool = true, oppNotes:Bool = false):Int
| Parameter | Type | Default |
|---|---|---|
song | SwagSong | — |
bothSides (optional) | Bool | true |
oppNotes (optional) | Bool | false |
getSavePath
static inline function getSavePath():String
setTextBorderFromString
static function setTextBorderFromString(text:FlxText, border:String)
| Parameter | Type | Default |
|---|---|---|
text | FlxText | — |
border | String | — |
showPopUp
static function showPopUp(message:String, title:String):Void
| Parameter | Type | Default |
|---|---|---|
message | String | — |
title | String | — |
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
SUFFIXES1 | Array<String> | yes |
TEN_SUFFIXES | Array<Array<String>> | yes |
DEC_SUFFIXES | Array<Array<Dynamic>> | yes |
CENTI_SUFFIXES | Array<Array<String>> | yes |
foundQuant | Int | yes |
theCurBPM | Float | yes |
stepCrochet | Float | yes |
latestBpmChangeIndex | — | yes |
latestBpmChange | — | yes |