Skip to content

Commit

Permalink
Fixed award widget not hiding on restart during podium. (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMaximum committed Mar 2, 2022
1 parent 0bf6a52 commit fc1dd95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyplanet/apps/contrib/mx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ async def on_start(self):
.add_param('pack', nargs='*', type=str, required=True, help='MX/TMX ID(s) of mappacks to add.'),
)

# Register callback.
# Register callbacks.
# Use podium end for regular map changes, the map start is required in case the map get restarted during the podium.
self.context.signals.listen(mp_signals.flow.podium_start, self.podium_start)
self.context.signals.listen(mp_signals.flow.podium_end, self.podium_end)
self.context.signals.listen(mp_signals.map.map_start, self.map_start)

async def podium_start(self, **kwargs):
if await self.setting_display_award_widget.get_value() is True:
Expand All @@ -103,6 +105,9 @@ async def podium_start(self, **kwargs):
async def podium_end(self, **kwargs):
await self.award_widget.hide()

async def map_start(self, map, restarted, **kwargs):
await self.award_widget.hide()

async def random_mx_map(self, player, data, **kwargs):
map_random_id = await self.api.mx_random()
await self.instance.command_manager.execute(
Expand Down

0 comments on commit fc1dd95

Please sign in to comment.