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

Method randomizeName

source/frontend/StarCharCreation.cpp:230–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void CharCreationPane::randomizeName() {
231 auto species = Root::singleton().speciesDatabase()->species(m_speciesList[m_speciesChoice]);
232 auto tb = fetchChild<TextBoxWidget>("name");
233 auto genderOption = species->options().genderOptions.wrap(m_genderChoice);
234 int limiter = 100;
235 while (!tb->setText(Root::singleton().nameGenerator()->generateName(species->nameGen(genderOption.gender)))) {
236 if (limiter == 0)
237 break;
238 limiter--;
239 }
240 changed();
241}
242
243void CharCreationPane::changed() {
244 auto& root = Root::singleton();

Callers

nothing calls this directly

Calls 8

singletonClass · 0.85
speciesDatabaseMethod · 0.80
nameGeneratorMethod · 0.80
nameGenMethod · 0.80
speciesMethod · 0.45
wrapMethod · 0.45
setTextMethod · 0.45
generateNameMethod · 0.45

Tested by

no test coverage detected