| 122 | } |
| 123 | |
| 124 | bool Console::flush() |
| 125 | { |
| 126 | if (mCmdPending.empty()) |
| 127 | return false; |
| 128 | |
| 129 | if (mCmdPending == "cls") |
| 130 | { |
| 131 | clear(); |
| 132 | return false; |
| 133 | } |
| 134 | |
| 135 | try |
| 136 | { |
| 137 | mLog += Scripting::interpretScript(mCmdPending); |
| 138 | } |
| 139 | catch (const std::exception& e) |
| 140 | { |
| 141 | mLog += std::string(e.what()) + "\n"; |
| 142 | }; |
| 143 | |
| 144 | mCmdPending.clear(); |
| 145 | |
| 146 | return true; |
| 147 | } |
| 148 | |
| 149 | void Console::enterCommand() |
| 150 | { |