Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/GuiInterface.js
function GuiInterface() {} | function GuiInterface() {} | ||||
elexis: `fi`? | |||||
GuiInterface.prototype.Schema = | GuiInterface.prototype.Schema = | ||||
"<a:component type='system'/><empty/>"; | "<a:component type='system'/><empty/>"; | ||||
GuiInterface.prototype.Serialize = function() | GuiInterface.prototype.Serialize = function() | ||||
{ | { | ||||
// This component isn't network-synchronized for the biggest part, | // This component isn't network-synchronized for the biggest part, | ||||
// so most of the attributes shouldn't be serialized. | // so most of the attributes shouldn't be serialized. | ||||
▲ Show 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | if (cmpPlayerStatisticsTracker) | ||||
ret.players[i].sequences = cmpPlayerStatisticsTracker.GetSequences(); | ret.players[i].sequences = cmpPlayerStatisticsTracker.GetSequences(); | ||||
} | } | ||||
return ret; | return ret; | ||||
}; | }; | ||||
/** | /** | ||||
* Returns the gamesettings that were chosen at the time the match started. | * Returns the gamesettings that were chosen at the time the match started. | ||||
*/ | */ | ||||
Done Inline Actionsthe campaign should decide itself, can be added later, likely calling some getter function from a trigger script or so. nuke the todo elexis: the campaign should decide itself, can be added later, likely calling some getter function from… | |||||
GuiInterface.prototype.GetInitAttributes = function() | GuiInterface.prototype.GetInitAttributes = function() | ||||
Not Done Inline ActionsThat's already contained in the GetSimulationState elexis: That's already contained in the GetSimulationState | |||||
{ | { | ||||
return InitAttributes; | return InitAttributes; | ||||
}; | }; | ||||
/** | /** | ||||
Not Done Inline ActionsSpace after { and before } elexis: Space after { and before } | |||||
Done Inline ActionsUnneeded comment, can become a single statement. elexis: Unneeded comment, can become a single statement.
Always having a property on a separate line in… | |||||
* This data will be stored in the replay metadata file after a match has been finished recording. | * This data will be stored in the replay metadata file after a match has been finished recording. | ||||
*/ | */ | ||||
GuiInterface.prototype.GetReplayMetadata = function() | GuiInterface.prototype.GetReplayMetadata = function() | ||||
{ | { | ||||
let extendedSimState = this.GetExtendedSimulationState(); | let extendedSimState = this.GetExtendedSimulationState(); | ||||
return { | return { | ||||
"timeElapsed": extendedSimState.timeElapsed, | "timeElapsed": extendedSimState.timeElapsed, | ||||
"playerStates": extendedSimState.players, | "playerStates": extendedSimState.players, | ||||
"mapSettings": InitAttributes.settings | "mapSettings": InitAttributes.settings | ||||
}; | }; | ||||
}; | }; | ||||
/** | |||||
* | |||||
*/ | |||||
GuiInterface.prototype.GetCampaignGameEndData = function(player) | |||||
{ | |||||
let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); | |||||
if (Trigger.prototype.OnCampaignGameEnd) | |||||
return Trigger.prototype.OnCampaignGameEnd(); | |||||
return {}; | |||||
}; | |||||
Done Inline ActionsThe reason why I'm not using CallEvents is:
I can change this to CallEvent if we agree that CallEvent should return the value of the trigger. wraitii: The reason why I'm not using CallEvents is:
- that doesn't return the value
- I don't care… | |||||
GuiInterface.prototype.GetRenamedEntities = function(player) | GuiInterface.prototype.GetRenamedEntities = function(player) | ||||
{ | { | ||||
if (this.miragedEntities[player]) | if (this.miragedEntities[player]) | ||||
return this.renamedEntities.concat(this.miragedEntities[player]); | return this.renamedEntities.concat(this.miragedEntities[player]); | ||||
return this.renamedEntities; | return this.renamedEntities; | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 1,769 Lines • ▼ Show 20 Lines | |||||
* be returned unless this player is meant to be able to see it.) | * be returned unless this player is meant to be able to see it.) | ||||
*/ | */ | ||||
let exposedFunctions = { | let exposedFunctions = { | ||||
"GetSimulationState": 1, | "GetSimulationState": 1, | ||||
"GetExtendedSimulationState": 1, | "GetExtendedSimulationState": 1, | ||||
"GetInitAttributes": 1, | "GetInitAttributes": 1, | ||||
"GetReplayMetadata": 1, | "GetReplayMetadata": 1, | ||||
"GetCampaignGameEndData": 1, | |||||
"GetRenamedEntities": 1, | "GetRenamedEntities": 1, | ||||
"ClearRenamedEntities": 1, | "ClearRenamedEntities": 1, | ||||
"GetEntityState": 1, | "GetEntityState": 1, | ||||
"GetMultipleEntityStates": 1, | "GetMultipleEntityStates": 1, | ||||
"GetAverageRangeForBuildings": 1, | "GetAverageRangeForBuildings": 1, | ||||
"GetTemplateData": 1, | "GetTemplateData": 1, | ||||
"IsTechnologyResearched": 1, | "IsTechnologyResearched": 1, | ||||
"CheckTechnologyRequirements": 1, | "CheckTechnologyRequirements": 1, | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
fi?