Codechange: Rename *Railtype* to *RailType* for consistency. (#11287)
This commit is contained in:
@@ -435,7 +435,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
void SetupRailToolbar(RailType railtype)
|
||||
{
|
||||
this->railtype = railtype;
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(railtype);
|
||||
|
||||
assert(railtype < RAILTYPE_END);
|
||||
this->GetWidget<NWidgetCore>(WID_RAT_BUILD_NS)->widget_data = rti->gui_sprites.build_ns_rail;
|
||||
@@ -491,7 +491,7 @@ struct BuildRailToolbarWindow : Window {
|
||||
void SetStringParameters(int widget) const override
|
||||
{
|
||||
if (widget == WID_RAT_CAPTION) {
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(this->railtype);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(this->railtype);
|
||||
if (rti->max_speed > 0) {
|
||||
SetDParam(0, STR_TOOLBAR_RAILTYPE_VELOCITY);
|
||||
SetDParam(1, rti->strings.toolbar_caption);
|
||||
@@ -857,7 +857,7 @@ static WindowDesc _build_rail_desc(
|
||||
Window *ShowBuildRailToolbar(RailType railtype)
|
||||
{
|
||||
if (!Company::IsValidID(_local_company)) return nullptr;
|
||||
if (!ValParamRailtype(railtype)) return nullptr;
|
||||
if (!ValParamRailType(railtype)) return nullptr;
|
||||
|
||||
CloseWindowByClass(WC_BUILD_TOOLBAR);
|
||||
_cur_railtype = railtype;
|
||||
@@ -1704,7 +1704,7 @@ public:
|
||||
this->sig_sprite_size.width = 0;
|
||||
this->sig_sprite_size.height = 0;
|
||||
this->sig_sprite_bottom_offset = 0;
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(_cur_railtype);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(_cur_railtype);
|
||||
for (uint type = SIGTYPE_NORMAL; type < SIGTYPE_END; type++) {
|
||||
for (uint variant = SIG_ELECTRIC; variant <= SIG_SEMAPHORE; variant++) {
|
||||
for (uint lowered = 0; lowered < 2; lowered++) {
|
||||
@@ -2268,14 +2268,14 @@ static void SetDefaultRailGui()
|
||||
case 0: {
|
||||
/* Use first available type */
|
||||
std::vector<RailType>::const_iterator it = std::find_if(_sorted_railtypes.begin(), _sorted_railtypes.end(),
|
||||
[](RailType r){ return HasRailtypeAvail(_local_company, r); });
|
||||
[](RailType r){ return HasRailTypeAvail(_local_company, r); });
|
||||
rt = it != _sorted_railtypes.end() ? *it : RAILTYPE_BEGIN;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
/* Use last available type */
|
||||
std::vector<RailType>::const_reverse_iterator it = std::find_if(_sorted_railtypes.rbegin(), _sorted_railtypes.rend(),
|
||||
[](RailType r){ return HasRailtypeAvail(_local_company, r); });
|
||||
[](RailType r){ return HasRailTypeAvail(_local_company, r); });
|
||||
rt = it != _sorted_railtypes.rend() ? *it : RAILTYPE_BEGIN;
|
||||
break;
|
||||
}
|
||||
@@ -2342,7 +2342,7 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option)
|
||||
|
||||
/* Find the used railtypes. */
|
||||
if (for_replacement) {
|
||||
avail_railtypes = GetCompanyRailtypes(c->index, false);
|
||||
avail_railtypes = GetCompanyRailTypes(c->index, false);
|
||||
used_railtypes = GetRailTypes(false);
|
||||
} else {
|
||||
avail_railtypes = c->avail_railtypes;
|
||||
@@ -2360,7 +2360,7 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option)
|
||||
if (!for_replacement) {
|
||||
for (const auto &rt : _sorted_railtypes) {
|
||||
if (!HasBit(used_railtypes, rt)) continue;
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(rt);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(rt);
|
||||
d = maxdim(d, GetSpriteSize(rti->gui_sprites.build_x_rail));
|
||||
}
|
||||
}
|
||||
@@ -2369,7 +2369,7 @@ DropDownList GetRailTypeDropDownList(bool for_replacement, bool all_option)
|
||||
/* If it's not used ever, don't show it to the user. */
|
||||
if (!HasBit(used_railtypes, rt)) continue;
|
||||
|
||||
const RailtypeInfo *rti = GetRailTypeInfo(rt);
|
||||
const RailTypeInfo *rti = GetRailTypeInfo(rt);
|
||||
|
||||
SetDParam(0, rti->strings.menu_text);
|
||||
SetDParam(1, rti->max_speed);
|
||||
|
||||
Reference in New Issue
Block a user