737 gd.month = 0xFF; |
737 gd.month = 0xFF; |
738 gd.unk61A = 10; |
738 gd.unk61A = 10; |
739 gd.unk61C = 10; |
739 gd.unk61C = 10; |
740 |
740 |
741 for (i = 0; i != NUM_CARGO; i++) { |
741 for (i = 0; i != NUM_CARGO; i++) { |
742 GfxFillRect(x, y, x+8, y+5, 0); |
742 /* Since the buttons have no text, no images, |
743 GfxFillRect(x+1, y+1, x+7, y+4, _cargo_legend_colors[i]); |
743 * both the text and the colored box have to be manually painted. |
|
744 * clk_dif will move one pixel down and one pixel to the right |
|
745 * when the button is clicked */ |
|
746 byte clk_dif = IsWindowWidgetLowered(w, i + 3) ? 1 : 0; |
|
747 |
|
748 GfxFillRect(x + clk_dif, y + clk_dif, x + 8 + clk_dif, y + 5 + clk_dif, 0); |
|
749 GfxFillRect(x + 1 + clk_dif, y + 1 + clk_dif, x + 7 + clk_dif, y + 4 + clk_dif, _cargo_legend_colors[i]); |
744 SetDParam(0, _cargoc.names_s[i]); |
750 SetDParam(0, _cargoc.names_s[i]); |
745 DrawString(x+14, y, STR_7065, 0); |
751 DrawString(x + 14 + clk_dif, y + clk_dif, STR_7065, 0); |
746 y += 8; |
752 y += 8; |
747 gd.colors[i] = _cargo_legend_colors[i]; |
753 gd.colors[i] = _cargo_legend_colors[i]; |
748 for (j = 0; j != 20; j++) { |
754 for (j = 0; j != 20; j++) { |
749 gd.cost[i][j] = (uint64)GetTransportedGoodsIncome(10, 20, j * 6 + 6, i); |
755 gd.cost[i][j] = (uint64)GetTransportedGoodsIncome(10, 20, j * 6 + 6, i); |
750 } |
756 } |