-------------------------------------------------------------------------------------------------
| 1831 | |
| 1832 | //------------------------------------------------------------------------------------------------- |
| 1833 | int CScriptObjectUI::ActivateScreen(IFunctionHandler *pH) |
| 1834 | { |
| 1835 | CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", ActivateScreen, 1); |
| 1836 | CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", ActivateScreen, 1, svtString, svtObject); |
| 1837 | |
| 1838 | CUIScreen *pScreen = 0; |
| 1839 | |
| 1840 | if (pH->GetParamType(1) == svtString) |
| 1841 | { |
| 1842 | char *szName; |
| 1843 | |
| 1844 | pH->GetParam(1, szName); |
| 1845 | |
| 1846 | pScreen = m_pUISystem->GetScreen(szName); |
| 1847 | |
| 1848 | if (!pScreen) |
| 1849 | { |
| 1850 | m_pLog->LogToConsole("\001$4[Error]:$1 Tried to activate screen '%s' which was not found!", szName); |
| 1851 | } |
| 1852 | } |
| 1853 | else |
| 1854 | { |
| 1855 | IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject(); |
| 1856 | |
| 1857 | pH->GetParam(1, pObj); |
| 1858 | |
| 1859 | pScreen = (CUIScreen *)pObj->GetNativeData(); |
| 1860 | |
| 1861 | if (!pScreen) |
| 1862 | { |
| 1863 | m_pLog->LogToConsole("\001$4[Error]:$1 Tried to activate a screen which was not found!"); |
| 1864 | } |
| 1865 | } |
| 1866 | |
| 1867 | if (pScreen) |
| 1868 | { |
| 1869 | m_pUISystem->ActivateScreen(pScreen); |
| 1870 | } |
| 1871 | |
| 1872 | return pH->EndFunctionNull(); |
| 1873 | } |
| 1874 | |
| 1875 | //------------------------------------------------------------------------------------------------- |
| 1876 | int CScriptObjectUI::DeactivateScreen(IFunctionHandler *pH) |
nothing calls this directly
no test coverage detected