LUADOC - Farming Simulator 22

Script v1_7_1_0

Engine v1_7_1_0

Foundation Reference

AnimationValueBool

Description
Animation value with a boolean as type
Parent
AnimationValueFloat
Functions

init

Description
Definition
init()
Code
33function AnimationValueBool:init(index, numParts)
34end

load

Description
Definition
load()
Code
22function AnimationValueBool:load(xmlFile, key)
23 self.value = xmlFile:getValue(key .. "#" .. self.startName)
24
25 self.warningInfo = key
26 self.xmlFile = xmlFile
27
28 return self.value ~= nil and self:extraLoad(xmlFile, key)
29end

new

Description
Definition
new()
Code
16function AnimationValueBool.new(vehicle, animation, part, startName, endName, name, initialUpdate, get, set, extraLoad, customMt)
17 return AnimationValueFloat.new(vehicle, animation, part, startName, endName, name, initialUpdate, get, set, extraLoad, customMt or AnimationValueBool_mt)
18end

postInit

Description
Definition
postInit()
Code
38function AnimationValueBool:postInit()
39end

reset

Description
Definition
reset()
Code
43function AnimationValueBool:reset()
44 self.curValue = nil
45end

update

Description
Definition
update()
Code
49function AnimationValueBool:update(durationToEnd, dtToUse, realDt)
50 if self.curValue == nil then
51 self.curValue = self:get()
52 end
53
54 if self.value ~= self.curValue then
55 self.curValue = self.value
56 self:set(self.value)
57 return true
58 end
59
60 return false
61end