Skip to content

Commit

Permalink
Train Log: Revert colors for train station summary
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Mar 21, 2024
1 parent e3b38be commit e577a01
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion train-log_1.2.0/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---------------------------------------------------------------------------------------------------
Version: 1.2.0
Date: 2024-03-21
Date: 2024-03-22
Features:
- Add item and fluid per-station summary

Expand Down
5 changes: 3 additions & 2 deletions train-log_1.2.0/gui/summary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ local function station_summary_children(station_payload_summary, gui_id)
local children = {}
for type, v in pairs(station_payload_summary) do
for name, count in pairs(v) do
local color = count > 0 and "green" or "red"
table.insert(children, gui_utils.sprite_button_type_name_amount(type, name, count, color, gui_id))
-- For station summary, reverse count so that positive = give to station, negative = take from station. Instead of "to/from train"
local color = -count > 0 and "green" or "red"
table.insert(children, gui_utils.sprite_button_type_name_amount(type, name, -count, color, gui_id))
end
end
return children
Expand Down

0 comments on commit e577a01

Please sign in to comment.