Debug: Show info of all aircraft parts in vehicle debug window
This commit is contained in:
@@ -92,10 +92,26 @@ class NIHVehicle : public NIHelper {
|
||||
|
||||
/* virtual */ void ExtraInfo(uint index, std::function<void(const char *)> print) const override
|
||||
{
|
||||
char buffer[1024];
|
||||
|
||||
Vehicle *v = Vehicle::Get(index);
|
||||
print("Debug Info:");
|
||||
seprintf(buffer, lastof(buffer), " Index: %u", index);
|
||||
this->VehicleInfo(v, print, true);
|
||||
if (v->type == VEH_AIRCRAFT) {
|
||||
print("");
|
||||
print("Shadow:");
|
||||
this->VehicleInfo(v->Next(), print, false);
|
||||
if (v->Next()->Next() != nullptr) {
|
||||
print("");
|
||||
print("Rotor:");
|
||||
this->VehicleInfo(v->Next()->Next(), print, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void VehicleInfo(Vehicle *v, std::function<void(const char *)> print, bool show_engine) const
|
||||
{
|
||||
char buffer[1024];
|
||||
seprintf(buffer, lastof(buffer), " Index: %u", v->index);
|
||||
print(buffer);
|
||||
char *b = buffer;
|
||||
b += seprintf(b, lastof(buffer), " Flags: ");
|
||||
@@ -297,6 +313,7 @@ class NIHVehicle : public NIHelper {
|
||||
}
|
||||
}
|
||||
|
||||
if (show_engine) {
|
||||
seprintf(buffer, lastof(buffer), " Engine: %u", v->engine_type);
|
||||
print(buffer);
|
||||
const Engine *e = Engine::GetIfValid(v->engine_type);
|
||||
@@ -353,6 +370,7 @@ class NIHVehicle : public NIHelper {
|
||||
print(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
seprintf(buffer, lastof(buffer), " Current image cacheable: %s (%X), spritenum: %X",
|
||||
v->cur_image_valid_dir != INVALID_DIR ? "yes" : "no", v->cur_image_valid_dir, v->spritenum);
|
||||
|
Reference in New Issue
Block a user