Пример #1
0
LRESULT CMainFrame::ShowCombatView(WPARAM /*wParam*/, LPARAM /*lParam*/)
{
    MYTRACE("general")(MT::LEVEL_INFO, "Getting Message to Show CombatView...");

    CBotEDoc* pDoc = resources::pDoc;
    AssertBotE(pDoc);

    // Combat View anzeigen
    FullScreenMainView(true);
    SelectMainView(VIEWS::COMBAT_VIEW, pDoc->GetPlayersRaceID());
    // wurde Rundenende geklickt zurücksetzen
    resources::pClientWorker->SetToEmpireViewFor(*pDoc->GetPlayersRace());
    pDoc->m_bRoundEndPressed = false;
    pDoc->m_bDataReceived = true;

    // Zuletzt gedrückten Button zurücksetzen
    CCombatMenuView* pView = ((CCombatMenuView*)GetView(RUNTIME_CLASS(CCombatMenuView)));
    pView->OnNewRound();

    pDoc->UpdateAllViews(NULL);

    MYTRACE("general")(MT::LEVEL_INFO, "Showing CombatView\n");

    return TRUE;
}
Пример #2
0
void CMainFrame::SelectMainView(VIEWS::MAIN_VIEWS whichView, const CString& sRace)
{
    if (sRace.IsEmpty())
        return;

    AssertBotE(VIEWS::NULL_VIEW <= whichView && whichView <= VIEWS::COMBAT_VIEW);

    CBotEDoc* pDoc = resources::pDoc;
    AssertBotE(pDoc);

    if (pDoc->GetPlayersRaceID() == sRace)
    {
        resources::pClientWorker->SetSelectedViewForTo(sRace, whichView);
        // konnte in die neue View gewechselt werden
        if (m_wndSplitter.SwitchView(whichView, 0, 1))
        {
            switch (whichView)
            {
            case VIEWS::SYSTEM_VIEW:
                SelectBottomView(VIEWS::PLANET_BOTTOM_VIEW);
                break;
            case VIEWS::RESEARCH_VIEW:
                SelectBottomView(VIEWS::RESEARCH_BOTTOM_VIEW);
                break;
            case VIEWS::INTEL_VIEW:
                SelectBottomView(VIEWS::INTEL_BOTTOM_VIEW);
                break;
            case VIEWS::DIPLOMACY_VIEW:
                SelectBottomView(VIEWS::DIPLOMACY_BOTTOM_VIEW);
                break;
            case VIEWS::TRADE_VIEW:
                SelectBottomView(VIEWS::TRADE_BOTTOM_VIEW);
                break;
            case VIEWS::SHIPDESIGN_VIEW:
                SelectBottomView(VIEWS::SHIPDESIGN_BOTTOM_VIEW);
                break;
            case VIEWS::FLEET_VIEW:
                SelectBottomView(VIEWS::SHIP_BOTTOM_VIEW);
                break;
            case VIEWS::TRANSPORT_VIEW:
                SelectBottomView(VIEWS::SHIP_BOTTOM_VIEW);
                break;
            default:
                SelectBottomView(VIEWS::PLANET_BOTTOM_VIEW);
                break;
            }

            // Wenn wir irgendwie in eine andere View, außer der Galaxieansicht gelangen, dann dürfen wir keine Handelsroute
            // oder Ressourcenroute mehr zeichnen
            if (whichView != VIEWS::GALAXY_VIEW)
            {
                CGalaxyMenuView::IsDrawResourceRoute(false);
                CGalaxyMenuView::IsDrawTradeRoute(false);
            }
        }
    }
}