Exemplo n.º 1
0
        public void SelectGroup(UnitListObject parent)
        {
            ClearRename();
            if (Input.GetKey(KeyCode.LeftShift))
            {
                AddToGrpSelection(parent);
            }
            else if (Input.GetKey(KeyCode.LeftControl))
            {
                if (SelectedGroups.Contains(parent))
                {
                    RemoveFromGrpSelection(parent);
                }
                else
                {
                    AddToGrpSelection(parent);
                }
            }
            else
            {
                ClearGrpSelection();
                AddToGrpSelection(parent);
            }

            UpdateGroupSelection();
        }
Exemplo n.º 2
0
 public void UpdateGroupSelection()
 {
     foreach (UnitListObject ulo in UnitGroups)
     {
         ulo.UpdateSelection(SelectedGroups.Contains(ulo), ulo == FirstSelected);
     }
 }
Exemplo n.º 3
0
        public void SelectGroup(UnitListObject parent, bool onTitle)
        {
            ClearRename();
            if (Input.GetKey(KeyCode.LeftShift))
            {
                AddToGrpSelection(parent);
            }
            else if (Input.GetKey(KeyCode.LeftControl))
            {
                if (SelectedGroups.Contains(parent))
                {
                    RemoveFromGrpSelection(parent);
                }
                else
                {
                    AddToGrpSelection(parent);
                }
            }
            else
            {
                if (SelectedGroups.Count == 1 && SelectedGroups[0] == parent)
                {
                    if (!onTitle && Time.realtimeSinceStartup - LastClickTime < UnitListObject.DoubleClickTime)
                    {
                        SelectionManager.Current.CleanSelection();

                        List <UnitInstance> SelectedInstances = new List <UnitInstance>(128);

                        parent.Source.GetAllUnitInstances(ref SelectedInstances);

                        GameObject[] NewSelection = new GameObject[SelectedInstances.Count];

                        for (int i = 0; i < SelectedInstances.Count; i++)
                        {
                            NewSelection[i] = SelectedInstances[i].gameObject;
                        }

                        SelectionManager.Current.SelectObjects(NewSelection);
                    }
                }
                else
                {
                    ClearGrpSelection();
                    AddToGrpSelection(parent);
                }

                LastClickTime = Time.realtimeSinceStartup;
            }

            UpdateGroupSelection();
        }
Exemplo n.º 4
0
 public Boolean MatchesFilter(TranslationItemViewModel translationLine)
 {
     if (translationLine == null)
     {
         return(false);
     }
     return((!TranslatedFilter.HasValue || translationLine.IsTranslated == TranslatedFilter.Value) &&
            (!EditingFilter.HasValue || translationLine.HasChangesInEditor == EditingFilter.Value) &&
            (String.IsNullOrWhiteSpace(AddressFilter) || translationLine.Address.StartsWith(AddressFilter, StringComparison.InvariantCultureIgnoreCase)) &&
            (SelectedGroups.Count == 0 || (InverseGroupFilter && !SelectedGroups.Contains(translationLine.Group)) || (!InverseGroupFilter && SelectedGroups.Contains(translationLine.Group))) &&
            MatchesContentFilter(translationLine) &&
            (!PotentialOverflowFilter || translationLine.TranslatedLineLength > 320 && translationLine.LineLengthDifference > 0) &&
            (!PotentialRepointIssueFilter || translationLine.RemainingLength < 0 && translationLine.PointerText.References.Where(r => r.Repoint).Count() != 1)
            );
 }