예제 #1
0
        public void BeginShow()
        {
            //First, capture and save a screenshot for blur effects
            byte[]   screenshot = GetScreenshotOfWindow();
            NativeJs nsjs       = new NativeJs();
            //Convert this into a string we can pass into an image
            string base64Screenshot = "data:image/png;base64, " + Convert.ToBase64String(screenshot);
            //Start animation on JS side
            var  activeWindow = GetActiveWindow();
            bool isArkActive  = false;

            if (activeWindow != null)
            {
                isArkActive = activeWindow.ProcessName == "ShooterGame";
            }
            //If Ark is active, show the window. If not, tell the user to start it.
            if (isArkActive)
            {
                BrowserYo.ExecuteScriptAsync("BeginShow('" + base64Screenshot + "');");
                //Also, press the tab key in Ark to open the console.
                nsjs.pressKey("Tab");
                //Set the process
                StaticVars.arkWindow = activeWindow;
            }
            else
            {
                isShown = true;
                StaticVars.allowShowHideNow = true;
                BrowserYo.ExecuteScriptAsync("ShowArkNotInForegroundWarning();");
            }
        }
예제 #2
0
        public void BeginHide()
        {
            //Start animation on JS side
            BrowserYo.ExecuteScriptAsync("BeginHide();");
            //Get rid of the console in Ark.
            NativeJs nsjs = new NativeJs();

            nsjs.setArkActive();
            Thread.Sleep(100);
            nsjs.pressKey("Escape");
        }