Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/placement.js
Show All 23 Lines | PlacementSupport.prototype.Reset = function() | ||||
this.RandomizeActorSeed(); | this.RandomizeActorSeed(); | ||||
this.attack = null; | this.attack = null; | ||||
Engine.GuiInterfaceCall("SetBuildingPlacementPreview", { "template": "" }); | Engine.GuiInterfaceCall("SetBuildingPlacementPreview", { "template": "" }); | ||||
Engine.GuiInterfaceCall("SetWallPlacementPreview", { "wallSet": null }); | Engine.GuiInterfaceCall("SetWallPlacementPreview", { "wallSet": null }); | ||||
}; | }; | ||||
PlacementSupport.prototype.SnapData = function(){ | |||||
elexis: ()\n{
let
What is the best location in this file for this function? | |||||
Done Inline ActionsRight here looks fine. nani: Right here looks fine. | |||||
Done Inline ActionsWondering whether it's not better to keep it near the two callers to remove fragmentation elexis: Wondering whether it's not better to keep it near the two callers to remove fragmentation | |||||
var snapData = Engine.GuiInterfaceCall("GetFoundationSnapData", { | |||||
"template": this.template, | |||||
"x": this.position.x, | |||||
"z": this.position.z | |||||
}); | |||||
if (snapData) | |||||
{ | |||||
this.angle = snapData.angle; | |||||
this.position.x = snapData.x; | |||||
this.position.z = snapData.z; | |||||
Not Done Inline Actionsposition = snapData (.clone() unneeded since we receive a copy and don't read later from the value) elexis: position = snapData (.clone() unneeded since we receive a copy and don't read later from the… | |||||
} | |||||
} | |||||
PlacementSupport.prototype.SetDefaultAngle = function() | PlacementSupport.prototype.SetDefaultAngle = function() | ||||
{ | { | ||||
this.angle = PlacementSupport.DEFAULT_ANGLE; | this.angle = PlacementSupport.DEFAULT_ANGLE; | ||||
}; | }; | ||||
PlacementSupport.prototype.RandomizeActorSeed = function() | PlacementSupport.prototype.RandomizeActorSeed = function() | ||||
{ | { | ||||
this.actorSeed = randIntExclusive(0, Math.pow(2, 16)); | this.actorSeed = randIntExclusive(0, Math.pow(2, 16)); | ||||
}; | }; | ||||
var placementSupport = new PlacementSupport(); | var placementSupport = new PlacementSupport(); |
Wildfire Games · Phabricator
()\n{
let
What is the best location in this file for this function?