Beispiel #1
0
    internal void Preview(AvatarModel hero, AvatarModel targetModel, WhereAmI whereAmI)
    {
        Card tmp = targetModel != null ? targetModel.Card : null;

        PreviewCard(hero, tmp, whereAmI);

        string effectsText = "";

        if (targetModel != null)
        {
            if (targetModel.Effects.Count > 0)
            {
                effectsText += "\n effects: ";
            }
            foreach (CastedCard cc in targetModel.Effects)
            {
                effectsText += "( ";
                foreach (KeyValuePair <CastedCardParamType, int> kvp in cc.Params)
                {
                    effectsText += kvp.Key + ": " + kvp.Value + ",";
                }
                effectsText += "),";
            }
        }

        TextDescription.GetComponent <Text>().text = tmp != null?(tmp.Describe(hero) + effectsText):"";
    }
Beispiel #2
0
        private void AddCommandsToDic()
        {
            CreateNewFolder   createNewFolder   = new CreateNewFolder();
            CreateNewFile     createNewFile     = new CreateNewFile();
            LockPc            lockPc            = new LockPc();
            Shutdown          shutDown          = new Shutdown();
            SearchInPc        searchInPc        = new SearchInPc();
            UnlockPc          unlockPc          = new UnlockPc();
            SleepPc           sleepPc           = new SleepPc();
            SleepLuna         sleepLuna         = new SleepLuna();
            WakeUpLuna        wakeUpLuna        = new WakeUpLuna();
            CreateClass       createClass       = new CreateClass();
            DefineLanguage    defineLanguage    = new DefineLanguage();
            DefineProjectName defineProjectName = new DefineProjectName();
            DefineProjectPath defineProjectPath = new DefineProjectPath();
            GoTo     goTo     = new GoTo();
            WhereAmI whereAmI = new WhereAmI();


            dic.Add(createNewFile.CommandName, createNewFile);
            dic.Add(createNewFolder.CommandName, createNewFolder);
            dic.Add(lockPc.CommandName, lockPc);
            dic.Add(shutDown.CommandName, shutDown);
            dic.Add(searchInPc.CommandName, searchInPc);
            dic.Add(unlockPc.CommandName, unlockPc);
            dic.Add(sleepPc.CommandName, sleepPc);
            dic.Add(sleepLuna.CommandName, sleepLuna);
            dic.Add(wakeUpLuna.CommandName, wakeUpLuna);
            dic.Add(createClass.CommandName, createClass);
            dic.Add(defineLanguage.CommandName, defineLanguage);
            dic.Add(defineProjectName.CommandName, defineProjectName);
            dic.Add(defineProjectPath.CommandName, defineProjectPath);
            dic.Add(goTo.CommandName, goTo);
            dic.Add(whereAmI.CommandName, whereAmI);
        }
Beispiel #3
0
        //to have a dynamic where i am Point

        /*
         * if the users result by calibration is more than 80% in each of eyes, we can use followEyes option, in other
         * cases just mouse position.
         */

        private void showWhereIam()
        {
            if (wAIOn == true)
            {
                WhereAmI wAI = new WhereAmI(mConfiguration.whereIamPointFollowsEyes, mConfiguration);
                wAI.Show();
            }
        }
 private void showWhereIam()
 {
     if (wAIOn == true)
     {
         WhereAmI wAI = new WhereAmI(false, mConfiguration);
         wAI.Show();
     }
 }
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
            //DontDestroyOnLoad(this.gameObject);
        }
        else if (instance != this)
        {
            Destroy(gameObject);
        }

        SceneManager.sceneLoaded += VerificaFase;
    }
Beispiel #6
0
    public void PreviewCardHand(AvatarModel heroModel, Card card, WhereAmI whereAmI)
    {
        Prepare(heroModel, card, whereAmI);

        PanelCrystal.GetComponent <PanelValue>().Prepare(Card != null? Card.Cost:0);
        PanelAttack.GetComponent <PanelValue>().Prepare(Card != null && Card.Params.ContainsKey(ParamType.Attack) ? Card.Params[ParamType.Attack] : 0);
        PanelHealth.GetComponent <PanelValue>().Prepare(Card != null && Card.Params.ContainsKey(ParamType.Health) ? Card.Params[ParamType.Health] : 0);

        ImageBorder.GetComponent <Image>().color = card != null && heroModel != null && card.Cost > heroModel.ActualMana ? Color.black : (whereAmI == global::WhereAmI.SpecialPower && heroModel.AlreadyUsedPower ? Color.black : Color.green);
        if (whereAmI == global::WhereAmI.TopInfo)
        {
            ImageBorder.GetComponent <Image>().color = Color.white;
        }
        //PanelCrystal.GetComponent<Image>().color = card != null && card.Cost > heroModel.ActualMana ? Color.black : Color.white;
        //PanelCrystal.GetComponent<PanelValue>().Text.GetComponent<Text>().color = card != null && heroModel != null && card.Cost > heroModel.ActualMana ? Color.black : Color.white;
    }
Beispiel #7
0
 public static void Execute(
     severity s,
     string message
     )
 {
     try {
         var log = $"{s.ToString().ToUpper()}|{WhereAmI.Execute(stepUp: 3)}|{ message}";
         //TODO: check exists
         LambdaLogger.Log(log);
         //if (_log != null) {
         //  _log.Log(logLevel: GetLogLevel(s), log);
         //}
         nlogger.Log(level: GetNLoggerLogLevel(s), message: log);
     } catch (Exception ex) {
         LogIt.E("error in LogIt|" + ex.Message);
     }
 }
Beispiel #8
0
    public void Prepare(AvatarModel heroModel, Card card, WhereAmI whereAmI)
    {
        HeroModel = heroModel;
        Card      = card;

        CardImage.SetActive(Card != null);
        ImageColor.SetActive(Card != null);
        ImageOval.SetActive(Card != null);
        PanelCrystal.SetActive(Card != null);
        PanelAttack.SetActive(Card != null);
        PanelHealth.SetActive(Card != null);
        ImageTaunt.SetActive(false);
        ImageSticky.SetActive(false);
        //minion has green background
        ImageColor.GetComponent <Image>().color = (card != null && card.CardPersistency.IsCharacter()) ? Color.blue : Color.red;
        //minion has oval
        //ImageOval.SetActive(card!=null && Card.CardPersistency.IsCharacter());

        CardImage.GetComponent <Image>().sprite = card != null?card.Animation:null;

        ImageBorder.SetActive(whereAmI == global::WhereAmI.Hand || whereAmI == global::WhereAmI.SpecialPower || whereAmI == global::WhereAmI.Board);
    }
