weebo_scene_info.c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. furi_string_cat_printf(str, "ID: %04x\n", weebo_get_figure_id(weebo));
  17. text_box_set_font(weebo->text_box, TextBoxFontText);
  18. text_box_set_text(weebo->text_box, furi_string_get_cstr(weebo->text_box_store));
  19. view_dispatcher_switch_to_view(weebo->view_dispatcher, WeeboViewTextBox);
  20. }
  21. bool weebo_scene_info_on_event(void* context, SceneManagerEvent event) {
  22. Weebo* weebo = context;
  23. bool consumed = false;
  24. UNUSED(weebo);
  25. if(event.type == SceneManagerEventTypeCustom) {
  26. }
  27. return consumed;
  28. }
  29. void weebo_scene_info_on_exit(void* context) {
  30. Weebo* weebo = context;
  31. // Clear view
  32. text_box_reset(weebo->text_box);
  33. }