Browse Source

add sounds and cries to the detail screen, resolves #20

SBird1337 6 years ago
parent
commit
40ba785dc4
1 changed files with 10 additions and 3 deletions
  1. 10
    3
      src/pokedex/pokedex_detail.c

+ 10
- 3
src/pokedex/pokedex_detail.c View File

265
 }
265
 }
266
 
266
 
267
 void dexdetail_loop(u8 tid) {
267
 void dexdetail_loop(u8 tid) {
268
-    (void)tid;
268
+    u16 currentIndex = pokedex_context->cursor_position_top + pokedex_context->cursor_position_internal;
269
     switch (pokedex_context->state) {
269
     switch (pokedex_context->state) {
270
     case 0:
270
     case 0:
271
         bgid_send_tilemap(2);
271
         bgid_send_tilemap(2);
272
-        u16 currentIndex = pokedex_context->cursor_position_top + pokedex_context->cursor_position_internal;
273
         dexdetail_load_form_arrows();
272
         dexdetail_load_form_arrows();
274
         dexdetail_load_pokemon(currentIndex, NORMAL);
273
         dexdetail_load_pokemon(currentIndex, NORMAL);
275
         pokedex_context->detail_form_position = 0;
274
         pokedex_context->detail_form_position = 0;
297
         pokedex_context->state++;
296
         pokedex_context->state++;
298
         break;
297
         break;
299
     case 2:
298
     case 2:
299
+        if (!pal_fade_control.active) {
300
+            pokecry_play(pdex_lazy_lookup_entry(currentIndex)->species, 0);
301
+            pokedex_context->state++;
302
+        }
303
+        break;
304
+    case 3:
300
         switch (super.buttons_new) {
305
         switch (super.buttons_new) {
301
         case KEY_B:
306
         case KEY_B:
302
             pokedex_context->state = 12;
307
             pokedex_context->state = 12;
308
                 pokedex_context->cursor_position_top = PDEX_LAST_SHOWN - 7;
313
                 pokedex_context->cursor_position_top = PDEX_LAST_SHOWN - 7;
309
                 pokedex_context->cursor_position_internal = (dexindex - pokedex_context->cursor_position_top);
314
                 pokedex_context->cursor_position_internal = (dexindex - pokedex_context->cursor_position_top);
310
             }
315
             }
311
-
316
+            m4aSongNumStart(601);
312
             fade_screen(0xFFFFFFFF, PDEX_FADEIN_SPD, 0, 16, 0x0000);
317
             fade_screen(0xFFFFFFFF, PDEX_FADEIN_SPD, 0, 16, 0x0000);
313
             break;
318
             break;
314
         case KEY_LEFT:
319
         case KEY_LEFT:
323
                 dexdetail_update_form(pokedex_context->detail_form_position);
328
                 dexdetail_update_form(pokedex_context->detail_form_position);
324
             }
329
             }
325
             break;
330
             break;
331
+        case KEY_START:
332
+            pokecry_play(pdex_lazy_lookup_entry(currentIndex)->species, 0);
326
         }
333
         }
327
         break;
334
         break;
328
     case 12:
335
     case 12: