forked from mirror/openmw-tes3mp
Update the saves list/preview image when character selection changes to make it more convenient to flip through characters with the keyboard
This commit is contained in:
parent
12510efab7
commit
d94235e3a7
2 changed files with 11 additions and 3 deletions
|
@ -50,7 +50,8 @@ namespace MWGui
|
||||||
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onOkButtonClicked);
|
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onOkButtonClicked);
|
||||||
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onCancelButtonClicked);
|
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onCancelButtonClicked);
|
||||||
mDeleteButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onDeleteButtonClicked);
|
mDeleteButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onDeleteButtonClicked);
|
||||||
mCharacterSelection->eventComboAccept += MyGUI::newDelegate(this, &SaveGameDialog::onCharacterSelected);
|
mCharacterSelection->eventComboChangePosition += MyGUI::newDelegate(this, &SaveGameDialog::onCharacterSelected);
|
||||||
|
mCharacterSelection->eventComboAccept += MyGUI::newDelegate(this, &SaveGameDialog::onCharacterAccept);
|
||||||
mSaveList->eventListChangePosition += MyGUI::newDelegate(this, &SaveGameDialog::onSlotSelected);
|
mSaveList->eventListChangePosition += MyGUI::newDelegate(this, &SaveGameDialog::onSlotSelected);
|
||||||
mSaveList->eventListMouseItemActivate += MyGUI::newDelegate(this, &SaveGameDialog::onSlotMouseClick);
|
mSaveList->eventListMouseItemActivate += MyGUI::newDelegate(this, &SaveGameDialog::onSlotMouseClick);
|
||||||
mSaveList->eventListSelectAccept += MyGUI::newDelegate(this, &SaveGameDialog::onSlotActivated);
|
mSaveList->eventListSelectAccept += MyGUI::newDelegate(this, &SaveGameDialog::onSlotActivated);
|
||||||
|
@ -132,6 +133,8 @@ namespace MWGui
|
||||||
mSaveNameEdit->setCaption ("");
|
mSaveNameEdit->setCaption ("");
|
||||||
if (mSaving)
|
if (mSaving)
|
||||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveNameEdit);
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveNameEdit);
|
||||||
|
else
|
||||||
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
||||||
|
|
||||||
center();
|
center();
|
||||||
|
|
||||||
|
@ -322,6 +325,12 @@ namespace MWGui
|
||||||
fillSaveList();
|
fillSaveList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SaveGameDialog::onCharacterAccept(MyGUI::ComboBox* sender, size_t pos)
|
||||||
|
{
|
||||||
|
// Give key focus to save list so we can confirm the selection with Enter
|
||||||
|
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
||||||
|
}
|
||||||
|
|
||||||
void SaveGameDialog::fillSaveList()
|
void SaveGameDialog::fillSaveList()
|
||||||
{
|
{
|
||||||
mSaveList->removeAllItems();
|
mSaveList->removeAllItems();
|
||||||
|
@ -336,8 +345,6 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
mSaveList->setIndexSelected(0);
|
mSaveList->setIndexSelected(0);
|
||||||
onSlotSelected(mSaveList, 0);
|
onSlotSelected(mSaveList, 0);
|
||||||
// Give key focus to save list so we can confirm the selection with Enter
|
|
||||||
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mSaveList);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
onSlotSelected(mSaveList, MyGUI::ITEM_NONE);
|
onSlotSelected(mSaveList, MyGUI::ITEM_NONE);
|
||||||
|
|
|
@ -29,6 +29,7 @@ namespace MWGui
|
||||||
void onOkButtonClicked (MyGUI::Widget* sender);
|
void onOkButtonClicked (MyGUI::Widget* sender);
|
||||||
void onDeleteButtonClicked (MyGUI::Widget* sender);
|
void onDeleteButtonClicked (MyGUI::Widget* sender);
|
||||||
void onCharacterSelected (MyGUI::ComboBox* sender, size_t pos);
|
void onCharacterSelected (MyGUI::ComboBox* sender, size_t pos);
|
||||||
|
void onCharacterAccept(MyGUI::ComboBox* sender, size_t pos);
|
||||||
// Slot selected (mouse click or arrow keys)
|
// Slot selected (mouse click or arrow keys)
|
||||||
void onSlotSelected (MyGUI::ListBox* sender, size_t pos);
|
void onSlotSelected (MyGUI::ListBox* sender, size_t pos);
|
||||||
// Slot activated (double click or enter key)
|
// Slot activated (double click or enter key)
|
||||||
|
|
Loading…
Reference in a new issue