2002-09-10 09:10:36 +00:00
|
|
|
#include "stdafx.h"
|
|
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: ScreenInputOptions
|
|
|
|
|
|
|
|
|
|
Desc: See header.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenInputOptions.h"
|
|
|
|
|
#include "RageTextureManager.h"
|
|
|
|
|
#include "RageUtil.h"
|
2003-01-02 07:54:28 +00:00
|
|
|
#include "RageSoundManager.h"
|
2002-09-10 09:10:36 +00:00
|
|
|
#include "ScreenManager.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "GameConstantsAndTypes.h"
|
|
|
|
|
#include "StepMania.h"
|
|
|
|
|
#include "PrefsManager.h"
|
|
|
|
|
#include "RageLog.h"
|
2002-11-11 04:53:31 +00:00
|
|
|
#include "ThemeManager.h"
|
2002-09-10 09:10:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
enum {
|
|
|
|
|
IO_IGNORE_AXES = 0,
|
|
|
|
|
IO_DEDICATED_MENU_BUTTONS,
|
|
|
|
|
IO_AUTOPLAY,
|
|
|
|
|
IO_DELAYED_ESCAPE,
|
|
|
|
|
IO_OPTIONS_NAVIGATION,
|
2003-01-21 07:04:53 +00:00
|
|
|
IO_WHEEL_SPEED,
|
2002-09-10 09:10:36 +00:00
|
|
|
NUM_INPUT_OPTIONS_LINES
|
|
|
|
|
};
|
2002-09-10 21:16:34 +00:00
|
|
|
|
2003-01-21 21:38:59 +00:00
|
|
|
/* Hmm. Ignore JoyAxes and Back Delayed probably belong in "key/joy config",
|
2002-09-10 09:10:36 +00:00
|
|
|
* preferably alongside button configuration. */
|
|
|
|
|
OptionRowData g_InputOptionsLines[NUM_INPUT_OPTIONS_LINES] = {
|
2002-09-10 21:16:34 +00:00
|
|
|
{ "Ignore\nJoy Axes", 2, {"OFF","ON (for NTPad or DirectPad)"} },
|
2002-09-10 09:10:36 +00:00
|
|
|
{ "Menu\nButtons", 2, {"USE GAMEPLAY BUTTONS","ONLY DEDICATED BUTTONS"} },
|
|
|
|
|
{ "AutoPlay", 2, {"OFF","ON"} },
|
|
|
|
|
{ "Back\nDelayed", 2, {"INSTANT","HOLD"} },
|
|
|
|
|
{ "Options\nNavigation",2, {"SM STYLE","ARCADE STYLE"} },
|
2003-01-21 07:04:53 +00:00
|
|
|
{ "Wheel\nSpeed", 4, {"SLOW","NORMAL","FAST","REALLY FAST"} },
|
2002-09-10 09:10:36 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ScreenInputOptions::ScreenInputOptions() :
|
|
|
|
|
ScreenOptions(
|
2002-09-23 07:35:47 +00:00
|
|
|
THEME->GetPathTo("BGAnimations","input options"),
|
2002-09-10 09:10:36 +00:00
|
|
|
THEME->GetPathTo("Graphics","input options page"),
|
|
|
|
|
THEME->GetPathTo("Graphics","input options top edge")
|
|
|
|
|
)
|
|
|
|
|
{
|
|
|
|
|
LOG->Trace( "ScreenInputOptions::ScreenInputOptions()" );
|
|
|
|
|
|
2002-09-10 21:16:34 +00:00
|
|
|
// fill g_InputOptionsLines with explanation text
|
|
|
|
|
for( int i=0; i<NUM_INPUT_OPTIONS_LINES; i++ )
|
|
|
|
|
{
|
|
|
|
|
CString sLineName = g_InputOptionsLines[i].szTitle;
|
|
|
|
|
sLineName.Replace("\n","");
|
|
|
|
|
sLineName.Replace(" ","");
|
|
|
|
|
strcpy( g_InputOptionsLines[i].szExplanation, THEME->GetMetric("ScreenInputOptions",sLineName) );
|
|
|
|
|
}
|
|
|
|
|
|
2002-09-10 09:10:36 +00:00
|
|
|
Init(
|
|
|
|
|
INPUTMODE_BOTH,
|
|
|
|
|
g_InputOptionsLines,
|
|
|
|
|
NUM_INPUT_OPTIONS_LINES,
|
|
|
|
|
false );
|
|
|
|
|
m_Menu.StopTimer();
|
|
|
|
|
|
2003-01-02 07:39:58 +00:00
|
|
|
SOUNDMAN->PlayMusic( THEME->GetPathTo("Sounds","input options music") );
|
2002-09-10 09:10:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenInputOptions::ImportOptions()
|
|
|
|
|
{
|
|
|
|
|
m_iSelectedOption[0][IO_IGNORE_AXES] = PREFSMAN->m_bIgnoreJoyAxes ? 1:0;
|
|
|
|
|
m_iSelectedOption[0][IO_DEDICATED_MENU_BUTTONS] = PREFSMAN->m_bOnlyDedicatedMenuButtons ? 1:0;
|
|
|
|
|
m_iSelectedOption[0][IO_AUTOPLAY] = PREFSMAN->m_bAutoPlay;
|
|
|
|
|
m_iSelectedOption[0][IO_DELAYED_ESCAPE] = PREFSMAN->m_bDelayedEscape ? 1:0;
|
|
|
|
|
m_iSelectedOption[0][IO_OPTIONS_NAVIGATION] = PREFSMAN->m_bArcadeOptionsNavigation ? 1:0;
|
2003-01-21 07:04:53 +00:00
|
|
|
m_iSelectedOption[0][IO_WHEEL_SPEED] =
|
|
|
|
|
(PREFSMAN->m_iMusicWheelSwitchSpeed <= 5)? 0:
|
|
|
|
|
(PREFSMAN->m_iMusicWheelSwitchSpeed <= 10)? 1:
|
|
|
|
|
(PREFSMAN->m_iMusicWheelSwitchSpeed <= 15)? 2:3;
|
2002-09-10 09:10:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenInputOptions::ExportOptions()
|
|
|
|
|
{
|
|
|
|
|
PREFSMAN->m_bIgnoreJoyAxes = m_iSelectedOption[0][IO_IGNORE_AXES] == 1;
|
|
|
|
|
PREFSMAN->m_bOnlyDedicatedMenuButtons= m_iSelectedOption[0][IO_DEDICATED_MENU_BUTTONS] == 1;
|
|
|
|
|
PREFSMAN->m_bDelayedEscape = m_iSelectedOption[0][IO_DELAYED_ESCAPE] == 1;
|
|
|
|
|
PREFSMAN->m_bAutoPlay = m_iSelectedOption[0][IO_AUTOPLAY] == 1;
|
|
|
|
|
PREFSMAN->m_bArcadeOptionsNavigation= m_iSelectedOption[0][IO_OPTIONS_NAVIGATION] == 1;
|
2003-01-21 07:04:53 +00:00
|
|
|
switch(m_iSelectedOption[0][IO_WHEEL_SPEED])
|
|
|
|
|
{
|
|
|
|
|
case 0: PREFSMAN->m_iMusicWheelSwitchSpeed = 5; break;
|
|
|
|
|
case 1: PREFSMAN->m_iMusicWheelSwitchSpeed = 10; break;
|
|
|
|
|
case 2: PREFSMAN->m_iMusicWheelSwitchSpeed = 15; break;
|
|
|
|
|
case 3: PREFSMAN->m_iMusicWheelSwitchSpeed = 25; break;
|
|
|
|
|
default: ASSERT(0);
|
|
|
|
|
}
|
2002-09-10 09:10:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenInputOptions::GoToPrevState()
|
|
|
|
|
{
|
2003-01-31 23:31:35 +00:00
|
|
|
SCREENMAN->SetNewScreen( "ScreenOptionsMenu" );
|
2002-09-10 09:10:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ScreenInputOptions::GoToNextState()
|
|
|
|
|
{
|
2003-01-31 23:31:35 +00:00
|
|
|
PREFSMAN->SaveGlobalPrefsToDisk();
|
2002-09-10 09:10:36 +00:00
|
|
|
GoToPrevState();
|
|
|
|
|
}
|
|
|
|
|
|