This commit is contained in:
parent
5f78e761a6
commit
9b3fe9535e
6 changed files with 54 additions and 5 deletions
|
@ -373,7 +373,7 @@ void CFrontEndOptions::init()
|
|||
tb->init(fr);
|
||||
tb->setObjectXYWH(176+26,45,150,15);
|
||||
tb->setText(STR__FRONTEND__WEAPONCHANGE);
|
||||
CGUIFactory::createCycleButtonFrame(m_modeMenus[MODE__CONTROL],
|
||||
m_vibGUIOption=CGUIFactory::createCycleButtonFrame(m_modeMenus[MODE__CONTROL],
|
||||
X_BORDER,Y_BORDER+90,OPTIONS_FRAME_W-(X_BORDER*2),25,
|
||||
STR__FRONTEND__VIBRATION,
|
||||
&m_vibrationStatus,s_vibrationValues,s_vibrationReadoutText);
|
||||
|
@ -573,6 +573,21 @@ void CFrontEndOptions::think(int _frames)
|
|||
int i,j,button;
|
||||
|
||||
|
||||
|
||||
// Hide the VIBRATION option if vibration not available
|
||||
if(PadCanVibrate(0))
|
||||
{
|
||||
m_vibGUIOption->unhide();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_vibGUIOption->isSelected())
|
||||
{
|
||||
m_modeMenus[MODE__CONTROL]->selectPreviousItem();
|
||||
}
|
||||
m_vibGUIOption->hide();
|
||||
}
|
||||
|
||||
m_background->think(_frames);
|
||||
|
||||
if(!CFader::isFading())
|
||||
|
|
|
@ -151,6 +151,7 @@ private:
|
|||
int m_speechVolume;
|
||||
int m_controlStyle;
|
||||
int m_vibrationStatus,m_lastVibrationStatus;
|
||||
class CGUIObject *m_vibGUIOption;
|
||||
int m_screenXOff;
|
||||
int m_screenYOff;
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ void CPauseMenu::init()
|
|||
CGUITextReadout *tr;
|
||||
|
||||
fr=new ("frame") CGUIGroupFrame();
|
||||
m_vibGUIOption=fr;
|
||||
fr->init(m_pauseGuiFrame);
|
||||
fr->setObjectXYWH((FRAME_WIDTH-TEXT_BOX_WIDTH)/2,ypos,TEXT_BOX_WIDTH,TEXT_BOX_HEIGHT);
|
||||
tb=new ("textbox") CGUITextBox();
|
||||
|
@ -324,6 +325,24 @@ void CPauseMenu::think(int _frames)
|
|||
{
|
||||
if(m_active)
|
||||
{
|
||||
if(m_pauseGuiFrame->isSelected())
|
||||
{
|
||||
// Hide the VIBRATION option if vibration not available
|
||||
if(PadCanVibrate(0))
|
||||
{
|
||||
m_vibGUIOption->unhide();
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_vibGUIOption->isSelected())
|
||||
{
|
||||
m_pauseGuiFrame->selectPreviousItem();
|
||||
}
|
||||
m_vibGUIOption->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(PadGetDown(0)&PAD_START)
|
||||
{
|
||||
if(!m_padDebounce)
|
||||
|
|
|
@ -73,6 +73,7 @@ private:
|
|||
|
||||
class CGUIControlFrame *m_pauseGuiFrame;
|
||||
class CGUIControlFrame *m_confirmQuitGuiFrame;
|
||||
class CGUIObject *m_vibGUIOption;
|
||||
|
||||
class FontBank *m_fontBank;
|
||||
|
||||
|
|
|
@ -208,6 +208,12 @@ int PadIsDualShock(int Port)
|
|||
return (PadData[Port].IsAnalogue==2);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
int PadCanVibrate(int Port)
|
||||
{
|
||||
return PadIsConnected(Port)&&PadData[Port].CanVibrate;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void SetPadRescan()
|
||||
{
|
||||
|
@ -293,6 +299,7 @@ int intensity;
|
|||
if (Pad->Status == PadStateFindPad)
|
||||
{
|
||||
Pad->Send = 0;
|
||||
Pad->CanVibrate=false;
|
||||
}
|
||||
if ( Pad->Send==0 || PadRescan)
|
||||
{
|
||||
|
@ -305,7 +312,11 @@ int intensity;
|
|||
}
|
||||
if (Pad->Status == PadStateStable)
|
||||
{
|
||||
if (PadSetActAlign(PortShift,PadAlign)) Pad->Send = 1;
|
||||
if (PadSetActAlign(PortShift,PadAlign))
|
||||
{
|
||||
Pad->Send = 1;
|
||||
Pad->CanVibrate=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ typedef struct
|
|||
u8 Send;
|
||||
u8 IsAnalogue;
|
||||
bool Active;
|
||||
bool CanVibrate;
|
||||
} sPadData;
|
||||
|
||||
struct VIBE_DATA
|
||||
|
@ -89,6 +90,7 @@ u16 PadGetRepeat(int Port);
|
|||
|
||||
|
||||
int PadIsDualShock(int Port);
|
||||
int PadCanVibrate(int Port);
|
||||
|
||||
u16 PadGetPadAngle(u16 Pad, s16 angleAdjust);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue