示例#1
0
        public void SearchByCategories()
        {
            Global.GlobalDefinitions.wait(20);

            MagnifyingGlass.Click();

            Global.GlobalDefinitions.wait(60);

            VideoAnimation.Click();

            Global.GlobalDefinitions.wait(60);

            PromotionalVideos.Click();

            Global.GlobalDefinitions.wait(60);

            for (var i = 1; i <= 10; i++)
            {
                var Textcode = Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-search-section']/div[2]/div/section/div/div[2]/div/div[2]/div/div/div[" + i + "]/div[1]/a[2]/p")).Text;
                Console.WriteLine(Textcode);
                if (Textcode == "Animation")
                {
                    Global.GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='service-search-section']/div[2]/div/section/div/div[2]/div/div[2]/div/div/div[" + i + "]/div[1]/a[2]/p")).Click();
                    Console.WriteLine("Test Passed");
                    Base.test.Log(LogStatus.Info, "Successfully Searched By Categories");
                    return;
                }
            }
        }
示例#2
0
        public void SetTarget(Transform target)
        {
            Vector3 targetPosition = new Vector3(target.position.x, target.position.y, transform.position.z);

            gameObject.GetOrAdd <TransformBezierMovable>().Move(new TransformBezierMovable.Data {
                movingType = MovingFuncType.Bezier3,
                speed      = speed,
                positions  = new PositionObject[] {
                    new StaticPositionObject(transform.position),
                    ComputeMid(1.0f / 3.0f, target),
                    ComputeMid(2.0f / 3.0f, target),
                    new StaticPositionObject(targetPosition)
                },
                onComplete = () => {
                    GetComponentInChildren <ParticleSystem>().Stop(true, ParticleSystemStopBehavior.StopEmitting);
                    magGlassComponent = Camera.main.gameObject.GetOrAdd <MagnifyingGlass>();
                    magGlassComponent.Setup(magGlassMaterial, 0.3f, new Vector2(0.1f, 0.2f), new Vector2(0.3f, 1.0f), targetPosition);

                    var nightSpot = FindObjectOfType <NightSpotlight>();
                    nightSpot?.SetSpotToWorldPosition(targetPosition);

                    StartCoroutine(CorWait());
                }
            });
        }
示例#3
0
        public static Shape createShape(ScreenshotEditor editor, bool cropBoxActive, XPathNavigator element)
        {
            string type = element.GetAttribute("type", "");
            Shape  s    = null;

            switch (type)
            {
            case "Arrow":
                s = new Arrow(editor, element);
                break;

            case "CropBox":
                s = new CropBox(editor, element, cropBoxActive);
                break;

            case "Censor":
                s = new Censor(editor, element);
                break;

            case "Line":
                s = new Line(editor, element);
                break;

            case "Oval":
                s = new Oval(editor, element);
                break;

            case "MagnifyingGlass":
                s = new MagnifyingGlass(editor, element);
                break;

            case "Pencil":
                s = new Pencil(editor, element);
                break;

            case "Picture":
                s = new Picture(editor, element);
                break;

            case "PonyVille":
                s = new PonyVille(editor, element);
                break;

            case "RectangleShape":
                s = new RectangleShape(editor, element);
                break;

            case "TextShape":
                s = new TextShape(editor, element);
                break;

            default:
                break;
            }
            return(s);
        }
示例#4
0
        private System.Collections.IEnumerator CorWait()
        {
            yield return(new WaitForSeconds(2.4f));

            if (magGlassComponent)
            {
                magGlassComponent.RemoveSelf();
                magGlassComponent = null;
            }
            Destroy(gameObject);
        }
示例#5
0
    public void ChangeCurrentAction()
    {
        audioSource.Play();
        MagnifyingGlass glass = FindObjectOfType <MagnifyingGlass>();

        if (glass)
        {
            glass.Disable();
        }
        im.ClearAction();
        im.SetCursor(cursorTexture);
        gm.ChangeAction(action);
    }
示例#6
0
    private void OnMouseEnter()
    {
        if (!gm)
        {
            gm = FindObjectOfType <GameManager>();
        }

        if (gm.IsSceneBlocked())
        {
            return;
        }

        if (!so)
        {
            so = GetComponent <SpriteOutline>();
        }
        MagnifyingGlass magnifyingGlass = FindObjectOfType <MagnifyingGlass>();

        if (so && (!magnifyingGlass || magnifyingGlass && !magnifyingGlass.IsActive()))
        {
            so.EnableOutline();
        }
    }
 public void MagnifyingGlassClick()
 {
     MagnifyingGlass.Click();
 }
