From c29eae567ffea99804a767b4ec7446130f9ff026 Mon Sep 17 00:00:00 2001 From: Octav Sandulescu Date: Mon, 15 May 2023 10:48:39 +0000 Subject: [PATCH] Fix productivity adjusted display --- README.md | 3 +++ VERSION | 2 +- changelog.txt | 6 ++++++ resmon.lua | 12 ++++++------ 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 48fb991..a974286 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,9 @@ members of the #factorio IRC on espernet. * Estimate calculations by @Kingdud (with apologies for taking over a year to test) * But it will need a bit more fixing to prevent corrupting saves. If you have v0.8.206, please read [this comment](https://github.com/narc0tiq/YARM/issues/145#issuecomment-1087358098) * SpaceEx explorer viewer patch by @oof2win2 +* Ore counts adjusted by mining productivity by @georgehank + * With fixes by @EvilPLa + ## Remote interface ## diff --git a/VERSION b/VERSION index 0d252e6..7db00ca 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.209 +0.8.210 diff --git a/changelog.txt b/changelog.txt index 7430c38..caf92a5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,9 @@ --------------------------------------------------------------------------------------------------- +Version: 0.8.210 +Date: 2023-05-15 + Bugfixes: + - Fix productivity display (per instructions from @EvilPLa) +--------------------------------------------------------------------------------------------------- Version: 0.8.209 Date: 2023-05-09 Bugfixes: @@ -10,6 +15,7 @@ Date: 2023-05-08 - Fix ore-per-minute calculation error (@wchristian, #148) Changes: - Add compatibility with SE explorer for site remote viewing (@oof2win2, #147) + - Add productivity-adjusted ore amounts for site display (@georgehank, #136) --------------------------------------------------------------------------------------------------- Version: 0.8.207 Date: 2021-04-04 diff --git a/resmon.lua b/resmon.lua index a4fbed6..3da0344 100644 --- a/resmon.lua +++ b/resmon.lua @@ -517,11 +517,11 @@ function resmon.update_chart_tag(site) end local display_value = format_number_si(site.amount) - if settings.global["YARM-adjust-for-productivity"] then + if settings.global["YARM-adjust-for-productivity"].value then local site_amount = display_value local site_amount_w_productivity = format_number_si(site.amount * (1 + site.force.mining_drill_productivity_bonus)) - if settings.global["YARM-productivity-show-raw-and-adjusted"] then - if settings.global["YARM-productivity-parentheses-part-is"] == "adjusted" then + if settings.global["YARM-productivity-show-raw-and-adjusted"].value then + if settings.global["YARM-productivity-parentheses-part-is"].value == "adjusted" then display_value = string.format("%s (%s)", site_amount, site_amount_w_productivity) else display_value = string.format("%s (%s)", site_amount_w_productivity, site_amount) @@ -945,11 +945,11 @@ function resmon.print_single_site(site, player, sites_gui, player_data) el.style.font_color = color local display_amount = format_number(site.amount) - if settings.global["YARM-adjust-for-productivity"] then + if settings.global["YARM-adjust-for-productivity"].value then local site_amount = display_amount local site_amount_w_productivity = format_number(math.floor(site.amount * (1 + player.force.mining_drill_productivity_bonus))) - if settings.global["YARM-productivity-show-raw-and-adjusted"] then - if settings.global["YARM-productivity-parentheses-part-is"] == "adjusted" then + if settings.global["YARM-productivity-show-raw-and-adjusted"].value then + if settings.global["YARM-productivity-parentheses-part-is"].value == "adjusted" then display_amount = string.format("%s (%s)", site_amount, site_amount_w_productivity) else display_amount = string.format("%s (%s)", site_amount_w_productivity, site_amount)