Skip to content

Commit

Permalink
Merge branch 'develop' into fix/shop-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Promises authored Mar 24, 2021
2 parents 0f34584 + 5c551db commit b3e1b94
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 b3e1b94

Please sign in to comment.