-------------------------------------------------------------------------------------------------
| 1788 | |
| 1789 | //------------------------------------------------------------------------------------------------- |
| 1790 | int CScriptObjectUI::GetScreen(IFunctionHandler *pH) |
| 1791 | { |
| 1792 | CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", GetScreen, 1); |
| 1793 | CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", GetScreen, 1, svtString, svtNumber); |
| 1794 | |
| 1795 | CUIScreen *pScreen = 0; |
| 1796 | |
| 1797 | if (pH->GetParamType(1) == svtString) |
| 1798 | { |
| 1799 | char *szName; |
| 1800 | |
| 1801 | pH->GetParam(1, szName); |
| 1802 | |
| 1803 | pScreen = m_pUISystem->GetScreen(szName); |
| 1804 | |
| 1805 | if (!pScreen) |
| 1806 | { |
| 1807 | m_pLog->LogToConsole("\001$4[Error]:$1 Screen '%s' was not found!", szName); |
| 1808 | } |
| 1809 | } |
| 1810 | else |
| 1811 | { |
| 1812 | int iScreenIndex; |
| 1813 | |
| 1814 | pH->GetParam(1, iScreenIndex); |
| 1815 | |
| 1816 | pScreen = m_pUISystem->GetScreen(iScreenIndex); |
| 1817 | |
| 1818 | if (!pScreen) |
| 1819 | { |
| 1820 | m_pLog->LogToConsole("\001$4[Error]:$1 Screen number '%d' was not found!", iScreenIndex); |
| 1821 | } |
| 1822 | } |
| 1823 | |
| 1824 | if (pScreen) |
| 1825 | { |
| 1826 | return pH->EndFunction(pScreen->GetScriptObject()); |
| 1827 | } |
| 1828 | |
| 1829 | return pH->EndFunctionNull(); |
| 1830 | } |
| 1831 | |
| 1832 | //------------------------------------------------------------------------------------------------- |
| 1833 | int CScriptObjectUI::ActivateScreen(IFunctionHandler *pH) |
no test coverage detected