mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 03:54:40 +00:00
Savegame dialog: Grey out buttons if no save is selected
This commit is contained in:
parent
311acfa8ff
commit
271aac3fcc
@ -112,6 +112,7 @@ namespace MWGui
|
||||
mCurrentCharacter = NULL;
|
||||
mCurrentSlot = NULL;
|
||||
mSaveList->removeAllItems();
|
||||
onSlotSelected(mSaveList, MyGUI::ITEM_NONE);
|
||||
|
||||
MWBase::StateManager* mgr = MWBase::Environment::get().getStateManager();
|
||||
if (mgr->characterBegin() == mgr->characterEnd())
|
||||
@ -239,12 +240,10 @@ namespace MWGui
|
||||
}
|
||||
else
|
||||
{
|
||||
if (mCurrentCharacter && mCurrentSlot)
|
||||
{
|
||||
assert (mCurrentCharacter && mCurrentSlot);
|
||||
MWBase::Environment::get().getStateManager()->loadGame (mCurrentCharacter, mCurrentSlot);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SaveGameDialog::onOkButtonClicked(MyGUI::Widget *sender)
|
||||
{
|
||||
@ -292,6 +291,9 @@ namespace MWGui
|
||||
|
||||
void SaveGameDialog::onSlotSelected(MyGUI::ListBox *sender, size_t pos)
|
||||
{
|
||||
mOkButton->setEnabled(pos != MyGUI::ITEM_NONE || mSaving);
|
||||
mDeleteButton->setEnabled(pos != MyGUI::ITEM_NONE);
|
||||
|
||||
if (pos == MyGUI::ITEM_NONE)
|
||||
{
|
||||
mCurrentSlot = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user