本文整理汇总了C++中vgui::DHANDLE类的典型用法代码示例。如果您正苦于以下问题:C++ DHANDLE类的具体用法?C++ DHANDLE怎么用?C++ DHANDLE使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DHANDLE类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetShowProgressText
//-----------------------------------------------------------------------------
// Purpose: Returns prev settings
//-----------------------------------------------------------------------------
bool CGameUI::SetShowProgressText( bool show )
{
if (!g_hLoadingDialog.Get())
return false;
return g_hLoadingDialog->SetShowProgressText( show );
}
示例2: ShowMedalCollection
void ShowMedalCollection()
{
using namespace vgui;
vgui::Panel *pMedalPanel = GetClientMode()->GetViewport()->FindChildByName("MedalCollectionPanel", true);
if (pMedalPanel)
{
pMedalPanel->SetVisible(false);
pMedalPanel->MarkForDeletion();
pMedalPanel = NULL;
return;
}
vgui::Frame* pFrame = NULL;
// create the basic frame which holds our briefing panels
//Msg("Assigning player list frame\n");
if (g_hBriefingFrame.Get()) // todo: handle if they bring it up during debrief or campaign map too
pMedalPanel = new vgui::Panel( g_hBriefingFrame.Get(), "MedalCollectionPanel" );
else
{
pFrame = new vgui::Frame( GetClientMode()->GetViewport(), "MedalCollectionPanel" );
pMedalPanel = pFrame;
}
HScheme scheme = vgui::scheme()->LoadSchemeFromFile("resource/SwarmSchemeNew.res", "SwarmSchemeNew");
pMedalPanel->SetScheme(scheme);
pMedalPanel->SetBounds(0, 0, GetClientMode()->GetViewport()->GetWide(), GetClientMode()->GetViewport()->GetTall());
//pMedalPanel->SetPos(GetClientMode()->GetViewport()->GetWide() * 0.15f, GetClientMode()->GetViewport()->GetTall() * 0.15f);
//pMedalPanel->SetSize( GetClientMode()->GetViewport()->GetWide() * 0.7f, GetClientMode()->GetViewport()->GetTall() * 0.7f );
if (pFrame)
{
pFrame->SetMoveable(false);
pFrame->SetSizeable(false);
pFrame->SetMenuButtonVisible(false);
pFrame->SetMaximizeButtonVisible(false);
pFrame->SetMinimizeToSysTrayButtonVisible(false);
pFrame->SetCloseButtonVisible(true);
pFrame->SetTitleBarVisible(false);
}
pMedalPanel->SetPaintBackgroundEnabled(false);
pMedalPanel->SetBgColor(Color(0,0,0, 192));
// the panel to show the info
MedalCollectionPanel *collection = new MedalCollectionPanel( pMedalPanel, "Collection" );
collection->SetVisible( true );
collection->SetBounds(0, 0, pMedalPanel->GetWide(),pMedalPanel->GetTall());
if (!pMedalPanel)
{
Msg("Error: pMedalPanel frame was closed immediately on opening\n");
}
else
{
pMedalPanel->RequestFocus();
pMedalPanel->SetVisible(true);
pMedalPanel->SetEnabled(true);
pMedalPanel->SetKeyBoardInputEnabled(false);
pMedalPanel->SetZPos(200);
}
}
示例3: ApplySchemeSettings
//-----------------------------------------------------------------------------
// Purpose: gets the font from the scheme
//-----------------------------------------------------------------------------
void Tooltip::ApplySchemeSettings(IScheme *pScheme)
{
if ( s_TooltipWindow.Get() )
{
s_TooltipWindow->SetFont(pScheme->GetFont("DefaultSmall", s_TooltipWindow->IsProportional()));
}
}
示例4: ASW_GetSmallFont
vgui::HFont ASW_GetSmallFont(bool bGlow)
{
vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( vgui::scheme()->GetScheme( "SwarmSchemeNew" ) );
if ( !pScheme )
return vgui::INVALID_FONT;
return pScheme->GetFont( "DefaultSmall", true );
if (!g_hObjectivesHUD.Get())
{
g_hObjectivesHUD = GET_HUDELEMENT( CASWHudObjective );
}
if (!g_hObjectivesHUD.Get())
{
return vgui::INVALID_FONT;
}
if (g_hObjectivesHUD->m_iLastHeight != ScreenHeight())
g_hObjectivesHUD->SetDefaultHUDFonts();
if (bGlow)
return g_hObjectivesHUD->m_hSmallGlowFont;
return g_hObjectivesHUD->m_hSmallFont;
}
示例5: SetText
//-----------------------------------------------------------------------------
// Purpose: Set the tooltip text
//-----------------------------------------------------------------------------
void Tooltip::SetText(const char *text)
{
_isDirty = true;
if (!text)
{
text = "";
}
if (m_Text.Count() > 0)
{
m_Text.RemoveAll();
}
for (unsigned int i = 0; i < strlen(text); i++)
{
m_Text.AddToTail(text[i]);
}
m_Text.AddToTail('\0');
if (s_TooltipWindow.Get())
{
s_TooltipWindow->SetText(m_Text.Base());
}
}
示例6: Detach
//-----------------------------------------------------------------------------
// main application
//-----------------------------------------------------------------------------
void CVsVGuiWindow::Detach()
{
if ( m_hTimerCallbackId != 0 )
{
MTimerMessage::removeCallback( m_hTimerCallbackId );
m_hTimerCallbackId = 0;
}
if ( m_hMainPanel.Get() )
{
m_hMainPanel->MarkForDeletion();
m_hMainPanel = NULL;
}
if ( m_hVGuiContext != vgui::DEFAULT_VGUI_CONTEXT )
{
vgui::ivgui()->DestroyContext( m_hVGuiContext );
m_hVGuiContext = vgui::DEFAULT_VGUI_CONTEXT;
}
// detach
if ( m_hWnd )
{
// kill the timer if any
g_pMaterialSystem->RemoveView( m_hWnd );
RemoveWindowSubclass( m_hWnd, SubclassCallback, s_subclassId );
m_hWnd = NULL;
}
if ( m_hKeyFocusWnd )
{
RemoveWindowSubclass( m_hKeyFocusWnd, KeyFocusSubclassCallback, s_subclassId );
m_hKeyFocusWnd = NULL;
}
}
示例7: OnDisconnectFromServer
//-----------------------------------------------------------------------------
// Purpose: Called when the game disconnects from a server
//-----------------------------------------------------------------------------
void CGameUI::OnDisconnectFromServer( uint8 eSteamLoginFailure )
{
m_iGameIP = 0;
m_iGameConnectionPort = 0;
m_iGameQueryPort = 0;
if ( g_hLoadingBackgroundDialog )
{
vgui::ivgui()->PostMessage( g_hLoadingBackgroundDialog, new KeyValues("DisconnectedFromGame"), NULL );
}
g_VModuleLoader.PostMessageToAllModules(new KeyValues("DisconnectedFromGame"));
if ( eSteamLoginFailure == STEAMLOGINFAILURE_NOSTEAMLOGIN )
{
if ( g_hLoadingDialog )
{
g_hLoadingDialog->DisplayNoSteamConnectionError();
}
}
else if ( eSteamLoginFailure == STEAMLOGINFAILURE_VACBANNED )
{
if ( g_hLoadingDialog )
{
g_hLoadingDialog->DisplayVACBannedError();
}
}
else if ( eSteamLoginFailure == STEAMLOGINFAILURE_LOGGED_IN_ELSEWHERE )
{
if ( g_hLoadingDialog )
{
g_hLoadingDialog->DisplayLoggedInElsewhereError();
}
}
}
示例8: CloseBriefingFrame
void BriefingImagePanel::CloseBriefingFrame()
{
if (g_hBriefingFrame.Get())
{
if (GetClientModeASW())
GetClientModeASW()->StopBriefingMusic();
g_hBriefingFrame->SetDeleteSelfOnClose(true);
g_hBriefingFrame->Close();
FadeInPanel *pFadeIn = dynamic_cast<FadeInPanel*>(GetClientMode()->GetViewport()->FindChildByName("FadeIn", true));
if (pFadeIn)
{
pFadeIn->AllowFastRemove();
}
// clear the currently visible part of the chat
CHudChat *pChat = GET_HUDELEMENT( CHudChat );
if (pChat && pChat->GetChatHistory())
pChat->GetChatHistory()->ResetAllFades( false, false, 0 );
// if (m_pChatEcho)
// {
// m_pChatEcho->SetVisible(false);
// }
}
g_hBriefingFrame = NULL;
}
示例9: SetSecondaryProgressBar
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CGameUI::SetSecondaryProgressBar(float progress /* range [0..1] */)
{
if (!g_hLoadingDialog.Get())
return;
g_hLoadingDialog->SetSecondaryProgress(progress);
}
示例10: SetSecondaryProgressBarText
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CGameUI::SetSecondaryProgressBarText(const char *statusText)
{
if (!g_hLoadingDialog.Get())
return;
g_hLoadingDialog->SetSecondaryProgressText(statusText);
}
示例11: StopProgressBar
//-----------------------------------------------------------------------------
// Purpose: stops progress bar, displays error if necessary
//-----------------------------------------------------------------------------
void CGameUI::StopProgressBar(bool bError, const char *failureReason, const char *extendedReason)
{
if (!g_hLoadingDialog.Get() && bError)
{
g_hLoadingDialog = new CLoadingDialog(staticPanel);
}
if (!g_hLoadingDialog.Get())
return;
if (bError)
{
// turn the dialog to error display mode
g_hLoadingDialog->DisplayError(failureReason,extendedReason);
}
else
{
// close loading dialog
g_hLoadingDialog->Close();
g_hLoadingDialog = NULL;
}
// stop drawing loading screen
staticPanel->SetBackgroundRenderState(CBasePanel::BACKGROUND_DESKTOPIMAGE);
}
示例12: ContinueProgressBar
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
int CGameUI::ContinueProgressBar(int progressPoint, float progressFraction)
{
if (!g_hLoadingDialog.Get())
return 0;
g_hLoadingDialog->SetProgressPoint(progressPoint);
return 1;
}
示例13: Shutdown
void Shutdown()
{
DestroySDKLoadingPanel();
if (g_hLogoPanel.Get())
{
delete g_hLogoPanel.Get();
}
}
示例14: SetProgressBarStatusText
//-----------------------------------------------------------------------------
// Purpose: sets loading info text
//-----------------------------------------------------------------------------
int CGameUI::SetProgressBarStatusText(const char *statusText)
{
if (!g_hLoadingDialog.Get())
return 0;
g_hLoadingDialog->SetStatusText(statusText);
return 1;
}
示例15: HideTooltip
//-----------------------------------------------------------------------------
// Purpose: Display the tooltip
//-----------------------------------------------------------------------------
void Tooltip::HideTooltip()
{
if ( s_TooltipWindow.Get() )
{
s_TooltipWindow->SetVisible(false);
}
_makeVisible = false;
}