MCPcopy Create free account
hub / github.com/TurningWheel/Barony / getBookLocalizedNameFromIndex

Function getBookLocalizedNameFromIndex

src/book.cpp:73–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73std::string getBookLocalizedNameFromIndex(int index, bool censored)
74{
75 if ( allBooks.empty() || index < 0 || index >= allBooks.size() ) {
76 return "";
77 }
78 if ( !spawn_blood && censored ) {
79 for ( int c = 0; c < num_banned_books; ++c ) {
80 auto banned_book = banned_books[c];
81 if ( allBooks[index].default_name == banned_book ) {
82 return getBookLocalizedNameFromIndex((index + 1) % allBooks.size(), censored);
83 }
84 }
85 }
86 return ItemTooltips.bookNameLocalizations[allBooks[index].default_name];
87}
88
89//Local helper function to make getting the list of books cross-platform easier.
90std::list<std::string> getListOfBooks()

Callers 4

descriptionMethod · 0.85
getNameMethod · 0.85
setCalloutTextMethod · 0.85
updateFrameTooltipMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected