Skip to content

Commit

Permalink
v1.0.0.3 - Separate percentage and fill level for input and output, a…
Browse files Browse the repository at this point in the history
…dd options for each
  • Loading branch information
jtsage committed Feb 20, 2022
1 parent 52aa00a commit dbb12d2
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 16 deletions.
Binary file modified FS22_ProductionInspector.zip
Binary file not shown.
44 changes: 34 additions & 10 deletions src/ProductionInspector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ ProductionInspector.isEnabledVisible = true
ProductionInspector.isEnabledOnlyOwned = true
ProductionInspector.isEnabledShowInactivePoint = false
ProductionInspector.isEnabledShowInactiveProd = false
ProductionInspector.isEnabledShowPercent = true
ProductionInspector.isEnabledShowOutPercent = true
ProductionInspector.isEnabledShowOutFillLevel = true
ProductionInspector.isEnabledShowInPercent = true
ProductionInspector.isEnabledShowInFillLevel = true
ProductionInspector.isEnabledShowInputs = true
ProductionInspector.isEnabledShowOutputs = true
ProductionInspector.isEnabledShowEmptyOutput = false
Expand Down Expand Up @@ -149,7 +152,10 @@ function ProductionInspector:new(mission, i18n, modDirectory, modName)
{"isEnabledOnlyOwned", "bool"},
{"isEnabledShowInactivePoint", "bool"},
{"isEnabledShowInactiveProd", "bool"},
{"isEnabledShowPercent", "bool"},
{"isEnabledShowOutPercent", "bool"},
{"isEnabledShowOutFillLevel", "bool"},
{"isEnabledShowInPercent", "bool"},
{"isEnabledShowInFillLevel", "bool"},
{"isEnabledShowInputs", "bool"},
{"isEnabledShowOutputs", "bool"},
{"isEnabledShowEmptyInput", "bool"},
Expand Down Expand Up @@ -421,12 +427,20 @@ function ProductionInspector:draw()
firstRun = false
end
table.insert(thisTextLine, {"colorFillType", thisFillType.title .. ": ", false})

if ( inputs[2] == 0 and g_productionInspector.isEnabledShortEmptyOutput ) then
table.insert(thisTextLine, {"colorEmptyInput", g_productionInspector.setStringTextEmptyInput, false})
else
table.insert(thisTextLine, {"rawFillColor", tostring(inputs[2]), fillColor})
if g_productionInspector.isEnabledShowPercent then
table.insert(thisTextLine, {"rawFillColor", " (" .. tostring(inputs[4]) .. "%)", fillColor})
if g_productionInspector.isEnabledShowInFillLevel then
table.insert(thisTextLine, {"rawFillColor", tostring(inputs[2]), fillColor})
end

if g_productionInspector.isEnabledShowInPercent then
if g_productionInspector.isEnabledShowInFillLevel then
table.insert(thisTextLine, {"rawFillColor", " (" .. tostring(inputs[4]) .. "%)", fillColor})
else
table.insert(thisTextLine, {"rawFillColor", tostring(inputs[4]) .. "%", fillColor})
end
end
end
end
Expand Down Expand Up @@ -461,9 +475,17 @@ function ProductionInspector:draw()
firstRun = false
end
table.insert(thisTextLine, {"colorFillType", thisFillType.title .. ": ", false})
table.insert(thisTextLine, {"rawFillColor", tostring(outputs[2]), fillColor})
if g_productionInspector.isEnabledShowPercent then
table.insert(thisTextLine, {"rawFillColor", " (" .. tostring(outputs[4]) .. "%)", fillColor})

if g_productionInspector.isEnabledShowOutFillLevel then
table.insert(thisTextLine, {"rawFillColor", tostring(outputs[2]), fillColor})
end

if g_productionInspector.isEnabledShowOutPercent then
if g_productionInspector.isEnabledShowOutFillLevel then
table.insert(thisTextLine, {"rawFillColor", " (" .. tostring(outputs[4]) .. "%)", fillColor})
else
table.insert(thisTextLine, {"rawFillColor", tostring(outputs[4]) .. "%", fillColor})
end
end
end

Expand Down Expand Up @@ -765,8 +787,10 @@ end

function ProductionInspector.initGui(self)
local boolMenuOptions = {
"Visible", "OnlyOwned", "ShowInactivePoint", "ShowInactiveProd", "ShowPercent",
"ShowInputs", "ShowEmptyInput", "ShowOutputs", "ShowEmptyOutput", "ShortEmptyOutput", "TextBold"
"Visible", "OnlyOwned", "ShowInactivePoint", "ShowInactiveProd",
"ShowInputs", "ShowEmptyInput", "ShortEmptyOutput", "ShowInPercent", "ShowInFillLevel",
"ShowOutputs", "ShowEmptyOutput", "ShowOutPercent", "ShowOutFillLevel",
"TextBold"
}

if not g_productionInspector.createdGUI then -- Skip if we've already done this once
Expand Down
9 changes: 7 additions & 2 deletions src/modDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ Left Ctrl + Left Alt + Num Pad 7 : Toggle display on and off
Changelog:
v1.0.0.1
- Add keybind to toggle HUD on and off
- Add key bind to toggle HUD on and off
v1.0.0.2
- Add option to hide empty input materials
v1.0.0.3
- Separate percentage and fill level for input and output, add options for each
]]></en>
<de><![CDATA[Production Inspector zeigt Ihre laufenden Produktionen auf einen Blick
Expand All @@ -39,8 +42,10 @@ Changelog:
v1.0.0.1
- Keybind hinzufügen, um HUD ein- und auszuschalten
v1.0.0.2
v1.0.0.2
- Option zum Ausblenden leerer Eingabematerialien hinzufügen
v1.0.0.3
- Getrennter Prozentsatz und Füllstand für Eingabe und Ausgabe, Optionen für beide hinzufügen
]]></de>
</description>
<author>JTSage</author>
Expand Down
10 changes: 8 additions & 2 deletions src/translations/translation_de.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
<text name="toolTip_productionInspector_ShowInactivePoint" text="Wenn diese Option aktiviert ist, werden Produktionsanlagen ohne laufende Produktionslinien angezeigt." />
<text name="setting_productionInspector_ShowInactiveProd" text="Inaktive Produktionslinien anzeigen" />
<text name="toolTip_productionInspector_ShowInactiveProd" text="Wenn aktiviert, werden Produktionslinien angezeigt, die inaktiv sind." />
<text name="setting_productionInspector_ShowPercent" text="Füllungsprozentsätze anzeigen" />
<text name="toolTip_productionInspector_ShowPercent" text="Wenn aktiviert, wird der Prozentsatz des Füllstandes angezeigt." />
<text name="setting_productionInspector_ShowOutPercent" text="Prozentuale Füllung der Ausgabe anzeigen" />
<text name="toolTip_productionInspector_ShowOutPercent" text="Wenn aktiviert, wird der Prozentsatz der Füllung des Ausgangsprodukts angezeigt." />
<text name="setting_productionInspector_ShowOutFillLevel" text="Füllstand der Ausgabe anzeigen" />
<text name="toolTip_productionInspector_ShowOutFillLevel" text="Wenn diese Funktion aktiviert ist, wird der Füllstand der Ausgabe in Litern angezeigt." />
<text name="setting_productionInspector_ShowInPercent" text="Prozentuale Füllung der Eingabe anzeigen" />
<text name="toolTip_productionInspector_ShowInPercent" text="Wenn diese Option aktiviert ist, wird der prozentuale Füllstand des eingegebenen Materials angezeigt." />
<text name="setting_productionInspector_ShowInFillLevel" text="Eingabefüllstand anzeigen" />
<text name="toolTip_productionInspector_ShowInFillLevel" text="Wenn aktiviert, wird der Eingangsfüllstand in Litern angezeigt." />
<text name="setting_productionInspector_ShowInputs" text="Eingaben anzeigen" />
<text name="toolTip_productionInspector_ShowInputs" text="Wenn diese Option aktiviert ist, werden die Eingangsmaterialien der Produktionsanlage angezeigt." />
<text name="setting_productionInspector_ShowEmptyInput" text="Leere Eingaben anzeigen" />
Expand Down
10 changes: 8 additions & 2 deletions src/translations/translation_en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@
<text name="toolTip_productionInspector_ShowInactivePoint" text="When enabled, show production facilities with no running production lines" />
<text name="setting_productionInspector_ShowInactiveProd" text="Show Inactive Production Lines" />
<text name="toolTip_productionInspector_ShowInactiveProd" text="When enabled, show production lines that are inactive" />
<text name="setting_productionInspector_ShowPercent" text="Show Fill Percentages" />
<text name="toolTip_productionInspector_ShowPercent" text="When enabled, show the percentage of the fill level" />
<text name="setting_productionInspector_ShowOutPercent" text="Show Output Fill Percentage " />
<text name="toolTip_productionInspector_ShowOutPercent" text="When enabled, show percentage of output prouduct fill" />
<text name="setting_productionInspector_ShowOutFillLevel" text="Show Output Fill Level" />
<text name="toolTip_productionInspector_ShowOutFillLevel" text="When enabled, show output fill level in liters" />
<text name="setting_productionInspector_ShowInPercent" text="Show Input Fill Percentage" />
<text name="toolTip_productionInspector_ShowInPercent" text="When enabled, show percentage of input material fill level" />
<text name="setting_productionInspector_ShowInFillLevel" text="Show Input Fill Level" />
<text name="toolTip_productionInspector_ShowInFillLevel" text="When enabled, show input fill level in liters" />
<text name="setting_productionInspector_ShowInputs" text="Show Inputs" />
<text name="toolTip_productionInspector_ShowInputs" text="When enabled, show production facility input materials" />
<text name="setting_productionInspector_ShowEmptyInput" text="Show Empty Inputs" />
Expand Down

0 comments on commit dbb12d2

Please sign in to comment.