Ejemplo n.º 1
0
 public void SetSingleSelectedControl(Control control)
 {
     SelectedEntity2DList.Clear();
     SelectedControlNamesInList.Clear();
     SelectedEntity2DList.Add(control);
     SelectedControlNamesInList.Add(control.Name);
 }
Ejemplo n.º 2
0
 private void SetNewControlAfterDelete(int index)
 {
     SelectedEntity2DList.Clear();
     if (Scene.Controls.Count == 0)
     {
         return;
     }
     SelectedEntity2DList.Add(Scene.Controls.Count == index
                         ? Scene.Controls[index - 1] : Scene.Controls[index]);
 }
Ejemplo n.º 3
0
 private void UpdateUIControlAndLists(Control control)
 {
     SelectedControlNamesInList.Add(control.Name);
     if (!SelectedEntity2DList.Contains(control))
     {
         SelectedEntity2DList.Add(control);
     }
     IsSelectingControl = true;
     uiControl.SetMaterials(SelectedEntity2DList);
     Messenger.Default.Send(SelectedControlNamesInList, "SetSelectedName");
     Messenger.Default.Send(uiControl.Index, "SetSelectedIndex");
     ControlProcessor.UpdateOutlines(SelectedEntity2DList);
     controlChanger.SetControlLayer(control.RenderLayer, this);
 }
Ejemplo n.º 4
0
 public void ClearScene()
 {
     foreach (var control in Scene.Controls)
     {
         control.IsActive = false;
     }
     Scene.Controls.Clear();
     UIImagesInList.Clear();
     SelectedEntity2DList.Clear();
     EnableButtons = SelectedEntity2DList.Count != 0;
     foreach (var entity in EntitiesRunner.Current.GetEntitiesOfType <DrawableEntity>())
     {
         entity.IsActive = false;
     }
 }
Ejemplo n.º 5
0
 private void ClearSceneWhenNotMulitSelecting(Vector2D mousePosition)
 {
     CanDeleteSelectedControl = true;
     if (SelectedEntity2DList.Count != 0 && SelectedEntity2DList.Count < 2)
     {
         if (SelectedEntity2DList[0].GetType() == typeof(Button) &&
             SelectedEntity2DList[0].DrawArea.Contains(mousePosition))
         {
             uiControl.isClicking = true;
         }
     }
     ControlProcessor.lastMousePosition = mousePosition;
     if (IsMultiSelecting || IsAnchoringControls)
     {
         return;
     }
     SelectedEntity2DList.Clear();
     SelectedControlNamesInList.Clear();
 }
Ejemplo n.º 6
0
 public void SetEntity2D(Control control)
 {
     if (control == null)
     {
         return;
     }
     if (!IsMultiSelecting)
     {
         SelectedEntity2DList.Clear();
         SelectedControlNamesInList.Clear();
     }
     controlChanger.ChangeUIControlWidthAndHeight(control, uiControl);
     uiControl.Index = Scene.Controls.IndexOf(control);
     if (uiControl.Index < 0)
     {
         return;
     }
     UpdateUIControlAndLists(control);
     SelectedName = control.Name;
 }