-------------------------------------------------------------------------------------------------
| 1874 | |
| 1875 | //------------------------------------------------------------------------------------------------- |
| 1876 | int CScriptObjectUI::DeactivateScreen(IFunctionHandler *pH) |
| 1877 | { |
| 1878 | CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", DeactivateScreen, 1); |
| 1879 | CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", DeactivateScreen, 1, svtString, svtObject); |
| 1880 | |
| 1881 | CUIScreen *pScreen = 0; |
| 1882 | |
| 1883 | if (pH->GetParamType(1) == svtString) |
| 1884 | { |
| 1885 | char *szName; |
| 1886 | |
| 1887 | pH->GetParam(1, szName); |
| 1888 | |
| 1889 | pScreen = m_pUISystem->GetScreen(szName); |
| 1890 | |
| 1891 | if (!pScreen) |
| 1892 | { |
| 1893 | m_pLog->LogToConsole("\001$4[Error]:$1 Tried to Deactivate screen '%s' which was not found!", szName); |
| 1894 | } |
| 1895 | } |
| 1896 | else |
| 1897 | { |
| 1898 | IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject(); |
| 1899 | |
| 1900 | pH->GetParam(1, pObj); |
| 1901 | |
| 1902 | pScreen = (CUIScreen *)pObj->GetNativeData(); |
| 1903 | |
| 1904 | if (!pScreen) |
| 1905 | { |
| 1906 | m_pLog->LogToConsole("\001$4[Error]:$1 Tried to Deactivate a screen which was not found!"); |
| 1907 | } |
| 1908 | } |
| 1909 | |
| 1910 | if (pScreen) |
| 1911 | { |
| 1912 | m_pUISystem->DeactivateScreen(pScreen); |
| 1913 | } |
| 1914 | |
| 1915 | return pH->EndFunctionNull(); |
| 1916 | } |
| 1917 | |
| 1918 | //------------------------------------------------------------------------------------------------- |
| 1919 | int CScriptObjectUI::IsScreenActive(IFunctionHandler *pH) |
nothing calls this directly
no test coverage detected