| 1625 | } |
| 1626 | |
| 1627 | void CGameConsole::Toggle(int Type) |
| 1628 | { |
| 1629 | if(m_ConsoleType != Type && (m_ConsoleState == CONSOLE_OPEN || m_ConsoleState == CONSOLE_OPENING)) |
| 1630 | { |
| 1631 | // don't toggle console, just switch what console to use |
| 1632 | } |
| 1633 | else |
| 1634 | { |
| 1635 | if(m_ConsoleState == CONSOLE_CLOSED || m_ConsoleState == CONSOLE_OPEN) |
| 1636 | { |
| 1637 | m_StateChangeEnd = Client()->GlobalTime() + m_StateChangeDuration; |
| 1638 | } |
| 1639 | else |
| 1640 | { |
| 1641 | float Progress = m_StateChangeEnd - Client()->GlobalTime(); |
| 1642 | float ReversedProgress = m_StateChangeDuration - Progress; |
| 1643 | |
| 1644 | m_StateChangeEnd = Client()->GlobalTime() + ReversedProgress; |
| 1645 | } |
| 1646 | |
| 1647 | if(m_ConsoleState == CONSOLE_CLOSED || m_ConsoleState == CONSOLE_CLOSING) |
| 1648 | { |
| 1649 | Ui()->SetEnabled(false); |
| 1650 | m_ConsoleState = CONSOLE_OPENING; |
| 1651 | } |
| 1652 | else |
| 1653 | { |
| 1654 | ConsoleForType(Type)->m_Input.Deactivate(); |
| 1655 | Input()->MouseModeRelative(); |
| 1656 | Ui()->SetEnabled(true); |
| 1657 | GameClient()->OnRelease(); |
| 1658 | m_ConsoleState = CONSOLE_CLOSING; |
| 1659 | } |
| 1660 | } |
| 1661 | m_ConsoleType = Type; |
| 1662 | } |
| 1663 | |
| 1664 | void CGameConsole::ConToggleLocalConsole(IConsole::IResult *pResult, void *pUserData) |
| 1665 | { |
no test coverage detected