Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function WarningSigns:load(savegame)
- self.playerCallback = SpecializationUtil.callSpecializationsFunction("playerCallback");
- self.setSign = SpecializationUtil.callSpecializationsFunction("setSign");
- self.ws = {};
- local i=0;
- while true do
- local str = getXMLString(self.xmlFile, string.format("vehicle.warningSigns.sign(%d)#index", i));
- if str == nil then
- break;
- end;
- local node = Utils.indexToObject(self.components, str);
- if node == nil then
- print("[Error::WarningSigns] node for "..tostring(str).." does not exist");
- break;
- end;
- local trigger = Utils.indexToObject( self.components, getXMLString(self.xmlFile, string.format("vehicle.warningSigns.sign(%d)#trigger", i)) );
- if trigger == nil then
- print("[Error::WarningSigns] node is OK, but trigger could not be located. Check line "..tostring(i+1).." in your vehicle.xml");
- end;
- local isVis = getXMLBool(self.xmlFile, string.format("vehicle.warningSigns.sign(%d)#isVisible", i))
- self.ws[i+1] = {};
- self.ws[i+1].node = node;
- self.ws[i+1].trigger = trigger;
- self.ws[i+1].isVis = isVis;
- self.ws[i+1].plIR = false;
- addTrigger( trigger, "playerCallback", self );
- i = i + 1;
- end;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement