8
8
9
9
typedef struct {
10
10
int mode ;
11
+ int animation ;
11
12
FuriMutex * mutex ;
12
13
} PluginState ;
13
14
15
+ void render_awake (Canvas * canvas , void * ctx ) {
16
+ const PluginState * plugin_state = ctx ;
17
+ if (plugin_state -> animation == 0 ) {
18
+ canvas_draw_icon (canvas , 30 , 5 , & I_eye_1_18x14 );
19
+ canvas_draw_icon (canvas , 32 , 40 , & I_fin_1_20x21 );
20
+ canvas_draw_icon (canvas , 1 , 6 , & I_nose_1_28x18 );
21
+ } else if (plugin_state -> animation == 1 ) {
22
+ canvas_draw_icon (canvas , 30 , 5 , & I_eye_2_18x14 );
23
+ canvas_draw_icon (canvas , 32 , 40 , & I_fin_2_20x21 );
24
+ canvas_draw_icon (canvas , 1 , 6 , & I_nose_2_28x18 );
25
+ } else if (plugin_state -> animation == 2 ) {
26
+ canvas_draw_icon (canvas , 30 , 5 , & I_eye_3_18x14 );
27
+ canvas_draw_icon (canvas , 32 , 40 , & I_fin_3_20x21 );
28
+ canvas_draw_icon (canvas , 1 , 6 , & I_nose_3_28x18 );
29
+ }
30
+ }
31
+
14
32
void vibro_draw_callback (Canvas * canvas , void * ctx ) {
15
33
furi_assert (ctx );
16
34
const PluginState * plugin_state = ctx ;
@@ -30,36 +48,41 @@ void vibro_draw_callback(Canvas* canvas, void* ctx) {
30
48
canvas_draw_icon (canvas , 38 , 24 , & I_center_7x7 );
31
49
furi_mutex_release (plugin_state -> mutex );
32
50
33
- if (plugin_state -> mode == 0 ) {
51
+ if (plugin_state -> mode == 0 ){
52
+ canvas_draw_icon (canvas , 30 , 5 , & I_eye_closed_18x14 );
34
53
canvas_draw_box (canvas , 36 , 23 , 15 , 18 );
35
54
canvas_invert_color (canvas );
36
55
canvas_draw_str (canvas , 38 , 39 , "Off" );
37
56
canvas_draw_icon (canvas , 38 , 24 , & I_center_7x7 );
38
57
canvas_invert_color (canvas );
39
- } else if (plugin_state -> mode == 1 ) {
58
+ } else if (plugin_state -> mode == 1 ){
40
59
canvas_draw_box (canvas , 55 , 36 , 36 , 10 );
41
60
canvas_invert_color (canvas );
42
61
canvas_draw_str (canvas , 61 , 44 , "Strong" );
43
62
canvas_draw_icon (canvas , 56 , 37 , & I_left_4x7 );
44
63
canvas_invert_color (canvas );
45
- } else if (plugin_state -> mode == 2 ) {
64
+ render_awake (canvas , ctx );
65
+ } else if (plugin_state -> mode == 2 ){
46
66
canvas_draw_box (canvas , 74 , 20 , 30 , 16 );
47
67
canvas_invert_color (canvas );
48
68
canvas_draw_str (canvas , 76 , 33 , "Pulsed" );
49
69
canvas_draw_icon (canvas , 85 , 21 , & I_up_7x4 );
50
70
canvas_invert_color (canvas );
51
- } else if (plugin_state -> mode == 3 ) {
71
+ render_awake (canvas , ctx );
72
+ } else if (plugin_state -> mode == 3 ){
52
73
canvas_draw_box (canvas , 95 , 36 , 28 , 10 );
53
74
canvas_invert_color (canvas );
54
75
canvas_draw_str (canvas , 97 , 44 , "Soft" );
55
76
canvas_draw_icon (canvas , 117 , 37 , & I_right_4x7 );
56
77
canvas_invert_color (canvas );
57
- } else if (plugin_state -> mode == 4 ) {
78
+ render_awake (canvas , ctx );
79
+ } else if (plugin_state -> mode == 4 ){
58
80
canvas_draw_box (canvas , 74 , 47 , 32 , 16 );
59
81
canvas_invert_color (canvas );
60
82
canvas_draw_str (canvas , 76 , 56 , "Combo" );
61
83
canvas_draw_icon (canvas , 85 , 57 , & I_down_7x4 );
62
84
canvas_invert_color (canvas );
85
+ render_awake (canvas , ctx );
63
86
}
64
87
}
65
88
@@ -99,7 +122,11 @@ int32_t orgasmotron_app(void* p) {
99
122
InputEvent event ;
100
123
bool processing = true;
101
124
notification_message (notification , & sequence_display_backlight_on );
125
+ plugin_state -> animation = 0 ;
102
126
while (processing ) {
127
+ if (plugin_state -> animation > 2 ) {
128
+ plugin_state -> animation = 0 ;
129
+ }
103
130
FuriStatus event_status = furi_message_queue_get (event_queue , & event , 100 );
104
131
furi_mutex_acquire (plugin_state -> mutex , FuriWaitForever );
105
132
if (event_status == FuriStatusOk ) {
@@ -114,6 +141,7 @@ int32_t orgasmotron_app(void* p) {
114
141
if (event .key == InputKeyOk &&
115
142
(event .type == InputTypePress || event .type == InputTypeRelease )) {
116
143
plugin_state -> mode = 0 ;
144
+ plugin_state -> animation = 0 ;
117
145
}
118
146
if (event .key == InputKeyLeft &&
119
147
(event .type == InputTypePress || event .type == InputTypeRelease )) {
@@ -141,18 +169,21 @@ int32_t orgasmotron_app(void* p) {
141
169
//Full power
142
170
notification_message (notification , & sequence_set_vibro_on );
143
171
notification_message (notification , & sequence_set_green_255 );
172
+ plugin_state -> animation ++ ;
144
173
} else if (plugin_state -> mode == 2 ) {
145
174
//Pulsed Vibration
146
175
notification_message (notification , & sequence_set_vibro_on );
147
176
notification_message (notification , & sequence_set_red_255 );
148
177
delay (100 );
149
178
notification_message (notification , & sequence_reset_vibro );
179
+ plugin_state -> animation ++ ;
150
180
} else if (plugin_state -> mode == 3 ) {
151
181
//Soft power
152
182
notification_message (notification , & sequence_set_vibro_on );
153
183
notification_message (notification , & sequence_set_blue_255 );
154
184
delay (50 );
155
185
notification_message (notification , & sequence_reset_vibro );
186
+ plugin_state -> animation ++ ;
156
187
} else if (plugin_state -> mode == 4 ) {
157
188
//Special Sequence
158
189
notification_message (notification , & sequence_solid_yellow );
@@ -168,6 +199,7 @@ int32_t orgasmotron_app(void* p) {
168
199
notification_message (notification , & sequence_reset_vibro );
169
200
delay (50 );
170
201
}
202
+ plugin_state -> animation ++ ;
171
203
}
172
204
furi_mutex_release (plugin_state -> mutex );
173
205
}
0 commit comments