store ship module layout in shipyard blueprint
This commit is contained in:
@@ -182,10 +182,11 @@ Blueprint BlueprintPanel::createBlueprintFromSelection() const
|
||||
for (const Entry& e : entries)
|
||||
{
|
||||
BlueprintBuilding bb;
|
||||
bb.type = e.building->type;
|
||||
bb.rotation = e.building->rotation;
|
||||
bb.offset = e.building->anchor - center;
|
||||
bb.recipeId = e.building->recipeId;
|
||||
bb.type = e.building->type;
|
||||
bb.rotation = e.building->rotation;
|
||||
bb.offset = e.building->anchor - center;
|
||||
bb.recipeId = e.building->recipeId;
|
||||
bb.shipLayout = e.building->shipLayout;
|
||||
bp.buildings.push_back(bb);
|
||||
}
|
||||
return bp;
|
||||
|
||||
@@ -504,18 +504,26 @@ void GameWorldView::placeBlueprintAtTile(QPoint center)
|
||||
}
|
||||
|
||||
const BuildingId id = m_sim->tryPlaceBuilding(bb.type, anchor, bb.rotation);
|
||||
if (id == kInvalidBuildingId || bb.recipeId.empty()) { continue; }
|
||||
if (id == kInvalidBuildingId) { continue; }
|
||||
|
||||
if (bb.type == BuildingType::Shipyard)
|
||||
if (!bb.recipeId.empty())
|
||||
{
|
||||
if (m_sim->isSchematicUnlocked(bb.recipeId))
|
||||
if (bb.type == BuildingType::Shipyard)
|
||||
{
|
||||
if (m_sim->isSchematicUnlocked(bb.recipeId))
|
||||
{
|
||||
m_sim->buildings().setRecipe(id, bb.recipeId);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_sim->buildings().setRecipe(id, bb.recipeId);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (bb.shipLayout.has_value())
|
||||
{
|
||||
m_sim->buildings().setRecipe(id, bb.recipeId);
|
||||
m_sim->buildings().setShipLayout(id, *bb.shipLayout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user