flip_world.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. // Define the submenu items for our FlipWorld application
  16. typedef enum
  17. {
  18. FlipWorldSubmenuIndexRun, // Click to run the FlipWorld application
  19. FlipWorldSubmenuIndexAbout,
  20. FlipWorldSubmenuIndexSettings,
  21. FlipWorldSubmenuIndexWiFiSettings,
  22. FlipWorldSubmenuIndexGameSettings,
  23. FlipWorldSubmenuIndexUserSettings,
  24. } FlipWorldSubmenuIndex;
  25. // Define a single view for our FlipWorld application
  26. typedef enum
  27. {
  28. FlipWorldViewMain, // The main screen
  29. FlipWorldViewSubmenu, // The submenu
  30. FlipWorldViewAbout, // The about screen
  31. FlipWorldViewSettings, // The settings screen
  32. FlipWorldViewVariableItemList, // The variable item list screen
  33. FlipWorldViewTextInput, // The text input screen
  34. } FlipWorldView;
  35. // Define a custom event for our FlipWorld application
  36. typedef enum
  37. {
  38. FlipWorldCustomEventPlay, // Play the game
  39. } FlipWorldCustomEvent;
  40. // Each screen will have its own view
  41. typedef struct
  42. {
  43. // necessary
  44. ViewDispatcher *view_dispatcher; // Switches between our views
  45. View *view_main; // The game screen
  46. View *view_about; // The about screen
  47. Submenu *submenu; // The submenu
  48. Submenu *submenu_settings; // The settings submenu
  49. VariableItemList *variable_item_list; // The variable item list (settngs)
  50. VariableItem *variable_item_wifi_ssid; // The variable item for WiFi SSID
  51. VariableItem *variable_item_wifi_pass; // The variable item for WiFi password
  52. //
  53. VariableItem *variable_item_game_fps; // The variable item for Game FPS
  54. //
  55. VariableItem *variable_item_user_username; // The variable item for the User username
  56. VariableItem *variable_item_user_password; // The variable item for the User password
  57. UART_TextInput *text_input; // The text input
  58. char *text_input_buffer; // Buffer for the text input
  59. char *text_input_temp_buffer; // Temporary buffer for the text input
  60. uint32_t text_input_buffer_size; // Size of the text input buffer
  61. } FlipWorldApp;
  62. extern char *game_fps_choices[];
  63. extern char *game_fps; // The game FPS
  64. // TODO - Add Download world function and download world pack button