forked from Courseplay/courseplay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspecialTools.lua
42 lines (37 loc) · 2.06 KB
/
specialTools.lua
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
function courseplay:setNameVariable(workTool)
if workTool.cp == nil then
workTool.cp = {};
end;
courseplay:updateFillLevelsAndCapacities(workTool)
-- TODO: is this even needed? Why not use the workTool.spec_* directly? Do we really need our own table?
-- Only default specs!
for i,spec in pairs(workTool.specializations) do
if spec == Combine then workTool.cp.hasSpecializationCombine = true;
elseif spec == Cutter then workTool.cp.hasSpecializationCutter = true;
elseif spec == Drivable then workTool.cp.hasSpecializationDrivable = true;
elseif spec == FillUnit then workTool.cp.hasSpecializationFillUnit = true;
elseif spec == FillVolume then workTool.cp.hasSpecializationFillVolume = true;
elseif spec == MixerWagon then workTool.cp.hasSpecializationMixerWagon = true;
elseif spec == Shovel then workTool.cp.hasSpecializationShovel = true;
elseif spec == Leveler then workTool.cp.hasSpecializationLeveler = true;
elseif spec == Overloading then workTool.cp.hasSpecializationOverloader = true;
elseif spec == Trailer then workTool.cp.hasSpecializationTrailer = true;
elseif spec == BunkerSiloCompacter then workTool.cp.hasSpecializationBunkerSiloCompacter = true;
end;
end;
if workTool.cp.hasSpecializationFillUnit and workTool.cp.hasSpecializationFillVolume then
workTool.cp.hasSpecializationFillable = true;
end;
--------------------------------------------------------------
-- ###########################################################
--------------------------------------------------------------
-- SPECIALIZATIONS BASED
-- [1] AUGER WAGONS
if workTool.typeName == 'augerWagon' then
workTool.cp.isAugerWagon = true;
elseif workTool.cp.hasSpecializationOverloader and not workTool.cp.hasSpecializationCutter then
workTool.cp.isAugerWagon = true;
elseif workTool.animationParts ~= nil and workTool.animationParts[2] ~= nil and workTool.toggleUnloadingState ~= nil and workTool.setUnloadingState ~= nil then
workTool.cp.isAugerWagon = true;
end;
end;