private void ClearCurentZone(object obj) { if (SelectedZone != null) { SelectedZone.ClearLocation(); } }
public void SelectInput(string name) { var input = SelectedZone.TheZone.Inputs.FirstOrDefault(i => i.Param == name); if (input != null) { SelectedZone.SelectInput(input, UI.Wrap(NotifyFinish)); } }
public void SelectDSP(string name) { if (null == SelectedZone) { return; } SelectedZone.SelectDSP(name); }
public void SelectScene(string name) { var scene = SelectedZone.TheZone.Scenes.FirstOrDefault(s => s.Name == name); if (scene != null) { SelectedZone.SelectScene(scene, UI.Wrap(NotifyFinish)); } }
public void RefreshSelectedZone(bool notify) { if (notify) { UI.Invoke(NotifyStart); SelectedZone.Refresh(UI.Wrap(NotifyFinish)); } else { SelectedZone.Refresh(null); } }
private void LeftMouseButtonClick(object obj) { if (SelectedZone != null && EnableEditZone) { MouseButtonEventArgs e = obj as MouseButtonEventArgs; var sender = e.Source as Client.Controls.Map.Map; if (sender != null) { System.Windows.Point mousePosition = e.GetPosition(sender); CurrentLocation = sender.ViewportPointToLocation(mousePosition); SelectedZone.AddLocation(CurrentLocation, true); } } }
private void UpdateAppearence() { // Internal state of data has been modified programmatically. // (for example, at initialization or reset.) // This method updates the appearence of the control only, it doesn't raise the events back. if (m_iMaximum - m_iMinimum > 0) { HandlerLeft.Left = BumperLeft.Width + Rescale(m_iSelStart - m_iMinimum, m_iMaximum - m_iMinimum, m_iMaxWidth); HandlerRight.Left = BumperLeft.Width + HandlerLeft.Width + Rescale(m_iSelEnd - m_iMinimum, m_iMaximum - m_iMinimum, m_iMaxWidth); StretchSelection(); SelectedZone.Invalidate(); } }
private void lstRooms_SelectedIndexChanged(object sender, EventArgs e) { if (lstRooms.SelectedIndex == -1) { return; } IRoom room = SelectedZone.GetRoom(lstRooms.SelectedItem.ToString()); if (room == null) { MessageBox.Show("There was an error retreiving the specified room.", this.Text); return; } else { SelectedRoom = room; } }
public override void DesignateMultiCell(IEnumerable <IntVec3> cells) { List <IntVec3> list = cells.ToList(); bool flag = false; if (list.Count == 1) { Zone zone = base.Map.zoneManager.ZoneAt(list[0]); if (zone != null) { if (zone.GetType() == zoneTypeToPlace) { SelectedZone = zone; } return; } } if (SelectedZone == null) { Zone zone2 = null; foreach (IntVec3 cell in cells) { Zone zone3 = base.Map.zoneManager.ZoneAt(cell); if (zone3 != null && zone3.GetType() == zoneTypeToPlace) { if (zone2 == null) { zone2 = zone3; } else if (zone3 != zone2) { zone2 = null; break; } } } SelectedZone = zone2; } list.RemoveAll((IntVec3 c) => base.Map.zoneManager.ZoneAt(c) != null); if (list.Count == 0 || (TutorSystem.TutorialMode && !TutorSystem.AllowAction(new EventPack(base.TutorTagDesignate, list)))) { return; } if (SelectedZone == null) { SelectedZone = MakeNewZone(); base.Map.zoneManager.RegisterZone(SelectedZone); SelectedZone.AddCell(list[0]); list.RemoveAt(0); } while (true) { flag = true; int count = list.Count; for (int num = list.Count - 1; num >= 0; num--) { bool flag2 = false; for (int i = 0; i < 4; i++) { IntVec3 c2 = list[num] + GenAdj.CardinalDirections[i]; if (c2.InBounds(base.Map) && base.Map.zoneManager.ZoneAt(c2) == SelectedZone) { flag2 = true; break; } } if (flag2) { SelectedZone.AddCell(list[num]); list.RemoveAt(num); } } if (list.Count == 0) { break; } if (list.Count == count) { SelectedZone = MakeNewZone(); base.Map.zoneManager.RegisterZone(SelectedZone); SelectedZone.AddCell(list[0]); list.RemoveAt(0); } } SelectedZone.CheckContiguous(); Finalize(flag); TutorSystem.Notify_Event(new EventPack(base.TutorTagDesignate, list)); }