|
|
|
@ -30,11 +30,13 @@ namespace MWGui
|
|
|
|
|
getWidget(mInfoText, "InfoText");
|
|
|
|
|
getWidget(mOkButton, "OkButton");
|
|
|
|
|
getWidget(mCancelButton, "CancelButton");
|
|
|
|
|
getWidget(mDeleteButton, "DeleteButton");
|
|
|
|
|
getWidget(mSaveList, "SaveList");
|
|
|
|
|
getWidget(mSaveNameEdit, "SaveNameEdit");
|
|
|
|
|
getWidget(mSpacer, "Spacer");
|
|
|
|
|
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onOkButtonClicked);
|
|
|
|
|
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onCancelButtonClicked);
|
|
|
|
|
mDeleteButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SaveGameDialog::onDeleteButtonClicked);
|
|
|
|
|
mCharacterSelection->eventComboChangePosition += MyGUI::newDelegate(this, &SaveGameDialog::onCharacterSelected);
|
|
|
|
|
mSaveList->eventListChangePosition += MyGUI::newDelegate(this, &SaveGameDialog::onSlotSelected);
|
|
|
|
|
mSaveList->eventListMouseItemActivate += MyGUI::newDelegate(this, &SaveGameDialog::onSlotMouseClick);
|
|
|
|
@ -54,13 +56,16 @@ namespace MWGui
|
|
|
|
|
onSlotSelected(sender, pos);
|
|
|
|
|
|
|
|
|
|
if (pos != MyGUI::ITEM_NONE && MyGUI::InputManager::getInstance().isShiftPressed())
|
|
|
|
|
{
|
|
|
|
|
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
|
|
|
|
dialog->open("#{sMessage3}");
|
|
|
|
|
dialog->eventOkClicked.clear();
|
|
|
|
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &SaveGameDialog::onDeleteSlotConfirmed);
|
|
|
|
|
dialog->eventCancelClicked.clear();
|
|
|
|
|
}
|
|
|
|
|
confirmDeleteSave();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SaveGameDialog::confirmDeleteSave()
|
|
|
|
|
{
|
|
|
|
|
ConfirmationDialog* dialog = MWBase::Environment::get().getWindowManager()->getConfirmationDialog();
|
|
|
|
|
dialog->open("#{sMessage3}");
|
|
|
|
|
dialog->eventOkClicked.clear();
|
|
|
|
|
dialog->eventOkClicked += MyGUI::newDelegate(this, &SaveGameDialog::onDeleteSlotConfirmed);
|
|
|
|
|
dialog->eventCancelClicked.clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SaveGameDialog::onDeleteSlotConfirmed()
|
|
|
|
@ -175,6 +180,9 @@ namespace MWGui
|
|
|
|
|
mCharacterSelection->setVisible(load);
|
|
|
|
|
mSpacer->setUserString("Hidden", load ? "false" : "true");
|
|
|
|
|
|
|
|
|
|
mDeleteButton->setUserString("Hidden", load ? "false" : "true");
|
|
|
|
|
mDeleteButton->setVisible(load);
|
|
|
|
|
|
|
|
|
|
if (!load)
|
|
|
|
|
{
|
|
|
|
|
mCurrentCharacter = MWBase::Environment::get().getStateManager()->getCurrentCharacter (false);
|
|
|
|
@ -188,6 +196,12 @@ namespace MWGui
|
|
|
|
|
exit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SaveGameDialog::onDeleteButtonClicked(MyGUI::Widget *sender)
|
|
|
|
|
{
|
|
|
|
|
if (mCurrentSlot)
|
|
|
|
|
confirmDeleteSave();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SaveGameDialog::onConfirmationGiven()
|
|
|
|
|
{
|
|
|
|
|
accept(true);
|
|
|
|
|