Kaynağa Gözat

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

SBird1337 6 yıl önce
ebeveyn
işleme
40ba785dc4
1 değiştirilmiş dosya ile 10 ekleme ve 3 silme
  1. 10
    3
      src/pokedex/pokedex_detail.c

+ 10
- 3
src/pokedex/pokedex_detail.c Dosyayı Görüntüle

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