Skip to content

Commit

Permalink
Merged PR 496: Merge 111_traits to master
Browse files Browse the repository at this point in the history
Related work items: #111
  • Loading branch information
Allen B. Cummings committed Apr 30, 2019
1 parent 049d085 commit eeb9209
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions include/itemFormatters.h
Original file line number Diff line number Diff line change
Expand Up @@ -857,6 +857,11 @@ private nosave mapping decorators = ([
"8-bit": "\x1b[0;38;5;190m",
"24-bit": "\x1b[0;38;2;200;200;0m"
]),
"personality trait":([
"3-bit": "\x1b[0;36m",
"8-bit": "\x1b[0;38;5;80m",
"24-bit": "\x1b[0;38;2;180;180;190m"
]),
]),
"quests":([
"description": ([
Expand Down
4 changes: 4 additions & 0 deletions modules/traits.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ private nomask string getTraitColor(string trait)
{
ret = "negative trait";
}
else if (traitDictionary()->traitIsOfType(trait, "personality"))
{
ret = "personality trait";
}
else if (traitDictionary()->isValidPersistedTrait(trait))
{
ret = "persisted trait";
Expand Down
2 changes: 1 addition & 1 deletion tests/commands/player/traitsTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void SectionWithMoreThanThreeTraitsCorrectlyDisplays()

ExpectTrue(Player->executeCommand("traits"));
ExpectEq("\n\x1b[0;31m+-=-=-=-=-=-=-=-=-=-=-=-=-=-=+ Personality Traits +-=-=-=-=-=-=-=-=-=-=-=-=-=-+\n\x1b[0m" +
sprintf(TraitsRow, "\x1b[0;36m", "Abrasive", "\x1b[0;33m", "Charming", "\x1b[0;31;1m", "Test 1") +
sprintf(TraitsRow, "\x1b[0;36m", "Abrasive", "\x1b[0;36m", "Charming", "\x1b[0;31;1m", "Test 1") +
sprintf(TraitsRowOne, "\x1b[0;36m", "Test 2", "", "", "", "") + EndBar,
Player->caughtMessage());
}
Expand Down

0 comments on commit eeb9209

Please sign in to comment.