-------------------------------------------------------------------------------------------------
| 1917 | |
| 1918 | //------------------------------------------------------------------------------------------------- |
| 1919 | int CScriptObjectUI::IsScreenActive(IFunctionHandler *pH) |
| 1920 | { |
| 1921 | CHECK_SCRIPT_FUNCTION_PARAMCOUNT(m_pScriptSystem, "UI", IsScreenActive, 1); |
| 1922 | CHECK_SCRIPT_FUNCTION_PARAMTYPE2(m_pScriptSystem, "UI", IsScreenActive, 1, svtString, svtObject); |
| 1923 | |
| 1924 | CUIScreen *pScreen = 0; |
| 1925 | |
| 1926 | if (pH->GetParamType(1) == svtString) |
| 1927 | { |
| 1928 | char *szName; |
| 1929 | |
| 1930 | pH->GetParam(1, szName); |
| 1931 | |
| 1932 | pScreen = m_pUISystem->GetScreen(szName); |
| 1933 | |
| 1934 | if (!pScreen) |
| 1935 | { |
| 1936 | m_pLog->LogToConsole("\001$4[Error]:$1 Tried to check for screen '%s' which was not found!", szName); |
| 1937 | } |
| 1938 | } |
| 1939 | else |
| 1940 | { |
| 1941 | IScriptObject *pObj = m_pScriptSystem->CreateEmptyObject(); |
| 1942 | |
| 1943 | pH->GetParam(1, pObj); |
| 1944 | |
| 1945 | pScreen = (CUIScreen *)pObj->GetNativeData(); |
| 1946 | |
| 1947 | if (!pScreen) |
| 1948 | { |
| 1949 | m_pLog->LogToConsole("\001$4[Error]:$1 Tried to check for a screen which was not found!"); |
| 1950 | } |
| 1951 | } |
| 1952 | |
| 1953 | if (pScreen) |
| 1954 | { |
| 1955 | return pH->EndFunction(m_pUISystem->IsScreenActive(pScreen)); |
| 1956 | } |
| 1957 | |
| 1958 | return pH->EndFunction(false); |
| 1959 | } |
| 1960 | |
| 1961 | //------------------------------------------------------------------------------------------------- |
| 1962 | int CScriptObjectUI::GetActiveScreenCount(IFunctionHandler *pH) |
nothing calls this directly
no test coverage detected