Beispiel #9
0
        private void CheckForKeys()
        {
            while (checkForKeys)
            {
                //sleeping for while, this will reduce load on cpu
                Thread.Sleep(10);


                foreach (Keys key in Enum.GetValues(typeof(Keys)))
                {
                    // if key is pressed
                    if (((GetAsyncKeyState(key) & (1 << 15)) != 0))
                    {
                        // zoom in
                        if (key == Keys.Add)
                        {
                            BeginInvoke(new MethodInvoker(delegate
                            {
                                if (mConfiguration.ZoomFactor < 10f)
                                {
                                    mConfiguration.ZoomFactor++;
                                    mMainForm.label_ZoomFaktor.Text = mConfiguration.ZoomFactor.ToString();
                                }
                            }));
                            Thread.Sleep(500);
                        }

                        // zoom out
                        if (key == Keys.Subtract)
                        {
                            BeginInvoke(new MethodInvoker(delegate
                            {
                                if (mConfiguration.ZoomFactor > 1f)
                                {
                                    mConfiguration.ZoomFactor--;
                                    mMainForm.label_ZoomFaktor.Text = mConfiguration.ZoomFactor.ToString();
                                }
                            }));
                            Thread.Sleep(500);
                        }

                        // toggle fullscreen
                        if (key == Keys.Multiply)
                        {
                            if (IsNormal == true)
                            {
                                IsNormal = false;
                                BeginInvoke(new MethodInvoker(delegate
                                {
                                    WindowState = FormWindowState.Maximized;
                                }));
                                Thread.Sleep(500);
                            }
                            else if (IsNormal == false)
                            {
                                IsNormal = true;
                                BeginInvoke(new MethodInvoker(delegate
                                {
                                    WindowState = FormWindowState.Normal;
                                }));
                                Thread.Sleep(500);
                            }
                        }


                        if (key == Keys.F2)
                        {
                            if (wAIOn == false)
                            {
                                // checkForKeys = false;
                                wAIOn = true;

                                BeginInvoke(new MethodInvoker(delegate
                                {
                                    WhereAmI wAI = new WhereAmI(wWhereAmIPoint, mConfiguration);
                                    wAI.Show();

                                    temp = mConfiguration.ZoomFactor;
                                    mConfiguration.ZoomFactor = 1;

                                    if (mConfiguration.invertColors == true)
                                    {
                                        mConfiguration.invertColors = false;
                                        tempString = "invertColors";
                                    }

                                    else if (mConfiguration.normal == true)
                                    {
                                        mConfiguration.normal = false;
                                        tempString            = "normal";
                                    }

                                    else if (mConfiguration.achromatomaly == true)
                                    {
                                        mConfiguration.achromatomaly = false;
                                        tempString = "achromatomaly";
                                    }

                                    else if (mConfiguration.achromatopsia == true)
                                    {
                                        mConfiguration.achromatopsia = false;
                                        tempString = "achromatopsia";
                                    }
                                    else if (mConfiguration.deuteranopia == true)
                                    {
                                        mConfiguration.deuteranopia = false;
                                        tempString = "deuteranopia";
                                    }
                                    else if (mConfiguration.deuteranomaly == true)
                                    {
                                        mConfiguration.deuteranomaly = false;
                                        tempString = "deuteranomaly";
                                    }
                                    else if (mConfiguration.protanomaly == true)
                                    {
                                        mConfiguration.protanomaly = false;
                                        tempString = "protanomaly";
                                    }
                                    else if (mConfiguration.protanopia == true)
                                    {
                                        mConfiguration.protanopia = false;
                                        tempString = "protanopia";
                                    }
                                    else if (mConfiguration.tritanomaly == true)
                                    {
                                        mConfiguration.tritanomaly = false;
                                        tempString = "tritanomaly";
                                    }
                                    else if (mConfiguration.tritanopia == true)
                                    {
                                        mConfiguration.tritanopia = false;
                                        tempString = "tritanopia";
                                    }

                                    mConfiguration.normal = true;
                                }));

                                Thread.Sleep(500);
                            }
                            else if (wAIOn == true)
                            {
                                wAIOn = false;

                                BeginInvoke(new MethodInvoker(delegate
                                {
                                    List <Form> forms = new List <Form>();

                                    foreach (Form f in Application.OpenForms)
                                    {
                                        if (f.Name == "WhereAmI")
                                        {
                                            forms.Add(f);
                                        }
                                    }

                                    // Now let's close opened myForm instances from aother thread
                                    if (forms.Count > 0)
                                    {
                                        foreach (Form f in forms)
                                        {
                                            f.Close();
                                        }
                                    }

                                    mConfiguration.normal     = false;
                                    mConfiguration.ZoomFactor = temp;

                                    if (tempString == "invertColors")
                                    {
                                        mConfiguration.invertColors = true;
                                    }

                                    else if (tempString == "normal")
                                    {
                                        mConfiguration.normal = true;
                                    }

                                    else if (tempString == "achromatomaly")
                                    {
                                        mConfiguration.achromatomaly = true;
                                    }

                                    else if (tempString == "achromatopsia")
                                    {
                                        mConfiguration.achromatopsia = true;
                                    }
                                    else if (tempString == "deuteranopia")
                                    {
                                        mConfiguration.deuteranopia = true;
                                    }
                                    else if (tempString == "deuteranomaly")
                                    {
                                        mConfiguration.deuteranomaly = true;
                                    }
                                    else if (tempString == "protanomaly")
                                    {
                                        mConfiguration.protanomaly = true;
                                    }
                                    else if (tempString == "protanopia")
                                    {
                                        mConfiguration.protanopia = true;
                                    }
                                    else if (tempString == "tritanomaly")
                                    {
                                        mConfiguration.tritanomaly = true;
                                    }
                                    else if (tempString == "tritanopia")
                                    {
                                        mConfiguration.tritanopia = true;
                                    }
                                }));

                                Thread.Sleep(500);
                            }
                        }

                        if (key == Keys.F3)
                        {
                            BeginInvoke(new MethodInvoker(delegate
                            {
                                mMainForm.Location    = this.Location;
                                mMainForm.WindowState = FormWindowState.Normal;
                            }));

                            Thread.Sleep(500);
                        }

                        if (key == Keys.Escape)
                        {
                            BeginInvoke(new MethodInvoker(delegate
                            {
                                NativeMethods.MagShowSystemCursor(true);

                                List <Form> forms = new List <Form>();

                                foreach (Form f in Application.OpenForms)
                                {
                                    if (f.Name == "WhereAmI")
                                    {
                                        forms.Add(f);
                                    }
                                }

                                // Now let's close opened myForm instances from aother thread
                                if (forms.Count > 0)
                                {
                                    foreach (Form f in forms)
                                    {
                                        f.Close();
                                    }
                                }


                                mMainForm.button_BackToMain.Hide();
                                this.Close();

                                if (IsBothEyeAndHead)
                                {
                                    mgBothEyeAndHead.Dispose();
                                }
                                if (IsBothEye)
                                {
                                    mgBothEye.Dispose();
                                }

                                if (IsLeftEyeAndHead)
                                {
                                    mgLeftEyeAndHead.Dispose();
                                }
                                if (IsLeftEye)
                                {
                                    mgLeftEye.Dispose();
                                }

                                if (IsRightEyeAndHead)
                                {
                                    mgRightEyeAndHead.Dispose();
                                }
                                if (IsRightEye)
                                {
                                    mgRightEye.Dispose();
                                }

                                if (IsJustHeadAndHead)
                                {
                                    mgJustHead.Dispose();
                                }

                                checkForKeys = false;

                                mMainForm.MagniferUsingMouse_button.Enabled     = true;
                                mMainForm.FullscreenMaginfierEye_Button.Enabled = true;
                                mMainForm.MaginfierEye_Button.Enabled           = true;
                                mMainForm.FullScreenMouse_Button.Enabled        = true;
                                mMainForm.Evaluation_button.Enabled             = true;
                            }));
                            Thread.Sleep(500);
                        }
                    }
                }
            }
        }
