| 27 | } |
| 28 | |
| 29 | wstr_t CObjectProperty::CreateTextData(bool extended) |
| 30 | { |
| 31 | CGameObject *obj = g_World->FindWorldObject(Serial); |
| 32 | bool coloredStartFont = false; |
| 33 | wstr_t result = {}; |
| 34 | |
| 35 | if (Name.length() != 0u) |
| 36 | { |
| 37 | if (obj != nullptr) |
| 38 | { |
| 39 | if (!obj->NPC) |
| 40 | { |
| 41 | result = L"<basefont color=\"yellow\">"; |
| 42 | coloredStartFont = true; |
| 43 | } |
| 44 | else |
| 45 | { |
| 46 | CGameCharacter *gc = obj->GameCharacterPtr(); |
| 47 | coloredStartFont = true; |
| 48 | |
| 49 | switch (gc->Notoriety) |
| 50 | { |
| 51 | case NT_INNOCENT: |
| 52 | { |
| 53 | result = L"<basefont color=\"cyan\">"; |
| 54 | break; |
| 55 | } |
| 56 | case NT_SOMEONE_GRAY: |
| 57 | case NT_CRIMINAL: |
| 58 | { |
| 59 | result = L"<basefont color=\"gray\">"; |
| 60 | break; |
| 61 | } |
| 62 | case NT_MURDERER: |
| 63 | { |
| 64 | result = L"<basefont color=\"red\">"; |
| 65 | break; |
| 66 | } |
| 67 | case NT_INVULNERABLE: |
| 68 | { |
| 69 | result = L"<basefont color=\"yellow\">"; |
| 70 | break; |
| 71 | } |
| 72 | default: |
| 73 | break; |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | result += Name; |
| 79 | |
| 80 | if (coloredStartFont) |
| 81 | { |
| 82 | result += L"<basefont color=\"#FFFFFFFF\">"; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | if (Data.length() != 0u) |
no test coverage detected