示例#8
0
    void Update()
    {
        if (Input.GetMouseButtonDown(1))
        {
            MagnifyingGlass glass = FindObjectOfType <MagnifyingGlass>();
            if (glass)
            {
                glass.Disable();
            }
            ClearAction();
        }

        if (blockingLayer != null && blockingLayer.activeSelf)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.LeftAlt))
        {
            MagnifyingGlass glass = FindObjectOfType <MagnifyingGlass>();
            if (!glass || !glass.IsActive())
            {
                foreach (SpriteOutline so in FindObjectsOfType <SpriteOutline>())
                {
                    so.EnableOutline();
                }
            }
        }
        else if (Input.GetKeyUp(KeyCode.LeftAlt))
        {
            foreach (SpriteOutline so in FindObjectsOfType <SpriteOutline>())
            {
                so.DisableOutline();
            }
        }

        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit2D hit = Physics2D.Raycast(new Vector2(
                                                     mainCamera.ScreenToWorldPoint(Input.mousePosition).x,
                                                     mainCamera.ScreenToWorldPoint(Input.mousePosition).y),
                                                 Vector2.zero, 100f, clickableMask, -Mathf.Infinity, Mathf.Infinity);

            if (hit)
            {
                Clickable clickable = hit.collider.GetComponent <Clickable>();

                if (clickable && clickable.enabled)
                {
                    Character c = hit.collider.GetComponent <Character>();
                    if (c && c.GetType() != typeof(Doggo))
                    {
                        ClearCurrentOutline();
                        if (c.OnClick(gm.GetSelectedAction()))
                        {
                            currentActionInfo.source = c;
                            currentActionInfo.target = null;
                            SetCurrentOutline();
                        }
                    }
                    else
                    {
                        if (currentActionInfo.source && !currentActionInfo.target)
                        {
                            currentActionInfo.target = clickable;
                        }
                    }
                }
            }

            if (currentActionInfo.source != null && currentActionInfo.target != null)
            {
                if (currentActionInfo.source.CanInteractWith(gm.GetSelectedAction(), currentActionInfo.target))
                {
                    currentActionInfo.source.Interact(gm.GetSelectedAction(), currentActionInfo.target);
                }
                else
                {
                    currentActionInfo.source.GetComponent <AudioSource>().clip = currentActionInfo.source.angryTrack;
                    currentActionInfo.source.GetComponent <AudioSource>().Play();
                }

                ClearAction();
            }
        }
    }
示例#9
0
        public ImagePresenterViewModel(ObservableCollection <Image> image, int viewModelID, Tools tool, int maxWindows)
        {
            switch (tool)
            {
            case Tools.None:
                break;

            case Tools.RegionSelection:
                Tool = new CreateRegion();
                break;

            case Tools.Magnifier:
                Tool = new MagnifyingGlass();
                break;

            case Tools.PixelInformations:
                Tool = new PixelPicker();
                break;

            case Tools.RegionTransformation:
                break;

            case Tools.ImagePan:
                Tool = new PanImage();
                break;

            case Tools.Rotate:
                Tool = new Rotate();
                break;

            default:
                break;
            }
            ViewModelID    = viewModelID;
            MaxWindows     = maxWindows;
            _imageList     = new ObservableCollection <Image>();
            _imageList     = image;
            ImageIndex     = 0;
            DisplayedImage = _imageList[_imageIndex];
            IsSynchronized = true;
            Scale          = 1;
            SubscriptionToken token;

            token = _aggregator.GetEvent <SerializeOutputEvent>().Subscribe(SerializeOutputFromPresenters);
            _subscriptionTokens.Add(typeof(SerializeOutputEvent), token);
            token = _aggregator.GetEvent <RotateImageEvent>().Subscribe(RotateImage);
            _subscriptionTokens.Add(typeof(RotateImageEvent), token);
            token = _aggregator.GetEvent <SynchronizationEvent>().Subscribe(i =>
            {
                if (ViewModelID == i)
                {
                    IsSynchronized = !IsSynchronized;
                }
            });
            _subscriptionTokens.Add(typeof(SynchronizationEvent), token);
            token = _aggregator.GetEvent <SendDisplayedImage>().Subscribe(item =>
            {
                if ((item.PresenterID == ViewModelID || (item.DoReset == true && item.IsSynchronized && IsSynchronized)) && item.Image != null)
                {
                    ImagePosition = item.Image.Position;
                }
                else if (item.IsSynchronized == true && IsSynchronized && item.DoReset == false)
                {
                    ImagePosition = new Thickness(ImagePosition.Left + item.OffsetX, ImagePosition.Top + item.OffsetY, -(ImagePosition.Left + item.OffsetX), -(ImagePosition.Top + item.OffsetY));
                }
                if (item.DoProcessing)
                {
                    CalculateRegionProperties();
                }
            });
            _subscriptionTokens.Add(typeof(SendDisplayedImage), token);
            token = _aggregator.GetEvent <SendToolEvent>().Subscribe(item =>
            {
                Tool = item;
            });
            _subscriptionTokens.Add(typeof(SendToolEvent), token);
            token = _aggregator.GetEvent <SendRegionNameEvent>().Subscribe(SaveRegion);
            _subscriptionTokens.Add(typeof(SendRegionNameEvent), token);
            token = _aggregator.GetEvent <LoadRegionEvent>().Subscribe(region =>
            {
                if (region.PresenterID > MaxWindows)
                {
                    region.PresenterID = DisplayImageWindowViewModel.ImageCounter;
                }
                if (region.PresenterID != ViewModelID)
                {
                    return;
                }

                if (_imageList != region.ImageList)
                {
                    _imageList = region.ImageList;
                }
                DisplayedImage = region.ImageList.First(x => x == region.AttachedImage);
                RegionLocation = new Thickness(region.Position.X * 96.0 / region.DpiX, region.Position.Y * 96.0 / region.DpiY, 0, 0);
                RegionWidth    = (int)(region.Size.Width * 96.0 / region.DpiX);
                RegionHeight   = (int)(region.Size.Height * 96.0 / region.DpiY);
                ImageIndex     = region.ImageIndex;
                Scale          = region.Zoom;
                ImagePosition  = region.ImagePosition;
                if (IsSynchronized)
                {
                    SynchronizeRegions sr = new SynchronizeRegions();
                    sr.PresenterID        = ViewModelID;
                    sr.Position           = RegionLocation;
                    sr.Width        = RegionWidth;
                    sr.Height       = RegionHeight;
                    sr.DoProcessing = true;
                    sr.Zoom         = Scale;
                    _aggregator.GetEvent <SynchronizeRegions>().Publish(sr);
                }
                CalculateRegionProperties();
            });
            _subscriptionTokens.Add(typeof(LoadRegionEvent), token);
            token = _aggregator.GetEvent <SendImageList>().Subscribe(item =>
            {
                try
                {
                    if (item.Count != 0)
                    {
                        if (!item.Any(x => x == _imageList))
                        {
                            _imageList     = item[0];
                            ImageIndex     = 0;
                            DisplayedImage = _imageList[0];
                        }
                    }
                    else
                    {
                        DisplayedImage = null;
                        _imageList     = null;
                    }
                }
                catch (Exception)
                {
                }
            });
            _subscriptionTokens.Add(typeof(SendImageList), token);
            token = _aggregator.GetEvent <ResetRegionsEvent>().Subscribe(() =>
            {
                RegionHeight   = 0;
                RegionWidth    = 0;
                RegionLocation = new Thickness(0, 0, 0, 0);
            });
            _subscriptionTokens.Add(typeof(ResetRegionsEvent), token);

            ImageClickCommand = new GalaSoft.MvvmLight.Command.RelayCommand <RoutedEventArgs>(ImageClickExecute);
            LeftArrowCommand  = new RelayCommand(PreviousImage);
            RightArrowCommand = new RelayCommand(NextImage);
            SaveRegionCommand = new RelayCommand(OpenSaveRegionWindow);
            SerializeOutputFromListCommand = new RelayCommand(SerializeOutputFromList);
            EscapeCommand         = new RelayCommand(EscapeClicked);
            SelectAllCommand      = new RelayCommand(SelectAll);
            ResetPositionCommand  = new RelayCommand(ResetPosition);
            ResetZoomCommand      = new RelayCommand(ResetZoom);
            MouseLeftClickCommand = new GalaSoft.MvvmLight.Command.RelayCommand <RoutedEventArgs>(MouseLeftClick);
            MouseMoveCommand      = new GalaSoft.MvvmLight.Command.RelayCommand <RoutedEventArgs>(MouseMove);
            MouseOverCommand      = new GalaSoft.MvvmLight.Command.RelayCommand <RoutedEventArgs>(MouseEnter);
            MouseWheelCommand     = new GalaSoft.MvvmLight.Command.RelayCommand <MouseWheelEventArgs>(MouseWheel);
        }
