Line 199: |
Line 199: |
| end | | end |
| | | |
− | function format_equipment_bg(resources) | + | function format_equipment_bg(target_equipment, resources) |
− | if resources and resources.equipment and type(first(resources.equipment)) == "string" then | + | if resources and resources.equipment then |
− | return "#ffe0b2"
| + | local equipment_name = first(resources.equipment) |
− | else
| + | if equipment_name == true then |
− | return "transparent" | + | return target_equipment:buildable() and "transparent" or "#ffcdd2" |
| + | elseif equipment_name then |
| + | return Equipment(equipment_name):buildable() and "#fff9c4" or "#ffe0b2" |
| + | end |
| end | | end |
| + | return "transparent" |
| end | | end |
| | | |
Line 266: |
Line 270: |
| equips6 = format_equipment(resources6), | | equips6 = format_equipment(resources6), |
| equips10 = format_equipment(resources10), | | equips10 = format_equipment(resources10), |
− | equips0_bg = format_equipment_bg(resources0), | + | equips0_bg = format_equipment_bg(equipment, resources0), |
− | equips6_bg = format_equipment_bg(resources6), | + | equips6_bg = format_equipment_bg(equipment, resources6), |
− | equips10_bg = format_equipment_bg(resources10), | + | equips10_bg = format_equipment_bg(equipment, resources10), |
| upgrades = format_products(product_names), | | upgrades = format_products(product_names), |
| ships = ships, | | ships = ships, |