weebo_scene_info.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "../weebo_i.h"
  2. #include <dolphin/dolphin.h>
  3. #define TAG "WeeboSceneInfo"
  4. void weebo_scene_info_on_enter(void* context) {
  5. Weebo* weebo = context;
  6. furi_string_reset(weebo->text_box_store);
  7. FuriString* str = weebo->text_box_store;
  8. FuriString* name = furi_string_alloc();
  9. furi_string_cat_printf(str, "Info:\n");
  10. if(weebo_get_figure_name(weebo, name)) {
  11. furi_string_cat_printf(str, "%s\n", furi_string_get_cstr(name));
  12. } else {
  13. furi_string_cat_printf(str, "Unknown\n");
  14. }
  15. furi_string_free(name);
  16. text_box_set_font(weebo->text_box, TextBoxFontText);
  17. text_box_set_text(weebo->text_box, furi_string_get_cstr(weebo->text_box_store));
  18. view_dispatcher_switch_to_view(weebo->view_dispatcher, WeeboViewTextBox);
  19. }
  20. bool weebo_scene_info_on_event(void* context, SceneManagerEvent event) {
  21. Weebo* weebo = context;
  22. bool consumed = false;
  23. UNUSED(weebo);
  24. if(event.type == SceneManagerEventTypeCustom) {
  25. }
  26. return consumed;
  27. }
  28. void weebo_scene_info_on_exit(void* context) {
  29. Weebo* weebo = context;
  30. // Clear view
  31. text_box_reset(weebo->text_box);
  32. }