本文整理汇总了C++中BaseModHybridButton::SetText方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseModHybridButton::SetText方法的具体用法?C++ BaseModHybridButton::SetText怎么用?C++ BaseModHybridButton::SetText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseModHybridButton
的用法示例。
在下文中一共展示了BaseModHybridButton::SetText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateSelectMissionButton
void GameSettings::UpdateSelectMissionButton()
{
DropDownMenu *menu = dynamic_cast< DropDownMenu* >( FindChildByName( "DrpSelectMission", true ) );
if ( !menu )
return;
BaseModHybridButton *button = menu->GetButton(); //dynamic_cast< BaseModHybridButton* >( FindChildByName( "BtnSelectMission", true ) );
if ( m_pSettings && button )
{
const char *szGameType = m_pSettings->GetString( "game/mode", "sdk" );
if ( !Q_stricmp( szGameType, "campaign" ) )
{
button->SetText( "#ASUI_Select_Campaign" );
button->SetHelpText( "#ASUI_Select_Campaign_tt" );
}
else if ( !Q_stricmp( szGameType, "single_mission" ) )
{
button->SetText( "#ASUI_Select_Mission" );
button->SetHelpText( "#ASUI_Select_Mission_tt" );
}
else if( !Q_stricmp( szGameType, "sdk" ) )
{
button->SetText( "Select Map" );
button->SetHelpText( "SDK select map example" );
}
else if( !Q_stricmp( szGameType, "swarmkeeper" ) )
{
button->SetText( "Select level" );
button->SetHelpText( "Select a Swarm Keeper level" );
}
}
/*
BaseModHybridButton *button = dynamic_cast< BaseModHybridButton* >( FindChildByName( "BtnSelectMission" ) );
if ( m_pSettings && button )
{
const char *szGameType = m_pSettings->GetString( "game/mode", "campaign" );
if ( !Q_stricmp( szGameType, "campaign" ) )
{
button->SetText( "#ASUI_Select_Campaign" );
button->SetHelpText( "#ASUI_Select_Campaign_tt" );
}
else if ( !Q_stricmp( szGameType, "single_mission" ) )
{
button->SetText( "#ASUI_Select_Mission" );
button->SetHelpText( "#ASUI_Select_Mission_tt" );
}
}
*/
}
示例2: OnThink
//=============================================================================
void MainMenu::OnThink()
{
// need to change state of flyout if user suddenly disconnects
// while flyout is open
BaseModUI::FlyoutMenu *flyout = dynamic_cast< FlyoutMenu* >( FindChildByName( "FlmCampaignFlyout" ) );
if ( flyout )
{
BaseModHybridButton *pButton = dynamic_cast< BaseModHybridButton* >( flyout->FindChildButtonByCommand( "QuickMatchCoOp" ) );
if ( pButton )
{
if ( !CUIGameData::Get()->SignedInToLive() )
{
pButton->SetText( "#L4D360UI_QuickStart" );
if ( m_iQuickJoinHelpText != MMQJHT_QUICKSTART )
{
pButton->SetHelpText( "#L4D360UI_QuickMatch_Offline_Tip" );
m_iQuickJoinHelpText = MMQJHT_QUICKSTART;
}
}
else
{
pButton->SetText( "#L4D360UI_QuickMatch" );
if ( m_iQuickJoinHelpText != MMQJHT_QUICKMATCH )
{
pButton->SetHelpText( "#L4D360UI_QuickMatch_Tip" );
m_iQuickJoinHelpText = MMQJHT_QUICKMATCH;
}
}
}
}
if ( IsPC() )
{
FlyoutMenu *pFlyout = dynamic_cast< FlyoutMenu* >( FindChildByName( "FlmOptionsFlyout" ) );
if ( pFlyout )
{
const MaterialSystem_Config_t &config = materials->GetCurrentConfigForVideoCard();
pFlyout->SetControlEnabled( "BtnBrightness", !config.Windowed() );
}
}
BaseClass::OnThink();
}
示例3: UpdateNumGamesFoundLabel
void QuickJoinPanel::UpdateNumGamesFoundLabel( void )
{
BaseModHybridButton *title = dynamic_cast< BaseModHybridButton* >( FindChildByName( "LblTitle" ) );
if ( title )
{
wchar_t* wFormatString = g_pVGuiLocalize->Find( GetTitle() );
if( wFormatString )
{
char gameCountTxt[ 4 ];
itoa( m_FriendInfo.Count(), gameCountTxt, 10 );
wchar_t wGameCountTxt[ 4 ];
g_pVGuiLocalize->ConvertANSIToUnicode( gameCountTxt, wGameCountTxt, sizeof( wGameCountTxt ) );
wchar_t wMessage[ 256 ];
g_pVGuiLocalize->ConstructString( wMessage, sizeof( wMessage ), wFormatString, 1, wGameCountTxt );
title->SetText( wMessage );
}
}
}
示例4: UpdateText
//=============================================================================
void DownloadCampaign::UpdateText()
{
wchar_t s1[MAX_PATH];
wchar_t s2[MAX_PATH];
wchar_t text[MAX_PATH];
g_pVGuiLocalize->ConvertANSIToUnicode( m_campaignName.Get(), s1, sizeof( s1 ) );
g_pVGuiLocalize->ConvertANSIToUnicode( m_author.Get(), s2, sizeof( s2 ) );
const wchar_t * downloadCampaignText = g_pVGuiLocalize->Find( "#L4D360UI_DownloadCampaign_Campaign" );
if ( downloadCampaignText )
{
g_pVGuiLocalize->ConstructString( text, sizeof( text ), downloadCampaignText, 2, s1, s2 );
vgui::Label *LblDownloadCampaign = dynamic_cast< vgui::Label * > ( FindChildByName( "LblDownloadCampaign" ) );
if ( LblDownloadCampaign )
{
LblDownloadCampaign->SetText( text );
}
}
g_pVGuiLocalize->ConvertANSIToUnicode( m_webSite.Get(), s1, sizeof( s1 ) );
BaseModHybridButton *BtnURL = dynamic_cast< BaseModHybridButton * > ( FindChildByName( "BtnURL" ) );
if ( BtnURL )
{
BtnURL->SetText( s1 );
}
if ( m_fromLobby )
{
vgui::Label *LblDownloadText = dynamic_cast< vgui::Label * > ( FindChildByName( "LblDownloadText" ) );
if ( LblDownloadText )
{
LblDownloadText->SetText( "#L4D360UI_DownloadCampaign_Text_FromLobby" );
}
}
}
示例5: ApplySchemeSettings
//=============================================================================
void MainMenu::ApplySchemeSettings( IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
const char *pSettings = "Resource/UI/BaseModUI/MainMenu.res";
#if !defined( _X360 )
if ( !g_pMatchFramework->GetMatchSystem() )
{
Msg( "BAD!\n" );
}
if ( !g_pMatchFramework->GetMatchSystem()->GetPlayerManager() )
{
Msg( "BAD PLAYER MANAGER!\n" );
}
if ( !g_pMatchFramework->GetMatchSystem()->GetPlayerManager()->GetLocalPlayer( 0 ) )
{
pSettings = "Resource/UI/BaseModUI/MainMenuStub.res";
}
#endif
LoadControlSettings( pSettings );
BaseModHybridButton *button = dynamic_cast< BaseModHybridButton* >( FindChildByName( "BtnPlaySolo" ) );
if ( button )
{
#ifdef _X360
button->SetText( ( XBX_GetNumGameUsers() > 1 ) ? ( "#L4D360UI_MainMenu_PlaySplitscreen" ) : ( "#L4D360UI_MainMenu_PlaySolo" ) );
button->SetHelpText( ( XBX_GetNumGameUsers() > 1 ) ? ( "#L4D360UI_MainMenu_OfflineCoOp_Tip" ) : ( "#L4D360UI_MainMenu_PlaySolo_Tip" ) );
#endif
}
#ifdef _X360
if ( !XBX_GetPrimaryUserIsGuest() )
{
wchar_t wszListText[ 128 ];
wchar_t wszPlayerName[ 128 ];
IPlayer *player1 = NULL;
if ( XBX_GetNumGameUsers() > 0 )
{
player1 = g_pMatchFramework->GetMatchSystem()->GetPlayerManager()->GetLocalPlayer( XBX_GetUserId( 0 ) );
}
IPlayer *player2 = NULL;
if ( XBX_GetNumGameUsers() > 1 )
{
player2 = g_pMatchFramework->GetMatchSystem()->GetPlayerManager()->GetLocalPlayer( XBX_GetUserId( 1 ) );
}
if ( player1 )
{
Label *pLblPlayer1GamerTag = dynamic_cast< Label* >( FindChildByName( "LblPlayer1GamerTag" ) );
if ( pLblPlayer1GamerTag )
{
g_pVGuiLocalize->ConvertANSIToUnicode( player1->GetName(), wszPlayerName, sizeof( wszPlayerName ) );
g_pVGuiLocalize->ConstructString( wszListText, sizeof( wszListText ), g_pVGuiLocalize->Find( "#L4D360UI_MainMenu_LocalProfilePlayer1" ), 1, wszPlayerName );
pLblPlayer1GamerTag->SetVisible( true );
pLblPlayer1GamerTag->SetText( wszListText );
}
}
if ( player2 )
{
Label *pLblPlayer2GamerTag = dynamic_cast< Label* >( FindChildByName( "LblPlayer2GamerTag" ) );
if ( pLblPlayer2GamerTag )
{
g_pVGuiLocalize->ConvertANSIToUnicode( player2->GetName(), wszPlayerName, sizeof( wszPlayerName ) );
g_pVGuiLocalize->ConstructString( wszListText, sizeof( wszListText ), g_pVGuiLocalize->Find( "#L4D360UI_MainMenu_LocalProfilePlayer2" ), 1, wszPlayerName );
pLblPlayer2GamerTag->SetVisible( true );
pLblPlayer2GamerTag->SetText( wszListText );
// in split screen, have player2 gamer tag instead of enable, and disable
SetControlVisible( "LblPlayer2DisableIcon", true );
SetControlVisible( "LblPlayer2Disable", true );
SetControlVisible( "LblPlayer2Enable", false );
}
}
else
{
SetControlVisible( "LblPlayer2DisableIcon", false );
SetControlVisible( "LblPlayer2Disable", false );
// not in split screen, no player2 gamertag, instead have enable
SetControlVisible( "LblPlayer2GamerTag", false );
SetControlVisible( "LblPlayer2Enable", true );
}
}
#endif
if ( IsPC() )
{
FlyoutMenu *pFlyout = dynamic_cast< FlyoutMenu* >( FindChildByName( "FlmOptionsFlyout" ) );
if ( pFlyout )
{
bool bUsesCloud = false;
//.........这里部分代码省略.........
示例6: LoadLayout
//=============================================================================
void InGameKickPlayerList::LoadLayout()
{
BaseClass::LoadLayout();
//int iLocalPlayerTeam;
if ( false ) // TODO: !GameClientExports()->GetPlayerTeamIdByUserId( -1, iLocalPlayerTeam ) )
{
// no local player?
Assert( 0 );
// hide all the buttons, weird state
for ( int i=0;i<KICK_PLAYER_LIST_MAX_PLAYERS; i++ )
{
BaseModHybridButton *pButton = dynamic_cast< BaseModHybridButton* >( FindChildByName( VarArgs( "BtnPlayer%d", i ) ) );
if ( pButton )
{
pButton->SetVisible( false );
}
}
return;
}
// get a list of players that we can kick
m_KickablePlayersUserIDs.Purge();
for( int i = 1; i <= engine->GetMaxClients(); ++i)
{
player_info_t playerInfo;
if( engine->GetPlayerInfo(i, &playerInfo) && !playerInfo.fakeplayer )
{
if ( true ) // TODO: GameClientExports()->IsPlayerKickableByLocalPlayer( i ) )
{
m_KickablePlayersUserIDs.AddToTail( playerInfo.userID );
}
}
}
int iKickablePlayers = m_KickablePlayersUserIDs.Count();
// If there are no players to be kicked, hide the description and show the label explaining why
// there are no players to choose
SetControlVisible( "LblDescription", iKickablePlayers > 0 );
SetControlVisible( "LblNoPlayers", iKickablePlayers == 0 );
for ( int i=0;i<KICK_PLAYER_LIST_MAX_PLAYERS; i++ )
{
BaseModHybridButton *pButton = dynamic_cast< BaseModHybridButton* >( FindChildByName( VarArgs( "BtnPlayer%d", i+1 ) ) );
if ( pButton )
{
if ( i < iKickablePlayers )
{
int userID = m_KickablePlayersUserIDs.Element(i);
player_info_t playerInfo;
if( engine->GetPlayerInfo( engine->GetPlayerForUserID(userID), &playerInfo ) )
{
pButton->SetVisible( true );
pButton->SetText( playerInfo.name );
pButton->SetCommand( VarArgs( "KickPlayer%d", userID ) );
}
else
{
pButton->SetVisible( false );
}
}
else
{
pButton->SetVisible( false );
}
}
}
}