mirror of
https://github.com/fallout2-ce/fallout2-ce.git
synced 2026-07-27 16:47:11 -07:00
* Implement sfall `signal_close_game` Used by Et tu, but might be useful for LLMs too to quit the game after running a test case. Also added enum for `_user_wants_to_quit`, and did minor reformatting of SFALL_COMPATIBILITY.md
38 lines
1.1 KiB
Plaintext
38 lines
1.1 KiB
Plaintext
#include "test_utils.h"
|
|
#include "sfall.h"
|
|
#include "dik.h"
|
|
|
|
variable signal_close_game_test_done := false;
|
|
|
|
procedure keypress_handler begin
|
|
variable pressed := get_sfall_arg_at(0);
|
|
variable key := get_sfall_arg_at(1);
|
|
|
|
if (not pressed) then return;
|
|
if (key != DIK_J) then return;
|
|
|
|
if (signal_close_game_test_done) then begin
|
|
display_msg("signal_close_game test already triggered");
|
|
return;
|
|
end
|
|
|
|
signal_close_game_test_done := true;
|
|
display_msg("signal_close_game test triggered");
|
|
signal_close_game;
|
|
end
|
|
|
|
procedure start begin
|
|
// TODO: move this to a more suitable place, once we have more functions implemented
|
|
// These are in the "Other" category in the sfall documentation
|
|
display_msg("Testing misc functions...");
|
|
variable hand := active_hand;
|
|
toggle_active_hand;
|
|
call assertEquals("active_hand toggled", active_hand, 1 - hand);
|
|
toggle_active_hand;
|
|
call assertEquals("active_hand toggled", active_hand, hand);
|
|
|
|
call report_test_results("misc");
|
|
display_msg("signal_close_game manual test ready: press J");
|
|
register_hook_proc(HOOK_KEYPRESS, keypress_handler);
|
|
end
|