Skip to content

Commit e031f89

Browse files
authored
Add files via upload
1 parent 1342133 commit e031f89

31 files changed

Lines changed: 18596 additions & 0 deletions

AnimCurve.lua

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
12+
13+
14+
15+
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
110+
111+
112+
113+
114+
115+
116+
117+
118+
119+
120+
121+
122+
123+
124+
125+
126+
127+
128+
129+
130+
131+
132+
133+
134+
135+
136+
137+
138+
139+
140+
141+
142+
143+
144+
145+
146+
147+
148+
149+
150+
151+
152+
153+
154+
155+
156+
157+
158+
159+
160+
161+
162+
163+
164+
165+
166+
---
167+
local AnimCurve_mt = Class(AnimCurve)
168+
169+
170+
171+
172+
173+
174+
175+
176+
177+
178+
179+
180+
181+
182+
183+
184+
185+
186+
---Resets this anim curve, clearing all keyframes and resetting time properties as if it were made again with new. Does not reset interpolator.
187+
function AnimCurve:reset()
188+
189+
-- Reset the keyframe properties.
190+
table.clear(self.keyframes)
191+
self.numKeyframes = 0
192+
193+
-- Reset the timing values.
194+
self.currentTime = 0
195+
self.maxTime = 0
196+
end

AnimationValueBool.lua

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
---Animation value with a boolean as type
12+
local AnimationValueBool_mt = Class(AnimationValueBool, AnimationValueFloat)
13+
14+
15+
---
16+
function 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)
18+
end
19+
20+
21+
---
22+
function 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)
29+
end
30+
31+
32+
---
33+
function AnimationValueBool:init(index, numParts)
34+
end
35+
36+
37+
---
38+
function AnimationValueBool:postInit()
39+
end
40+
41+
42+
---
43+
function AnimationValueBool:reset()
44+
self.curValue = nil
45+
end
46+
47+
48+
---
49+
function 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
61+
end

0 commit comments

Comments
 (0)