Skip to content

Commit

Permalink
Merge pull request #281 from hallowatcher/quest-list-color-fix
Browse files Browse the repository at this point in the history
Fix quest colors being green when not started
  • Loading branch information
Tynarus authored Mar 24, 2021
2 parents 08738ac + dae8f35 commit 5c551db
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/game-engine/world/actor/player/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1002,9 +1002,17 @@ export class Player extends Actor {
Object.keys(questMap).forEach(questKey => {
const questData = questMap[questKey];
const playerQuest = this.quests.find(quest => quest.questId === questData.id);
let color = colors.green;
if(playerQuest && !playerQuest.complete) {
color = playerQuest.progress === 0 ? colors.red : colors.yellow;
let color: number;

if (playerQuest?.complete) {
// Quest complete, regardless of progress
color = colors.green;
} else if (playerQuest?.progress > 0) {
// Quest in progress, not yet complete but progress is greater than 0
color = colors.yellow;
} else {
// Everything else failed, so quest hasn't been started yet
color = colors.red;
}

this.modifyWidget(widgets.questTab, { childId: questData.questTabId, textColor: color });
Expand Down

0 comments on commit 5c551db

Please sign in to comment.