| 92 | } |
| 93 | |
| 94 | bool Menu_Save::onInputAction(Engine::ActionType action) |
| 95 | { |
| 96 | using Engine::ActionType; |
| 97 | |
| 98 | if (!m_isWaitingForSaveName) |
| 99 | return Menu::onInputAction(action); |
| 100 | else |
| 101 | { |
| 102 | switch (action) |
| 103 | { |
| 104 | case ActionType::UI_Confirm: |
| 105 | if (!m_SelectableItems.empty()) |
| 106 | performSelectAction(m_SelectableItems[m_SelectedItem]); |
| 107 | break; |
| 108 | case ActionType::UI_Backspace: |
| 109 | if (m_SaveName.size() > 0) |
| 110 | m_SaveName.pop_back(); |
| 111 | break; |
| 112 | case ActionType::UI_Close: |
| 113 | m_isWaitingForSaveName = false; |
| 114 | // restore displayname of current slot |
| 115 | gatherAvailableSavegames(); |
| 116 | break; |
| 117 | default: |
| 118 | break; |
| 119 | } |
| 120 | } |
| 121 | return false; |
| 122 | } |
| 123 | |
| 124 | void Menu_Save::onTextInput(const std::string& text) |
| 125 | { |