| 40 | #include "HUDManager.h" |
| 41 | |
| 42 | void CDialogHolder::StartMenu(CUIDialogWnd* pDialog, bool bDoHideIndicators) |
| 43 | { |
| 44 | R_ASSERT(!pDialog->IsShown()); |
| 45 | |
| 46 | if (MainInputReceiver() && GetUICursor()->IsVisible()) |
| 47 | { |
| 48 | // предыдущий диалог теряет фокус |
| 49 | MainInputReceiver()->UpdateFocus(true); |
| 50 | MainInputReceiver()->CommitFocus(true); |
| 51 | } |
| 52 | |
| 53 | AddDialogToRender(pDialog); |
| 54 | SetMainInputReceiver(pDialog, false); |
| 55 | |
| 56 | if (UseIndicators()) |
| 57 | { |
| 58 | bool b = !!psHUD_Flags.test(HUD_CROSSHAIR_RT); |
| 59 | m_input_receivers.back().m_flags.set(recvItem::eCrosshair, b); |
| 60 | |
| 61 | b = HUD().GetUI()->GameIndicatorsShown(); |
| 62 | m_input_receivers.back().m_flags.set(recvItem::eIndicators, b); |
| 63 | |
| 64 | if (bDoHideIndicators) |
| 65 | { |
| 66 | psHUD_Flags.set(HUD_CROSSHAIR_RT, FALSE); |
| 67 | HUD().GetUI()->HideGameIndicators(); |
| 68 | } |
| 69 | } |
| 70 | pDialog->SetHolder(this); |
| 71 | pDialog->Show(); |
| 72 | |
| 73 | if (pDialog->NeedCursor()) |
| 74 | GetUICursor()->Show(); |
| 75 | |
| 76 | if (g_pGameLevel) |
| 77 | { |
| 78 | CActor* A = smart_cast<CActor*>(Level().CurrentViewEntity()); |
| 79 | if (A && pDialog->StopAnyMove()) |
| 80 | { |
| 81 | A->StopAnyMove(); |
| 82 | }; |
| 83 | if (A) |
| 84 | { |
| 85 | A->PickupModeOff(); |
| 86 | A->IR_OnKeyboardRelease(kWPN_ZOOM); |
| 87 | A->IR_OnKeyboardRelease(kWPN_FIRE); |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | void CDialogHolder::StopMenu(CUIDialogWnd* pDialog) |
| 93 | { |
nothing calls this directly
no test coverage detected