コード例 #1
0
ファイル: CGUI.cpp プロジェクト: stymR/mtasa-blue
void CLocalGUI::SetMainMenuVisible ( bool bVisible )
{
    if ( m_pMainMenu )
    {
        // This code installs the original CCore input handlers when the ingame menu
        // is shown, and restores the mod input handlers when the menu is hidden again.
        // This is needed for things like pressing escape when changing a key bind

        m_pMainMenu->SetVisible ( bVisible );

        CGUI* pGUI = CCore::GetSingleton ().GetGUI ();
        if ( bVisible )
        {
            pGUI->SelectInputHandlers ( INPUT_CORE );
        }
        else
        {
            pGUI->SelectInputHandlers ( INPUT_MOD );
        }

        if ( bVisible )
            pGUI->SetCursorAlpha ( 1.0f );
        else
            pGUI->SetCursorAlpha ( pGUI->GetCurrentServerCursorAlpha () );
    }
    else
    {
        WriteDebugEvent ( "WARNING: CLocalGUI::SetMainMenuVisible() called, but CLocalGUI::CreateObjects() isn't" );
    }
}
コード例 #2
0
ファイル: CGUI.cpp プロジェクト: stymR/mtasa-blue
void CLocalGUI::SetConsoleVisible ( bool bVisible )
{
    if ( m_pConsole )
    {
        // Only allow the console if the chat doesn't take input
        if ( m_pChat->IsInputVisible () )
            bVisible = false;
        
        // Set the visible state
        m_pConsole->SetVisible ( bVisible );

        CGUI* pGUI = CCore::GetSingleton ().GetGUI ();
        if ( bVisible )
	        pGUI->SetCursorAlpha ( 1.0f );
        else
	        pGUI->SetCursorAlpha ( pGUI->GetCurrentServerCursorAlpha () );
    }
    else
    {
        WriteDebugEvent ( "WARNING: CLocalGUI::HideConsole() called, but CLocalGUI::CreateObjects() isn't!" );
    }
}