|
32 | 32 |
|
33 | 33 | #define floop while(1)
|
34 | 34 |
|
35 |
| -#define GT_VAR_STR "13.5" |
| 35 | +#define GT_VAR_STR "13.6" |
36 | 36 |
|
37 | 37 | using namespace SSTP_link_n;
|
38 | 38 | using namespace std;
|
@@ -416,10 +416,11 @@ class ghost_terminal final: public simple_terminal {
|
416 | 416 | able_command_update = 0;
|
417 | 417 | able_command_complete = 0;
|
418 | 418 | able_command_history = 0;
|
419 |
| - able_command_prompt = 0; |
| 419 | + able_command_prompt = 0; |
| 420 | + able_get_result = 0; |
420 | 421 | err << SET_RED "Event " SET_GREEN "Has_Event" SET_RED " Not defined.\n"
|
421 | 422 | "You need to make your ghost support " SET_GREEN "Has_Event" SET_RED " event so that Terminal can know what events it supports.\n"
|
422 |
| - "Terminal will assume your ghost only supports " SET_GREEN "ShioriEcho" SET_RED " and " SET_GREEN "ShioriEcho.GetResult" SET_RED " events." RESET_COLOR "\n\n"; |
| 423 | + "Terminal will assume your ghost only supports " SET_GREEN "ShioriEcho" SET_RED " event." RESET_COLOR "\n\n"; |
423 | 424 | }
|
424 | 425 | }
|
425 | 426 |
|
@@ -453,8 +454,17 @@ class ghost_terminal final: public simple_terminal {
|
453 | 454 | return Result_command;
|
454 | 455 | }
|
455 | 456 | std::wstring terminal_command_update(std::wstring command) {
|
456 |
| - if(!able_command_update || _kbhit()) //考虑到sstp极慢的速度,只在需要时更新command的色彩 |
| 457 | + if(!able_command_update) |
457 | 458 | return command;
|
| 459 | + { |
| 460 | + bool in_kbhit = _kbhit(); |
| 461 | + if(in_kbhit) { //考虑到sstp极慢的速度,只在需要时更新command的色彩 |
| 462 | + const auto next_ch = _getwch(); |
| 463 | + _ungetwch(next_ch); |
| 464 | + if(next_ch != L'\n' && next_ch != L'\r') |
| 465 | + return command; |
| 466 | + } |
| 467 | + } |
458 | 468 | auto Result = linker.NOTYFY({{L"Event", L"ShioriEcho.CommandUpdate"},
|
459 | 469 | {L"Reference0", command}});
|
460 | 470 | if(Result.has(L"CommandForDisplay"))
|
@@ -557,8 +567,11 @@ class ghost_terminal final: public simple_terminal {
|
557 | 567 | Sleep(1000);
|
558 | 568 | }
|
559 | 569 | if(Result.has(L"Status")) {
|
560 |
| - if(Result[L"Status"] == L"End") |
| 570 | + const auto& status = Result[L"Status"]; |
| 571 | + if(status == L"End") |
561 | 572 | return false;
|
| 573 | + else if(status == L"Continue") |
| 574 | + break; |
562 | 575 | }
|
563 | 576 | }
|
564 | 577 | }
|
|
0 commit comments