Drops that haven't started yet within an active campaign;

are now labeled as Upcoming instead of showing unobtainable progress
This commit is contained in:
DevilXD committed 2022-08-08 22:03:27 +02:00
1 parent 98f5f7bc69
commit 2d1c201e2f
1 file changed
+6 -1
+6 -1
View File
@@ -5,6 +5,7 @@ import logging
import webbrowser import webbrowser
import tkinter as tk import tkinter as tk
from math import log10, ceil from math import log10, ceil
from datetime import datetime
from functools import partial from functools import partial
from collections import abc, namedtuple from collections import abc, namedtuple
from tkinter.font import Font, nametofont from tkinter.font import Font, nametofont
@@ -1130,6 +1131,10 @@ class InventoryOverview:
progress_text = "Ready to claim ⏳" progress_text = "Ready to claim ⏳"
progress_color = "goldenrod" progress_color = "goldenrod"
elif drop.preconditions: elif drop.preconditions:
if drop.starts_at > datetime.now(timezone.utc):
progress_text = "Upcoming ⏳"
progress_color = "goldenrod"
else:
progress_text = f"{drop.progress:3.1%} of {drop.required_minutes} minutes" progress_text = f"{drop.progress:3.1%} of {drop.required_minutes} minutes"
return (progress_text, progress_color) return (progress_text, progress_color)
@@ -1719,7 +1724,7 @@ class GUIManager:
if __name__ == "__main__": if __name__ == "__main__":
# Everything below is for debug purposes only # Everything below is for debug purposes only
from types import SimpleNamespace from types import SimpleNamespace
from datetime import datetime, timedelta, timezone from datetime import timedelta, timezone
class StrNamespace(SimpleNamespace): class StrNamespace(SimpleNamespace):
def __str__(self): def __str__(self):