uart_terminal_scene_help.c 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #include "../uart_terminal_app_i.h"
  2. void uart_terminal_scene_help_widget_callback(GuiButtonType result, InputType type, void* context) {
  3. UART_TerminalApp* app = context;
  4. if(type == InputTypeShort) {
  5. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  6. }
  7. }
  8. void uart_terminal_scene_help_on_enter(void* context) {
  9. UART_TerminalApp* app = context;
  10. FuriString* temp_str;
  11. temp_str = furi_string_alloc();
  12. furi_string_printf(temp_str, "\nUART terminal for Flipper\n\nI'm in github: cool4uma\n\nThis app is a modified\nWiFi Marauder companion,\nThanks 0xchocolate(github)\nfor great code and app.\n\n");
  13. furi_string_cat_printf( temp_str, "Press BACK to return\n");
  14. widget_add_text_box_element(
  15. app->widget,
  16. 0,
  17. 0,
  18. 128,
  19. 14,
  20. AlignCenter,
  21. AlignBottom,
  22. "\e#\e! \e!\n",
  23. false);
  24. widget_add_text_box_element(
  25. app->widget,
  26. 0,
  27. 2,
  28. 128,
  29. 14,
  30. AlignCenter,
  31. AlignBottom,
  32. "\e#\e! UART Terminal \e!\n",
  33. false);
  34. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  35. furi_string_free(temp_str);
  36. view_dispatcher_switch_to_view(app->view_dispatcher, UART_TerminalAppViewHelp);
  37. }
  38. bool uart_terminal_scene_help_on_event(void* context, SceneManagerEvent event) {
  39. UART_TerminalApp* app = context;
  40. bool consumed = false;
  41. UNUSED(app);
  42. UNUSED(event);
  43. return consumed;
  44. }
  45. void uart_terminal_scene_help_on_exit(void* context) {
  46. UART_TerminalApp* app = context;
  47. // Clear views
  48. widget_reset(app->widget);
  49. }