private void Display() { List <MissionState> ml = last_he != null?discoveryform.history.MissionListAccumulator.GetMissionList(last_he.MissionList) : null; missionListCurrent.Clear(); missionListPrevious.Clear(); if (ml != null) { DateTime hetime = last_he.EventTimeUTC; List <MissionState> mcurrent = MissionListAccumulator.GetAllCurrentMissions(ml, hetime); foreach (MissionState ms in mcurrent) { missionListCurrent.Add(ms, false); } missionListCurrent.Finish(); List <MissionState> mprev = MissionListAccumulator.GetAllExpiredMissions(ml, hetime); var previousRows = new List <DataGridViewRow>(mprev.Count); foreach (MissionState ms in mprev) { missionListPrevious.Add(ms, true); } missionListPrevious.Finish(); } }
//EliteDangerousCore.UIEvents.UIOverallStatus status, public JToken MakeResponse(int entry, string type) // entry = -1 means latest { if (discoveryform.InvokeRequired) { return((JToken)discoveryform.Invoke(new Func <JToken>(() => MakeResponse(entry, type)))); } else { JObject response = new JObject(); response["responsetype"] = type; var hl = discoveryform.history; if (hl.Count == 0) { response["entry"] = -1; } else { if (entry < 0 || entry >= hl.Count) { entry = hl.Count - 1; } response["entry"] = entry; HistoryEntry he = hl[entry]; List <MissionState> ml = discoveryform.history.MissionListAccumulator.GetMissionList(he.MissionList); DateTime hetime = he.EventTimeUTC; List <MissionState> mcurrent = MissionListAccumulator.GetAllCurrentMissions(ml, hetime); JArray cur = new JArray(); foreach (MissionState ms in mcurrent) { cur.Add(MissionInfo(ms, false)); } response["current"] = cur; List <MissionState> mprev = MissionListAccumulator.GetAllExpiredMissions(ml, hetime); JArray prev = new JArray(); foreach (MissionState ms in mprev) { prev.Add(MissionInfo(ms, true)); } response["previous"] = prev; } return(response); } }
public FilterEntry(MissionState m) { Type = EntryType.Mission; Name = m.Mission.Name + ":" + m.Mission.Faction; if (m.Mission.Target.Length > 0) { Name += ":" + m.Mission.Target; } starttime = m.Mission.EventTimeUTC; endtime = m.Mission.Expiry; // NOTE expiry time of mission, not used however to gate below, we use Mission MissionKey = MissionListAccumulator.Key(m.Mission); TargetFaction = m.Mission.TargetFaction; }
private void Reset(bool full = true) { currenthe = null; outfitting = new OutfittingList(); shipinformationlist = new ShipInformationList(); matlist = new MaterialCommoditiesList(); missionlistaccumulator = new MissionListAccumulator(); // and mission list.. cashledger = new Ledger(); if (full) { lastutc = DateTime.Now.AddYears(-100); currentcmdrnr = -1; } }
public void FillCampaignCombo() { displayedfilterentries = new List <FilterEntry>(); displayedfilterentries.Add(new FilterEntry("New Campaign".T(EDTx.UserControlCombatPanel_NewCampaign), FilterEntry.EntryType.NewEntry)); displayedfilterentries.Add(new FilterEntry("Since Last Dock".T(EDTx.UserControlCombatPanel_SinceLastDock), FilterEntry.EntryType.Lastdock)); displayedfilterentries.Add(new FilterEntry("Today".T(EDTx.Today), FilterEntry.EntryType.Today)); displayedfilterentries.Add(new FilterEntry("24h".T(EDTx.t24h), FilterEntry.EntryType.Oneday)); displayedfilterentries.Add(new FilterEntry("7 days".T(EDTx.t7days), FilterEntry.EntryType.Sevendays)); displayedfilterentries.Add(new FilterEntry("All".T(EDTx.All), FilterEntry.EntryType.All)); displayedfilterentries.AddRange(savedfilterentries); var missions = discoveryform.history.MissionListAccumulator.GetAllMissions(); var combatmissions = MissionListAccumulator.GetAllCombatMissionsLatestFirst(missions); if (combatmissions != null) { foreach (var s in combatmissions) { FilterEntry f = new FilterEntry(s); displayedfilterentries.Add(f); } } disablecombobox = true; comboBoxCustomCampaign.Items.Clear(); foreach (FilterEntry f in displayedfilterentries) { comboBoxCustomCampaign.Items.Add(f.NameDate); } int cursel = current != null?displayedfilterentries.FindIndex(x => x.UniqueID.Equals(current.UniqueID)) : -1; if (cursel >= 0) { comboBoxCustomCampaign.SelectedIndex = cursel; } disablecombobox = false; }
public void UpdateMissions(MissionListAccumulator mlist, EliteDangerousCore.ISystem sys, string body, DB.SQLiteConnectionUser conn) { mlist.Abandoned(this); }
public void UpdateMissions(MissionListAccumulator mlist, EliteDangerousCore.ISystem sys, string body, DB.SQLiteConnectionUser conn) { mlist.Missions(this); // check vs our mission list }
public void UpdateMissions(MissionListAccumulator mlist, EliteDangerousCore.ISystem sys, string body) { mlist.Abandoned(this); }
public void UpdateMissions(MissionListAccumulator mlist, EliteDangerousCore.ISystem sys, string body) { mlist.Missions(this); // check vs our mission list }
public void UpdateMissions(MissionListAccumulator mlist, EDDiscovery.DB.ISystem sys, string body, DB.SQLiteConnectionUser conn) { mlist.Abandoned(this); }
private void Display(HistoryEntry he) { currentHE = he; pictureBox.ClearImageList(); if (currentHE != null) { Color textcolour = IsTransparent ? discoveryform.theme.SPanelColor : discoveryform.theme.LabelColor; Color backcolour = IsTransparent ? Color.Transparent : this.BackColor; DateTime hetime = currentHE.EventTimeUTC; List <MissionState> ml = discoveryform.history.MissionListAccumulator.GetMissionList(currentHE.MissionList); List <MissionState> mcurrent = MissionListAccumulator.GetAllCurrentMissions(ml, hetime); int vpos = 4; Font displayfont = discoveryform.theme.GetFont; foreach (MissionState ms in mcurrent) { string text = ""; if (missionNameToolStripMenuItem.Checked) { text += JournalFieldNaming.ShortenMissionName(ms.Mission.Name); } if (missionDescriptionToolStripMenuItem.Checked && ms.Mission.LocalisedName.HasChars()) { text = text.AppendPrePad(ms.Mission.LocalisedName, ", "); } if (startDateToolStripMenuItem.Checked) { text = text.AppendPrePad(EDDiscoveryForm.EDDConfig.ConvertTimeToSelectedFromUTC(ms.Mission.EventTimeUTC).ToString(), ", "); } if (endDateToolStripMenuItem.Checked) { text = text.AppendPrePad(EDDiscoveryForm.EDDConfig.ConvertTimeToSelectedFromUTC(ms.Mission.Expiry).ToString(), startDateToolStripMenuItem.Checked ? "-" : ", "); } string mainpart = BaseUtils.FieldBuilder.Build( "< ", ms.DestinationSystemStation(), " ", factionInformationToolStripMenuItem.Checked ? ms.Mission.TargetFaction : null, "< ", ms.Mission.TargetLocalised, "< ", ms.Mission.KillCount?.ToString("N") ?? null, " ", ms.Mission.CommodityLocalised, "< ", ms.Mission.Count, " Left ".T(EDTx.UserControlMissionOverlay_IL), ms.CargoDepot?.ItemsToGo ); text = text.AppendPrePad(mainpart, ", "); if (rewardToolStripMenuItem.Checked && ms.Mission.Reward.HasValue && ms.Mission.Reward > 0) { text = text.AppendPrePad(BaseUtils.FieldBuilder.Build(" ;cr", ms.Mission.Reward.GetValueOrDefault().ToString("N0")), ", "); } using (StringFormat frmt = new StringFormat()) { var ie = pictureBox.AddTextAutoSize(new Point(10, vpos), new Size(this.Width - 20, this.Height), text, displayfont, textcolour, backcolour, 1.0F, frmt: frmt); vpos = ie.Location.Bottom + displayfont.ScalePixels(4); } } } pictureBox.Render(); }
public void UpdateMissions(MissionListAccumulator mlist, EliteDangerous.ISystem sys, string body, DB.SQLiteConnectionUser conn) { mlist.Accepted(this, sys, body); }
public void UpdateMissions(MissionListAccumulator mlist, EliteDangerousCore.ISystem sys, string body) { mlist.Died(this.EventTimeUTC); }