Added debug key for toggling action sounds off. Touches every place that RageSound::Play is called, hope I didn't miss one.

This commit is contained in:
Kyzentun
2015-02-28 06:25:02 -07:00
parent d35933f1e5
commit b293a8c073
38 changed files with 165 additions and 131 deletions
+28 -3
View File
@@ -52,6 +52,8 @@ static const ThemeMetric<float> PAGE_SPACING_X ("ScreenDebugOverlay", "PageSpac
// We don't use SubscriptionManager, because we want to keep the line order.
static LocalizedString ON ( "ScreenDebugOverlay", "on" );
static LocalizedString OFF ( "ScreenDebugOverlay", "off" );
static LocalizedString MUTE_ACTIONS_ON ("ScreenDebugOverlay", "Mute actions on");
static LocalizedString MUTE_ACTIONS_OFF ("ScreenDebugOverlay", "Mute actions off");
class IDebugLine;
static vector<IDebugLine*> *g_pvpSubscribers = NULL;
@@ -113,6 +115,7 @@ struct MapDebugToDI
DeviceInput holdForDebug2;
DeviceInput holdForSlow;
DeviceInput holdForFast;
DeviceInput toggleMute;
DeviceInput debugButton[MAX_DEBUG_LINES];
DeviceInput gameplayButton[MAX_DEBUG_LINES];
map<DeviceInput, int> pageButton;
@@ -122,6 +125,7 @@ struct MapDebugToDI
holdForDebug2.MakeInvalid();
holdForSlow.MakeInvalid();
holdForFast.MakeInvalid();
toggleMute.MakeInvalid();
for( int i=0; i<MAX_DEBUG_LINES; i++ )
{
debugButton[i].MakeInvalid();
@@ -176,6 +180,7 @@ void ScreenDebugOverlay::Init()
g_Mappings.holdForDebug2.MakeInvalid();
g_Mappings.holdForSlow = DeviceInput(DEVICE_KEYBOARD, KEY_ACCENT);
g_Mappings.holdForFast = DeviceInput(DEVICE_KEYBOARD, KEY_TAB);
g_Mappings.toggleMute = DeviceInput(DEVICE_KEYBOARD, KEY_PAUSE);
/* TODO: Find a better way of indicating which option is which here.
* Maybe we should take a page from ScreenEdit's menus and make
@@ -206,9 +211,9 @@ void ScreenDebugOverlay::Init()
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_Ci);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_Co);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_Cp);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_UP);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_DOWN);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_BACK);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_Ca);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_Cs);
g_Mappings.debugButton[i++] = DeviceInput(DEVICE_KEYBOARD, KEY_Cd);
g_Mappings.pageButton[DeviceInput(DEVICE_KEYBOARD, KEY_F5)] = 0;
g_Mappings.pageButton[DeviceInput(DEVICE_KEYBOARD, KEY_F6)] = 1;
g_Mappings.pageButton[DeviceInput(DEVICE_KEYBOARD, KEY_F7)] = 2;
@@ -438,6 +443,11 @@ bool ScreenDebugOverlay::Input( const InputEventPlus &input )
else
g_bIsDisplayed = false;
}
if(input.DeviceI == g_Mappings.toggleMute)
{
PREFSMAN->m_MuteActions.Set(!PREFSMAN->m_MuteActions);
SCREENMAN->SystemMessage(PREFSMAN->m_MuteActions ? MUTE_ACTIONS_ON.GetValue() : MUTE_ACTIONS_OFF.GetValue());
}
int iPage = 0;
if( g_bIsDisplayed && GetValueFromMap(g_Mappings.pageButton, input.DeviceI, iPage) )
@@ -546,6 +556,7 @@ static LocalizedString CLEAR_PROFILE_STATS ( "ScreenDebugOverlay", "Clear Profil
static LocalizedString FILL_PROFILE_STATS ( "ScreenDebugOverlay", "Fill Profile Stats" );
static LocalizedString SEND_NOTES_ENDED ( "ScreenDebugOverlay", "Send Notes Ended" );
static LocalizedString RESET_KEY_MAP ("ScreenDebugOverlay", "Reset key mapping to default");
static LocalizedString MUTE_ACTIONS ("ScreenDebugOverlay", "Mute actions");
static LocalizedString RELOAD ( "ScreenDebugOverlay", "Reload" );
static LocalizedString RESTART ( "ScreenDebugOverlay", "Restart" );
static LocalizedString SCREEN_ON ( "ScreenDebugOverlay", "Send On To Screen" );
@@ -967,6 +978,19 @@ class DebugLineResetKeyMapping : public IDebugLine
}
};
class DebugLineMuteActions : public IDebugLine
{
virtual RString GetDisplayTitle() { return MUTE_ACTIONS.GetValue(); }
virtual RString GetDisplayValue() { return RString(); }
virtual bool IsEnabled() { return PREFSMAN->m_MuteActions; }
virtual void DoAndLog( RString &sMessageOut )
{
PREFSMAN->m_MuteActions.Set(!PREFSMAN->m_MuteActions);
SCREENMAN->SystemMessage(PREFSMAN->m_MuteActions ? MUTE_ACTIONS_ON.GetValue() : MUTE_ACTIONS_OFF.GetValue());
IDebugLine::DoAndLog( sMessageOut );
}
};
class DebugLineReloadCurrentScreen : public IDebugLine
{
virtual RString GetDisplayTitle() { return RELOAD.GetValue(); }
@@ -1288,6 +1312,7 @@ DECLARE_ONE( DebugLineVisualDelayUp );
DECLARE_ONE( DebugLineForceCrash );
DECLARE_ONE( DebugLineUptime );
DECLARE_ONE( DebugLineResetKeyMapping );
DECLARE_ONE( DebugLineMuteActions );
/*