flip_world.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #pragma once
  2. #include <font/font.h>
  3. #include <flipper_http/flipper_http.h>
  4. #include <easy_flipper/easy_flipper.h>
  5. #include <furi.h>
  6. #include <furi_hal.h>
  7. #include <gui/gui.h>
  8. #include <gui/view.h>
  9. #include <gui/modules/submenu.h>
  10. #include <gui/view_dispatcher.h>
  11. #include <notification/notification.h>
  12. #include <dialogs/dialogs.h>
  13. #define TAG "FlipWorld"
  14. #define VERSION_TAG "FlipWorld v0.1"
  15. // Screen size
  16. #define SCREEN_WIDTH 128
  17. #define SCREEN_HEIGHT 64
  18. // World size (3x3)
  19. #define WORLD_WIDTH 384
  20. #define WORLD_HEIGHT 192
  21. // Define the submenu items for our FlipWorld application
  22. typedef enum
  23. {
  24. FlipWorldSubmenuIndexRun, // Click to run the FlipWorld application
  25. FlipWorldSubmenuIndexAbout,
  26. FlipWorldSubmenuIndexSettings,
  27. } FlipWorldSubmenuIndex;
  28. // Define a single view for our FlipWorld application
  29. typedef enum
  30. {
  31. FlipWorldViewMain, // The main screen
  32. FlipWorldViewSubmenu, // The submenu
  33. FlipWorldViewAbout, // The about screen
  34. FlipWorldViewSettings, // The settings screen
  35. FlipWorldViewTextInput, // The text input screen
  36. } FlipWorldView;
  37. // Define a custom event for our FlipWorld application
  38. typedef enum
  39. {
  40. FlipWorldCustomEventPlay, // Play the game
  41. } FlipWorldCustomEvent;
  42. // Each screen will have its own view
  43. typedef struct
  44. {
  45. // necessary
  46. ViewDispatcher *view_dispatcher; // Switches between our views
  47. View *view_main; // The game screen
  48. View *view_about; // The about screen
  49. Submenu *submenu; // The submenu
  50. VariableItemList *variable_item_list; // The variable item list (settngs)
  51. VariableItem *variable_item_ssid; // The variable item
  52. VariableItem *variable_item_pass; // The variable item
  53. UART_TextInput *text_input; // The text input
  54. char *text_input_buffer; // Buffer for the text input
  55. char *text_input_temp_buffer; // Temporary buffer for the text input
  56. uint32_t text_input_buffer_size; // Size of the text input buffer
  57. } FlipWorldApp;
  58. // TODO - Add Download world function and download world pack button