mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-30 16:11:06 +01:00
fixed some songs not properly stopping and overlapping others, thanks to @Lunos for reporting
This commit is contained in:
parent
81d7986d34
commit
010c1b5d82
16
src/debug.c
16
src/debug.c
@ -22,6 +22,7 @@
|
|||||||
#include "item.h"
|
#include "item.h"
|
||||||
#include "item_icon.h"
|
#include "item_icon.h"
|
||||||
#include "list_menu.h"
|
#include "list_menu.h"
|
||||||
|
#include "m4a.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "main_menu.h"
|
#include "main_menu.h"
|
||||||
#include "malloc.h"
|
#include "malloc.h"
|
||||||
@ -2722,6 +2723,7 @@ static void DebugAction_Sound_SE(u8 taskId)
|
|||||||
gTasks[taskId].data[2] = windowId;
|
gTasks[taskId].data[2] = windowId;
|
||||||
gTasks[taskId].data[3] = 1; //Current ID
|
gTasks[taskId].data[3] = 1; //Current ID
|
||||||
gTasks[taskId].data[4] = 0; //Digit Selected
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
||||||
|
gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Last song played (for stopping)
|
||||||
}
|
}
|
||||||
static void DebugAction_Sound_SE_SelectId(u8 taskId)
|
static void DebugAction_Sound_SE_SelectId(u8 taskId)
|
||||||
{
|
{
|
||||||
@ -2761,12 +2763,14 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId)
|
|||||||
|
|
||||||
if (gMain.newKeys & A_BUTTON)
|
if (gMain.newKeys & A_BUTTON)
|
||||||
{
|
{
|
||||||
PlaySE(gTasks[taskId].data[3]);
|
m4aSongNumStop(gTasks[taskId].data[5]);
|
||||||
|
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
||||||
|
m4aSongNumStart(gTasks[taskId].data[3]);
|
||||||
}
|
}
|
||||||
else if (gMain.newKeys & B_BUTTON)
|
else if (gMain.newKeys & B_BUTTON)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
MapMusicMain();
|
m4aSongNumStop(gTasks[taskId].data[5]);
|
||||||
DebugAction_DestroyExtraWindow(taskId);
|
DebugAction_DestroyExtraWindow(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2798,6 +2802,7 @@ static void DebugAction_Sound_MUS(u8 taskId)
|
|||||||
gTasks[taskId].data[2] = windowId;
|
gTasks[taskId].data[2] = windowId;
|
||||||
gTasks[taskId].data[3] = START_MUS; //Current ID
|
gTasks[taskId].data[3] = START_MUS; //Current ID
|
||||||
gTasks[taskId].data[4] = 0; //Digit Selected
|
gTasks[taskId].data[4] = 0; //Digit Selected
|
||||||
|
gTasks[taskId].data[5] = gTasks[taskId].data[3]; //Last song played (for stopping)
|
||||||
}
|
}
|
||||||
static void DebugAction_Sound_MUS_SelectId(u8 taskId)
|
static void DebugAction_Sound_MUS_SelectId(u8 taskId)
|
||||||
{
|
{
|
||||||
@ -2837,13 +2842,14 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId)
|
|||||||
|
|
||||||
if (gMain.newKeys & A_BUTTON)
|
if (gMain.newKeys & A_BUTTON)
|
||||||
{
|
{
|
||||||
StopMapMusic();
|
m4aSongNumStop(gTasks[taskId].data[5]);
|
||||||
PlayNewMapMusic(gTasks[taskId].data[3]);
|
gTasks[taskId].data[5] = gTasks[taskId].data[3];
|
||||||
|
m4aSongNumStart(gTasks[taskId].data[3]);
|
||||||
}
|
}
|
||||||
else if (gMain.newKeys & B_BUTTON)
|
else if (gMain.newKeys & B_BUTTON)
|
||||||
{
|
{
|
||||||
PlaySE(SE_SELECT);
|
PlaySE(SE_SELECT);
|
||||||
MapMusicMain();
|
// m4aSongNumStop(gTasks[taskId].data[5]); //Uncomment if music should stop after leaving menu
|
||||||
DebugAction_DestroyExtraWindow(taskId);
|
DebugAction_DestroyExtraWindow(taskId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user