Skip to content

Commit

Permalink
Added button to add maps from rank lists to folders. (#1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMaximum committed Aug 29, 2023
1 parent 713acea commit 07ecc02
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pyplanet/apps/contrib/rankings/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,21 @@ async def get_data(self):

return data

async def get_actions(self):
custom_actions = list()
if 'rankings' in self.app.instance.apps.apps:
custom_actions.append(dict(
name='Add to folder',
action=self.app.instance.apps.apps['jukebox'].add_to_folder,
text='',
textsize='1.2',
safe=True,
type='label',
order=-50,
require_confirm=False,
))

return custom_actions

async def action_jukebox(self, player, values, map_info, **kwargs):
await self.app.instance.apps.apps['jukebox'].add_to_jukebox(player, await self.app.instance.map_manager.get_map(map_info['uid']))

0 comments on commit 07ecc02

Please sign in to comment.