//0=primary, 1 = first windowed version, etc public override void Init( EDDiscoveryForm ed, int vn) { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; discoveryform.OnNewEntry += AddNewEntry; travelhistorycontrol.OnTravelSelectionChanged += SelectionChanged; }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; discoveryform.OnNewEntry += AddNewEntry; travelhistorycontrol.OnTravelSelectionChanged += SelectionChanged; userControlStatsTimeScan.ScanMode = true; }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { _discoveryForm = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; edsm = new EDSMClass(); _currentExplorationSet = new ExplorationSetClass(); _savedExplorationSets = new List <ExplorationSetClass>(); _discoveryForm.OnNewEntry += NewEntry; travelhistorycontrol.OnTravelSelectionChanged += Display; }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { config = (Configuration)SQLiteDBClass.GetSettingInt(DbSave + "Config", (int)config); discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; discoveryform.OnHistoryChange += Display; discoveryform.OnNewEntry += NewEntry; travelhistorycontrol.OnTravelSelectionChanged += DisplaySelected; displayfont = discoveryform.theme.GetFont; }
//0=primary, 1 = first windowed version, etc public override void Init(EDDiscoveryForm ed, int vn) { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; travelhistorycontrol.OnTravelSelectionChanged += Display; discoveryform.OnNewEntry += NewEntry; checkBoxMaterials.Checked = SQLiteDBClass.GetSettingBool(DbSave+"Materials", true); checkBoxMaterialsRare.Checked = SQLiteDBClass.GetSettingBool(DbSave+"MaterialsRare", false); checkBoxMoons.Checked = SQLiteDBClass.GetSettingBool(DbSave+"Moons", true); int size = SQLiteDBClass.GetSettingInt(DbSave+"Size", 64); SetSizeCheckBoxes(size); imagebox.ClickElement += ClickElement; }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; travelhistorycontrol.OnTravelSelectionChanged += Display; discoveryform.OnNewEntry += NewEntry; checkBoxMaterials.Checked = SQLiteDBClass.GetSettingBool(DbSave + "Materials", true); checkBoxMaterialsRare.Checked = SQLiteDBClass.GetSettingBool(DbSave + "MaterialsRare", false); checkBoxMoons.Checked = SQLiteDBClass.GetSettingBool(DbSave + "Moons", true); int size = SQLiteDBClass.GetSettingInt(DbSave + "Size", 64); SetSizeCheckBoxes(size); imagebox.ClickElement += ClickElement; }
public AssignTravelLogSystemForm(TravelHistoryControl travelHistory, EliteDangerous.JournalEvents.JournalLocOrJump vsc) { InitializeComponent(); this._travelLogEntry = vsc; SystemClass.GetSystemAndAlternatives(vsc, out _linkSystem, out _alternatives, out _namestatus); this.tbLogSystemName.Text = vsc.StarSystem; this.tbVisitedDate.Text = vsc.EventTimeLocal.ToString(); this.tbLogCoordX.Text = vsc.HasCoordinate ? vsc.StarPos[0].ToString("0.000") : "?"; this.tbLogCoordY.Text = vsc.HasCoordinate ? vsc.StarPos[1].ToString("0.000") : "?"; this.tbLogCoordZ.Text = vsc.HasCoordinate ? vsc.StarPos[2].ToString("0.000") : "?"; this.tbLogCoordX.TextAlign = vsc.HasCoordinate ? HorizontalAlignment.Right : HorizontalAlignment.Center; this.tbLogCoordY.TextAlign = vsc.HasCoordinate ? HorizontalAlignment.Right : HorizontalAlignment.Center; this.tbLogCoordZ.TextAlign = vsc.HasCoordinate ? HorizontalAlignment.Right : HorizontalAlignment.Center; UpdateLinkedSystemList(_linkSystem); tbManualSystemName.AutoCompleteMode = AutoCompleteMode.SuggestAppend; tbManualSystemName.AutoCompleteSource = AutoCompleteSource.CustomSource; tbManualSystemName.SetAutoCompletor(EDDiscovery.DB.SystemClass.ReturnSystemListForAutoComplete); }
public AssignTravelLogSystemForm(TravelHistoryControl travelHistory, VisitedSystemsClass vsc) { InitializeComponent(); this._travelHistory = travelHistory; this._travelLogEntry = vsc; this._linkSystem = vsc.curSystem; this.tbLogSystemName.Text = vsc.Name; this.tbDateVisited.Text = vsc.Time.ToString(); this.tbLogCoordX.Text = vsc.HasTravelCoordinates ? vsc.X.ToString("0.000") : "?"; this.tbLogCoordY.Text = vsc.HasTravelCoordinates ? vsc.Y.ToString("0.000") : "?"; this.tbLogCoordZ.Text = vsc.HasTravelCoordinates ? vsc.Z.ToString("0.000") : "?"; this.tbLogCoordX.TextAlign = vsc.HasTravelCoordinates ? HorizontalAlignment.Right : HorizontalAlignment.Center; this.tbLogCoordY.TextAlign = vsc.HasTravelCoordinates ? HorizontalAlignment.Right : HorizontalAlignment.Center; this.tbLogCoordZ.TextAlign = vsc.HasTravelCoordinates ? HorizontalAlignment.Right : HorizontalAlignment.Center; UpdateLinkedSystemList(vsc.curSystem); tbManualSystemName.AutoCompleteMode = AutoCompleteMode.SuggestAppend; tbManualSystemName.AutoCompleteSource = AutoCompleteSource.CustomSource; AutoCompleteStringCollection autocomplete = new AutoCompleteStringCollection(); SystemClass.GetSystemNames(ref autocomplete); tbManualSystemName.AutoCompleteCustomSource = autocomplete; }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; discoveryform.OnHistoryChange += Display; discoveryform.OnNewEntry += NewEntry; discoveryform.OnNewTarget += NewTarget; displayfont = discoveryform.theme.GetFont; jumpRange = SQLiteDBClass.GetSettingDouble(DbSave + "JumpRange", -1.0); tankSize = SQLiteDBClass.GetSettingDouble(DbSave + "TankSize", -1); currentCargo = SQLiteDBClass.GetSettingDouble(DbSave + "currentCargo", 0); unladenMass = SQLiteDBClass.GetSettingDouble(DbSave + "unladenMass", -1); linearConstant = SQLiteDBClass.GetSettingDouble(DbSave + "linearConstant", -1); powerConstant = SQLiteDBClass.GetSettingDouble(DbSave + "powerConstant", -1); optimalMass = SQLiteDBClass.GetSettingDouble(DbSave + "optimalMass", -1); maxFuelPerJump = SQLiteDBClass.GetSettingDouble(DbSave + "maxFuelPerJump", -1); fsdDrive = SQLiteDBClass.GetSettingString(DbSave + "fsdDrive", null); tankWarning = SQLiteDBClass.GetSettingDouble(DbSave + "TankWarning", -1); }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; dataGridViewMC.MakeDoubleBuffered(); dataGridViewMC.DefaultCellStyle.WrapMode = DataGridViewTriState.False; dataGridViewMC.RowTemplate.Height = 26; if (materials) { dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[5]); // to give name,shortname abv,category,type,number } else { dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]); //shortname dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]); //then category to give name,type,number, avg price } travelhistorycontrol.OnTravelSelectionChanged += Display; SetCheckBoxes(); }
//0=primary, 1 = first windowed version, etc public override void Init(EDDiscoveryForm ed, int vn) { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; discoveryform.OnHistoryChange += Display; discoveryform.OnNewEntry += NewEntry; discoveryform.OnNewTarget += NewTarget; config = (Configuration)SQLiteDBClass.GetSettingInt(DbSave + "Config", (int)config); toolStripMenuItemTargetLine.Checked = Config(Configuration.showTargetLine); toolStripMenuItemTime.Checked = Config(Configuration.showTime); EDSMButtonToolStripMenuItem.Checked = Config(Configuration.showEDSMButton); showTargetToolStripMenuItem.Checked = Config(Configuration.showDistancePerStar); showNotesToolStripMenuItem.Checked = Config(Configuration.showNotes); showXYZToolStripMenuItem.Checked = Config(Configuration.showXYZ); showDescriptionToolStripMenuItem.Checked = Config(Configuration.showDescription); showInformationToolStripMenuItem.Checked = Config(Configuration.showInformation); blackBoxAroundTextToolStripMenuItem.Checked = Config(Configuration.showBlackBoxAroundText); showDistancesOnFSDJumpsOnlyToolStripMenuItem.Checked = Config(Configuration.showDistancesOnFSDJumpsOnly); expandTextOverEmptyColumnsToolStripMenuItem.Checked = Config(Configuration.showExpandOverColumns); showNothingWhenDockedtoolStripMenuItem.Checked = Config(Configuration.showNothingWhenDocked); SetSurfaceScanBehaviour(null); SetScanPosition(null); SetLayoutOrder(SQLiteDBClass.GetSettingInt(DbSave + "Layout", layoutorder),false); // also resets the tab order scanhide.Tick += HideScanData; dividercheck.Tick += DividerCheck; dividercheck.Interval = 500; string tabs = SQLiteDBClass.GetSettingString(DbSave + "PanelTabs", ""); try { List<int> tablist = tabs.Split(',').Select(int.Parse).ToList(); for (int i = 0; i < tablist.Count && i < columnpos.Count; i++) // for what we have, and not more than pre-populated, fill columnpos[i] = tablist[i]; } catch { } displayfont = discoveryform.theme.GetFont; pictureBox.ContextMenuStrip = contextMenuStripConfig; string filter = SQLiteDBClass.GetSettingString(DbFieldFilter, ""); if (filter.Length > 0) fieldfilter.FromJSON(filter); // load filter cfs.ConfigureThirdOption("Travel", "Docked;FSD Jump;Undocked;"); cfs.Changed += EventFilterChanged; dividers = new ButtonExt[] { buttonExt0, buttonExt1, buttonExt2, buttonExt3, buttonExt4, buttonExt5, buttonExt6, buttonExt7, buttonExt8, buttonExt9, buttonExt10 }; #if TH travelhistorycontrol.OnTravelSelectionChanged += Travelhistorycontrol_OnTravelSelectionChanged; #endif }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; discoveryform.OnHistoryChange += Display; discoveryform.OnNewEntry += NewEntry; discoveryform.OnNewTarget += NewTarget; config = (Configuration)SQLiteDBClass.GetSettingInt(DbSave + "Config", (int)config); toolStripMenuItemTargetLine.Checked = Config(Configuration.showTargetLine); toolStripMenuItemTime.Checked = Config(Configuration.showTime); EDSMButtonToolStripMenuItem.Checked = Config(Configuration.showEDSMButton); iconToolStripMenuItem.Checked = Config(Configuration.showIcon); showTargetToolStripMenuItem.Checked = Config(Configuration.showDistancePerStar); showNotesToolStripMenuItem.Checked = Config(Configuration.showNotes); showXYZToolStripMenuItem.Checked = Config(Configuration.showXYZ); showDescriptionToolStripMenuItem.Checked = Config(Configuration.showDescription); showInformationToolStripMenuItem.Checked = Config(Configuration.showInformation); blackBoxAroundTextToolStripMenuItem.Checked = Config(Configuration.showBlackBoxAroundText); showDistancesOnFSDJumpsOnlyToolStripMenuItem.Checked = Config(Configuration.showDistancesOnFSDJumpsOnly); expandTextOverEmptyColumnsToolStripMenuItem.Checked = Config(Configuration.showExpandOverColumns); showNothingWhenDockedtoolStripMenuItem.Checked = Config(Configuration.showNothingWhenDocked); SetSurfaceScanBehaviour(null); SetScanPosition(null); SetLayoutOrder(SQLiteDBClass.GetSettingInt(DbSave + "Layout", layoutorder), false); // also resets the tab order scanhide.Tick += HideScanData; dividercheck.Tick += DividerCheck; dividercheck.Interval = 500; string tabs = SQLiteDBClass.GetSettingString(DbSave + "PanelTabs", ""); try { List <int> tablist = tabs.Split(',').Select(int.Parse).ToList(); for (int i = 0; i < tablist.Count && i < columnpos.Count; i++) // for what we have, and not more than pre-populated, fill { columnpos[i] = tablist[i]; } } catch { } displayfont = discoveryform.theme.GetFont; pictureBox.ContextMenuStrip = contextMenuStripConfig; string filter = SQLiteDBClass.GetSettingString(DbFieldFilter, ""); if (filter.Length > 0) { fieldfilter.FromJSON(filter); // load filter } cfs.ConfigureThirdOption("Travel", "Docked;FSD Jump;Undocked;"); cfs.Changed += EventFilterChanged; dividers = new ButtonExt[] { buttonExt0, buttonExt1, buttonExt2, buttonExt3, buttonExt4, buttonExt5, buttonExt6, buttonExt7, buttonExt8, buttonExt9, buttonExt10, buttonExt11, buttonExt12 }; #if TH travelhistorycontrol.OnTravelSelectionChanged += Travelhistorycontrol_OnTravelSelectionChanged; #endif }
//0=primary, 1 = first windowed version, etc public override void Init( EDDiscoveryForm ed, int vn) { discoveryform = ed; travelhistorycontrol = ed.TravelControl; displaynumber = vn; dataGridViewMC.MakeDoubleBuffered(); dataGridViewMC.DefaultCellStyle.WrapMode = DataGridViewTriState.False; dataGridViewMC.RowTemplate.Height = 26; if (materials) dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[5]); // to give name,shortname abv,category,type,number else { dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]); //shortname dataGridViewMC.Columns.Remove(dataGridViewMC.Columns[1]); //then category to give name,type,number, avg price } namecol = 0; abvcol = (materials) ? 1 : -1; catcol = (materials) ? 2 : -1; typecol = (materials) ? 3 : 1; numcol = (materials) ? 4 : 2; pricecol = (materials) ? -1 : 3; travelhistorycontrol.OnTravelSelectionChanged += Display; SetCheckBoxes(); }
private void watcher(object sender, System.IO.FileSystemEventArgs e) { try { string output_folder = textBoxOutputDir.Text; string cur_sysname = "Unknown System"; ISystem cursys = null; if (!checkBoxAutoConvert.Checked) { return; } cursys = _discoveryForm.TravelControl.GetCurrentSystem(); if (cursys != null) { cur_sysname = cursys.name; } if (!Directory.Exists(textBoxOutputDir.Text)) { Directory.CreateDirectory(textBoxOutputDir.Text); } //sometimes the picture doesn't load into the picture box so waiting 1 sec in case this due to the file not being closed quick enough in ED System.Threading.Thread.Sleep(1000); int formatindex = 0; bool hires = false; bool checkboxremove = false; bool checkboxpreview = false; bool cropimage = false; Rectangle crop = new Rectangle(); string extension = null; bool cannotexecute = false; Invoke((MethodInvoker) delegate // pick it in a delegate as we are in another thread.. { // I've tested that this is required.. // cropping also picked up dialog items so moved here.. // other items are also picked up here in one go. formatindex = comboBoxFileNameFormat.SelectedIndex; hires = checkBoxHires.Checked; checkboxremove = checkBoxRemove.Checked; checkboxpreview = checkBoxPreview.Checked; cropimage = checkBoxCropImage.Checked; crop.X = int.Parse(numericUpDownLeft.Text); crop.Y = int.Parse(numericUpDownTop.Text); crop.Width = int.Parse(numericUpDownWidth.Text); crop.Height = int.Parse(numericUpDownHeight.Text); extension = "." + comboBoxFormat.Text; cannotexecute = textBoxOutputDir.Text.Equals(textBoxScreenshotsDir.Text) && extension.Equals(".bmp"); }); if (cannotexecute) // cannot store BMPs into the Elite dangerous folder as it creates a circular condition { MessageBox.Show("Cannot convert .bmp files into the same folder as they are stored into by Elite Dangerous" + Environment.NewLine + Environment.NewLine + "Pick a different conversion folder or a different output format", "WARNING", MessageBoxButtons.OK); return; } string store_name = null; int index = 0; do // add _N on the filename for index>0, to make them unique. { store_name = output_folder + "\\" + CreateFileName(cur_sysname, e.FullPath, formatindex, hires) + (index == 0?"":"_" + index) + extension; index++; } while (File.Exists(store_name)); // if name exists, pick another //var bmp = System.Drawing.Bitmap.FromFile(e.FullPath); System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(e.FullPath); System.Drawing.Bitmap croppedbmp = null; /* MKW - crop image */ if (cropimage) { /* check that crop settings are within the image, otherwise adjust. */ if ((crop.Width <= 0) || (crop.Width > bmp.Width)) { crop.X = 0; crop.Width = bmp.Width; } else if (crop.Left + crop.Width > bmp.Width) { crop.X = bmp.Width - crop.Width; } if ((crop.Height <= 0) || (crop.Height > bmp.Height)) { crop.Y = 0; crop.Height = bmp.Height; } else if (crop.Top + crop.Height > bmp.Height) { crop.Y = bmp.Height - crop.Height; } /* Only crop if we need to */ if ((crop.Width != bmp.Width) || (crop.Height != bmp.Height)) { // CLONE new one, which creates a new object croppedbmp = bmp.Clone(crop, System.Drawing.Imaging.PixelFormat.DontCare); } else { croppedbmp = bmp; // just copy reference.. no need to crop. } } else { croppedbmp = bmp; // just copy reference.. } if (extension.Equals(".jpg")) { croppedbmp.Save(store_name, System.Drawing.Imaging.ImageFormat.Jpeg); } else if (extension.Equals(".tiff")) { croppedbmp.Save(store_name, System.Drawing.Imaging.ImageFormat.Tiff); } else if (extension.Equals(".bmp")) { croppedbmp.Save(store_name, System.Drawing.Imaging.ImageFormat.Bmp); } else { croppedbmp.Save(store_name, System.Drawing.Imaging.ImageFormat.Png); } bmp.Dispose(); // need to free the bmp before any more operations on the file.. croppedbmp.Dispose(); // and ensure this one is freed of handles to the file. FileInfo fi = new FileInfo(e.FullPath); File.SetCreationTime(store_name, fi.CreationTime); if (checkboxpreview) // if preview, load in { pictureBox1.ImageLocation = store_name; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; } if (checkboxremove) // if remove, delete original picture { File.Delete(e.FullPath); } Invoke((MethodInvoker) delegate { TravelHistoryControl.LogText("Converted " + e.Name + " to " + store_name + Environment.NewLine); }); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine("Exception watcher: " + ex.Message); System.Diagnostics.Trace.WriteLine("Trace: " + ex.StackTrace); MessageBox.Show("Exception in imageConvert:" + ex.Message); } }
public override void Init(EDDiscoveryForm ed, int vn) //0=primary, 1 = first windowed version, etc { _discoveryForm = ed; _travelcontrol = _discoveryForm.TravelControl; _travelcontrol.OnNearestStarListChanged += FillGrid; }
public MapManager(bool nowindowreposition, TravelHistoryControl tc) { _formMap = new FormMap(); _formMap.travelHistoryControl = tc; _formMap.noWindowReposition = nowindowreposition; }