Jukebox fixes: clear on toggle, don't show 'has played' with one person.
This commit is contained in:
parent
c01857063b
commit
0fb3b7edbf
@ -67,6 +67,7 @@ class AreaManager:
|
|||||||
self.blankposting_allowed = True
|
self.blankposting_allowed = True
|
||||||
self.jukebox = jukebox
|
self.jukebox = jukebox
|
||||||
self.jukebox_votes = []
|
self.jukebox_votes = []
|
||||||
|
self.jukebox_prev_char_id = -1
|
||||||
|
|
||||||
def new_client(self, client):
|
def new_client(self, client):
|
||||||
self.clients.add(client)
|
self.clients.add(client)
|
||||||
@ -167,10 +168,14 @@ class AreaManager:
|
|||||||
self.current_music = ''
|
self.current_music = ''
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if vote_picked.char_id != self.jukebox_prev_char_id or len(self.jukebox_votes) > 1:
|
||||||
|
self.jukebox_prev_char_id = vote_picked.char_id
|
||||||
if vote_picked.showname == '':
|
if vote_picked.showname == '':
|
||||||
self.send_command('MC', vote_picked.name, vote_picked.client.char_id)
|
self.send_command('MC', vote_picked.name, vote_picked.client.char_id)
|
||||||
else:
|
else:
|
||||||
self.send_command('MC', vote_picked.name, vote_picked.client.char_id, vote_picked.showname)
|
self.send_command('MC', vote_picked.name, vote_picked.client.char_id, vote_picked.showname)
|
||||||
|
else:
|
||||||
|
self.send_command('MC', vote_picked.name, -1)
|
||||||
|
|
||||||
self.current_music_player = 'The Jukebox'
|
self.current_music_player = 'The Jukebox'
|
||||||
self.current_music_player_ipid = 'has no IPID'
|
self.current_music_player_ipid = 'has no IPID'
|
||||||
|
@ -174,6 +174,7 @@ def ooc_cmd_jukebox_toggle(client, arg):
|
|||||||
if len(arg) != 0:
|
if len(arg) != 0:
|
||||||
raise ArgumentError('This command has no arguments.')
|
raise ArgumentError('This command has no arguments.')
|
||||||
client.area.jukebox = not client.area.jukebox
|
client.area.jukebox = not client.area.jukebox
|
||||||
|
client.area.jukebox_votes = []
|
||||||
changer = 'Unknown'
|
changer = 'Unknown'
|
||||||
if client.is_cm:
|
if client.is_cm:
|
||||||
changer = 'The CM'
|
changer = 'The CM'
|
||||||
|
Loading…
Reference in New Issue
Block a user