Character selection enhancements.
- Changing areas or switching characters updates the character availability list for everyone. - Taken and passworded on by default.
This commit is contained in:
parent
c3e29d6850
commit
dffd48711a
@ -39,6 +39,9 @@ void Courtroom::construct_char_select()
|
|||||||
ui_char_taken->setText("Taken");
|
ui_char_taken->setText("Taken");
|
||||||
set_size_and_pos(ui_char_taken, "char_taken");
|
set_size_and_pos(ui_char_taken, "char_taken");
|
||||||
|
|
||||||
|
ui_char_taken->setChecked(true);
|
||||||
|
ui_char_passworded->setChecked(true);
|
||||||
|
|
||||||
set_size_and_pos(ui_char_buttons, "char_buttons");
|
set_size_and_pos(ui_char_buttons, "char_buttons");
|
||||||
|
|
||||||
connect (char_button_mapper, SIGNAL(mapped(int)), this, SLOT(char_clicked(int)));
|
connect (char_button_mapper, SIGNAL(mapped(int)), this, SLOT(char_clicked(int)));
|
||||||
@ -71,6 +74,8 @@ void Courtroom::set_char_select()
|
|||||||
ui_char_select_background->resize(f_charselect.width, f_charselect.height);
|
ui_char_select_background->resize(f_charselect.width, f_charselect.height);
|
||||||
ui_char_select_background->set_image("charselect_background.png");
|
ui_char_select_background->set_image("charselect_background.png");
|
||||||
|
|
||||||
|
filter_character_list();
|
||||||
|
|
||||||
ui_char_search->setFocus();
|
ui_char_search->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,6 +122,7 @@ class ClientManager:
|
|||||||
self.char_id = char_id
|
self.char_id = char_id
|
||||||
self.pos = ''
|
self.pos = ''
|
||||||
self.send_command('PV', self.id, 'CID', self.char_id)
|
self.send_command('PV', self.id, 'CID', self.char_id)
|
||||||
|
self.area.send_command('CharsCheck', *self.get_available_char_list())
|
||||||
logger.log_server('[{}]Changed character from {} to {}.'
|
logger.log_server('[{}]Changed character from {} to {}.'
|
||||||
.format(self.area.id, old_char, self.get_char_name()), self)
|
.format(self.area.id, old_char, self.get_char_name()), self)
|
||||||
|
|
||||||
@ -193,6 +194,7 @@ class ClientManager:
|
|||||||
logger.log_server(
|
logger.log_server(
|
||||||
'[{}]Changed area from {} ({}) to {} ({}).'.format(self.get_char_name(), old_area.name, old_area.id,
|
'[{}]Changed area from {} ({}) to {} ({}).'.format(self.get_char_name(), old_area.name, old_area.id,
|
||||||
self.area.name, self.area.id), self)
|
self.area.name, self.area.id), self)
|
||||||
|
self.area.send_command('CharsCheck', *self.get_available_char_list())
|
||||||
self.send_command('HP', 1, self.area.hp_def)
|
self.send_command('HP', 1, self.area.hp_def)
|
||||||
self.send_command('HP', 2, self.area.hp_pro)
|
self.send_command('HP', 2, self.area.hp_pro)
|
||||||
self.send_command('BN', self.area.background)
|
self.send_command('BN', self.area.background)
|
||||||
@ -276,11 +278,7 @@ class ClientManager:
|
|||||||
self.send_host_message(info)
|
self.send_host_message(info)
|
||||||
|
|
||||||
def send_done(self):
|
def send_done(self):
|
||||||
avail_char_ids = set(range(len(self.server.char_list))) - set([x.char_id for x in self.area.clients])
|
self.send_command('CharsCheck', *self.get_available_char_list())
|
||||||
char_list = [-1] * len(self.server.char_list)
|
|
||||||
for x in avail_char_ids:
|
|
||||||
char_list[x] = 0
|
|
||||||
self.send_command('CharsCheck', *char_list)
|
|
||||||
self.send_command('HP', 1, self.area.hp_def)
|
self.send_command('HP', 1, self.area.hp_def)
|
||||||
self.send_command('HP', 2, self.area.hp_pro)
|
self.send_command('HP', 2, self.area.hp_pro)
|
||||||
self.send_command('BN', self.area.background)
|
self.send_command('BN', self.area.background)
|
||||||
@ -292,6 +290,13 @@ class ClientManager:
|
|||||||
self.char_id = -1
|
self.char_id = -1
|
||||||
self.send_done()
|
self.send_done()
|
||||||
|
|
||||||
|
def get_available_char_list(self):
|
||||||
|
avail_char_ids = set(range(len(self.server.char_list))) - set([x.char_id for x in self.area.clients])
|
||||||
|
char_list = [-1] * len(self.server.char_list)
|
||||||
|
for x in avail_char_ids:
|
||||||
|
char_list[x] = 0
|
||||||
|
return char_list
|
||||||
|
|
||||||
def auth_mod(self, password):
|
def auth_mod(self, password):
|
||||||
if self.is_mod:
|
if self.is_mod:
|
||||||
raise ClientError('Already logged in.')
|
raise ClientError('Already logged in.')
|
||||||
|
Loading…
Reference in New Issue
Block a user