flip_world.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 0.2
  15. #define VERSION_TAG "FlipWorld v0.2"
  16. // Define the submenu items for our FlipWorld application
  17. typedef enum
  18. {
  19. FlipWorldSubmenuIndexRun, // Click to run the FlipWorld application
  20. FlipWorldSubmenuIndexAbout,
  21. FlipWorldSubmenuIndexSettings,
  22. FlipWorldSubmenuIndexWiFiSettings,
  23. FlipWorldSubmenuIndexGameSettings,
  24. FlipWorldSubmenuIndexUserSettings,
  25. } FlipWorldSubmenuIndex;
  26. // Define a single view for our FlipWorld application
  27. typedef enum
  28. {
  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. //
  35. FlipWorldViewWidgetResult, // The text box that displays the random fact
  36. FlipWorldViewLoader, // The loader screen retrieves data from the internet
  37. } FlipWorldView;
  38. // Define a custom event for our FlipWorld application
  39. typedef enum
  40. {
  41. FlipWorldCustomEventProcess,
  42. FlipWorldCustomEventPlay, // Play the game
  43. } FlipWorldCustomEvent;
  44. // Each screen will have its own view
  45. typedef struct
  46. {
  47. View *view_loader;
  48. Widget *widget_result;
  49. //
  50. ViewDispatcher *view_dispatcher; // Switches between our views
  51. View *view_about; // The about screen
  52. Submenu *submenu; // The submenu
  53. Submenu *submenu_settings; // The settings submenu
  54. VariableItemList *variable_item_list; // The variable item list (settngs)
  55. VariableItem *variable_item_wifi_ssid; // The variable item for WiFi SSID
  56. VariableItem *variable_item_wifi_pass; // The variable item for WiFi password
  57. //
  58. VariableItem *variable_item_game_fps; // The variable item for Game FPS
  59. VariableItem *variable_item_game_screen_always_on; // The variable item for Screen always on
  60. VariableItem *variable_item_game_download_world; // The variable item for Download world
  61. //
  62. VariableItem *variable_item_user_username; // The variable item for the User username
  63. VariableItem *variable_item_user_password; // The variable item for the User password
  64. UART_TextInput *text_input; // The text input
  65. char *text_input_buffer; // Buffer for the text input
  66. char *text_input_temp_buffer; // Temporary buffer for the text input
  67. uint32_t text_input_buffer_size; // Size of the text input buffer
  68. } FlipWorldApp;
  69. extern char *game_fps_choices[];
  70. extern const float game_fps_choices_2[];
  71. extern int game_fps_index;
  72. extern char *game_screen_always_on_choices[];
  73. extern int game_screen_always_on_index;
  74. extern FlipWorldApp *app_instance;
  75. extern bool player_context_loaded;