示例#10
0
        //JsonSerializer a = new JsonSerializer();

        public void loadData()
        {
            config = instance.Helper.Data.ReadJsonFile <ModData>($"data/{Constants.SaveFolderName}.json") ?? new ModData();

            List <List <string> > itemInfo = config.itemInfo;

            maxTab = config.maxTab;

            cost = config.cost;

            int y = 0;
            int z = 1;

            invs[0] = Game1.player.Items;
            invs.Add(new List <Item>());

            for (int i = 0; i < itemInfo.Count; i++)
            {
                if (y == 36)
                {
                    invs.Add(new List <Item>());
                    z++;
                    y = 0;
                }

                if (itemInfo[i][0] == "null")
                {
                    invs[z].Add((null));
                }
                else if (itemInfo[i][0] == "toolz")
                {
                    Tool x = (Tool)null;

                    if (itemInfo[i][1] == "0")
                    {
                        x = new Axe();
                        x.UpgradeLevel = int.Parse(itemInfo[i][2]);
                    }
                    else if (itemInfo[i][1] == "1")
                    {
                        x = new Hoe();
                    }
                    else if (itemInfo[i][1] == "2")
                    {
                        x = new FishingRod(int.Parse(itemInfo[i][2]));
                    }
                    else if (itemInfo[i][1] == "3")
                    {
                        x = new Pickaxe();
                        x.UpgradeLevel = int.Parse(itemInfo[i][2]);
                    }
                    else if (itemInfo[i][1] == "4")
                    {
                        x = new WateringCan();
                        x.UpgradeLevel = int.Parse(itemInfo[i][2]);
                    }
                    else if (itemInfo[i][1] == "5")
                    {
                        x = new MeleeWeapon(int.Parse(itemInfo[i][3])); //sprite index??
                        x.UpgradeLevel = int.Parse(itemInfo[i][2]);
                    }
                    else if (itemInfo[i][1] == "6")
                    {
                        x = new Slingshot();
                        x.UpgradeLevel = int.Parse(itemInfo[i][2]);
                    }
                    else if (itemInfo[i][1] == "7")
                    {
                        x = new Lantern();
                        //x.UpgradeLevel = int.Parse(itemInfo[i][2]);
                    }
                    else if (itemInfo[i][1] == "8")
                    {
                        x = new MagnifyingGlass();
                    }
                    else if (itemInfo[i][1] == "9")
                    {
                        x = new MilkPail();
                    }
                    else if (itemInfo[i][1] == "10")
                    {
                        x = new Pan();
                    }
                    else if (itemInfo[i][1] == "11")
                    {
                        x = new Raft();
                    }
                    else if (itemInfo[i][1] == "12")
                    {
                        x = new Seeds(itemInfo[i][2], int.Parse(itemInfo[i][3]));
                    }
                    else if (itemInfo[i][1] == "13")
                    {
                        x = new Shears();
                    }
                    else if (itemInfo[i][1] == "14")
                    {
                        x = new Sword(itemInfo[i][2], int.Parse(itemInfo[i][3]));
                    }
                    else if (itemInfo[i][1] == "15")
                    {
                        x = new Wand();
                    }

                    invs[z].Add(x);
                }
                else
                {
                    StardewValley.Object x = new StardewValley.Object(int.Parse(itemInfo[i][0]), int.Parse(itemInfo[i][1]));

                    //x.SpecialVariable = int.Parse(itemInfo[i][2]);
                    //x.Category = int.Parse(itemInfo[i][3]);
                    //x.Name = itemInfo[i][4];
                    //x.DisplayName = itemInfo[i][5];

                    invs[z].Add((Item)(x));
                }

                y++;
            }
        }
示例#11
0
 private void magnifyingGlass_DisplayUpdated(MagnifyingGlass sender)
 {
     panel1.BackColor = magnifyingGlass.PixelColor;
     this.Location    = MainForm.MousePosition;
     SelectColor();
 }