mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
feat(glue): display list of characters
This commit is contained in:
parent
d536140d63
commit
f28f4b0379
10 changed files with 174 additions and 8 deletions
43
src/clientobject/Unit_C.cpp
Normal file
43
src/clientobject/Unit_C.cpp
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#include "clientobject/Unit_C.hpp"
|
||||
|
||||
const char* CGUnit_C::GetDisplayRaceNameFromRecord(ChrRacesRec* record, uint8_t sexIn, uint8_t* sexOut) {
|
||||
const char* result;
|
||||
|
||||
if (sexOut) {
|
||||
*sexOut = sexIn;
|
||||
}
|
||||
if (!record) {
|
||||
return nullptr;
|
||||
}
|
||||
if (!sexIn) {
|
||||
if (record->m_nameMale[0]) {
|
||||
return record->m_nameMale;
|
||||
}
|
||||
|
||||
if (record->m_nameFemale[0]) {
|
||||
if (sexOut) {
|
||||
*sexOut = 1;
|
||||
}
|
||||
return record->m_nameFemale;
|
||||
}
|
||||
|
||||
return record->m_name;
|
||||
}
|
||||
|
||||
if (sexIn != 1) {
|
||||
return record->m_name;
|
||||
}
|
||||
|
||||
if (record->m_nameFemale[0]) {
|
||||
return record->m_nameFemale;
|
||||
}
|
||||
|
||||
if (!record->m_nameMale[0]) {
|
||||
return record->m_name;
|
||||
}
|
||||
|
||||
if (sexOut) {
|
||||
*sexOut = 0;
|
||||
}
|
||||
return record->m_nameMale;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue