Script Dokumentation LS 2015 - TreePlanterActivatable (Patch 1.3)
scripts/vehicles/specializations/TreePlanterActivatable.lua
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
1 | -- |
2 | -- TreePlanterActivatable |
3 | -- This is the activable class for treeplanters |
4 | -- |
5 | -- @author Manuel Leithner |
6 | -- @date 24/09/14 |
7 | -- |
8 | -- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved. |
9 | |
10 | TreePlanterActivatable = {} |
11 | local TreePlanterActivatable_mt = Class(TreePlanterActivatable); |
12 | |
13 | function TreePlanterActivatable:new(treePlanter) |
14 | local self = {}; |
15 | setmetatable(self, TreePlanterActivatable_mt); |
16 | |
17 | self.treePlanter = treePlanter; |
18 | self.activateText = string.format(g_i18n:getText("refill_OBJECT"), self.treePlanter.typeDesc) |
19 | |
20 | return self; |
21 | end; |
22 | |
23 | function TreePlanterActivatable:getIsActivatable() |
24 | if self.treePlanter:getRootAttacherVehicle() ~= g_currentMission.controlledVehicle then |
25 | return false; |
26 | end; |
27 | |
28 | if self.treePlanter.mountedSaplingPallet == nil and self.treePlanter.nearestSaplingPallet ~= nil then |
29 | return true; |
30 | end |
31 | return false; |
32 | end; |
33 | |
34 | function TreePlanterActivatable:onActivateObject() |
35 | self.treePlanter:loadPallet(networkGetObjectId(self.treePlanter.nearestSaplingPallet)); |
36 | end; |
37 | |
38 | function TreePlanterActivatable:drawActivate() |
39 | end;
|
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de