Differential D2079 Diff 10885 ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/GuiInterface.js
Show All 29 Lines | GuiInterface.prototype.Init = function() | ||||
this.renamedEntities = []; | this.renamedEntities = []; | ||||
this.miragedEntities = []; | this.miragedEntities = []; | ||||
this.timeNotificationID = 1; | this.timeNotificationID = 1; | ||||
this.timeNotifications = []; | this.timeNotifications = []; | ||||
this.entsRallyPointsDisplayed = []; | this.entsRallyPointsDisplayed = []; | ||||
this.entsWithAuraAndStatusBars = new Set(); | this.entsWithAuraAndStatusBars = new Set(); | ||||
this.enabledVisualRangeOverlayTypes = {}; | this.enabledVisualRangeOverlayTypes = {}; | ||||
this.templateModified = {}; | this.templateModified = {}; | ||||
this.obstructionSnap = new ObstructionSnap(); | |||||
}; | }; | ||||
/* | /* | ||||
* All of the functions defined below are called via Engine.GuiInterfaceCall(name, arg) | * All of the functions defined below are called via Engine.GuiInterfaceCall(name, arg) | ||||
* from GUI scripts, and executed here with arguments (player, arg). | * from GUI scripts, and executed here with arguments (player, arg). | ||||
* | * | ||||
* CAUTION: The input to the functions in this module is not network-synchronised, so it | * CAUTION: The input to the functions in this module is not network-synchronised, so it | ||||
* mustn't affect the simulation state (i.e. the data that is serialised and can affect | * mustn't affect the simulation state (i.e. the data that is serialised and can affect | ||||
▲ Show 20 Lines • Show All 1,617 Lines • ▼ Show 20 Lines | for (let ent of data.snapEntities) | ||||
}; | }; | ||||
} | } | ||||
} | } | ||||
if (minDistEntitySnapData != null) | if (minDistEntitySnapData != null) | ||||
return minDistEntitySnapData; | return minDistEntitySnapData; | ||||
} | } | ||||
if (data.snapToEdges) | |||||
{ | |||||
let position = this.obstructionSnap.getPosition(data, template); | |||||
if (position) | |||||
return position; | |||||
} | |||||
if (template.BuildRestrictions.PlacementType == "shore") | if (template.BuildRestrictions.PlacementType == "shore") | ||||
{ | { | ||||
let angle = GetDockAngle(template, data.x, data.z); | let angle = GetDockAngle(template, data.x, data.z); | ||||
if (angle !== undefined) | if (angle !== undefined) | ||||
return { | return { | ||||
"x": data.x, | "x": data.x, | ||||
"z": data.z, | "z": data.z, | ||||
"angle": angle | "angle": angle | ||||
▲ Show 20 Lines • Show All 331 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator