本文整理汇总了C++中idWidgetAction::GetType方法的典型用法代码示例。如果您正苦于以下问题:C++ idWidgetAction::GetType方法的具体用法?C++ idWidgetAction::GetType怎么用?C++ idWidgetAction::GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idWidgetAction
的用法示例。
在下文中一共展示了idWidgetAction::GetType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAction
/*
========================
idMenuWidget_ScrollBar::HandleAction
========================
*/
bool idMenuWidget_ScrollBar::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
widgetAction_t actionType = action.GetType();
switch ( actionType ) {
case WIDGET_ACTION_SCROLL_DRAG: {
if ( event.parms.Num() != 3 ) {
return true;
}
dragging = true;
float x = event.parms[0].ToFloat();
float y = event.parms[1].ToFloat();
bool initial = event.parms[2].ToBool();
if ( initial ) {
CalcTopAndBottom();
}
CalculatePosition( x, y );
return true;
}
case WIDGET_ACTION_EVENT_DRAG_STOP: {
dragging = false;
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例2: HandleAction
/*
========================
idMenuScreen_Shell_ModeSelect::HandleAction h
========================
*/
bool idMenuScreen_Shell_ModeSelect::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
if ( menuData == NULL ) {
return true;
}
if ( menuData->ActiveScreen() != SHELL_AREA_MODE_SELECT ) {
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_GO_BACK: {
menuData->SetNextScreen( SHELL_AREA_PARTY_LOBBY, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED: {
if ( options == NULL ) {
return true;
}
int selectionIndex = options->GetViewIndex();
if ( parms.Num() == 1 ) {
selectionIndex = parms[0].ToInteger();
}
if ( options->GetFocusIndex() != selectionIndex ) {
options->SetFocusIndex( selectionIndex );
options->SetViewIndex( options->GetViewOffset() + selectionIndex );
}
idMatchParameters matchParameters = idMatchParameters( session->GetPartyLobbyBase().GetMatchParms() );
matchParameters.gameMap = GAME_MAP_RANDOM;
matchParameters.gameMode = selectionIndex;
// Always a public match.
matchParameters.matchFlags &= ~MATCH_INVITE_ONLY;
session->UpdatePartyParms( matchParameters );
// Update flags for game lobby.
matchParameters.matchFlags = DefaultPartyFlags | DefaultPublicGameFlags;
cvarSystem->MoveCVarsToDict( CVAR_SERVERINFO, matchParameters.serverInfo );
// Force a default value for the si_timelimit and si_fraglimit for quickmatch
matchParameters.serverInfo.SetInt( "si_timelimit", 15 );
matchParameters.serverInfo.SetInt( "si_fraglimit", 10 );
session->FindOrCreateMatch( matchParameters );
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例3: HandleAction
/*
========================
idMenuScreen_Shell_GameBrowser::HandleAction h
========================
*/
bool idMenuScreen_Shell_GameBrowser::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandle ) {
idMenuHandler_Shell * const mgr = dynamic_cast< idMenuHandler_Shell * >( menuData );
if ( mgr == NULL ) {
return false;
}
if ( mgr->ActiveScreen() != SHELL_AREA_BROWSER ) {
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_GO_BACK: {
menuData->SetNextScreen( SHELL_AREA_PARTY_LOBBY, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_COMMAND: {
switch ( parms[ 0 ].ToInteger() ) {
case BROWSER_COMMAND_REFRESH_SERVERS: {
UpdateServerList();
break;
}
case BROWSER_COMMAND_SHOW_GAMERTAG: {
int index = listWidget->GetServerIndex();
if ( index != -1 ) {
session->ShowServerGamerCardUI( index );
}
break;
}
}
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED: {
int selectionIndex = listWidget->GetFocusIndex();
if ( parms.Num() > 0 ) {
selectionIndex = parms[0].ToInteger();
}
if ( selectionIndex != listWidget->GetFocusIndex() ) {
listWidget->SetViewIndex( listWidget->GetViewOffset() + selectionIndex );
listWidget->SetFocusIndex( selectionIndex );
return true;
}
int index = listWidget->GetServerIndex();
if ( index != -1 ) {
session->ConnectToServer( index );
}
return true;
}
}
return idMenuScreen::HandleAction( action, event, widget, forceHandle );
}
示例4: HandleAction
/*
========================
idMenuScreen_Shell_Playstation::HandleAction h
========================
*/
bool idMenuScreen_Shell_Playstation::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{
if( menuData == NULL )
{
return true;
}
if( menuData->ActiveScreen() != SHELL_AREA_PLAYSTATION )
{
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList& parms = action.GetParms();
switch( actionType )
{
case WIDGET_ACTION_GO_BACK:
{
menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED:
{
if( options == NULL )
{
return true;
}
int selectionIndex = options->GetViewIndex();
if( parms.Num() == 1 )
{
selectionIndex = parms[0].ToInteger();
}
if( options->GetFocusIndex() != selectionIndex )
{
options->SetFocusIndex( selectionIndex );
options->SetViewIndex( options->GetViewOffset() + selectionIndex );
}
if( selectionIndex == 0 )
{
}
else if( selectionIndex == 1 )
{
}
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例5: HandleAction
/*
================================================
idMenuHandler::Update
================================================
*/
bool idMenuHandler::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_ADJUST_FIELD: {
if ( widget != NULL && widget->GetDataSource() != NULL ) {
widget->GetDataSource()->AdjustField( widget->GetDataSourceFieldIndex(), parms[ 0 ].ToInteger() );
widget->Update();
}
return true;
}
case WIDGET_ACTION_FUNCTION: {
if ( verify( action.GetScriptFunction() != NULL ) ) {
action.GetScriptFunction()->Call( event.thisObject, event.parms );
}
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED: {
idMenuScreen * const screen = menuScreens[ activeScreen ];
if ( screen != NULL ) {
idWidgetEvent pressEvent( WIDGET_EVENT_PRESS, 0, event.thisObject, idSWFParmList() );
screen->ReceiveEvent( pressEvent );
}
return true;
}
case WIDGET_ACTION_START_REPEATER: {
idWidgetAction repeatAction;
widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
assert( parms.Num() >= 2 );
int repeatDelay = DEFAULT_REPEAT_TIME;
if ( parms.Num() >= 3 ) {
repeatDelay = parms[2].ToInteger();
}
repeatAction.Set( repeatActionType, parms[ 1 ], repeatDelay );
StartWidgetActionRepeater( widget, repeatAction, event );
return true;
}
case WIDGET_ACTION_STOP_REPEATER: {
ClearWidgetActionRepeater();
return true;
}
}
if ( !widget->GetHandlerIsParent() ) {
for ( int index = 0; index < children.Num(); ++index ) {
if ( children[index] != NULL ) {
if ( children[index]->HandleAction( action, event, widget, forceHandled ) ) {
return true;
}
}
}
}
return false;
}
示例6: HandleAction
/*
========================
idMenuScreen_Shell_Settings::HandleAction h
========================
*/
bool idMenuScreen_Shell_Settings::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
if ( menuData == NULL ) {
return true;
}
if ( menuData->ActiveScreen() != SHELL_AREA_SETTINGS ) {
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_GO_BACK: {
menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_COMMAND: {
switch ( parms[0].ToInteger() ) {
case SETTING_CMD_CONTROLS: {
menuData->SetNextScreen( SHELL_AREA_CONTROLS, MENU_TRANSITION_SIMPLE );
break;
}
case SETTING_CMD_GAMEPLAY: {
menuData->SetNextScreen( SHELL_AREA_GAME_OPTIONS, MENU_TRANSITION_SIMPLE );
break;
}
case SETTING_CMD_SYSTEM: {
menuData->SetNextScreen( SHELL_AREA_SYSTEM_OPTIONS, MENU_TRANSITION_SIMPLE );
break;
}
case SETTING_CMD_3D: {
menuData->SetNextScreen( SHELL_AREA_STEREOSCOPICS, MENU_TRANSITION_SIMPLE );
break;
}
}
if ( options != NULL ) {
int selectionIndex = options->GetViewIndex();
if ( parms.Num() == 1 ) {
selectionIndex = parms[0].ToInteger();
}
if ( options->GetFocusIndex() != selectionIndex ) {
options->SetFocusIndex( selectionIndex );
options->SetViewIndex( options->GetViewOffset() + selectionIndex );
}
}
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例7: HandleAction
/*
========================
idMenuScreen_Shell_NewGame::HandleAction h
========================
*/
bool idMenuScreen_Shell_NewGame::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{
if( menuData != NULL )
{
if( menuData->ActiveScreen() != SHELL_AREA_NEW_GAME )
{
return false;
}
}
widgetAction_t actionType = action.GetType();
const idSWFParmList& parms = action.GetParms();
switch( actionType )
{
case WIDGET_ACTION_GO_BACK:
{
if( menuData != NULL )
{
menuData->SetNextScreen( SHELL_AREA_CAMPAIGN, MENU_TRANSITION_SIMPLE );
}
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED:
{
if( options == NULL )
{
return true;
}
int selectionIndex = options->GetViewIndex();
if( parms.Num() == 1 )
{
selectionIndex = parms[0].ToInteger();
}
if( selectionIndex != options->GetFocusIndex() )
{
options->SetViewIndex( selectionIndex );
options->SetFocusIndex( selectionIndex );
}
idMenuHandler_Shell* shell = dynamic_cast< idMenuHandler_Shell* >( menuData );
if( shell != NULL )
{
shell->SetNewGameType( selectionIndex );
menuData->SetNextScreen( SHELL_AREA_DIFFICULTY, MENU_TRANSITION_SIMPLE );
}
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例8: HandleAction
/*
========================
idMenuScreen_Shell_Dev::HandleAction h
========================
*/
bool idMenuScreen_Shell_Dev::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{
if( menuData == NULL )
{
return true;
}
if( menuData->ActiveScreen() != SHELL_AREA_DEV )
{
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList& parms = action.GetParms();
switch( actionType )
{
case WIDGET_ACTION_GO_BACK:
{
menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED:
{
if( options == NULL )
{
return true;
}
int selectionIndex = options->GetViewIndex();
if( parms.Num() == 1 )
{
selectionIndex = parms[0].ToInteger();
}
if( options->GetFocusIndex() != selectionIndex - options->GetViewOffset() )
{
options->SetFocusIndex( selectionIndex );
options->SetViewIndex( options->GetViewOffset() + selectionIndex );
}
int mapIndex = options->GetViewIndex();
if( ( mapIndex < devOptions.Num() ) && ( devOptions[ mapIndex ].map != NULL ) )
{
cmdSystem->AppendCommandText( va( "devmap %s\n", devOptions[ mapIndex ].map ) );
}
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例9: HandleAction
/*
========================
idMenuScreen_PDA_VideoDisks::HandleAction
========================
*/
bool idMenuScreen_PDA_VideoDisks::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{
if( menuData == NULL )
{
return true;
}
if( menuData->ActiveScreen() != PDA_AREA_VIDEO_DISKS )
{
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList& parms = action.GetParms();
switch( actionType )
{
case WIDGET_ACTION_GO_BACK:
{
menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
return true;
}
case WIDGET_ACTION_START_REPEATER:
{
idWidgetAction repeatAction;
widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
assert( parms.Num() == 2 );
repeatAction.Set( repeatActionType, parms[ 1 ] );
if( menuData != NULL )
{
menuData->StartWidgetActionRepeater( widget, repeatAction, event );
}
return true;
}
case WIDGET_ACTION_STOP_REPEATER:
{
if( menuData != NULL )
{
menuData->ClearWidgetActionRepeater();
}
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED:
{
ToggleVideoDiskPlay();
Update();
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例10: HandleAction
/*
========================
idMenuWidget_InfoBox::ObserveEvent
========================
*/
bool idMenuWidget_InfoBox::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
const idSWFParmList & parms = action.GetParms();
if ( action.GetType() == WIDGET_ACTION_SCROLL_VERTICAL ) {
const scrollType_t scrollType = static_cast< scrollType_t >( event.arg );
if ( scrollType == SCROLL_SINGLE ) {
Scroll( parms[ 0 ].ToInteger() );
}
return true;
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例11: HandleAction
/*
========================
idMenuScreen_Shell_Singleplayer::HandleAction
========================
*/
bool idMenuScreen_Shell_Singleplayer::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
if ( menuData == NULL ) {
return true;
}
if ( menuData->ActiveScreen() != SHELL_AREA_CAMPAIGN ) {
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_GO_BACK: {
menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED: {
if ( options == NULL ) {
return true;
}
int selectionIndex = options->GetViewIndex();
if ( parms.Num() == 1 ) {
selectionIndex = parms[0].ToInteger();
}
canContinue = false;
const saveGameDetailsList_t & saveGameInfo = session->GetSaveGameManager().GetEnumeratedSavegames();
canContinue = ( saveGameInfo.Num() > 0 );
if ( canContinue ) {
if ( selectionIndex == 0 ) {
ContinueGame();
} else if ( selectionIndex == 1 ) {
class idSWFScriptFunction_NewGame : public idSWFScriptFunction_RefCounted {
public:
idSWFScriptFunction_NewGame( idMenuHandler * _menuData, bool _accept ) {
menuData = _menuData;
accept = _accept;
}
idSWFScriptVar Call( idSWFScriptObject * thisObject, const idSWFParmList & parms ) {
common->Dialog().ClearDialog( GDM_DELETE_AUTOSAVE );
if ( accept ) {
menuData->SetNextScreen( SHELL_AREA_NEW_GAME, MENU_TRANSITION_SIMPLE );
}
return idSWFScriptVar();
}
private:
idMenuHandler * menuData;
bool accept;
};
common->Dialog().AddDialog( GDM_DELETE_AUTOSAVE, DIALOG_ACCEPT_CANCEL, new idSWFScriptFunction_NewGame( menuData, true ), new idSWFScriptFunction_NewGame( menuData, false ), true );
} else if ( selectionIndex == 2 ) {
menuData->SetNextScreen( SHELL_AREA_LOAD, MENU_TRANSITION_SIMPLE );
}
} else {
if ( selectionIndex == 0 ) {
menuData->SetNextScreen( SHELL_AREA_NEW_GAME, MENU_TRANSITION_SIMPLE );
} else if ( selectionIndex == 1 ) {
menuData->SetNextScreen( SHELL_AREA_LOAD, MENU_TRANSITION_SIMPLE );
}
}
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例12: HandleAction
/*
========================
idMenuScreen_Shell_Save::HandleAction
========================
*/
bool idMenuScreen_Shell_Save::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{
if( menuData == NULL )
{
return true;
}
if( menuData->ActiveScreen() != SHELL_AREA_SAVE )
{
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList& parms = action.GetParms();
switch( actionType )
{
case WIDGET_ACTION_JOY4_ON_PRESS:
{
return true;
}
case WIDGET_ACTION_JOY3_ON_PRESS:
{
if( options == NULL )
{
return true;
}
DeleteGame( options->GetViewIndex() );
return true;
}
case WIDGET_ACTION_GO_BACK:
{
menuData->SetNextScreen( SHELL_AREA_ROOT, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED:
{
if( options == NULL )
{
return true;
}
if( session->GetSaveGameManager().IsWorking() )
{
return true;
}
if( parms.Num() == 1 )
{
int selectionIndex = parms[0].ToInteger();
if( selectionIndex != options->GetFocusIndex() )
{
options->SetViewIndex( options->GetViewOffset() + selectionIndex );
options->SetFocusIndex( selectionIndex );
return true;
}
}
SaveGame( options->GetViewIndex() );
return true;
}
case WIDGET_ACTION_SCROLL_VERTICAL:
{
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例13: HandleAction
/*
========================
idMenuScreen_PDA_Inventory::HandleAction
========================
*/
bool idMenuScreen_PDA_Inventory::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
if ( menuData == NULL ) {
return true;
}
if ( menuData->ActiveScreen() != PDA_AREA_INVENTORY ) {
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_JOY3_ON_PRESS: {
EquipWeapon();
return true;
}
case WIDGET_ACTION_GO_BACK: {
menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
return true;
}
case WIDGET_ACTION_START_REPEATER: {
idWidgetAction repeatAction;
widgetAction_t repeatActionType = static_cast< widgetAction_t >( parms[ 0 ].ToInteger() );
assert( parms.Num() == 2 );
repeatAction.Set( repeatActionType, parms[ 1 ] );
menuData->StartWidgetActionRepeater( widget, repeatAction, event );
return true;
}
case WIDGET_ACTION_SELECT_PDA_ITEM: {
if ( itemList.GetMoveDiff() > 0 ) {
itemList.MoveToIndex( itemList.GetMoveToIndex(), true );
}
int index = parms[0].ToInteger();
if ( index != 0 ) {
itemList.MoveToIndex( index );
Update();
}
return true;
}
case WIDGET_ACTION_STOP_REPEATER: {
menuData->ClearWidgetActionRepeater();
return true;
}
case WIDGET_ACTION_SCROLL_HORIZONTAL: {
if ( itemList.GetTotalNumberOfOptions() <= 1 ) {
return true;
}
if ( itemList.GetMoveDiff() > 0 ) {
itemList.MoveToIndex( itemList.GetMoveToIndex(), true );
}
int direction = parms[0].ToInteger();
if ( direction == 1 ) {
if ( itemList.GetViewIndex() == itemList.GetTotalNumberOfOptions() - 1 ) {
return true;
} else {
itemList.MoveToIndex( 1 );
}
} else {
if ( itemList.GetViewIndex() == 0 ) {
return true;
} else {
itemList.MoveToIndex( ( itemList.GetNumVisibleOptions() / 2 ) + 1 );
}
}
Update();
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例14: HandleAction
/*
========================
idMenuScreen_PDA_UserEmails::HandleAction
========================
*/
bool idMenuScreen_PDA_UserEmails::HandleAction( idWidgetAction& action, const idWidgetEvent& event, idMenuWidget* widget, bool forceHandled )
{
if( menuData == NULL )
{
return true;
}
if( menuData->ActiveScreen() != PDA_AREA_USER_EMAIL )
{
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList& parms = action.GetParms();
switch( actionType )
{
case WIDGET_ACTION_PDA_CLOSE:
{
menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
return true;
}
case WIDGET_ACTION_GO_BACK:
{
if( readingEmails )
{
ShowEmail( false );
}
else
{
menuData->SetNextScreen( PDA_AREA_INVALID, MENU_TRANSITION_ADVANCE );
}
return true;
}
case WIDGET_ACTION_REFRESH:
{
UpdateEmail();
return true;
}
case WIDGET_ACTION_PDA_SELECT_EMAIL:
{
if( widget->GetParent() != NULL )
{
idMenuWidget_DynamicList* emailList = dynamic_cast< idMenuWidget_DynamicList* >( widget->GetParent() );
int index = parms[0].ToInteger();
if( emailList != NULL )
{
emailList->SetViewIndex( emailList->GetViewOffset() + index );
emailList->SetFocusIndex( index );
}
}
ShowEmail( true );
return true;
}
case WIDGET_ACTION_EMAIL_HOVER:
{
scrollEmailInfo = parms[0].ToBool();
return true;
}
case WIDGET_ACTION_SCROLL_VERTICAL:
{
if( ScrollCorrectList( action, event, widget ) )
{
return true;
}
UpdateEmail();
break;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}
示例15: HandleAction
/*
========================
idMenuScreen_Shell_Leaderboards::HandleAction
========================
*/
bool idMenuScreen_Shell_Leaderboards::HandleAction( idWidgetAction & action, const idWidgetEvent & event, idMenuWidget * widget, bool forceHandled ) {
if ( menuData == NULL ) {
return true;
}
if ( menuData->ActiveScreen() != SHELL_AREA_LEADERBOARDS ) {
return false;
}
widgetAction_t actionType = action.GetType();
const idSWFParmList & parms = action.GetParms();
switch ( actionType ) {
case WIDGET_ACTION_GO_BACK: {
menuData->SetNextScreen( SHELL_AREA_PARTY_LOBBY, MENU_TRANSITION_SIMPLE );
return true;
}
case WIDGET_ACTION_JOY3_ON_PRESS: {
lbCache->CycleFilter();
refreshLeaderboard = true;
return true;
}
case WIDGET_ACTION_PRESS_FOCUSED: {
if ( options == NULL ) {
return true;
}
int index = options->GetFocusIndex();
if ( parms.Num() != 0 ) {
index = parms[0].ToInteger();
}
if ( lbCache->GetEntryIndex() != index ) {
lbCache->SetEntryIndex( index );
refreshLeaderboard = true;
return true;
}
const idLeaderboardCallback::row_t * row = lbCache->GetLeaderboardRow( lbCache->GetRowOffset() + lbCache->GetEntryIndex() );
if ( row != NULL ) {
lbCache->DisplayGamerCardUI( row );
}
return true;
}
case WIDGET_ACTION_SCROLL_TAB: {
int delta = parms[0].ToInteger();
lbIndex += delta;
SetLeaderboardIndex();
return true;
}
case WIDGET_ACTION_SCROLL_VERTICAL_VARIABLE: {
if ( parms.Num() == 0 ) {
return true;
}
if ( options == NULL ) {
return true;
}
int dir = parms[ 0 ].ToInteger();
if ( lbCache->Scroll( dir ) ) {
// TODO_SPARTY: play scroll sound
refreshLeaderboard = true;
}
return true;
}
case WIDGET_ACTION_SCROLL_PAGE: {
if ( parms.Num() == 0 ) {
return true;
}
if ( options == NULL ) {
return true;
}
int dir = parms[ 0 ].ToInteger();
if ( lbCache->ScrollOffset( dir ) ) {
refreshLeaderboard = true;
}
return true;
}
}
return idMenuWidget::HandleAction( action, event, widget, forceHandled );
}