Skip to content

Commit

Permalink
Fix productivity adjusted display
Browse files Browse the repository at this point in the history
  • Loading branch information
narc0tiq committed May 15, 2023
1 parent 0bd27b2 commit c29eae5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.209
0.8.210
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions resmon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit c29eae5

Please sign in to comment.