Beispiel #10
0
 public virtual void whereAmI(WhereAmI whereAmI)
 {
 }
Beispiel #11
0
 public override void whereAmI(WhereAmI whereAmI)
 {
     where = whereAmI;
 }
Beispiel #12
0
 // Start is called before the first frame update
 void Start()
 {
     WhereAmI = GetComponent <WhereAmI>();
 }
        private void HandleEsc(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Add)
            {
                BeginInvoke(new MethodInvoker(delegate
                {
                    if (mConfiguration.ZoomFactor < 10f)
                    {
                        mConfiguration.ZoomFactor++;
                        mMainForm.label_ZoomFaktor.Text = mConfiguration.ZoomFactor.ToString();
                    }
                }));
            }

            // zoom out
            if (e.KeyCode == Keys.Subtract)
            {
                BeginInvoke(new MethodInvoker(delegate
                {
                    if (mConfiguration.ZoomFactor > 1f)
                    {
                        mConfiguration.ZoomFactor--;
                        mMainForm.label_ZoomFaktor.Text = mConfiguration.ZoomFactor.ToString();
                    }
                }));
            }

            // toggle fullscreen
            if (e.KeyCode == Keys.Multiply)
            {
                if (IsNormal)
                {
                    IsNormal = false;
                    BeginInvoke(new MethodInvoker(delegate
                    {
                        WindowState = FormWindowState.Maximized;
                    }));
                }
                else
                {
                    IsNormal = true;
                    BeginInvoke(new MethodInvoker(delegate
                    {
                        WindowState = FormWindowState.Normal;
                    }));
                }
            }


            if (e.KeyCode == Keys.Escape)
            {
                NativeMethods.MagShowSystemCursor(true);

                mMainForm.button_BackToMain.Hide();
                this.Close();

                if (IsBothEyeAndHead)
                {
                    mgBothEyeAndHead.Dispose();
                }
                if (IsBothEye)
                {
                    mgBothEye.Dispose();
                }

                if (IsLeftEyeAndHead)
                {
                    mgLeftEyeAndHead.Dispose();
                }
                if (IsLeftEye)
                {
                    mgLeftEye.Dispose();
                }

                if (IsRightEyeAndHead)
                {
                    mgRightEyeAndHead.Dispose();
                }
                if (IsRightEye)
                {
                    mgRightEye.Dispose();
                }

                if (IsJustHeadAndHead)
                {
                    mgJustHead.Dispose();
                }

                mMainForm.MagniferUsingMouse_button.Enabled     = true;
                mMainForm.FullscreenMaginfierEye_Button.Enabled = true;
                mMainForm.MaginfierEye_Button.Enabled           = true;
                mMainForm.FullScreenMouse_Button.Enabled        = true;
                mMainForm.Evaluation_button.Enabled             = true;
            }

            if (e.KeyCode == Keys.F1)
            {
                WhereAmI wAI = new WhereAmI(this, wWhereAmIPoint);
                this.Hide();
                wAI.Show();
            }
        }
Beispiel #14
0
 public void PreviewCard(AvatarModel hero, Card card, WhereAmI whereAmI)
 {
     PanelAvatar.GetComponent <PanelAvatarCard>().PreviewCardHand(hero, card, whereAmI);
     TextName.GetComponent <Text>().text        = card != null?card.Name:"";
     TextDescription.GetComponent <Text>().text = card != null?card.Describe(hero) : "";
 }