mirror of
https://github.com/rangermix/TwitchDropsMiner.git
synced 2026-06-07 04:49:36 +00:00
Merge branch 'master' of https://github.com/DevilXD/TwitchDropsMiner
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,6 +11,7 @@ __pycache__
|
||||
# Dev files
|
||||
/env
|
||||
/cache
|
||||
log.txt
|
||||
cookies.jar
|
||||
settings.json
|
||||
/lang/English.json
|
||||
|
||||
12
gui.py
12
gui.py
@@ -1213,21 +1213,23 @@ class InventoryOverview:
|
||||
self._campaigns.clear()
|
||||
|
||||
def get_progress(self, drop: TimedDrop) -> tuple[str, tk._Color]:
|
||||
progress_text: str
|
||||
progress_color: tk._Color = ''
|
||||
progress_text: str = _("gui", "inventory", "minutes_progress").format(
|
||||
minutes=drop.required_minutes
|
||||
)
|
||||
if drop.is_claimed:
|
||||
progress_color = "green"
|
||||
progress_text = _("gui", "inventory", "status", "claimed")
|
||||
elif drop.can_claim:
|
||||
progress_color = "goldenrod"
|
||||
progress_text = _("gui", "inventory", "status", "ready")
|
||||
elif drop.can_earn():
|
||||
progress_text = _("gui", "inventory", "status", "ready_to_claim")
|
||||
elif drop.current_minutes or drop.can_earn():
|
||||
progress_text = _("gui", "inventory", "percent_progress").format(
|
||||
percent=f"{drop.progress:3.1%}",
|
||||
minutes=drop.required_minutes,
|
||||
)
|
||||
else:
|
||||
progress_text = _("gui", "inventory", "minutes_progress").format(
|
||||
minutes=drop.required_minutes
|
||||
)
|
||||
return (progress_text, progress_color)
|
||||
|
||||
def update_drop(self, drop: TimedDrop) -> None:
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
"upcoming": "即将上线 \u23f3",
|
||||
"expired": "已结束 \u274c",
|
||||
"claimed": "声明 \u2714",
|
||||
"ready": "准备掉宝 \u23f3"
|
||||
"ready_to_claim": "准备掉宝 \u23f3"
|
||||
},
|
||||
"starts": "开始时间: {time}",
|
||||
"ends": "结束时间: {time}",
|
||||
|
||||
@@ -133,7 +133,7 @@ class GUIInvStatus(TypedDict):
|
||||
expired: str
|
||||
upcoming: str
|
||||
claimed: str
|
||||
ready: str
|
||||
ready_to_claim: str
|
||||
|
||||
|
||||
class GUIInventory(TypedDict):
|
||||
@@ -318,7 +318,7 @@ default_translation: Translation = {
|
||||
"upcoming": "Upcoming ⏳",
|
||||
"expired": "Expired ❌",
|
||||
"claimed": "Claimed ✔",
|
||||
"ready": "Ready to claim ⏳",
|
||||
"ready_to_claim": "Ready to claim ⏳",
|
||||
},
|
||||
"starts": "Starts: {time}",
|
||||
"ends": "Ends: {time}",
|
||||
|
||||
@@ -880,7 +880,11 @@ class Twitch:
|
||||
# just so that quick 2nd retries that often happen, aren't shown
|
||||
if delay > 1:
|
||||
self.print(_("error", "no_connection").format(seconds=round(delay)))
|
||||
if self.gui.close_requested:
|
||||
raise ExitRequest()
|
||||
await asyncio.sleep(delay)
|
||||
if self.gui.close_requested:
|
||||
raise ExitRequest()
|
||||
|
||||
async def gql_request(self, op: GQLOperation) -> JsonType:
|
||||
gql_logger.debug(f"GQL Request: {op}")
|
||||
|
||||
Reference in New Issue
Block a user