Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/session.js
Show First 20 Lines • Show All 575 Lines • ▼ Show 20 Lines | return { | ||||
"selection": g_Selection.selected, | "selection": g_Selection.selected, | ||||
"playerAssignments": g_PlayerAssignments, | "playerAssignments": g_PlayerAssignments, | ||||
"player": g_Players, | "player": g_Players, | ||||
}; | }; | ||||
} | } | ||||
function getSavedGameData() | function getSavedGameData() | ||||
{ | { | ||||
const simulationState = GetSimState(); | |||||
return { | return { | ||||
"groups": g_Groups.groups | "groups": g_Groups.groups, | ||||
"timeElapsed": simulationState.timeElapsed, | |||||
"states": simulationState.players.map(pState => pState.state) | |||||
}; | }; | ||||
} | } | ||||
function restoreSavedGameData(data) | function restoreSavedGameData(data) | ||||
{ | { | ||||
// Restore camera if any | // Restore camera if any | ||||
if (data.camera) | if (data.camera) | ||||
Engine.SetCameraData(data.camera.PosX, data.camera.PosY, data.camera.PosZ, | Engine.SetCameraData(data.camera.PosX, data.camera.PosY, data.camera.PosZ, | ||||
▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator