From 0fef88c02a548ef52ab46e8d732eba5da6f57b1d Mon Sep 17 00:00:00 2001 From: herbmc <74637040+herbmc@users.noreply.github.com> Date: Thu, 19 Nov 2020 22:43:56 -0500 Subject: [PATCH 1/3] Create damage_report.lua --- damage_report.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 damage_report.lua diff --git a/damage_report.lua b/damage_report.lua new file mode 100644 index 0000000..96ef9aa --- /dev/null +++ b/damage_report.lua @@ -0,0 +1,23 @@ +unit.setTimer("dmgRpt", 1) +screen.activate() + +function update() + elements = core.getElementIdList() + local text = [[]] + text = text .. [[]] + for i = 1, #elements do + elementInfo = database.getElement(core, elements[i]) + if elementInfo['hitPoints'] < elementInfo['maxHitPoints'] then + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + end + end + text = text .. [[
ElementIdElementTypeElementNameRemaining Hit Points
]] .. elementInfo['id'] .. [[]] .. elementInfo['type'] .. [[]] .. elementInfo['name'] .. [[]] .. string.format('%0.2f', elementInfo['hitPoints']/elementInfo['maxHitPoints']*100) .. [[%
]] + screen.setHTML(text) +end + +update() From 3319b8daf607515f8cb015aa86ad0ca357c3e975 Mon Sep 17 00:00:00 2001 From: herbmc <74637040+herbmc@users.noreply.github.com> Date: Thu, 19 Nov 2020 22:49:19 -0500 Subject: [PATCH 2/3] Update damage_report.lua Format for wrap.lua usage. --- damage_report.lua | 51 +++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/damage_report.lua b/damage_report.lua index 96ef9aa..419c242 100644 --- a/damage_report.lua +++ b/damage_report.lua @@ -1,23 +1,36 @@ -unit.setTimer("dmgRpt", 1) -screen.activate() +script = {} -function update() - elements = core.getElementIdList() - local text = [[]] - text = text .. [[]] - for i = 1, #elements do - elementInfo = database.getElement(core, elements[i]) - if elementInfo['hitPoints'] < elementInfo['maxHitPoints'] then - text = text .. [[]] - text = text .. [[]] - text = text .. [[]] - text = text .. [[]] - text = text .. [[]] - text = text .. [[]] - end +function script.onStart() + unit.setTimer("dmgRpt", 1) + screen.activate() + + function update() + elements = core.getElementIdList() + local text = [[
ElementIdElementTypeElementNameRemaining Hit Points
]] .. elementInfo['id'] .. [[]] .. elementInfo['type'] .. [[]] .. elementInfo['name'] .. [[]] .. string.format('%0.2f', elementInfo['hitPoints']/elementInfo['maxHitPoints']*100) .. [[%
]] + text = text .. [[]] + for i = 1, #elements do + elementInfo = database.getElement(core, elements[i]) + if elementInfo['hitPoints'] < elementInfo['maxHitPoints'] then + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + text = text .. [[]] + end + end + text = text .. [[
ElementIdElementTypeElementNameRemaining Hit Points
]] .. elementInfo['id'] .. [[]] .. elementInfo['type'] .. [[]] .. elementInfo['name'] .. [[]] .. string.format('%0.2f', elementInfo['hitPoints']/elementInfo['maxHitPoints']*100) .. [[%
]] + screen.setHTML(text) end - text = text .. [[]] - screen.setHTML(text) + update() +end + +function script.onStop() + screen.deactivate() +end + +function script.onTick(dmgRpt) + update() end -update() +script.onStart() From ad7a1890c68c347a01e7f7e9770b9ce7e3cc013d Mon Sep 17 00:00:00 2001 From: herbmc <74637040+herbmc@users.noreply.github.com> Date: Thu, 19 Nov 2020 22:55:28 -0500 Subject: [PATCH 3/3] Update release.yml Update the github action to build additional programming boards. --- .github/workflows/release.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ce2d9b..0712cdb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,9 @@ jobs: run: | lua5.3 -v lua5.3 DU-Orbital-Hud/scripts/wrap.lua main/container_monitor.lua t1-t3-monitor.json --slots displayT1a:type=screen core displayT1b:type=screen displayT2a:type=screen displayT2b:type=screen displayT3a:type=screen displayT3b:type=screen - + lua5.3 DU-Orbital-Hud/scripts/wrap.lua main/container_monitor.lua t4-t5-etc-monitor.json --slots displayT4a:type=screen core displayT4b:type=screen displayT5a:type=screen displayT5b:type=screen displayFuels:type=screen + lua5.3 DU-Orbital-Hud/scripts/wrap.lua main/damage_report.lua damage-report.json --slots core screen + - name: Create Release id: create_release uses: actions/create-release@v1 @@ -57,3 +59,23 @@ jobs: asset_path: t1-t3-monitor.json asset_name: t1-t3-monitor.json asset_content_type: application/json + + - name: Upload T4-T5-Etc PB as Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above + asset_path: t4-t5-etc-monitor.json + asset_name: t4-t5-etc-monitor.json + asset_content_type: application/json + + - name: Upload damage report PB as Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above + asset_path: damage-report.json + asset_name: damage-report.json + asset_content_type: application/json