Skip to content

Commit

Permalink
have commonclient check race mode on connect and add it to the toolti…
Browse files Browse the repository at this point in the history
…p ui
  • Loading branch information
alwaysintreble committed Sep 30, 2024
1 parent 1ef0522 commit c61fa78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CommonClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def __init__(self, server_address: typing.Optional[str] = None, password: typing
"collect": "disabled",
"remaining": "disabled",
}
self.race_mode: int = 0

# own state
self.finished_game = False
Expand Down Expand Up @@ -454,6 +455,7 @@ async def send_connect(self, **kwargs: typing.Any) -> None:
if kwargs:
payload.update(kwargs)
await self.send_msgs([payload])
await self.send_msgs([{"cmd": "Get", "keys": ["race_mode"]}])

async def console_input(self) -> str:
if self.ui:
Expand Down
2 changes: 2 additions & 0 deletions kvui.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ def get_text(self):
f"\nYou currently have {ctx.hint_points} points."
elif ctx.hint_cost == 0:
text += "\n!hint is free to use."
if ctx.stored_data and "race_mode" in ctx.stored_data:
text += "\nRace mode is enabled." if ctx.stored_data["race_mode"] else "\nRace mode is disabled."
else:
text += f"\nYou are not authenticated yet."

Expand Down

0 comments on commit c61fa78

Please sign in to comment.