#include "plugin.h" #include "button.h" #include "help.h" PLUGIN_HEADER static const struct plugin_api* rb; #define HELP 9 #if HELP == 1 static char help_text[] = "-- Navigation --\0" ": Move the cursor to the previous/ next column.\0" ": Move the cursor up/ down in the column.\0" ": Select cards, move cards, reveal hidden cards...\0" ": Deselect a card if it was selected. Else draw new card(s) from the remains stack.\0" "-- Shortcuts --\0" ": Put the card on top of the remains stack on top of the cursor.\0" ": Put the card under the cursor on one of the 4 final stacks.\0" ": Put the card on top of the remains stack on one of the 4 final stacks.\0" ; #elif HELP == 2 static char help_text[] = "\0"; #elif HELP == 3 static char help_text[] = "\n"; #elif HELP == 4 static char help_text[] = "hello_world\n"; #elif HELP == 5 static char help_text[] = "hello_world"; #elif HELP == 6 static char help_text[] = "a"; #elif HELP == 7 static char help_text[] = "-- Navigation --\n" ": Move the cursor to the previous/ next column.\n" ": Move the cursor up/ down in the column.\n" ": Select cards, move cards, reveal hidden cards...\n" ": Deselect a card if it was selected. Else draw new card(s) from the remains stack.\n" "-- Shortcuts --\n" ": Put the card on top of the remains stack on top of the cursor.\n" ": Put the card under the cursor on one of the 4 final stacks.\n" ": Put the card on top of the remains stack on one of the 4 final stacks.\n" ; #elif HELP == 8 static char help_text[] = "-- Navigation --\n" ": Move the cursor to the previous/ next column.\n" ": Move the cursor up/ down in the column.\n" ": Select cards, move cards, reveal hidden cards...\n" ": Deselect a card if it was selected. Else draw new card(s) from the remains stack.\n" "-- Shortcuts --\n" ": Put the card on top of the remains stack on top of the cursor.\n" ": Put the card under the cursor on one of the 4 final stacks.\n" ": Put the card on top of the remains stack on one of the 4 final stacks.\n" "\n" "-- Navigation --\n" ": Move the cursor to the previous/ next column.\n" ": Move the cursor up/ down in the column.\n" ": Select cards, move cards, reveal hidden cards...\n" ": Deselect a card if it was selected. Else draw new card(s) from the remains stack.\n" "-- Shortcuts --\n" ": Put the card on top of the remains stack on top of the cursor.\n" ": Put the card under the cursor on one of the 4 final stacks.\n" ": Put the card on top of the remains stack on one of the 4 final stacks.\n" "mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm\n" ; #elif HELP == 9 static char help_text[] = "0\n" "1\n" "2\n" "3\n" "4\n" "5\n" "6\n" "7\n" "8\n" "9\n" "10\n" "11\n" "12\n" "13\n" "14\n" "15\n" "16\n" "17\n" "18\n" "19\n" "20\n" "21\n" "22\n" "23\n" "24\n" "25\n" "26\n" "27\n" "28\n" "29\n" ; #endif enum plugin_status plugin_start( const struct plugin_api* api, const void* parameter ) { struct help_context ctx; // char str[1000]; rb = api; // rb->splash( HZ, "before help_init()"); help_init(&ctx, api, 20, help_text, BUTTON_SCROLL_BACK, BUTTON_SCROLL_FWD, BUTTON_LEFT); // rb->sprintf(str, "total_lines: %d", ctx.total_lines); // rb->splash( HZ, str); // rb->sprintf(str, "display_lines: %d", ctx.display_lines); // rb->splash( HZ, str); // rb->splash( HZ, "after help_init()"); int fd = rb->open("/help_text.txt", O_WRONLY|O_CREAT); rb->write(fd, ctx.help_text, rb->strlen(ctx.help_text)); rb->close(fd); // rb->splash( HZ, "before help_show()"); help_show(&ctx); // rb->splash( HZ, "after help_show()"); return PLUGIN_OK; }