Sprache Deutsch Language English

Script Dokumentation LS 2015 - Nightlight2 (Patch 1.3)

Script Dokumentation Übersicht

scripts/objects/Nightlight2.lua

Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
1-- Nightlight2 class
2--
3-- Copyright (C) GIANTS Software GmbH, Confidential, All Rights Reserved.
4
5Nightlight2 = {}
6
7local Nightlight2_mt = Class(Nightlight2);
8
9function Nightlight2:onCreate(id)
10 g_currentMission:addNonUpdateable(Nightlight2:new(id));
11end;
12
13function Nightlight2:new(id)
14 local self = {};
15 setmetatable(self, Nightlight2_mt);
16
17 g_currentMission.environment:addWeatherChangeListener(self);
18
19 self.id = id;
20 setVisibility(self.id, false);
21
22 return self;
23end;
24
25function Nightlight2:delete()
26 if g_currentMission.environment ~= nil then
27 g_currentMission.environment:removeWeatherChangeListener(self);
28 end;
29end;
30
31function Nightlight2:weatherChanged()
32 if g_currentMission ~= nil and g_currentMission.environment ~= nil then
33 setVisibility(self.id, not (g_currentMission.environment.isSunOn and g_currentMission.environment.currentRain == nil));
34 end;
35end;
Copyright (c) 2008-2015 GIANTS Software GmbH, Confidential, All Rights Reserved.
This document is to be published solely by ls-mods.de
Script Dokumentation Übersicht