-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGC_AddOnDigitalFarming.lua
93 lines (64 loc) · 2.38 KB
/
GC_AddOnDigitalFarming.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
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
--
-- GlobalCompany - AddOn - GC_AddOnDigitalFarming
--
-- @Interface: --
-- @Author: LS-Modcompany / kevink98
-- @Date:
-- @Version: 1.0.0.0
--
-- @Support: LS-Modcompany
--
-- Changelog:
--
--
-- v1.0.0.0 ():
--
-- Notes:
--
--
-- ToDo:
--
--
--
--[[
for k,v in pairs(spec) do
print(string.format("%s %s",k,v))
end;
]]--
GC_AddOnDigitalFarming = {}
GC_AddOnDigitalFarming.modName = g_currentModName;
function GC_AddOnDigitalFarming.initSpecialization()
end;
function GC_AddOnDigitalFarming.prerequisitesPresent(specializations)
return SpecializationUtil.hasSpecialization(Drivable, specializations);
end;
function GC_AddOnDigitalFarming.registerFunctions(vehicleType)
SpecializationUtil.registerFunction(vehicleType, "getSpec", GC_AddOnDigitalFarming.getSpec);
end;
function GC_AddOnDigitalFarming.registerEventListeners(vehicleType)
SpecializationUtil.registerEventListener(vehicleType, "onLoad", GC_AddOnDigitalFarming);
SpecializationUtil.registerEventListener(vehicleType, "onUpdate", GC_AddOnDigitalFarming);
SpecializationUtil.registerEventListener(vehicleType, "onDraw", GC_AddOnDigitalFarming);
end;
function GC_AddOnDigitalFarming:getSpec()
return self["spec_FS19_GlobalCompany.gcAddOnDigitalFarming"];
end
function GC_AddOnDigitalFarming:onLoad(savegame)
local spec = self:getSpec();
spec.isEnabled = g_company.digitalFarming.getIsVehicleRegister(self.configFileName);
if spec.isEnabled then
spec.vehicleData = g_company.digitalFarming.getVehicleDataByXmlfilename(self.configFileName);
--load display
local parentNode = I3DUtil.indexToObject(self.components, spec.vehicleData.displayPosition.link);
local nodeId = I3DUtil.indexToObject(g_i3DManager:loadSharedI3DFile(g_company.digitalFarming.displayPath, "", false, false, false), "0");
link(parentNode, nodeId);
setTranslation(nodeId, spec.vehicleData.displayPosition.X, spec.vehicleData.displayPosition.Y, spec.vehicleData.displayPosition.Z);
setRotation(nodeId, math.rad(spec.vehicleData.displayPosition.RX), math.rad(spec.vehicleData.displayPosition.RY), math.rad(spec.vehicleData.displayPosition.RZ));
end;
end;
function GC_AddOnDigitalFarming:onUpdate()
local spec = self:getSpec();
end;
function GC_AddOnDigitalFarming:onDraw()
local spec = self:getSpec();
end;