Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/functions_utility.js
/** | /** | ||||
* Used for acoustic GUI notifications. | * Used for acoustic GUI notifications. | ||||
* Define the soundfile paths and specific time thresholds (avoid spam). | * Define the soundfile paths and specific time thresholds (avoid spam). | ||||
* And store the timestamp of last interaction for each notification. | * And store the timestamp of last interaction for each notification. | ||||
*/ | */ | ||||
var g_SoundNotifications = { | var g_SoundNotifications = { | ||||
"nick": { "soundfile": "audio/interface/ui/chat_alert.ogg", "threshold": 3000 } | "nick": { "soundfile": "audio/interface/ui/chat_alert.ogg", "threshold": 3000 } | ||||
}; | }; | ||||
/** | |||||
* XEP-0172 doesn't restrict nicknames, but our lobby policy does. | |||||
* So use this human readable delimiter to separate buddy names in the config file. | |||||
*/ | |||||
var g_ConfigListDelimiter = ","; | |||||
/** | |||||
* Save array values as string with delimiter. | |||||
*/ | |||||
function setUserConfigValues(key, array) | |||||
{ | |||||
// Don't save empty strings to the config file (save single g_ConfigListDelimiter on empty) | |||||
Engine.ConfigDB_CreateValue("user", key, array.filter(value => value).join(g_ConfigListDelimiter) || g_ConfigListDelimiter); | |||||
} | |||||
/** | |||||
* Write user config into file. | |||||
*/ | |||||
function writeUserConfig() | |||||
{ | |||||
Engine.ConfigDB_WriteFile("user", "config/user.cfg"); | |||||
} | |||||
// Get list of XML files in pathname with recursion, excepting those starting with _ | // Get list of XML files in pathname with recursion, excepting those starting with _ | ||||
function getXMLFileList(pathname) | function getXMLFileList(pathname) | ||||
{ | { | ||||
var files = Engine.BuildDirEntList(pathname, "*.xml", true); | var files = Engine.BuildDirEntList(pathname, "*.xml", true); | ||||
var result = []; | var result = []; | ||||
// Get only subpath from filename and discard extension | // Get only subpath from filename and discard extension | ||||
▲ Show 20 Lines • Show All 243 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator