mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-30 06:53:51 +00:00
make a user friendly delete message
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
parent
5b47d034c5
commit
fe1dc5e02b
5 changed files with 62 additions and 10 deletions
|
|
@ -166,15 +166,10 @@ void UIScreenCallbackHandler::setupCallbacks() {
|
|||
});
|
||||
|
||||
// Character delete result callback
|
||||
gameHandler_.setCharDeleteCallback([this](bool success) {
|
||||
gameHandler_.setCharDeleteCallback([this](bool success, const std::string& message) {
|
||||
uiManager_.getCharacterScreen().setStatus(message, !success);
|
||||
if (success) {
|
||||
uiManager_.getCharacterScreen().setStatus("Character deleted.");
|
||||
// Refresh character list
|
||||
gameHandler_.requestCharacterList();
|
||||
} else {
|
||||
uint8_t code = gameHandler_.getLastCharDeleteResult();
|
||||
uiManager_.getCharacterScreen().setStatus(
|
||||
"Delete failed (code " + std::to_string(static_cast<int>(code)) + ").", true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue