(svn r11374) -Codechange: Give meaning to the magical number that specifies the color of the text in a DrawString call.

Patch heavily based on BiBB's work (FS#1383)
This commit is contained in:
belugas
2007-11-04 00:08:57 +00:00
parent 9e69fc8114
commit 56e6282f2f
37 changed files with 408 additions and 383 deletions

View File

@@ -124,7 +124,7 @@ static void TrainDetailsCargoTab(const Vehicle *v, int x, int y)
SetDParam(3, _patches.freight_trains);
str = FreightWagonMult(v->cargo_type) > 1 ? STR_FROM_MULT : STR_8813_FROM;
}
DrawString(x, y, str, 0);
DrawString(x, y, str, TC_FROMSTRING);
}
}
@@ -133,12 +133,12 @@ static void TrainDetailsInfoTab(const Vehicle *v, int x, int y)
if (RailVehInfo(v->engine_type)->railveh_type == RAILVEH_WAGON) {
SetDParam(0, v->engine_type);
SetDParam(1, v->value);
DrawString(x, y, STR_882D_VALUE, 0x10);
DrawString(x, y, STR_882D_VALUE, TC_BLACK);
} else {
SetDParam(0, v->engine_type);
SetDParam(1, v->build_year);
SetDParam(2, v->value);
DrawString(x, y, STR_882C_BUILT_VALUE, 0x10);
DrawString(x, y, STR_882C_BUILT_VALUE, TC_BLACK);
}
}
@@ -148,7 +148,7 @@ static void TrainDetailsCapacityTab(const Vehicle *v, int x, int y)
SetDParam(0, v->cargo_type);
SetDParam(1, v->cargo_cap);
SetDParam(2, _patches.freight_trains);
DrawString(x, y, FreightWagonMult(v->cargo_type) > 1 ? STR_CAPACITY_MULT : STR_013F_CAPACITY, 0);
DrawString(x, y, FreightWagonMult(v->cargo_type) > 1 ? STR_CAPACITY_MULT : STR_013F_CAPACITY, TC_FROMSTRING);
}
}
@@ -240,7 +240,7 @@ void DrawTrainDetails(const Vehicle *v, int x, int y, int vscroll_pos, uint16 vs
}
/* draw total cargo tab */
DrawString(x, y + 2, STR_013F_TOTAL_CAPACITY_TEXT, 0);
DrawString(x, y + 2, STR_013F_TOTAL_CAPACITY_TEXT, TC_FROMSTRING);
for (CargoID i = 0; i < NUM_CARGO; i++) {
if (max_cargo[i] > 0 && --vscroll_pos < 0 && vscroll_pos > -vscroll_cap) {
y += 14;
@@ -249,10 +249,10 @@ void DrawTrainDetails(const Vehicle *v, int x, int y, int vscroll_pos, uint16 vs
SetDParam(2, i); // {SHORTCARGO} #1
SetDParam(3, max_cargo[i]); // {SHORTCARGO} #2
SetDParam(4, _patches.freight_trains);
DrawString(x, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_013F_TOTAL_CAPACITY, 0);
DrawString(x, y + 2, FreightWagonMult(i) > 1 ? STR_TOTAL_CAPACITY_MULT : STR_013F_TOTAL_CAPACITY, TC_FROMSTRING);
}
}
SetDParam(0, v->cargo.FeederShare());
DrawString(x, y + 15, STR_FEEDER_CARGO_VALUE, 0);
DrawString(x, y + 15, STR_FEEDER_CARGO_VALUE, TC_FROMSTRING);
}
}