* Fills an array for the industries legends. */
| 187 | * Fills an array for the industries legends. |
| 188 | */ |
| 189 | void BuildIndustriesLegend() |
| 190 | { |
| 191 | uint j = 0; |
| 192 | |
| 193 | /* Add each name */ |
| 194 | for (IndustryType ind : _sorted_industry_types) { |
| 195 | const IndustrySpec *indsp = GetIndustrySpec(ind); |
| 196 | if (indsp->enabled) { |
| 197 | _legend_from_industries[j].legend = indsp->name; |
| 198 | _legend_from_industries[j].colour = indsp->map_colour; |
| 199 | _legend_from_industries[j].type = ind; |
| 200 | _legend_from_industries[j].show_on_map = true; |
| 201 | _legend_from_industries[j].col_break = false; |
| 202 | _legend_from_industries[j].end = false; |
| 203 | |
| 204 | /* Store widget number for this industry type. */ |
| 205 | _industry_to_list_pos[ind] = j; |
| 206 | j++; |
| 207 | } |
| 208 | } |
| 209 | /* Terminate the list */ |
| 210 | _legend_from_industries[j].end = true; |
| 211 | |
| 212 | /* Store number of enabled industries */ |
| 213 | _smallmap_industry_count = j; |
| 214 | } |
| 215 | |
| 216 | /** |
| 217 | * Populate legend table for the link stat view. |
no test coverage detected