Script v1_7_1_0
- AI
- Animals
- Collections
- Contracts
- Debug
- Economy
- Elements
- EnvironmentalScore
- Errors
- Events
- GUI
- Handtools
- Hud
- I3d
- Input
- Jobs
- Maps
- Materials
- Misc
- Objects
- Parameters
- Placeables
- Placement
- Player
- Shop
- Sounds
- Specialization
- Specializations
- StateMachine
- Statistics
- Tasks
- Triggers
- Utils
- Vehicles
Engine v1_7_1_0
- AI
- Animation
- Camera
- Entity
- Fillplanes
- general
- General
- I3D
- Input
- Lighting
- Math
- Network
- Node
- NoteNode
- Overlays
- Particle System
- Physics
- Rendering
- getMaterialCustomShaderFilename
- getMaterialCustomShaderVariation
- getMaterialDiffuseMapFilename
- getMaterialDiffuseMapHasAlpha
- getMaterialEmissiveMapFilename
- getMaterialEmissiveMapHasAlpha
- getMaterialGlossMapFilename
- getMaterialHasRefractionMap
- getMaterialIsAlphaBlended
- getMaterialIsAlphaTested
- getMaterialNormalMapFilename
- getMaterialNormalMapFormat
- getMaterialReflectionMapScaling
- setMaterialCustomMapFromFile
- setMaterialCustomShaderVariation
- setMaterialDiffuseMapFromFile
- setMaterialGlossMapFromFile
- setMaterialNormalMapFromFile
- Scenegraph
- Shape
- Sound
- Spline
- String
- Terrain Detail
- Text Rendering
- Tire Track
- VoiceChat
- XML
Foundation Reference
FoldableSetFoldDirectionEvent
DescriptionEvent for set folding directionParent
EventFunctions
emptyNew
DescriptionCreate instance of Event classDefinition
emptyNew()Return Values
table | self | instance of class event |
13 | function FoldableSetFoldDirectionEvent.emptyNew() |
14 | local self = Event.new(FoldableSetFoldDirectionEvent_mt) |
15 | return self |
16 | end |
new
DescriptionCreate new instance of eventDefinition
new(table object, integer direction, boolean moveToMiddle)Arguments
table | object | object |
integer | direction | direction |
boolean | moveToMiddle | move to middle |
23 | function FoldableSetFoldDirectionEvent.new(object, direction, moveToMiddle) |
24 | local self = FoldableSetFoldDirectionEvent.emptyNew() |
25 | self.object = object |
26 | self.direction = MathUtil.sign(direction) |
27 | self.moveToMiddle = moveToMiddle |
28 | return self |
29 | end |
readStream
DescriptionCalled on client side on joinDefinition
readStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
35 | function FoldableSetFoldDirectionEvent:readStream(streamId, connection) |
36 | self.object = NetworkUtil.readNodeObject(streamId) |
37 | self.direction = streamReadUIntN(streamId, 2)-1 |
38 | self.moveToMiddle = streamReadBool(streamId) |
39 | self:run(connection) |
40 | end |
run
DescriptionRun action on receiving sideDefinition
run(integer connection)Arguments
integer | connection | connection |
55 | function FoldableSetFoldDirectionEvent:run(connection) |
56 | if self.object ~= nil and self.object:getIsSynchronized() then |
57 | self.object:setFoldState(self.direction, self.moveToMiddle, true) |
58 | end |
59 | |
60 | if not connection:getIsServer() then |
61 | g_server:broadcastEvent(FoldableSetFoldDirectionEvent.new(self.object, self.direction, self.moveToMiddle), nil, connection, self.object) |
62 | end |
63 | end |
writeStream
DescriptionCalled on server side on joinDefinition
writeStream(integer streamId, integer connection)Arguments
integer | streamId | streamId |
integer | connection | connection |
46 | function FoldableSetFoldDirectionEvent:writeStream(streamId, connection) |
47 | NetworkUtil.writeNodeObject(streamId, self.object) |
48 | streamWriteUIntN(streamId, self.direction+1, 2) |
49 | streamWriteBool(streamId, self.moveToMiddle) |
50 | end |