flip_world.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #pragma once
  2. #include <font/font.h>
  3. #include <flipper_http/flipper_http.h>
  4. #include <easy_flipper/easy_flipper.h>
  5. // added by Derek Jamison to lower memory usage
  6. #undef FURI_LOG_E
  7. #define FURI_LOG_E(tag, msg, ...)
  8. //
  9. #define TAG "FlipWorld"
  10. #define VERSION 0.3
  11. #define VERSION_TAG "FlipWorld v0.3"
  12. // Define the submenu items for our FlipWorld application
  13. typedef enum
  14. {
  15. FlipWorldSubmenuIndexRun, // Click to run the FlipWorld application
  16. FlipWorldSubmenuIndexAbout,
  17. FlipWorldSubmenuIndexSettings,
  18. FlipWorldSubmenuIndexWiFiSettings,
  19. FlipWorldSubmenuIndexGameSettings,
  20. FlipWorldSubmenuIndexUserSettings,
  21. } FlipWorldSubmenuIndex;
  22. // Define a single view for our FlipWorld application
  23. typedef enum
  24. {
  25. FlipWorldViewSubmenu, // The submenu
  26. FlipWorldViewAbout, // The about screen
  27. FlipWorldViewSettings, // The settings screen
  28. FlipWorldViewVariableItemList, // The variable item list screen
  29. FlipWorldViewTextInput, // The text input screen
  30. //
  31. FlipWorldViewWidgetResult, // The text box that displays the random fact
  32. FlipWorldViewLoader, // The loader screen retrieves data from the internet
  33. } FlipWorldView;
  34. // Define a custom event for our FlipWorld application
  35. typedef enum
  36. {
  37. FlipWorldCustomEventProcess,
  38. FlipWorldCustomEventPlay, // Play the game
  39. } FlipWorldCustomEvent;
  40. // Each screen will have its own view
  41. typedef struct
  42. {
  43. View *view_loader;
  44. Widget *widget_result;
  45. //
  46. ViewDispatcher *view_dispatcher; // Switches between our views
  47. View *view_about; // The about screen
  48. Submenu *submenu; // The submenu
  49. Submenu *submenu_settings; // The settings submenu
  50. VariableItemList *variable_item_list; // The variable item list (settngs)
  51. VariableItem *variable_item_wifi_ssid; // The variable item for WiFi SSID
  52. VariableItem *variable_item_wifi_pass; // The variable item for WiFi password
  53. //
  54. VariableItem *variable_item_game_fps; // The variable item for Game FPS
  55. VariableItem *variable_item_game_screen_always_on; // The variable item for Screen always on
  56. VariableItem *variable_item_game_download_world; // The variable item for Download world
  57. VariableItem *variable_item_game_sound_on; // The variable item for Sound on
  58. VariableItem *variable_item_game_vibration_on; // The variable item for Vibration on
  59. //
  60. VariableItem *variable_item_user_username; // The variable item for the User username
  61. VariableItem *variable_item_user_password; // The variable item for the User password
  62. UART_TextInput *text_input; // The text input
  63. char *text_input_buffer; // Buffer for the text input
  64. char *text_input_temp_buffer; // Temporary buffer for the text input
  65. uint32_t text_input_buffer_size; // Size of the text input buffer
  66. } FlipWorldApp;
  67. extern char *game_fps_choices[];
  68. extern const float game_fps_choices_2[];
  69. extern int game_fps_index;
  70. extern char *yes_or_no_choices[];
  71. extern int game_screen_always_on_index;
  72. extern int game_sound_on_index;
  73. extern int game_vibration_on_index;
  74. bool is_enough_heap(size_t heap_size);