Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsage committed Jan 25, 2022
0 parents commit 5c10113
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# FS22_BetterAILights

<p align="left">
<img src="https://github.com/jtsage/FS22_BetterAILights/raw/main/modIcon.png">
</p>

Turns on AI lights when it's raining or snowing too.
Binary file added modHubIcon.psd
Binary file not shown.
Binary file added modIcon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions src/aiBetterLights.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
----------------------------------------------------------------------------
-- @Author: JTSage ---------------------------------------------------------
----------------------------------------------------------------------------

aiBetterLights = {};

function aiBetterLights:updateAILights(isWorking)
local spec = self.spec_lights

if not g_currentMission.environment.isSunOn or g_currentMission.environment.weather:getIsRaining() then
local typeMask = spec.aiLightsTypesMask
if isWorking then
typeMask = spec.aiLightsTypesMaskWork
end
if spec.lightsTypesMask ~= typeMask then
self:setLightsTypesMask(typeMask)
end
else
if spec.lightsTypesMask ~= 0 then
self:setLightsTypesMask(0)
end
end
end

Lights.updateAILights = Utils.overwrittenFunction(Lights.updateAILights, aiBetterLights.updateAILights);
18 changes: 18 additions & 0 deletions src/modDesc.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<modDesc descVersion="63">
<title>
<en>Better AI Lights</en>
<de>Bessere AI-Lichter</de>
</title>
<author>JTSage</author>
<version>1.0.0.0</version>
<description>
<en><![CDATA[Turns on helper lights during rain and snow]]></en>
<de><![CDATA[Schaltet die Hilfslichter bei Regen und Schnee ein]]></de>
</description>
<iconFilename>icon.dds</iconFilename>
<multiplayer supported="true"/>
<extraSourceFiles>
<sourceFile filename="aiBetterLights.lua" />
</extraSourceFiles>
</modDesc>

0 comments on commit 5c10113

Please sign in to comment.