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

Method addCollectable

source/game/StarPlayer.cpp:1390–1401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1388}
1389
1390bool Player::addCollectable(String const& collectionName, String const& collectableName) {
1391 if (m_log->addCollectable(collectionName, collectableName)) {
1392 auto collectionDatabase = Root::singleton().collectionDatabase();
1393
1394 auto collection = collectionDatabase->collection(collectionName);
1395 auto collectable = collectionDatabase->collectable(collectionName, collectableName);
1396 queueUIMessage(Root::singleton().assets()->json("/player.config:collectableUnlock").toString().replace("<collectable>", collectable.title).replace("<collection>", collection.title));
1397 return true;
1398 } else {
1399 return false;
1400 }
1401}
1402
1403PlayerUniverseMapPtr Player::universeMap() const {
1404 return m_universeMap;

Callers 1

craftMethod · 0.45

Calls 8

singletonClass · 0.85
collectionDatabaseMethod · 0.80
collectionMethod · 0.80
collectableMethod · 0.80
jsonMethod · 0.80
assetsMethod · 0.80
replaceMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected