Sprache Deutsch Language English

Script Dokumentation LS 2015 - SunAdmirer (Patch 1.3)

Script Dokumentation Übersicht

scripts/objects/SunAdmirer.lua

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