MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / addBlueprint

Method addBlueprint

source/game/StarPlayer.cpp:1365–1381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1363}
1364
1365bool Player::addBlueprint(ItemDescriptor const& descriptor, bool showFailure) {
1366 if (descriptor.isNull())
1367 return false;
1368
1369 auto itemDb = Root::singleton().itemDatabase();
1370 auto item = itemDb->item(descriptor);
1371 auto assets = Root::singleton().assets();
1372 if (!m_blueprints->isKnown(descriptor)) {
1373 m_blueprints->add(descriptor);
1374 queueUIMessage(assets->json("/player.config:blueprintUnlock").toString().replace("<ItemName>", item->friendlyName()));
1375 return true;
1376 } else if (showFailure) {
1377 queueUIMessage(assets->json("/player.config:blueprintAlreadyKnown").toString().replace("<ItemName>", item->friendlyName()));
1378 }
1379
1380 return false;
1381}
1382
1383bool Player::blueprintKnown(ItemDescriptor const& descriptor) const {
1384 if (descriptor.isNull())

Callers 6

fireTriggeredMethod · 0.80
fireTriggeredMethod · 0.80
makePlayerCallbacksMethod · 0.80
displayedMethod · 0.80
upgradeTableMethod · 0.80
giveBlueprintMethod · 0.80

Calls 11

singletonClass · 0.85
itemDatabaseMethod · 0.80
assetsMethod · 0.80
isKnownMethod · 0.80
jsonMethod · 0.80
isNullMethod · 0.45
itemMethod · 0.45
addMethod · 0.45
replaceMethod · 0.45
toStringMethod · 0.45
friendlyNameMethod · 0.45

Tested by

no test coverage detected