Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/messages.js
Show First 20 Lines • Show All 447 Lines • ▼ Show 20 Lines | "playercommand": function(notification, player) | ||||
if (cmd.entities) | if (cmd.entities) | ||||
selection = cmd.entities; | selection = cmd.entities; | ||||
if (cmd.target) | if (cmd.target) | ||||
selection.push(cmd.target); | selection.push(cmd.target); | ||||
// Allow gaia in selection when gathering | // Allow gaia in selection when gathering | ||||
g_Selection.reset(); | g_Selection.reset(); | ||||
g_Selection.addList(selection, false, cmd.type == "gather"); | g_Selection.addList(selection, false, cmd.type == "gather"); | ||||
}, | |||||
"play-tracks": function (notification, player) { | |||||
if (notification.lock == 1) | |||||
{ | |||||
global.music.storeTracks(notification.tracks); | |||||
global.music.setState(global.music.states.CUSTOM); | |||||
global.music.lock(); | |||||
} | |||||
else | |||||
{ | |||||
global.music.unlock(); | |||||
elexis: storeTracks and setState only needed when locking, right?
Might want to use a fancy `map`… | |||||
global.music.setState(global.music.states.PEACE); | |||||
elexisUnsubmitted Not Done Inline ActionssetState not needed as its updated every turn on its own, right? So the else part can be avoided afterwards elexis: setState not needed as its updated every turn on its own, right? So the else part can be… | |||||
} | |||||
} | } | ||||
}; | }; | ||||
/** | /** | ||||
* Loads all known cheat commands. | * Loads all known cheat commands. | ||||
*/ | */ | ||||
function getCheatsData() | function getCheatsData() | ||||
{ | { | ||||
Show All 38 Lines | function executeCheat(text) | ||||
Engine.PostNetworkCommand({ | Engine.PostNetworkCommand({ | ||||
"type": "cheat", | "type": "cheat", | ||||
"action": cheat.Action, | "action": cheat.Action, | ||||
"text": cheat.Type, | "text": cheat.Type, | ||||
"player": Engine.GetPlayerID(), | "player": Engine.GetPlayerID(), | ||||
"parameter": parameter, | "parameter": parameter, | ||||
"templates": cheat.Templates, | "templates": cheat.Templates, | ||||
"selected": g_Selection.toList() | "selected": g_Selection.toList(), | ||||
"tracks":cheat.Tracks | |||||
}); | }); | ||||
return true; | return true; | ||||
} | } | ||||
function findGuidForPlayerID(playerID) | function findGuidForPlayerID(playerID) | ||||
{ | { | ||||
return Object.keys(g_PlayerAssignments).find(guid => g_PlayerAssignments[guid].player == playerID); | return Object.keys(g_PlayerAssignments).find(guid => g_PlayerAssignments[guid].player == playerID); | ||||
▲ Show 20 Lines • Show All 754 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
storeTracks and setState only needed when locking, right?
Might want to use a fancy map array function:
storeTracks(notification.tracks.map(track => ({ "Type": "custom", "File": track }))