MM: MM1: Further QuickRef dialog

This commit is contained in:
Paul Gilbert 2023-02-06 22:19:59 -08:00
parent d4f8c51567
commit e1977dbd77
3 changed files with 37 additions and 5 deletions

View File

@ -654,5 +654,18 @@ size_t Character::getPerformanceTotal() const {
+ totalFlags;
}
int Character::statColor(int amount, int threshold) const {
if (amount < 1)
return 6;
else if (amount > threshold)
return 2;
else if (amount == threshold)
return 15;
else if (amount >= (threshold / 4))
return 9;
else
return 32;
}
} // namespace MM1
} // namespace MM

View File

@ -532,6 +532,12 @@ struct Character : public PrimaryAttributes {
* value for the party at the end of the game
*/
size_t getPerformanceTotal() const;
/**
* Returns the color to use in enhanced mode to
* represent the color of a character attribute
*/
int statColor(int amount, int threshold) const;
};
} // namespace MM1

View File

@ -52,10 +52,8 @@ void QuickRef::draw() {
writeString(COLUMN_NAME, 20, STRING["enhdialogs.quickref.headers.name"]);
writeString(COLUMN_CLASS, 20, STRING["enhdialogs.quickref.headers.class"]);
writeString(COLUMN_LEVEL, 20, STRING["enhdialogs.quickref.headers.level"], ALIGN_RIGHT);
writeString(COLUMN_HP, 20, " ");
writeString(STRING["enhdialogs.quickref.headers.hp"]);
writeString(COLUMN_SP, 20, " ");
writeString(STRING["enhdialogs.quickref.headers.sp"]);
writeString(COLUMN_HP, 20, STRING["enhdialogs.quickref.headers.hp"]);
writeString(COLUMN_SP, 20, STRING["enhdialogs.quickref.headers.sp"]);
writeString(COLUMN_AC, 20, STRING["enhdialogs.quickref.headers.ac"]);
writeString(COLUMN_CONDITION, 20, STRING["enhdialogs.quickref.headers.cond"]);
@ -78,8 +76,23 @@ void QuickRef::writeCharacterLine(int charNum) {
writeString(COLUMN_CLASS, yp, Common::String(
classStr.c_str(), classStr.c_str() + 3));
setTextColor(c.statColor(c._level._current, c._level._base));
writeString(COLUMN_LEVEL, yp,
Common::String::format("%d", c._level), ALIGN_RIGHT);
Common::String::format("%d", c._level._current), ALIGN_RIGHT);
setTextColor(c.statColor(c._hpCurrent, c._hpMax));
writeNumber(COLUMN_HP, yp, c._hpCurrent);
setTextColor(c.statColor(c._sp._current, c._sp._base));
writeChar(COLUMN_SP, yp, ' ');
writeNumber(c._sp._current);
setTextColor(c.statColor(c._ac._current, c._ac._base));
writeChar(COLUMN_AC, yp, ' ');
writeNumber(c._ac._current);
setTextColor(0);
}
} // namespace Views