Пример #1
2
void CLocalGUI::SetMainMenuVisible ( bool bVisible )
{
    if ( m_pMainMenu )
    {
        // This code installs the original CCore mouseclick handlers when the ingame menu
        // is shown, and restores the mod mouseclick handlers when the menu is hidden again.
        // This is needed to prevent a crash when double clicking a server in the server browser
        // while already ingame: the mod module gets unloaded while its doubleclick handler is
        // still running.

        m_pMainMenu->SetVisible ( bVisible );

        CGUI* pGUI = CCore::GetSingleton ().GetGUI ();
        if ( bVisible )
        {
            pGUI->SelectInputHandlers ( INPUT_CORE );
        }
        else
        {
            pGUI->SelectInputHandlers ( INPUT_MOD );
        }
    }
    else
    {
        WriteDebugEvent ( "WARNING: CLocalGUI::SetMainMenuVisible() called, but CLocalGUI::CreateObjects() isn't" );
    }
}
Пример #2
0
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" );
    }
}