Compare commits
5 Commits
991b7a958e
...
9a07f14f56
Author | SHA1 | Date |
---|---|---|
Jonathan G Rennison | 9a07f14f56 | |
Jonathan G Rennison | c5cd598217 | |
Jonathan G Rennison | adc7840f01 | |
Jonathan G Rennison | a14f850f33 | |
Peter Nelson | 96ddabb30c |
|
@ -2168,7 +2168,7 @@ STR_SCHDISPATCH_SLOT_TOOLTIP_TAG :{}Tag {NUM}
|
|||
STR_SCHDISPATCH_SUMMARY_NO_LAST_DEPARTURE :{BLACK}No previous departures.
|
||||
STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_PAST :{BLACK}Last departure at {TT_TIME}.
|
||||
STR_SCHDISPATCH_SUMMARY_LAST_DEPARTURE_FUTURE :{BLACK}Last departure has not left yet, it will depart at {TT_TIME}.
|
||||
STR_SCHDISPATCH_SUMMARY_L1 :{BLACK}This schedule requires {COMMA} vehicle{P "" s}.
|
||||
STR_SCHDISPATCH_SUMMARY_L1 :{BLACK}This schedule is estimated to require at least {COMMA} vehicle{P "" s}.
|
||||
STR_SCHDISPATCH_SUMMARY_L2 :{BLACK}This schedule repeats every {STRING1}.
|
||||
STR_SCHDISPATCH_SUMMARY_L3 :{BLACK}This schedule began at {TT_TIME}, and ends at {TT_TIME}.
|
||||
STR_SCHDISPATCH_SUMMARY_L4 :{BLACK}Maximum delay of {STRING1} is allowed before the slot is skipped.
|
||||
|
|
|
@ -499,15 +499,8 @@ NetworkRecvStatus ServerNetworkGameSocketHandler::SendNewGRFCheck()
|
|||
return this->SendNeedGamePassword();
|
||||
}
|
||||
|
||||
const GRFConfig *c;
|
||||
uint grf_count = 0;
|
||||
|
||||
for (c = _grfconfig; c != nullptr; c = c->next) {
|
||||
if (!HasBit(c->flags, GCF_STATIC)) grf_count++;
|
||||
}
|
||||
|
||||
p->Send_uint32(grf_count);
|
||||
for (c = _grfconfig; c != nullptr; c = c->next) {
|
||||
p->Send_uint32(GetGRFConfigListNonStaticCount(_grfconfig));
|
||||
for (const GRFConfig *c = _grfconfig; c != nullptr; c = c->next) {
|
||||
if (!HasBit(c->flags, GCF_STATIC)) SerializeGRFIdentifier(*p, c->ident);
|
||||
}
|
||||
|
||||
|
|
|
@ -5145,7 +5145,6 @@ static ChangeInfoResult RoadStopChangeInfo(uint id, int numinfo, int prop, const
|
|||
|
||||
uint32_t classid = buf->ReadDWord();
|
||||
rs->cls_id = RoadStopClass::Allocate(BSWAP32(classid));
|
||||
rs->spec_id = id + i;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -540,6 +540,15 @@ void ResetGRFConfig(bool defaults)
|
|||
AppendStaticGRFConfigs(&_grfconfig);
|
||||
}
|
||||
|
||||
/** Get the count of non-static GRFs in a GRF config list */
|
||||
uint GetGRFConfigListNonStaticCount(const GRFConfig *config)
|
||||
{
|
||||
uint grf_count = 0;
|
||||
for (const GRFConfig *c = config; c != nullptr; c = c->next) {
|
||||
if (!HasBit(c->flags, GCF_STATIC)) grf_count++;
|
||||
}
|
||||
return grf_count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all GRFs in the GRF config from a savegame can be loaded.
|
||||
|
|
|
@ -233,6 +233,7 @@ void AppendStaticGRFConfigs(GRFConfig **dst);
|
|||
void AppendToGRFConfigList(GRFConfig **dst, GRFConfig *el);
|
||||
void ClearGRFConfigList(GRFConfig **config);
|
||||
void ResetGRFConfig(bool defaults);
|
||||
uint GetGRFConfigListNonStaticCount(const GRFConfig *config);
|
||||
GRFListCompatibility IsGoodGRFConfigList(GRFConfig *grfconfig);
|
||||
bool FillGRFDetails(GRFConfig *config, bool is_static, Subdirectory subdir = NEWGRF_DIR);
|
||||
std::string GRFBuildParamList(const GRFConfig *c);
|
||||
|
|
|
@ -145,7 +145,6 @@ struct RoadStopSpec {
|
|||
*/
|
||||
GRFFilePropsBase<NUM_CARGO + 3> grf_prop;
|
||||
RoadStopClassID cls_id; ///< The class to which this spec belongs.
|
||||
int spec_id; ///< The ID of this spec inside the class.
|
||||
StringID name; ///< Name of this stop
|
||||
|
||||
RoadStopAvailabilityType stop_type = ROADSTOPTYPE_ALL;
|
||||
|
|
|
@ -753,6 +753,7 @@ void SpriteGroupDumper::DumpSpriteGroup(const SpriteGroup *sg, const char *paddi
|
|||
} else {
|
||||
std::string subgroup_padding(padding);
|
||||
subgroup_padding += " ";
|
||||
bool found_error_group = false;
|
||||
for (const auto &range : (*ranges)) {
|
||||
char *p = this->buffer;
|
||||
p += seprintf(p, lastof(this->buffer), "%srange: %X -> %X", padding, range.low, range.high);
|
||||
|
@ -767,6 +768,7 @@ void SpriteGroupDumper::DumpSpriteGroup(const SpriteGroup *sg, const char *paddi
|
|||
}
|
||||
print();
|
||||
this->DumpSpriteGroup(range.group, subgroup_padding.c_str(), SGDF_RANGE);
|
||||
if (range.group == dsg->error_group) found_error_group = true;
|
||||
}
|
||||
if (default_group != nullptr) {
|
||||
char *p = this->buffer;
|
||||
|
@ -776,6 +778,13 @@ void SpriteGroupDumper::DumpSpriteGroup(const SpriteGroup *sg, const char *paddi
|
|||
}
|
||||
print();
|
||||
this->DumpSpriteGroup(default_group, subgroup_padding.c_str(), SGDF_DEFAULT);
|
||||
if (default_group == dsg->error_group) found_error_group = true;
|
||||
}
|
||||
if (this->more_details && !found_error_group && dsg->error_group != nullptr) {
|
||||
char *p = this->buffer;
|
||||
p += seprintf(p, lastof(this->buffer), "%sunreachable error group", padding);
|
||||
print();
|
||||
this->DumpSpriteGroup(dsg->error_group, subgroup_padding.c_str(), SGDF_DEFAULT);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "newgrf_sl.h"
|
||||
#include "../fios.h"
|
||||
#include "../load_check.h"
|
||||
#include "../debug.h"
|
||||
|
||||
#include "../safeguards.h"
|
||||
|
||||
|
@ -98,6 +99,8 @@ struct NGRFChunkHandler : ChunkHandler {
|
|||
if (IsSavegameVersionBefore(SLV_101)) c->SetSuitablePalette();
|
||||
AppendToGRFConfigList(&grfconfig, c);
|
||||
}
|
||||
|
||||
DEBUG(sl, 2, "Loaded %u NewGRFs", GetGRFConfigListNonStaticCount(grfconfig));
|
||||
}
|
||||
|
||||
void Load() const override
|
||||
|
|
|
@ -850,14 +850,6 @@ struct SchdispatchWindow : GeneralVehicleWindow {
|
|||
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_REUSE_SLOTS_ENABLED);
|
||||
extra_lines++;
|
||||
y += GetCharacterHeight(FS_NORMAL);
|
||||
} else if (!have_conditional) {
|
||||
const int required_vehicle = CalculateMaxRequiredVehicle(v->orders->GetTimetableTotalDuration(), ds.GetScheduledDispatchDuration(), ds.GetScheduledDispatch());
|
||||
if (required_vehicle > 0) {
|
||||
SetDParam(0, required_vehicle);
|
||||
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_L1);
|
||||
extra_lines++;
|
||||
y += GetCharacterHeight(FS_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
SetTimetableParams(0, ds.GetScheduledDispatchDuration(), true);
|
||||
|
@ -873,6 +865,16 @@ struct SchdispatchWindow : GeneralVehicleWindow {
|
|||
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_L4);
|
||||
y += GetCharacterHeight(FS_NORMAL);
|
||||
|
||||
if (!ds.GetScheduledDispatchReuseSlots() && !have_conditional) {
|
||||
const int required_vehicle = CalculateMaxRequiredVehicle(v->orders->GetTimetableTotalDuration(), ds.GetScheduledDispatchDuration(), ds.GetScheduledDispatch());
|
||||
if (required_vehicle > 0) {
|
||||
SetDParam(0, required_vehicle);
|
||||
DrawString(ir.left, ir.right, y, STR_SCHDISPATCH_SUMMARY_L1);
|
||||
extra_lines++;
|
||||
y += GetCharacterHeight(FS_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t duration = ds.GetScheduledDispatchDuration();
|
||||
for (const DispatchSlot &slot : ds.GetScheduledDispatch()) {
|
||||
if (slot.offset >= duration) {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "../fios.h"
|
||||
#include "../load_check.h"
|
||||
#include "../string_func.h"
|
||||
#include "../debug.h"
|
||||
|
||||
#include "saveload.h"
|
||||
#include "newgrf_sl.h"
|
||||
|
@ -118,6 +119,7 @@ static void Load_NGRF_common(GRFConfig *&grfconfig)
|
|||
if (IsSavegameVersionBefore(SLV_101)) c->SetSuitablePalette();
|
||||
AppendToGRFConfigList(&grfconfig, c);
|
||||
}
|
||||
DEBUG(sl, 2, "Loaded %u NewGRFs", GetGRFConfigListNonStaticCount(grfconfig));
|
||||
}
|
||||
|
||||
static void Load_NGRF()
|
||||
|
|
|
@ -2472,7 +2472,7 @@ class NIHRoadStop : public NIHelper {
|
|||
const RoadStopSpec *spec = GetRoadStopSpec(index);
|
||||
if (spec) {
|
||||
uint class_id = RoadStopClass::Get(spec->cls_id)->global_id;
|
||||
char *b = buffer + seprintf(buffer, lastof(buffer), " class ID: %c%c%c%c, spec ID: %u", class_id >> 24, class_id >> 16, class_id >> 8, class_id, spec->spec_id);
|
||||
char *b = buffer + seprintf(buffer, lastof(buffer), " class ID: %c%c%c%c", class_id >> 24, class_id >> 16, class_id >> 8, class_id);
|
||||
if (spec->grf_prop.grffile != nullptr) {
|
||||
b += seprintf(b, lastof(buffer), " (local ID: %u)", spec->grf_prop.local_id);
|
||||
}
|
||||
|
|
|
@ -1634,7 +1634,7 @@ post_cb = [](auto) { InvalidateWindowData(WC_BUILD_TOOLBAR, TRANSPORT_RAIL); }
|
|||
[SDTC_BOOL]
|
||||
var = gui.show_running_costs_calendar_year
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_PATCH
|
||||
def = false
|
||||
def = true
|
||||
str = STR_CONFIG_SHOW_VEHICLE_RUNNING_COSTS_CALENDAR_YEAR
|
||||
strhelp = STR_CONFIG_SHOW_VEHICLE_RUNNING_COSTS_CALENDAR_YEAR_HELPTEXT
|
||||
post_cb = [](auto) { MarkWholeScreenDirty(); }
|
||||
|
|
Loading…
Reference in New Issue