static public void HistoryEventVars(ConditionVariables vars, HistoryEntry he, string prefix) { if (he != null) { System.Globalization.CultureInfo ct = System.Globalization.CultureInfo.InvariantCulture; vars[prefix + "LocalTime"] = he.EventTimeLocal.ToString("MM/dd/yyyy HH:mm:ss"); vars[prefix + "DockedState"] = he.IsDocked ? "1" : "0"; vars[prefix + "LandedState"] = he.IsLanded ? "1" : "0"; vars[prefix + "WhereAmI"] = he.WhereAmI; vars[prefix + "ShipType"] = he.ShipType; vars[prefix + "ShipId"] = he.ShipId.ToString(ct); vars[prefix + "IndexOf"] = he.Indexno.ToString(ct); vars[prefix + "JID"] = he.Journalid.ToString(ct); vars.AddPropertiesFieldsOfClass(he.journalEntry, prefix + "Class_", new Type[] { typeof(System.Drawing.Bitmap), typeof(Newtonsoft.Json.Linq.JObject) }, 5); //depth seems good enough // being backwards compatible to actions packs BEFORE the V3 change to remove JS vars // these were the ones used in the pack.. vars[prefix + "JS_event"] = he.EntryType.ToString(); if (he.journalEntry is EliteDangerous.JournalEvents.JournalReceiveText) { vars[prefix + "JS_Channel"] = (he.journalEntry as EliteDangerous.JournalEvents.JournalReceiveText).Channel; } if (he.journalEntry is EliteDangerous.JournalEvents.JournalBuyAmmo) { vars[prefix + "JS_Cost"] = (he.journalEntry as EliteDangerous.JournalEvents.JournalBuyAmmo).Cost.ToString(System.Globalization.CultureInfo.InvariantCulture); } } }
private void writeEventInfoToLogDebugToolStripMenuItem_Click(object sender, EventArgs e) //DEBUG ONLY { ConditionVariables cv = new ConditionVariables(); cv.AddPropertiesFieldsOfClass(rightclicksystem.journalEntry, "", new Type[] { typeof(System.Drawing.Bitmap), typeof(Newtonsoft.Json.Linq.JObject) }, 5); discoveryform.LogLine(cv.ToString(separ: Environment.NewLine, quoteit: false)); if (rightclicksystem.ShipInformation != null) discoveryform.LogLine(rightclicksystem.ShipInformation.ToString()); }
static public void HistoryEventVars(ConditionVariables vars, HistoryEntry he, string prefix) { if (he != null) { System.Globalization.CultureInfo ct = System.Globalization.CultureInfo.InvariantCulture; vars[prefix + "LocalTime"] = he.EventTimeLocal.ToStringUS(); vars[prefix + "DockedState"] = he.IsDocked ? "1" : "0"; vars[prefix + "LandedState"] = he.IsLanded ? "1" : "0"; vars[prefix + "Hyperspace"] = he.IsInHyperSpace ? "1" : "0"; vars[prefix + "WhereAmI"] = he.WhereAmI; vars[prefix + "BodyType"] = he.BodyType; vars[prefix + "ShipType"] = he.ShipType; vars[prefix + "ShipId"] = he.ShipId.ToString(ct); vars[prefix + "IndexOf"] = he.Indexno.ToString(ct); vars[prefix + "JID"] = he.Journalid.ToString(ct); vars[prefix + "Credits"] = he.Credits.ToString(ct); vars[prefix + "TravelledDistance"] = he.TravelledDistance.ToString("0.0"); vars[prefix + "TravelledSeconds"] = he.TravelledSeconds.ToString(); vars[prefix + "IsTravelling"] = he.isTravelling ? "1" : "0"; vars[prefix + "TravelledJumps"] = he.Travelledjumps.ToStringInvariant(); vars[prefix + "TravelledMissingJumps"] = he.TravelledMissingjump.ToStringInvariant(); vars[prefix + "MultiPlayer"] = he.MultiPlayer ? "1" : "0"; vars[prefix + "ContainsRares"] = he.ContainsRares() ? "1" : "0"; vars[prefix + "EventSummary"] = he.EventSummary; he.journalEntry.FillInformation(out string EventDescription, out string EventDetailedInfo); vars[prefix + "EventDescription"] = EventDescription; vars[prefix + "EventDetailedInfo"] = EventDetailedInfo; vars.AddPropertiesFieldsOfClass(he.journalEntry, prefix + "Class_", new Type[] { typeof(System.Drawing.Icon), typeof(System.Drawing.Image), typeof(System.Drawing.Bitmap), typeof(Newtonsoft.Json.Linq.JObject) }, 5); //depth seems good enough // being backwards compatible to actions packs BEFORE the V3 change to remove JS vars // these were the ones used in the pack.. vars[prefix + "JS_event"] = he.EntryType.ToString(); if (he.journalEntry is EliteDangerousCore.JournalEvents.JournalReceiveText) { vars[prefix + "JS_Channel"] = (he.journalEntry as EliteDangerousCore.JournalEvents.JournalReceiveText).Channel; } if (he.journalEntry is EliteDangerousCore.JournalEvents.JournalBuyAmmo) { vars[prefix + "JS_Cost"] = (he.journalEntry as EliteDangerousCore.JournalEvents.JournalBuyAmmo).Cost.ToString(System.Globalization.CultureInfo.InvariantCulture); } } }