From 38a1ff2199e8ec929476b59d1d26a2439cce192a Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Wed, 29 May 2019 20:20:46 +0100 Subject: [PATCH] Added text colour to confix --- config/science.lua | 2 ++ modules/gui/science-info.lua | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/science.lua b/config/science.lua index 194303f3..3cd3ce5f 100644 --- a/config/science.lua +++ b/config/science.lua @@ -1,6 +1,8 @@ -- config file for the science info gui return { -- list of all science packs to be shown in the gui show_eta=true, -- when true the eta for research completion will be shown + required_for_green=5, -- the amount required for the text to show as green + required_for_red=-5, -- the amount required for the text to show as red 'automation-science-pack', 'logistic-science-pack', 'military-science-pack', diff --git a/modules/gui/science-info.lua b/modules/gui/science-info.lua index 8637e559..572bfc3b 100644 --- a/modules/gui/science-info.lua +++ b/modules/gui/science-info.lua @@ -37,9 +37,9 @@ end --- Gets the font colour for a certain level of production local function get_font_colour(value,secondary) - if value > 5 then + if value > config.required_for_green then return Colors.light_green - elseif value < -5 then + elseif value < config.required_for_red then return Colors.indian_red elseif secondary and secondary > 0 or not secondary and value ~= 0 then return Colors.orange @@ -228,9 +228,9 @@ local function generate_science_pack(player,element,science_pack) element.parent.non_made.visible = false local icon_style = 'quick_bar_slot_button' - if stats.minute_net > 1 then + if stats.minute_net > config.required_for_green then icon_style = 'green_slot_button' - elseif stats.minute_net < -1 then + elseif stats.minute_net < config.required_for_red then icon_style = 'red_slot_button' elseif stats.minute_made > 0 then icon_style = 'selected_slot_button'