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