## Bug fixes
- Default to automatic map mode positioning when mixing manual and
automatic (would just break before)
- Account for map mode image scale when automatically positioning
This commit is contained in:
xen-42 2024-02-23 20:51:23 -05:00 committed by GitHub
commit a85e966617
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -45,13 +45,31 @@ namespace NewHorizons.Builder.ShipLog
}
}
if (flagAutoPositionUsed)
var isBaseSolarSystem = systemName == "SolarSystem";
// Default to MANUAL in Base Solar System (we can't automatically fix them so it might just break, but AUTO breaks even more!)
var useManual = (flagManualPositionUsed && !flagAutoPositionUsed) || (flagAutoPositionUsed && flagManualPositionUsed && isBaseSolarSystem);
// Default to AUTO in other solar systems (since we can actually fix them)
var useAuto = (flagAutoPositionUsed && !flagManualPositionUsed) || (flagAutoPositionUsed && flagManualPositionUsed && !isBaseSolarSystem);
if (flagAutoPositionUsed && flagManualPositionUsed)
{
if (useAuto)
{
NHLogger.LogWarning("Can't mix manual and automatic layout of ship log map mode, defaulting to AUTOMATIC");
}
else
{
NHLogger.LogWarning("Can't mix manual and automatic layout of ship log map mode, defaulting to MANUAL");
}
}
if (useAuto)
{
if (flagAutoPositionUsed && flagManualPositionUsed)
NHLogger.LogWarning("Can't mix manual and automatic layout of ship log map mode, defaulting to automatic");
return ConstructMapModeAuto(bodies, transformParent, greyScaleMaterial, layer);
}
else if (flagManualPositionUsed)
else if (useManual)
{
return ConstructMapModeManual(bodies, transformParent, greyScaleMaterial, currentNav, layer);
}