|
4 | 4 | -- |
5 | 5 | -- Author: Martin Fabík (LoogleCZ) |
6 | 6 | -- Author of some events: Andy (GtX) |
7 | | --- For IC version: 4.1.0 |
| 7 | +-- For IC version: 4.1.1 |
8 | 8 | -- You can find whole list of supported events in documentation |
9 | 9 | -- |
10 | | --- Last edit: 2018-08-11 16:30:00 |
| 10 | +-- Last edit: 2018-09-05 21:30:00 |
11 | 11 | -- Free for non-comerecial usage |
12 | 12 | -- |
13 | 13 |
|
@@ -696,6 +696,29 @@ function InteractiveControl:actionOnObject(id, isObjectOpen, noEventSend) |
696 | 696 | self:setPipeState(1); |
697 | 697 | end; |
698 | 698 | end; |
| 699 | + --[[ LRM ]]-- |
| 700 | + elseif self.LIC.interactiveObjects[id].event == "lrm.rotateMode.toggle" |
| 701 | + or self.LIC.interactiveObjects[id].event == "lrm.rotateMode.map" |
| 702 | + or self.LIC.interactiveObjects[id].event == "lrm.rotateMode.player" then |
| 703 | + if self.LRM ~= nil and self.LRM.isInitialized then |
| 704 | + self:lrm_setRotateMap(self.LIC.interactiveObjects[id].isOpen); |
| 705 | + end; |
| 706 | + elseif self.LIC.interactiveObjects[id].event == "lrm.mapZoom.increase" then |
| 707 | + if self.LRM ~= nil and self.LRM.isInitialized then |
| 708 | + self:lrm_setMapZoom(Utils.clamp(self.LRM.map.zoom + 0.5, self.LRM.map.minZoom, self.LRM.map.maxZoom)); |
| 709 | + end; |
| 710 | + elseif self.LIC.interactiveObjects[id].event == "lrm.mapZoom.decrease" then |
| 711 | + if self.LRM ~= nil and self.LRM.isInitialized then |
| 712 | + self:lrm_setMapZoom(Utils.clamp(self.LRM.map.zoom - 0.5, self.LRM.map.minZoom, self.LRM.map.maxZoom)); |
| 713 | + end; |
| 714 | + elseif self.LIC.interactiveObjects[id].event == "lrm.playerSize.increase" then |
| 715 | + if self.LRM ~= nil and self.LRM.isInitialized then |
| 716 | + self:lrm_setPlayerSize(Utils.clamp(self.LRM.player.size + 0.04, self.LRM.player.minSize, self.LRM.player.maxSize)); |
| 717 | + end; |
| 718 | + elseif self.LIC.interactiveObjects[id].event == "lrm.playerSize.decrease" then |
| 719 | + if self.LRM ~= nil and self.LRM.isInitialized then |
| 720 | + self:lrm_setPlayerSize(Utils.clamp(self.LRM.player.size - 0.04, self.LRM.player.minSize, self.LRM.player.maxSize)); |
| 721 | + end; |
699 | 722 | end; |
700 | 723 | end; |
701 | 724 |
|
@@ -1003,6 +1026,23 @@ function InteractiveControl:updateOpenStatus(id) |
1003 | 1026 | end; |
1004 | 1027 | elseif self.LIC.interactiveObjects[id].event == "pipe" then |
1005 | 1028 | self.LIC.interactiveObjects[id].isOpen = self.pipeTargetState ~= 1; |
| 1029 | + --[[ LRM ]]-- |
| 1030 | + elseif self.LIC.interactiveObjects[id].event == "lrm.rotateMode.toggle" then |
| 1031 | + if self.LRM ~= nil and self.LRM.isInitialized then |
| 1032 | + self.LIC.interactiveObjects[id].isOpen = self.LRM.rotatingMap; |
| 1033 | + end; |
| 1034 | + elseif self.LIC.interactiveObjects[id].event == "lrm.rotateMode.map" then |
| 1035 | + self.LIC.interactiveObjects[id].isOpen = false; |
| 1036 | + elseif self.LIC.interactiveObjects[id].event == "lrm.rotateMode.player" then |
| 1037 | + self.LIC.interactiveObjects[id].isOpen = true; |
| 1038 | + elseif self.LIC.interactiveObjects[id].event == "lrm.mapZoom.decrease" then |
| 1039 | + self.LIC.interactiveObjects[id].isOpen = false; |
| 1040 | + elseif self.LIC.interactiveObjects[id].event == "lrm.mapZoom.increase" then |
| 1041 | + self.LIC.interactiveObjects[id].isOpen = false; |
| 1042 | + elseif self.LIC.interactiveObjects[id].event == "lrm.playerSize.decrease" then |
| 1043 | + self.LIC.interactiveObjects[id].isOpen = false; |
| 1044 | + elseif self.LIC.interactiveObjects[id].event == "lrm.playerSize.increase" then |
| 1045 | + self.LIC.interactiveObjects[id].isOpen = false; |
1006 | 1046 | end; |
1007 | 1047 | end; |
1008 | 1048 |
|
@@ -1037,6 +1077,8 @@ function InteractiveControl:checkButtonVisible(id) |
1037 | 1077 | self.LIC.interactiveObjects[id].doNotShow = true; |
1038 | 1078 | elseif self.LIC.interactiveObjects[id].event == "steering.lockMovingTools" and self.lmt == nil then |
1039 | 1079 | self.LIC.interactiveObjects[id].doNotShow = true; |
| 1080 | + elseif string.sub( self.LIC.interactiveObjects[id].event, 1, 4 ) == "lrm." and (self.LRM == nil or not self.LRM.isInitialized) then |
| 1081 | + self.LIC.interactiveObjects[id].doNotShow = true; |
1040 | 1082 | end; |
1041 | 1083 | end; |
1042 | 1084 | end; |
|
0 commit comments