|
@@ -293,56 +293,67 @@ void subbrute_attack_view_exit(void* context) {
|
|
|
false);
|
|
false);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Thanks to the author of metronome
|
|
|
|
|
+ * @param canvas
|
|
|
|
|
+ * @param str
|
|
|
|
|
+ */
|
|
|
void elements_button_top_left(Canvas* canvas, const char* str) {
|
|
void elements_button_top_left(Canvas* canvas, const char* str) {
|
|
|
const Icon* icon = &I_ButtonUp_7x4;
|
|
const Icon* icon = &I_ButtonUp_7x4;
|
|
|
|
|
|
|
|
const uint8_t button_height = 12;
|
|
const uint8_t button_height = 12;
|
|
|
- const uint8_t vertical_offset = 9; //
|
|
|
|
|
|
|
+ const uint8_t vertical_offset = 3;
|
|
|
const uint8_t horizontal_offset = 3;
|
|
const uint8_t horizontal_offset = 3;
|
|
|
const uint8_t string_width = canvas_string_width(canvas, str);
|
|
const uint8_t string_width = canvas_string_width(canvas, str);
|
|
|
const uint8_t icon_h_offset = 3;
|
|
const uint8_t icon_h_offset = 3;
|
|
|
const uint8_t icon_width_with_offset = icon_get_width(icon) + icon_h_offset;
|
|
const uint8_t icon_width_with_offset = icon_get_width(icon) + icon_h_offset;
|
|
|
- const uint8_t icon_v_offset = icon_get_height(icon); //
|
|
|
|
|
- const uint8_t button_width = string_width + horizontal_offset * 2 + icon_width_with_offset + 1;
|
|
|
|
|
|
|
+ const uint8_t icon_v_offset = icon_get_height(icon) + vertical_offset;
|
|
|
|
|
+ const uint8_t button_width = string_width + horizontal_offset * 2 + icon_width_with_offset;
|
|
|
|
|
|
|
|
const uint8_t x = 0;
|
|
const uint8_t x = 0;
|
|
|
- const uint8_t y = 0;
|
|
|
|
|
|
|
+ const uint8_t y = 0 + button_height;
|
|
|
|
|
|
|
|
- canvas_draw_box(canvas, x, y, button_width, button_height);
|
|
|
|
|
- // canvas_draw_line(canvas, x + button_width + 0, y, x + button_width + 0, y + button_height - 0); //
|
|
|
|
|
- // canvas_draw_line(canvas, x + button_width + 1, y, x + button_width + 1, y + button_height - 1);
|
|
|
|
|
- // canvas_draw_line(canvas, x + button_width + 2, y, x + button_width + 2, y + button_height - 2);
|
|
|
|
|
|
|
+ canvas_draw_box(canvas, x, y - button_height, button_width, button_height);
|
|
|
|
|
+ canvas_draw_line(canvas, x + button_width + 0, y - button_height, x + button_width + 0, y - 1);
|
|
|
|
|
+ canvas_draw_line(canvas, x + button_width + 1, y - button_height, x + button_width + 1, y - 2);
|
|
|
|
|
+ canvas_draw_line(canvas, x + button_width + 2, y - button_height, x + button_width + 2, y - 3);
|
|
|
|
|
|
|
|
canvas_invert_color(canvas);
|
|
canvas_invert_color(canvas);
|
|
|
- canvas_draw_icon(canvas, x + horizontal_offset, y + icon_v_offset, icon);
|
|
|
|
|
|
|
+ canvas_draw_icon(canvas, x + horizontal_offset, y - icon_v_offset, icon);
|
|
|
canvas_draw_str(
|
|
canvas_draw_str(
|
|
|
- canvas, x + horizontal_offset + icon_width_with_offset, y + vertical_offset, str);
|
|
|
|
|
|
|
+ canvas, x + horizontal_offset + icon_width_with_offset, y - vertical_offset, str);
|
|
|
canvas_invert_color(canvas);
|
|
canvas_invert_color(canvas);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * Thanks to the author of metronome
|
|
|
|
|
+ * @param canvas
|
|
|
|
|
+ * @param str
|
|
|
|
|
+ */
|
|
|
void elements_button_top_right(Canvas* canvas, const char* str) {
|
|
void elements_button_top_right(Canvas* canvas, const char* str) {
|
|
|
const Icon* icon = &I_ButtonDown_7x4;
|
|
const Icon* icon = &I_ButtonDown_7x4;
|
|
|
|
|
|
|
|
const uint8_t button_height = 12;
|
|
const uint8_t button_height = 12;
|
|
|
- const uint8_t vertical_offset = 9;
|
|
|
|
|
|
|
+ const uint8_t vertical_offset = 3;
|
|
|
const uint8_t horizontal_offset = 3;
|
|
const uint8_t horizontal_offset = 3;
|
|
|
const uint8_t string_width = canvas_string_width(canvas, str);
|
|
const uint8_t string_width = canvas_string_width(canvas, str);
|
|
|
const uint8_t icon_h_offset = 3;
|
|
const uint8_t icon_h_offset = 3;
|
|
|
const uint8_t icon_width_with_offset = icon_get_width(icon) + icon_h_offset;
|
|
const uint8_t icon_width_with_offset = icon_get_width(icon) + icon_h_offset;
|
|
|
- const uint8_t icon_v_offset = icon_get_height(icon); // + vertical_offset;
|
|
|
|
|
- const uint8_t button_width = string_width + horizontal_offset * 2 + icon_width_with_offset + 1;
|
|
|
|
|
|
|
+ const uint8_t icon_v_offset = icon_get_height(icon) + vertical_offset + 1;
|
|
|
|
|
+ const uint8_t button_width = string_width + horizontal_offset * 2 + icon_width_with_offset;
|
|
|
|
|
|
|
|
const uint8_t x = canvas_width(canvas);
|
|
const uint8_t x = canvas_width(canvas);
|
|
|
- const uint8_t y = 0;
|
|
|
|
|
|
|
+ const uint8_t y = 0 + button_height;
|
|
|
|
|
|
|
|
- canvas_draw_box(canvas, x - button_width, y, button_width, button_height);
|
|
|
|
|
- // canvas_draw_line(canvas, x - button_width - 1, y, x + button_width - 1, y + button_height - 0);
|
|
|
|
|
- // canvas_draw_line(canvas, x - button_width - 2, y, x + button_width - 2, y + button_height - 1);
|
|
|
|
|
- // canvas_draw_line(canvas, x - button_width - 3, y, x + button_width - 3, y + button_height - 2);
|
|
|
|
|
|
|
+ canvas_draw_box(canvas, x - button_width, y - button_height, button_width, button_height);
|
|
|
|
|
+ canvas_draw_line(canvas, x - button_width - 1, y - button_height, x - button_width - 1, y - 1);
|
|
|
|
|
+ canvas_draw_line(canvas, x - button_width - 2, y - button_height, x - button_width - 2, y - 2);
|
|
|
|
|
+ canvas_draw_line(canvas, x - button_width - 3, y - button_height, x - button_width - 3, y - 3);
|
|
|
|
|
|
|
|
canvas_invert_color(canvas);
|
|
canvas_invert_color(canvas);
|
|
|
- canvas_draw_str(canvas, x - button_width + horizontal_offset, y + vertical_offset, str);
|
|
|
|
|
- canvas_draw_icon(canvas, x - horizontal_offset - icon_get_width(icon), y + icon_v_offset, icon);
|
|
|
|
|
|
|
+ canvas_draw_str(canvas, x - button_width + horizontal_offset, y - vertical_offset, str);
|
|
|
|
|
+ canvas_draw_icon(
|
|
|
|
|
+ canvas, x - horizontal_offset - icon_get_width(icon), y - icon_v_offset, icon);
|
|
|
canvas_invert_color(canvas);
|
|
canvas_invert_color(canvas);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -381,7 +392,8 @@ void subbrute_attack_view_draw(Canvas* canvas, void* context) {
|
|
|
}
|
|
}
|
|
|
// canvas_draw_icon_animation
|
|
// canvas_draw_icon_animation
|
|
|
const uint8_t icon_h_offset = 0;
|
|
const uint8_t icon_h_offset = 0;
|
|
|
- const uint8_t icon_width_with_offset = icon_animation_get_width(model->icon) + icon_h_offset;
|
|
|
|
|
|
|
+ const uint8_t icon_width_with_offset =
|
|
|
|
|
+ icon_animation_get_width(model->icon) + icon_h_offset;
|
|
|
const uint8_t icon_v_offset = icon_animation_get_height(model->icon); // + vertical_offset;
|
|
const uint8_t icon_v_offset = icon_animation_get_height(model->icon); // + vertical_offset;
|
|
|
const uint8_t x = canvas_width(canvas);
|
|
const uint8_t x = canvas_width(canvas);
|
|
|
const uint8_t y = canvas_height(canvas);
|
|
const uint8_t y = canvas_height(canvas);
|