From b70f462e33fe9ca4ac17fc14d1e62327f258b62c Mon Sep 17 00:00:00 2001 From: robbyxp1 Date: Wed, 11 Jul 2018 10:14:09 -0400 Subject: [PATCH] Journal entries are translated Massive work to add tx to translator and update the lang file to cover these. There will be bugs! EDDiscovery/translator has an example file This is not final --- BaseUtils/Misc/CommandArgs.cs | 1 + BaseUtils/Strings/StringObjectExtensions.cs | 27 +- BaseUtils/Translator/Translator.cs | 163 +- EDDiscovery/EDDOptions.cs | 9 +- EDDiscovery/EDDiscoveryController.cs | 2 +- EDDiscovery/EDDiscoveryForm.cs | 4 +- EDDiscovery/Forms/AddOnManagerForm.cs | 4 +- EDDiscovery/Forms/CommanderForm.cs | 2 +- EDDiscovery/Forms/GalaxySectorSelect.cs | 2 +- .../UserControls/UserControlExpedition.cs | 4 +- .../UserControls/UserControlMarketData.cs | 6 +- .../UserControls/UserControlModules.cs | 4 +- EDDiscovery/UserControls/UserControlRoute.cs | 2 +- .../UserControls/UserControlSettings.cs | 12 +- .../UserControls/UserControlShipYards.cs | 2 +- EDDiscovery/UserControls/UserControlStats.cs | 18 +- .../UserControls/UserControlSysInfo.cs | 2 +- EliteDangerous/EliteDangerous/Bodies.cs | 50 +- EliteDangerous/EliteDangerous/JournalEntry.cs | 34 +- .../JournalEvents/JournalAfmuRepair.cs | 17 +- .../JournalEvents/JournalApproachBody.cs | 12 +- .../JournalApproachSettlement.cs | 9 +- EliteDangerous/JournalEvents/JournalBounty.cs | 19 +- .../JournalEvents/JournalBuyAmmo.cs | 8 +- .../JournalEvents/JournalBuyDrones.cs | 12 +- .../JournalBuyExplorationData.cs | 11 +- .../JournalEvents/JournalBuyTradeData.cs | 12 +- .../JournalEvents/JournalCapShipBond.cs | 14 +- EliteDangerous/JournalEvents/JournalCargo.cs | 17 +- .../JournalEvents/JournalCargoDepot.cs | 10 +- .../JournalEvents/JournalChangeCrewRole.cs | 6 +- .../JournalEvents/JournalClearSavedGame.cs | 8 +- .../JournalEvents/JournalCockpitBreached.cs | 10 +- .../JournalEvents/JournalCollectCargo.cs | 11 +- .../JournalEvents/JournalCommander.cs | 8 +- .../JournalEvents/JournalCommitCrime.cs | 21 +- .../JournalEvents/JournalCommunityGoal.cs | 44 +- .../JournalCommunityGoalDiscard.cs | 10 +- .../JournalEvents/JournalCommunityGoalJoin.cs | 12 +- .../JournalCommunityGoalReward.cs | 12 +- .../JournalEvents/JournalContinued.cs | 8 +- .../JournalEvents/JournalCrewAssign.cs | 10 +- .../JournalEvents/JournalCrewFire.cs | 13 +- .../JournalEvents/JournalCrewHire.cs | 7 +- .../JournalEvents/JournalCrewLaunchFighter.cs | 8 +- .../JournalEvents/JournalCrewMemberJoins.cs | 7 +- .../JournalEvents/JournalCrewMemberQuits.cs | 7 +- .../JournalCrewMemberRoleChange.cs | 12 +- .../JournalEvents/JournalDataScanned.cs | 9 +- .../JournalEvents/JournalDatalinkScan.cs | 10 +- .../JournalEvents/JournalDatalinkVoucher.cs | 13 +- EliteDangerous/JournalEvents/JournalDied.cs | 24 +- .../JournalEvents/JournalDiscoveryScan.cs | 8 +- .../JournalEvents/JournalDockFighter.cs | 7 +- .../JournalEvents/JournalDockSRV.cs | 8 +- EliteDangerous/JournalEvents/JournalDocked.cs | 46 +- .../JournalEvents/JournalDockingCancelled.cs | 8 +- .../JournalEvents/JournalDockingDenied.cs | 13 +- .../JournalEvents/JournalDockingGranted.cs | 7 +- .../JournalEvents/JournalDockingRequested.cs | 8 +- .../JournalEvents/JournalDockingTimeout.cs | 8 +- .../JournalEDDCommodityPrices.cs | 25 +- .../JournalEvents/JournalEDDItemSet.cs | 8 +- .../JournalEvents/JournalEjectCargo.cs | 14 +- .../JournalEvents/JournalEndCrewSession.cs | 9 +- .../JournalEvents/JournalEngineerApply.cs | 6 +- .../JournalEngineerContribution.cs | 13 +- .../JournalEvents/JournalEngineerCraft.cs | 11 +- .../JournalEngineerLegacyConvert.cs | 1 - .../JournalEvents/JournalEngineerProgress.cs | 12 +- .../JournalEscapeInterdiction.cs | 10 +- .../JournalEvents/JournalFSDJump.cs | 18 +- .../JournalEvents/JournalFactionKillBond.cs | 8 +- .../JournalEvents/JournalFetchRemoteModule.cs | 16 +- .../JournalEvents/JournalFighterDestroyed.cs | 6 +- .../JournalEvents/JournalFighterRebuilt.cs | 6 +- .../JournalEvents/JournalFileheader.cs | 7 +- .../JournalEvents/JournalFriends.cs | 11 +- .../JournalEvents/JournalFuelScope.cs | 11 +- .../JournalEvents/JournalHeatDamage.cs | 10 +- .../JournalEvents/JournalHeatWarning.cs | 7 +- .../JournalEvents/JournalHullDamage.cs | 7 +- .../JournalEvents/JournalInterdicted.cs | 14 +- .../JournalEvents/JournalInterdiction.cs | 6 +- .../JournalEvents/JournalJetConeBoost.cs | 10 +- .../JournalEvents/JournalJetConeDamage.cs | 8 +- .../JournalEvents/JournalJoinACrew.cs | 8 +- .../JournalEvents/JournalKickCrewMember.cs | 9 +- .../JournalEvents/JournalLaunchDrone.cs | 8 +- .../JournalEvents/JournalLaunchFighter.cs | 13 +- .../JournalEvents/JournalLaunchSRV.cs | 12 +- .../JournalEvents/JournalLeaveBody.cs | 12 +- .../JournalEvents/JournalLiftoff.cs | 14 +- .../JournalEvents/JournalLoadGame.cs | 10 +- .../JournalEvents/JournalLoadout.cs | 9 +- .../JournalEvents/JournalLocOrJump.cs | 2 +- .../JournalEvents/JournalLocation.cs | 35 +- EliteDangerous/JournalEvents/JournalMarket.cs | 2 +- .../JournalEvents/JournalMarketBuy.cs | 13 +- .../JournalEvents/JournalMarketSell.cs | 19 +- .../JournalEvents/JournalMassModuleStore.cs | 19 +- .../JournalEvents/JournalMaterialCollected.cs | 11 +- .../JournalEvents/JournalMaterialDiscarded.cs | 7 +- .../JournalMaterialDiscovered.cs | 7 +- .../JournalEvents/JournalMaterialTrade.cs | 10 +- .../JournalEvents/JournalMaterials.cs | 27 +- .../JournalEvents/JournalMiningRefined.cs | 11 +- .../JournalEvents/JournalMissionAbandoned.cs | 10 +- .../JournalEvents/JournalMissionAccepted.cs | 29 +- .../JournalEvents/JournalMissionCompleted.cs | 43 +- .../JournalEvents/JournalMissionFailed.cs | 9 +- .../JournalEvents/JournalMissionRedirected.cs | 11 +- .../JournalEvents/JournalMissions.cs | 22 +- .../JournalEvents/JournalModuleBuy.cs | 19 +- .../JournalEvents/JournalModuleInfo.cs | 22 +- .../JournalEvents/JournalModuleRetrieve.cs | 19 +- .../JournalEvents/JournalModuleSell.cs | 12 +- .../JournalEvents/JournalModuleSellRemote.cs | 14 +- .../JournalEvents/JournalModuleStore.cs | 21 +- .../JournalEvents/JournalModuleSwap.cs | 15 +- EliteDangerous/JournalEvents/JournalMusic.cs | 18 +- .../JournalEvents/JournalNavBeaconScan.cs | 14 +- .../JournalEvents/JournalNewCommander.cs | 10 +- .../JournalEvents/JournalNpcCrewPaidWage.cs | 10 +- .../JournalEvents/JournalNpcCrewRank.cs | 8 +- .../JournalEvents/JournalOutfitting.cs | 7 +- .../JournalEvents/JournalPVPKill.cs | 14 +- .../JournalEvents/JournalPassengers.cs | 17 +- .../JournalEvents/JournalPayBounties.cs | 8 +- .../JournalEvents/JournalPayFines.cs | 13 +- .../JournalEvents/JournalPayLegacyFines.cs | 13 +- .../JournalEvents/JournalPowerplay.cs | 12 +- .../JournalEvents/JournalPowerplayCollect.cs | 12 +- .../JournalEvents/JournalPowerplayDefect.cs | 12 +- .../JournalEvents/JournalPowerplayDeliver.cs | 14 +- .../JournalPowerplayFastTrack.cs | 13 +- .../JournalEvents/JournalPowerplayJoin.cs | 10 +- .../JournalEvents/JournalPowerplayLeave.cs | 10 +- .../JournalEvents/JournalPowerplaySalary.cs | 12 +- .../JournalEvents/JournalPowerplayVote.cs | 13 +- .../JournalEvents/JournalPowerplayVoucher.cs | 12 +- .../JournalEvents/JournalProgress.cs | 26 +- .../JournalEvents/JournalPromotion.cs | 24 +- .../JournalEvents/JournalQuitACrew.cs | 12 +- EliteDangerous/JournalEvents/JournalRank.cs | 24 +- .../JournalEvents/JournalRebootRepair.cs | 9 +- .../JournalEvents/JournalReceiveText.cs | 14 +- .../JournalEvents/JournalRedeemVoucher.cs | 16 +- .../JournalEvents/JournalRefuelAll.cs | 14 +- .../JournalEvents/JournalRefuelPartial.cs | 15 +- EliteDangerous/JournalEvents/JournalRepair.cs | 11 +- .../JournalEvents/JournalRepairAll.cs | 13 +- .../JournalEvents/JournalRepairDrone.cs | 16 +- .../JournalEvents/JournalReputation.cs | 10 +- .../JournalEvents/JournalRestockVehicle.cs | 14 +- .../JournalEvents/JournalResurrect.cs | 11 +- .../JournalEvents/JournalSRVDestroyed.cs | 8 +- EliteDangerous/JournalEvents/JournalScan.cs | 160 +- .../JournalEvents/JournalScanned.cs | 12 +- .../JournalScientificResearch.cs | 7 +- .../JournalEvents/JournalScreenshot.cs | 24 +- .../JournalEvents/JournalSearchAndRescue.cs | 11 +- .../JournalEvents/JournalSelfDestruct.cs | 14 +- .../JournalEvents/JournalSellDrones.cs | 15 +- .../JournalSellExplorationData.cs | 18 +- .../JournalEvents/JournalSellShipOnRebuy.cs | 20 +- .../JournalEvents/JournalSendText.cs | 12 +- .../JournalEvents/JournalSetUserShipName.cs | 18 +- .../JournalEvents/JournalShieldState.cs | 14 +- .../JournalEvents/JournalShipTargeted.cs | 33 +- .../JournalEvents/JournalShipyard.cs | 17 +- .../JournalEvents/JournalShipyardBuy.cs | 23 +- .../JournalEvents/JournalShipyardNew.cs | 9 +- .../JournalEvents/JournalShipyardSell.cs | 14 +- .../JournalEvents/JournalShipyardSwap.cs | 17 +- .../JournalEvents/JournalShipyardTransfer.cs | 20 +- .../JournalEvents/JournalShutdown.cs | 8 +- .../JournalEvents/JournalStartJump.cs | 11 +- .../JournalEvents/JournalStatistics.cs | 143 +- .../JournalEvents/JournalStoredModules.cs | 14 +- .../JournalEvents/JournalStoredShips.cs | 39 +- .../JournalEvents/JournalSupercruiseEntry.cs | 8 +- .../JournalEvents/JournalSupercruiseExit.cs | 11 +- .../JournalEvents/JournalSynthesis.cs | 7 +- .../JournalEvents/JournalSystemsShutdown.cs | 11 - .../JournalEvents/JournalTechnologyBroker.cs | 8 +- .../JournalEvents/JournalTouchdown.cs | 13 +- .../JournalEvents/JournalUSSDrop.cs | 12 +- .../JournalEvents/JournalUnderAttack.cs | 8 +- .../JournalEvents/JournalUndocked.cs | 13 +- .../JournalEvents/JournalUnknown.cs | 6 +- .../JournalEvents/JournalVehicleSwitch.cs | 8 +- .../JournalEvents/JournalWingAdd.cs | 9 +- .../JournalEvents/JournalWingInvite.cs | 9 +- .../JournalEvents/JournalWingJoin.cs | 8 +- .../JournalEvents/JournalWingLeave.cs | 8 +- TestNetLogEntry/Program.cs | 19 +- TestNetLogEntry/ScanTranslate.cs | 287 +- translator/example-ex.tlf | 2501 +++++++++++++++++ 199 files changed, 3711 insertions(+), 2027 deletions(-) create mode 100644 translator/example-ex.tlf diff --git a/BaseUtils/Misc/CommandArgs.cs b/BaseUtils/Misc/CommandArgs.cs index c05cd91354..1cf3a5bc82 100644 --- a/BaseUtils/Misc/CommandArgs.cs +++ b/BaseUtils/Misc/CommandArgs.cs @@ -26,6 +26,7 @@ public CommandArgs(CommandArgs other) public string Next { get { return (pos < args.Length) ? args[pos++] : null; } } public int Int { get { return (pos < args.Length) ? args[pos++].InvariantParseInt(0) : 0; } } public string this[int v] { get { int left = args.Length - pos; return (v < left) ? args[pos + v] : null; } } + public bool More { get { return args.Length > pos; } } public int Left { get { return args.Length - pos; } } public void Remove() { if (pos < args.Length) pos++; } } diff --git a/BaseUtils/Strings/StringObjectExtensions.cs b/BaseUtils/Strings/StringObjectExtensions.cs index 515af52663..9e87855fa6 100644 --- a/BaseUtils/Strings/StringObjectExtensions.cs +++ b/BaseUtils/Strings/StringObjectExtensions.cs @@ -131,18 +131,37 @@ public static string ReplaceUnderscoresNull(this object obj) } } - public static string ReplaceNonAlphaNumeric(this string obj) + public static string FirstAlphaNumericText(this string obj) // skip to find first alpha text ignoring whitespace { if (obj == null) return null; else { - char[] arr = obj.ToCharArray(); - arr = Array.FindAll(arr, (c => char.IsLetterOrDigit(c))); - return new string(arr); + string ret = ""; + int i = 0; + while (i < obj.Length && !char.IsLetterOrDigit(obj[i])) + i++; + + for(; i < obj.Length; i++) + { + if (char.IsLetterOrDigit(obj[i])) + ret += obj[i]; + else if (!char.IsWhiteSpace(obj[i]) ) + break; + } + + return ret; + } } + public static string ReplaceNonAlphaNumeric(this string obj) + { + char[] arr = obj.ToCharArray(); + arr = Array.FindAll(arr, (c => char.IsLetterOrDigit(c))); + return new string(arr); + } + public static string QuoteString(this string obj, bool comma = false, bool bracket = false, bool space = true) { if (obj.Length == 0 || obj.Contains("\"") || obj[obj.Length - 1] == ' ' || (space && obj.Contains(" ")) || (bracket && obj.Contains(")")) || (comma && obj.Contains(","))) diff --git a/BaseUtils/Translator/Translator.cs b/BaseUtils/Translator/Translator.cs index 7441e072fa..3abea91218 100644 --- a/BaseUtils/Translator/Translator.cs +++ b/BaseUtils/Translator/Translator.cs @@ -11,7 +11,7 @@ public static class TranslatorExtensions { static public string Tx(this string s) // use the text, alpha numeric only, as the translation id { - return BaseUtils.Translator.Instance.Translate(s, s.ReplaceNonAlphaNumeric()); + return BaseUtils.Translator.Instance.Translate(s, s.FirstAlphaNumericText()); } static public string Tx(this string s, Object c, string id) // use the type plus an id @@ -19,14 +19,24 @@ public static class TranslatorExtensions return BaseUtils.Translator.Instance.Translate(s, c.GetType().Name, id); } + static public string Txb(this string s, Object c, string id) // use the base type plus an id + { + return BaseUtils.Translator.Instance.Translate(s, c.GetType().BaseType.Name, id); + } + static public string Tx(this string s, Type c) // use a type definition using the string as the id { - return BaseUtils.Translator.Instance.Translate(s, c.Name, s.ReplaceNonAlphaNumeric()); + return BaseUtils.Translator.Instance.Translate(s, c.Name, s.FirstAlphaNumericText()); } static public string Tx(this string s, Object c) // use the object type with string as id { - return BaseUtils.Translator.Instance.Translate(s, c.GetType().Name, s.ReplaceNonAlphaNumeric()); + return BaseUtils.Translator.Instance.Translate(s, c.GetType().Name, s.FirstAlphaNumericText()); + } + + static public string Txb(this string s, Object c) // use the base type using the string as the id + { + return BaseUtils.Translator.Instance.Translate(s, c.GetType().BaseType.Name, s.FirstAlphaNumericText()); } static public string Tx(this string s, Type c, string id) // use a type definition with id @@ -40,7 +50,7 @@ namespace BaseUtils { // specials : if text in a control = its presumed its a code filled in entry and not suitable for translation // in translator file, .Label means use the previous first word prefix stored, for shortness - // using Label: "English" @ means for debug, replace @ with as the foreign word + // using Label: "English" @ means for debug, replace @ with as the foreign word in the debug build. In release, just use the in-code text public class Translator { @@ -55,7 +65,7 @@ public class Translator LogToFile logger = null; - Dictionary translations = null; + Dictionary translations = null; // translation result can be null, which means, use the in-game english string List ExcludedControls = new List(); private Translator() @@ -64,102 +74,122 @@ private Translator() // You can call this multiple times if required for debugging purposes - public void LoadTranslation(string language, CultureInfo uicurrent, string txfolder) + public void LoadTranslation(string language, CultureInfo uicurrent, string writabletxfolder1, string txfolder2) { #if DEBUG if (logger != null) logger.Dispose(); logger = new LogToFile(); - logger.SetFile(txfolder, "ids.txt", false); + logger.SetFile(writabletxfolder1, "ids.txt", false); #endif translations = null; // forget any - List languages = Languages(txfolder); + List languagesfolder1 = Languages(writabletxfolder1,false); // full paths + List languagesfolder2 = Languages(txfolder2,false); // uicurrent = CultureInfo.CreateSpecificCulture("es"); // debug + string langfile = null; + if (language == "Auto") { - language = FindLanguage(languages, uicurrent.Name); + langfile = FindLanguage(languagesfolder1, uicurrent.Name); + + if (langfile == null) + langfile = FindLanguage(languagesfolder2, uicurrent.Name); if (language == null) - language = FindLanguage(languages, uicurrent.TwoLetterISOLanguageName); + langfile = FindLanguage(languagesfolder1, uicurrent.TwoLetterISOLanguageName); if (language == null) + langfile = FindLanguage(languagesfolder2, uicurrent.TwoLetterISOLanguageName); + + if (langfile == null) return; } - - string langfile = Path.Combine(txfolder, language + ".tlf"); - - if (File.Exists(langfile)) + else { - System.Diagnostics.Debug.WriteLine("Load Language " + langfile); - logger?.WriteLine("Read " + langfile); + langfile = Path.Combine(writabletxfolder1, language + ".tlf"); - try + if (!File.Exists(langfile)) { - var utc8nobom = new UTF8Encoding(false); // give it the default UTF8 no BOM encoding, it will detect BOM or UCS-2 automatically + langfile = Path.Combine(txfolder2, language + ".tlf"); - StreamReader sr = new StreamReader(langfile, utc8nobom); + if (!File.Exists(langfile)) + return; + } + } - translations = new Dictionary(); + System.Diagnostics.Debug.WriteLine("Load Language " + langfile); + logger?.WriteLine("Read " + langfile); + + try + { + var utc8nobom = new UTF8Encoding(false); // give it the default UTF8 no BOM encoding, it will detect BOM or UCS-2 automatically - string prefix = ""; + StreamReader sr = new StreamReader(langfile, utc8nobom); - string line = null; - while ((line = sr.ReadLine()) != null) + translations = new Dictionary(); + + string prefix = ""; + + string line = null; + while ((line = sr.ReadLine()) != null) + { + line = line.Trim(); + if (line.Length > 0 && !line.StartsWith("//")) { - line = line.Trim(); - if (line.Length > 0 && !line.StartsWith("//")) + StringParser s = new StringParser(line); + + string id = s.NextWord(" :"); + + if (id.StartsWith(".") && prefix.HasChars()) + id = prefix + id; + else + prefix = id.Word(new char[] { '.' }); + + if (s.IsCharMoveOn(':')) { - StringParser s = new StringParser(line); + s.NextQuotedWord(replaceescape: true); // ignore the english for ref purposes only - string id = s.NextWord(" :").ToLower(); + string foreign = null; + bool err = false; - if (s.IsCharMoveOn(':')) + if (s.IsStringMoveOn("=>")) { - string english = s.NextQuotedWord(replaceescape: true); - string foreign = null; - - if (s.IsStringMoveOn("=>")) - foreign = s.NextQuotedWord(replaceescape: true); - else if (s.IsCharMoveOn('@')) // debug marker - foreign = "<" + english + ">"; + foreign = s.NextQuotedWord(replaceescape: true); + err = foreign == null; + } + else if (s.IsCharMoveOn('@')) + foreign = null; + else + err = false; - if (foreign != null) + if ( err == true ) + { + logger?.WriteLine(string.Format("*** Translator ID but no translation {0}", id)); + System.Diagnostics.Debug.WriteLine("*** Translator ID but no translation {0}", id); + } + else + { + if (!translations.ContainsKey(id)) { - // System.Diagnostics.Debug.WriteLine("{0}: {1} => {2}", id, english, foreign); - - // make LF work - - if (id.StartsWith(".") && prefix.HasChars()) - id = prefix + id; - else - prefix = id.Word(new char[] { '.' }); - - if (!translations.ContainsKey(id)) - { - //logger?.WriteLine(string.Format("New {0}: \"{1}\" => \"{2}\"", id, english, foreign)); - translations[id] = foreign; - } - else - { - logger?.WriteLine(string.Format("*** Translator Repeat {0}: \"{1}\" => \"{2}\"", id, english, foreign)); - System.Diagnostics.Debug.WriteLine("*** Translator Repeat {0}: {1} => {2}", id, english, foreign); - } + //logger?.WriteLine(string.Format("New {0}: \"{1}\" => \"{2}\"", id, english, foreign)); + translations[id] = foreign; } else { - logger?.WriteLine(string.Format("*** Translator ID but no translation \"{0}\": \"{1}\"", id, english)); - System.Diagnostics.Debug.WriteLine("*** Translator ID but no translation {0}: {1}", id, english); + logger?.WriteLine(string.Format("*** Translator Repeat {0}", id)); } + } + } } } - catch { } } + catch { } } public void AddExcludedControls(string [] s) @@ -167,17 +197,18 @@ public void AddExcludedControls(string [] s) ExcludedControls.AddRange(s); } - static public List Languages(string txfolder) + static public List Languages(string txfolder, bool nameonly) { FileInfo[] allFiles = Directory.EnumerateFiles(txfolder, "*.tlf", SearchOption.TopDirectoryOnly).Select(f => new FileInfo(f)).OrderBy(p => p.LastWriteTime).ToArray(); - return allFiles.Select(x => Path.GetFileNameWithoutExtension(x.Name)).ToList(); + return nameonly ? allFiles.Select(x => Path.GetFileNameWithoutExtension(x.Name)).ToList() : allFiles.Select(x => x.Name).ToList(); } - static public string FindLanguage(List lang, string isoname) + static public string FindLanguage(List lang, string isoname) // take filename part only, see if filename text- is present { return lang.Find(x => { + string filename = Path.GetFileNameWithoutExtension(x); int dash = x.IndexOf('-'); return dash != -1 && x.Substring(dash + 1).Equals(isoname); }); @@ -185,17 +216,21 @@ static public string FindLanguage(List lang, string isoname) public string Translate(string normal, string id) { - string key = id.ToLower(); if (translations != null && !normal.Equals("") ) { + string key = id; if (translations.ContainsKey(key)) { - //System.Diagnostics.Debug.WriteLine("Translate: \"{0}\" => \"{1}\"", id, translations[id]); - return translations[key]; +#if DEBUG + return translations[key] ?? ('\'' + normal + '\''); // debug more we quote them to show its not translated, else in release we just print +#else + return translations[key] ?? normal; +#endif } else { logger?.WriteLine(string.Format("{0}: {1} @", id, normal.EscapeControlChars().AlwaysQuoteString())); + translations.Add(key, normal); //System.Diagnostics.Debug.WriteLine("*** Missing Translate ID: {0}: \"{1}\" => \"{2}\"", id, normal.EscapeControlChars(), "<" + normal.EscapeControlChars() + ">"); return normal; } diff --git a/EDDiscovery/EDDOptions.cs b/EDDiscovery/EDDOptions.cs index 3f39f3a8c0..d3cb2bef8f 100644 --- a/EDDiscovery/EDDOptions.cs +++ b/EDDiscovery/EDDOptions.cs @@ -29,7 +29,7 @@ public static EDDOptions Instance public string UserDatabasePath { get; private set; } public string SystemDatabasePath { get; private set; } public string IconsPath { get; private set; } - public bool NoWindowReposition { get; set; } + public bool NoWindowReposition { get; set; } public bool ActionButton { get; private set; } public bool NoLoad { get; private set; } public bool NoTheme { get; set; } @@ -66,6 +66,7 @@ public static EDDOptions Instance public string ThemeAppDirectory() { return SubAppDirectory("Theme"); } public string DLLAppDirectory() { return SubAppDirectory("DLL"); } public string TranslatorDirectory() { return SubAppDirectory("Translator"); } + static public string ExeDirectory() { return System.AppDomain.CurrentDomain.BaseDirectory; } private string AppFolder { get; set; } // internal to use.. for -appfolder option private bool StoreDataInProgramDirectory { get; set; } // internal to us, to indicate portable @@ -97,7 +98,7 @@ private void SetAppDataDirectory() } else if (StoreDataInProgramDirectory) { - AppDataDirectory = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, appfolder); + AppDataDirectory = Path.Combine(ExeDirectory(), appfolder); } else { @@ -286,9 +287,9 @@ public void Init() { ProcessConfigVariables(); - ProcessOptionsFileOption(System.AppDomain.CurrentDomain.BaseDirectory); // go thru the command line looking for -optionfile, use relative base dir + ProcessOptionsFileOption(ExeDirectory()); // go thru the command line looking for -optionfile, use relative base dir - string optval = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, "options.txt"); // options in the base folder. + string optval = Path.Combine(ExeDirectory(), "options.txt"); // options in the base folder. if (File.Exists(optval)) // try options.txt in the base folder.. ProcessOptionFile(optval); diff --git a/EDDiscovery/EDDiscoveryController.cs b/EDDiscovery/EDDiscoveryController.cs index e7e1660440..e42a62839d 100644 --- a/EDDiscovery/EDDiscoveryController.cs +++ b/EDDiscovery/EDDiscoveryController.cs @@ -153,7 +153,7 @@ public EDDiscoveryController(Func getNormalTextColor, Func getHigh string path = EDDOptions.Instance.IconsPath ?? (EDDOptions.Instance.IconsAppDirectory() + "\\*.zip"); - Icons.IconSet.LoadIconPack(path, EDDOptions.Instance.AppDataDirectory, AppDomain.CurrentDomain.BaseDirectory); + Icons.IconSet.LoadIconPack(path, EDDOptions.Instance.AppDataDirectory, EDDOptions.ExeDirectory()); } public void Init() // ED Discovery calls this during its init diff --git a/EDDiscovery/EDDiscoveryForm.cs b/EDDiscovery/EDDiscoveryForm.cs index fe5f648ada..1a5c364d95 100644 --- a/EDDiscovery/EDDiscoveryForm.cs +++ b/EDDiscovery/EDDiscoveryForm.cs @@ -151,7 +151,7 @@ public EDDiscoveryForm() msg.Invoke("Modulating Shields"); - BaseUtils.Translator.Instance.LoadTranslation(EDDConfig.Instance.Language, CultureInfo.CurrentUICulture, EDDOptions.Instance.TranslatorDirectory()); + BaseUtils.Translator.Instance.LoadTranslation(EDDConfig.Instance.Language, CultureInfo.CurrentUICulture, EDDOptions.Instance.TranslatorDirectory(), EDDOptions.ExeDirectory()); BaseUtils.Translator.Instance.AddExcludedControls(new string[] { "ComboBoxCustom", "NumberBoxDouble", "NumberBoxLong", "VScrollBarCustom", // Controls not for translation.. "StatusStripCustom" , "RichTextBoxScroll","TextBoxBorder", "AutoCompleteTextBox", "DateTimePicker" , "NumericUpDownCustom" }); @@ -884,7 +884,7 @@ private void ReportSyncProgress(int percentComplete, string message) private void buttonReloadActions_Click(object sender, EventArgs e) { - BaseUtils.Translator.Instance.LoadTranslation(EDDConfig.Instance.Language, CultureInfo.CurrentUICulture, EDDOptions.Instance.TranslatorDirectory()); + BaseUtils.Translator.Instance.LoadTranslation(EDDConfig.Instance.Language, CultureInfo.CurrentUICulture, EDDOptions.Instance.TranslatorDirectory(), EDDOptions.ExeDirectory()); actioncontroller.ReLoad(); actioncontroller.CheckWarn(); actioncontroller.onStartup(); diff --git a/EDDiscovery/Forms/AddOnManagerForm.cs b/EDDiscovery/Forms/AddOnManagerForm.cs index 6944dcfe88..f9c5a37d20 100644 --- a/EDDiscovery/Forms/AddOnManagerForm.cs +++ b/EDDiscovery/Forms/AddOnManagerForm.cs @@ -255,12 +255,12 @@ void ReadyToDisplay() else if (di.state == VersioningManager.ItemState.NotPresent) { isversion = true; - text = "Version ".Tx(this) + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); + text = "Version".Tx(this) + " " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } else { isversion = true; - text = "New version ".Tx(this) + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); + text = "New version".Tx(this) + " " + di.downloadedversion.ToString(".") + ((di.localmodified) ? "*" : ""); } g.actionlabel = new Label(); diff --git a/EDDiscovery/Forms/CommanderForm.cs b/EDDiscovery/Forms/CommanderForm.cs index d920725bde..b6f9bb7499 100644 --- a/EDDiscovery/Forms/CommanderForm.cs +++ b/EDDiscovery/Forms/CommanderForm.cs @@ -111,7 +111,7 @@ void UpdateCAPIState() textBoxBorderCompanionLogin.Text = textBoxBorderCompanionPassword.Text = ""; buttonExtCAPI.Text = "Clear".Tx(this); // default state is clear/abort buttonExtCAPI.Enabled = true; - toolTip.SetToolTip(textBoxBorderCompanionLogin, "Enter the confirmation code you just received via email from Frontier".Tx(this, "Confirm")); + toolTip.SetToolTip(textBoxBorderCompanionLogin, "Enter the confirmation code you just received via email from Frontier".Tx(this, "ConfirmCode")); if ( capi.NeedLogin ) { diff --git a/EDDiscovery/Forms/GalaxySectorSelect.cs b/EDDiscovery/Forms/GalaxySectorSelect.cs index e616a4b311..020e88ae78 100644 --- a/EDDiscovery/Forms/GalaxySectorSelect.cs +++ b/EDDiscovery/Forms/GalaxySectorSelect.cs @@ -62,7 +62,7 @@ public enum ActionToDo { None, Add, Remove }; new Tuple("None".Tx(typeof(GalaxySectorSelect)),""), new Tuple("Bubble".Tx(typeof(GalaxySectorSelect)),"810"), new Tuple("Extended Bubble".Tx(typeof(GalaxySectorSelect)),"608,609,610,611,612,708,709,710,711,712,808,809,810,811,812,908,909,910,911,912,1008,1009,1010,1011,1012"), - new Tuple("Bubble+Colonia".Tx(typeof(GalaxySectorSelect)),"608,609,610,611,612,708,709,710,711,712,808,809,810,811,812,908,909,910,911,912,1008,1009,1010,1011,1012,1108,1109,1110,1207,1208,1209,1306,1307,1308,1405,1406,1407,1504,1505,1603,1604,1703"), + new Tuple("Bubble+Colonia".Tx(typeof(GalaxySectorSelect),"BC"),"608,609,610,611,612,708,709,710,711,712,808,809,810,811,812,908,909,910,911,912,1008,1009,1010,1011,1012,1108,1109,1110,1207,1208,1209,1306,1307,1308,1405,1406,1407,1504,1505,1603,1604,1703"), }; public GalaxySectorSelect() diff --git a/EDDiscovery/UserControls/UserControlExpedition.cs b/EDDiscovery/UserControls/UserControlExpedition.cs index 78b6df8fca..6ce674039f 100644 --- a/EDDiscovery/UserControls/UserControlExpedition.cs +++ b/EDDiscovery/UserControls/UserControlExpedition.cs @@ -403,7 +403,7 @@ private void toolStripButtonImportRoute_Click(object sender, EventArgs e) { if (latestplottedroute == null || latestplottedroute.Count == 0) { - ExtendedControls.MessageBoxTheme.Show(FindForm(), "Please create a route on a route panel".Tx(this,"Nonames"), "Warning".Tx()); + ExtendedControls.MessageBoxTheme.Show(FindForm(), "Please create a route on a route panel".Tx(this,"Createroute"), "Warning".Tx()); return; } else if (!PromptAndSaveIfNeeded()) @@ -429,7 +429,7 @@ private void toolStripButtonExport_Click(object sender, EventArgs e) { if (rt.Systems.Count < 1) { - ExtendedControls.MessageBoxTheme.Show(FindForm(), "There is no route to export ".Tx(this,"NoRoute"), + ExtendedControls.MessageBoxTheme.Show(FindForm(), "There is no route to export ".Tx(this,"NoRouteExport"), "Warning".Tx(), MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } diff --git a/EDDiscovery/UserControls/UserControlMarketData.cs b/EDDiscovery/UserControls/UserControlMarketData.cs index 1fcfbfb84b..6bda9ab849 100644 --- a/EDDiscovery/UserControls/UserControlMarketData.cs +++ b/EDDiscovery/UserControls/UserControlMarketData.cs @@ -202,8 +202,7 @@ private void Display() c.stock > 0 ? c.stock.ToString() : "" , c.meanPrice > 0 ? c.meanPrice.ToString() : "", c.ComparisionLR, - c.ComparisionRL, - }; + c.ComparisionRL }; int rowno = dataGridViewMarketData.Rows.Add(rowobj); @@ -231,8 +230,7 @@ private void Display() "", "", "", - "", - }; + "" }; int rowno = dataGridViewMarketData.Rows.Add(rowobj); dataGridViewMarketData.Rows[rowno].Cells[0].ToolTipText = diff --git a/EDDiscovery/UserControls/UserControlModules.cs b/EDDiscovery/UserControls/UserControlModules.cs index 43dd5141b6..2a86465027 100644 --- a/EDDiscovery/UserControls/UserControlModules.cs +++ b/EDDiscovery/UserControls/UserControlModules.cs @@ -207,9 +207,9 @@ private void DisplayShip(ShipInformation si) if (fsdspec != null) { EliteDangerousCalculations.FSDSpec.JumpInfo ji = fsdspec.GetJumpInfo(0, modulemass + hullmass, si.FuelCapacity, si.FuelCapacity / 2); - AddInfoLine("FSD Avg Jump".Tx(this), ji.avgsinglejumpnocargo.ToStringInvariant("N2") + "ly", "Half tank, no cargo".Tx(this), fsdspec.ToString()); + AddInfoLine("FSD Avg Jump".Tx(this), ji.avgsinglejumpnocargo.ToStringInvariant("N2") + "ly", "Half tank, no cargo".Tx(this,"HT"), fsdspec.ToString()); DataGridViewRow rw = dataGridViewModules.Rows[dataGridViewModules.Rows.Count - 1]; - AddInfoLine("FSD Max Range".Tx(this), ji.maxjumprange.ToStringInvariant("N2") + "ly", "Full Tank, no cargo".Tx(this), fsdspec.ToString()); + AddInfoLine("FSD Max Range".Tx(this), ji.maxjumprange.ToStringInvariant("N2") + "ly", "Full Tank, no cargo".Tx(this,"FT"), fsdspec.ToString()); AddInfoLine("FSD Maximum Fuel per jump".Tx(this), fsdspec.MaxFuelPerJump.ToStringInvariant()+"t","", fsdspec.ToString()); } diff --git a/EDDiscovery/UserControls/UserControlRoute.cs b/EDDiscovery/UserControls/UserControlRoute.cs index aeab6920f9..37e3cb0c8c 100644 --- a/EDDiscovery/UserControls/UserControlRoute.cs +++ b/EDDiscovery/UserControls/UserControlRoute.cs @@ -241,7 +241,7 @@ private void button_Route_Click(object sender, EventArgs e) if (plotter.possiblejumps > 100) { DialogResult res = ExtendedControls.MessageBoxTheme.Show(FindForm(), - string.Format(("This will result in a large number ({0})) of jumps" + Environment.NewLine + Environment.NewLine + "Confirm please").Tx(this,"Confirm"), + string.Format(("This will result in a large number ({0})) of jumps" + Environment.NewLine + "Confirm please").Tx(this,"Confirm"), plotter.possiblejumps), "Warning".Tx(), MessageBoxButtons.YesNo); if (res != System.Windows.Forms.DialogResult.Yes) { diff --git a/EDDiscovery/UserControls/UserControlSettings.cs b/EDDiscovery/UserControls/UserControlSettings.cs index cba829559a..3f6f4d1e11 100644 --- a/EDDiscovery/UserControls/UserControlSettings.cs +++ b/EDDiscovery/UserControls/UserControlSettings.cs @@ -52,9 +52,11 @@ public override void Init() comboBoxClickThruKey.SelectedItem = EDDConfig.Instance.ClickThruKey.VKeyToString(); comboBoxClickThruKey.SelectedIndexChanged += comboBoxClickThruKey_SelectedIndexChanged; - comboBoxCustomLanguage.Items = BaseUtils.Translator.Languages(EDDOptions.Instance.TranslatorDirectory()); + comboBoxCustomLanguage.Items = BaseUtils.Translator.Languages(EDDOptions.Instance.TranslatorDirectory(), true); + comboBoxCustomLanguage.Items.AddRange(BaseUtils.Translator.Languages(EDDOptions.ExeDirectory(), true)); + comboBoxCustomLanguage.Items.Add("Auto"); - comboBoxCustomLanguage.Items.Add("Undefined"); + comboBoxCustomLanguage.Items.Add("None"); if (comboBoxCustomLanguage.Items.Contains(EDDConfig.Instance.Language)) comboBoxCustomLanguage.SelectedItem = EDDConfig.Instance.Language; else @@ -103,7 +105,7 @@ public override void Init() checkBoxCustomEDSMEDDBDownload.Checked = EDDConfig.Instance.EDSMEDDBDownload; this.checkBoxCustomEDSMEDDBDownload.CheckedChanged += new System.EventHandler(this.checkBoxCustomEDSMDownload_CheckedChanged); - comboBoxCustomHistoryLoadTime.Items = new string[] { "Disabled-Load All".Tx(this), ">7 days old".Tx(this), ">30 days old".Tx(this), ">60 days old".Tx(this), ">90 days old".Tx(this), ">180 days old".Tx(this), "> 365 days old".Tx(this) }; + comboBoxCustomHistoryLoadTime.Items = new string[] { "Disabled-Load All".Tx(this,"DLA"), ">7 days old".Tx(this), ">30 days old".Tx(this), ">60 days old".Tx(this), ">90 days old".Tx(this), ">180 days old".Tx(this), "> 365 days old".Tx(this) }; comboBoxCustomHistoryLoadTime.Tag = new int[] { 0, 7, 30, 60, 90, 180, 365 }; int ix = Array.FindIndex(comboBoxCustomHistoryLoadTime.Tag as int[], x => x == EDDConfig.Instance.FullHistoryLoadDayLimit); comboBoxCustomHistoryLoadTime.SelectedIndex = ix >= 0 ? ix : 0; @@ -560,11 +562,11 @@ private void buttonExtEDSMConfigureArea_Click(object sender, EventArgs e) info = new ExtendedControls.InfoForm(); info.Info("Remove Sectors".Tx(this), EDDiscovery.Properties.Resources.edlogo_3mo_icon, - ("Removing " + gss.Removed.Count + " Sector(s)." + Environment.NewLine + Environment.NewLine + + string.Format( ("Removing {0} Sector(s)." + Environment.NewLine + Environment.NewLine + "This will take a while (up to 30 mins dep on drive type and amount of sectors)." + Environment.NewLine + "You may continue to use EDD while this operation takes place" + Environment.NewLine + "but it may be slow to respond. Do not close down EDD until this window says" + Environment.NewLine + - "the process has finished" + Environment.NewLine + Environment.NewLine).Tx(this,"GalRemove")); + "the process has finished" + Environment.NewLine + Environment.NewLine).Tx(this,"GalRemove"), gss.Removed.Count )); info.EnableClose = false; info.Show(discoveryform); diff --git a/EDDiscovery/UserControls/UserControlShipYards.cs b/EDDiscovery/UserControls/UserControlShipYards.cs index f36dfe286b..b1ef281a10 100644 --- a/EDDiscovery/UserControls/UserControlShipYards.cs +++ b/EDDiscovery/UserControls/UserControlShipYards.cs @@ -221,7 +221,7 @@ private void DisplayYard(ShipYard yard) Col1.Tag = null; Col2.HeaderText = "Manufacturer".Tx(this); Col2.Tag = null; - Col3.HeaderText = "Mass/Speed".Tx(this); + Col3.HeaderText = "Mass/Speed".Tx(this,"MS"); Col3.Tag = null; ColPrice.HeaderText = "Price".Tx(this); ColPrice.Tag = "cr"; diff --git a/EDDiscovery/UserControls/UserControlStats.cs b/EDDiscovery/UserControls/UserControlStats.cs index 7c0c1e2420..e91dc46fe3 100644 --- a/EDDiscovery/UserControls/UserControlStats.cs +++ b/EDDiscovery/UserControls/UserControlStats.cs @@ -150,7 +150,7 @@ private void StatsGeneral(HistoryEntry he, HistoryList hl) StatToDGV("Total No of jumps: ".Tx(this), totaljumps); if (totaljumps > 0) { - StatToDGV("Jump History".Tx(this), "24 Hours: ".Tx(this) + hl.GetFSDJumps(new TimeSpan(1, 0, 0, 0)) + + StatToDGV("Jump History".Tx(this), "24 Hours: ".Tx(this,"24hc") + hl.GetFSDJumps(new TimeSpan(1, 0, 0, 0)) + ", One Week: ".Tx(this) + hl.GetFSDJumps(new TimeSpan(7, 0, 0, 0)) + ", 30 Days: ".Tx(this) + hl.GetFSDJumps(new TimeSpan(30, 0, 0, 0)) + ", One Year: ".Tx(this) + hl.GetFSDJumps(new TimeSpan(365, 0, 0, 0)) @@ -316,16 +316,16 @@ void StatsTravel(HistoryEntry he, HistoryList hl) Col1.Tag = "AlphaSort"; var Col2 = new DataGridViewTextBoxColumn(); - Col2.HeaderText = "24 hours"; + Col2.HeaderText = "24 Hours".Tx(this); var Col3 = new DataGridViewTextBoxColumn(); - Col3.HeaderText = "week"; + Col3.HeaderText = "Week".Tx(this); var Col4 = new DataGridViewTextBoxColumn(); - Col4.HeaderText = "month"; + Col4.HeaderText = "Month".Tx(this); var Col5 = new DataGridViewTextBoxColumn(); - Col5.HeaderText = "Last dock"; + Col5.HeaderText = "Last dock".Tx(this); var Col6 = new DataGridViewTextBoxColumn(); var Col7 = new DataGridViewTextBoxColumn(); @@ -591,13 +591,13 @@ void StatsScan(HistoryEntry he, HistoryList hl) Col1.Tag = "AlphaSort"; var Col2 = new DataGridViewTextBoxColumn(); - Col2.HeaderText = "24 hours".Tx(this); + Col2.HeaderText = "24 Hours".Tx(this); var Col3 = new DataGridViewTextBoxColumn(); - Col3.HeaderText = "week".Tx(this); + Col3.HeaderText = "Week".Tx(this); var Col4 = new DataGridViewTextBoxColumn(); - Col4.HeaderText = "month".Tx(this); + Col4.HeaderText = "Month".Tx(this); var Col5 = new DataGridViewTextBoxColumn(); Col5.HeaderText = "Last dock".Tx(this); @@ -693,7 +693,7 @@ void StatsScan(HistoryEntry he, HistoryList hl) strarr = new string[intervals]; var Col1 = new DataGridViewTextBoxColumn(); - Col1.HeaderText = "Body type".Tx(this); + Col1.HeaderText = "Body Type".Tx(this); Col1.Tag = "AlphaSort"; dataGridViewScan.Columns.Add(Col1); diff --git a/EDDiscovery/UserControls/UserControlSysInfo.cs b/EDDiscovery/UserControls/UserControlSysInfo.cs index 8a2f3b310c..c936ccabbd 100644 --- a/EDDiscovery/UserControls/UserControlSysInfo.cs +++ b/EDDiscovery/UserControls/UserControlSysInfo.cs @@ -267,7 +267,7 @@ private void Display(HistoryEntry he, HistoryList hl) else if (he.ShipInformation.FuelCapacity > 0) textBoxFuel.Text = he.ShipInformation.FuelCapacity.ToStringInvariant("0.#"); else - textBoxFuel.Text = "N/A".Tx(); + textBoxFuel.Text = "N/A".Tx(this,"NA"); } else textBoxShip.Text = textBoxFuel.Text = ""; diff --git a/EliteDangerous/EliteDangerous/Bodies.cs b/EliteDangerous/EliteDangerous/Bodies.cs index 75175a95c5..21498a3b05 100644 --- a/EliteDangerous/EliteDangerous/Bodies.cs +++ b/EliteDangerous/EliteDangerous/Bodies.cs @@ -376,37 +376,37 @@ public static string StarName( EDStar id ) switch (id) // see journal, section 11.2 { case EDStar.O: - return string.Format("Luminous Hot Main Sequence {0} star", id.ToString()); + return string.Format("Luminous Hot Main Sequence {0} star".Tx(typeof(Bodies), "HMS"), id.ToString()); case EDStar.B: // also have an B1V - return string.Format("Luminous Blue Main Sequence {0} star", id.ToString()); + return string.Format("Luminous Blue Main Sequence {0} star".Tx(typeof(Bodies), "BMS"), id.ToString()); case EDStar.A: // also have an A3V.. - return string.Format("Bluish-White Main Sequence {0} star", id.ToString()); + return string.Format("Bluish-White Main Sequence {0} star".Tx(typeof(Bodies), "BWMS"), id.ToString()); case EDStar.F: - return string.Format("White Main Sequence {0} star", id.ToString()); + return string.Format("White Main Sequence {0} star".Tx(typeof(Bodies), "WMS"), id.ToString()); case EDStar.G: // also have a G8V - return string.Format("Yellow Main Sequence {0} star", id.ToString()); + return string.Format("Yellow Main Sequence {0} star".Tx(typeof(Bodies), "YMS"), id.ToString()); case EDStar.K: // also have a K0V - return string.Format("Orange Main Sequence {0} star", id.ToString()); + return string.Format("Orange Main Sequence {0} star".Tx(typeof(Bodies), "OMS"), id.ToString()); case EDStar.M: // also have a M1VA - return string.Format("Red Main Sequence {0} star", id.ToString()); + return string.Format("Red Main Sequence {0} star".Tx(typeof(Bodies), "RMS"), id.ToString()); // dwarfs case EDStar.L: - return string.Format("Dark Red Non Main Sequence {0} star", id.ToString()); + return string.Format("Dark Red Non Main Sequence {0} star".Tx(typeof(Bodies), "DRNS"), id.ToString()); case EDStar.T: - return string.Format("Methane Dwarf star"); + return string.Format("Methane Dwarf star".Tx(typeof(Bodies), "MD")); case EDStar.Y: - return string.Format("Brown Dwarf star"); + return string.Format("Brown Dwarf star".Tx(typeof(Bodies), "BD")); // proto stars case EDStar.AeBe: // Herbig @@ -420,7 +420,7 @@ public static string StarName( EDStar id ) case EDStar.WNC: case EDStar.WC: case EDStar.WO: - return string.Format("Wolf-Rayet {0} star", id.ToString()); + return string.Format("Wolf-Rayet {0} star".Tx(typeof(Bodies), "WR"), id.ToString()); // Carbon case EDStar.CS: @@ -428,13 +428,13 @@ public static string StarName( EDStar id ) case EDStar.CN: case EDStar.CJ: case EDStar.CHd: - return string.Format("Carbon {0} star", id.ToString()); + return string.Format("Carbon {0} star".Tx(typeof(Bodies), "C"), id.ToString()); case EDStar.MS: //seen in log https://en.wikipedia.org/wiki/S-type_star - return string.Format("Intermediate low Zirconium Monoxide Type star"); + return string.Format("Intermediate low Zirconium Monoxide Type star".Tx(typeof(Bodies), "IZ")); case EDStar.S: // seen in log, data from http://elite-dangerous.wikia.com/wiki/Stars - return string.Format("Cool Giant Zirconium Monoxide rich Type star"); + return string.Format("Cool Giant Zirconium Monoxide rich Type star".Tx(typeof(Bodies), "CGZ")); // white dwarf case EDStar.D: @@ -452,35 +452,35 @@ public static string StarName( EDStar id ) case EDStar.DC: case EDStar.DCV: case EDStar.DX: - return string.Format("White Dwarf {0} star", id.ToString()); + return string.Format("White Dwarf {0} star".Tx(typeof(Bodies), "WD"), id.ToString()); case EDStar.N: - return "Neutron Star"; + return "Neutron Star".Tx(typeof(Bodies), "NS"); case EDStar.H: - return "Black Hole"; + return "Black Hole".Tx(typeof(Bodies), "BH"); case EDStar.X: // currently speculative, not confirmed with actual data... in journal - return "Exotic"; + return "Exotic".Tx(typeof(Bodies), "EX"); // Journal.. really? need evidence these actually are formatted like this. case EDStar.SuperMassiveBlackHole: - return "Super Massive Black Hole"; + return "Super Massive Black Hole".Tx(typeof(Bodies), "SMBH"); case EDStar.A_BlueWhiteSuperGiant: - return "Blue White Super Giant"; + return "Blue White Super Giant".Tx(typeof(Bodies), "BSG"); case EDStar.F_WhiteSuperGiant: - return "F White Super Giant"; + return "F White Super Giant".Tx(typeof(Bodies), "WSG"); case EDStar.M_RedSuperGiant: - return "M Red Super Giant"; + return "M Red Super Giant".Tx(typeof(Bodies), "MSR"); case EDStar.M_RedGiant: - return "M Red Giant"; + return "M Red Giant".Tx(typeof(Bodies), "MOG"); case EDStar.K_OrangeGiant: - return "K Orange Giant"; + return "K Orange Giant".Tx(typeof(Bodies), "KOG"); case EDStar.RoguePlanet: - return "Rogue Planet"; + return "Rogue Planet".Tx(typeof(Bodies), "RP"); default: return string.Format("Class {0} star\n", id.ToString()); diff --git a/EliteDangerous/EliteDangerous/JournalEntry.cs b/EliteDangerous/EliteDangerous/JournalEntry.cs index 708e2526a0..a866823411 100644 --- a/EliteDangerous/EliteDangerous/JournalEntry.cs +++ b/EliteDangerous/EliteDangerous/JournalEntry.cs @@ -231,7 +231,7 @@ public enum SyncFlags EGO = 0x04, StartMarker = 0x0100, // measure distance start pos marker StopMarker = 0x0200, // measure distance stop pos marker - }; + } [DebuggerDisplay("Event {EventTypeStr} {EventTimeUTC} EdsmID {EdsmID} JID {Id} C {CommanderId}")] public abstract class JournalEntry @@ -245,6 +245,8 @@ public abstract class JournalEntry public string EventTypeStr { get { return EventTypeID.ToString(); } } // name of event. these two duplicate each other, string if for debuggin in the db view of a browser public string EventSummaryName { get; private set; } // filled in during creation, its EventTypeID expanded out. Stored since splitcaseword is expensive in time + public System.Drawing.Image Icon { get { return JournalTypeIcons[this.IconEventType]; } } // Icon to paint for this + public DateTime EventTimeUTC { get; set; } public long EdsmID { get; protected set; } // 0 = unassigned, >0 = assigned @@ -317,17 +319,17 @@ public virtual bool Beta JournalTypeEnum.Loadout, JournalTypeEnum.MassModuleStore, JournalTypeEnum.ModuleBuy, JournalTypeEnum.ModuleSell, JournalTypeEnum.ModuleRetrieve, JournalTypeEnum.ModuleSellRemote, JournalTypeEnum.ModuleStore, JournalTypeEnum.ModuleSwap, JournalTypeEnum.SellShipOnRebuy, - JournalTypeEnum.SetUserShipName, JournalTypeEnum.ShipyardBuy, JournalTypeEnum.ShipyardNew, JournalTypeEnum.ShipyardSell, + JournalTypeEnum.SetUserShipName, JournalTypeEnum.ShipyardBuy, JournalTypeEnum.ShipyardNew, JournalTypeEnum.ShipyardSell, JournalTypeEnum.ShipyardSwap , JournalTypeEnum.ShipyardTransfer, JournalTypeEnum.StoredModules, JournalTypeEnum.StoredShips, // scan JournalTypeEnum.Scan, JournalTypeEnum.SellExplorationData, // misc - JournalTypeEnum.ClearSavedGame, + JournalTypeEnum.ClearSavedGame, }; - private static Dictionary JournalEntryTypes = GetJournalEntryTypes(); + private static Dictionary JournalEntryTypes = GetJournalEntryTypes(); // enum -> type /// /// Gets the mapping of journal type value to JournalEntry type @@ -351,31 +353,35 @@ public virtual bool Beta return typedict; } + // enum -> icons + public static IReadOnlyDictionary JournalTypeIcons { get; } = new IconGroup("Journal"); - #endregion + // enum -> Summary name - #region Formatting control and Icons + private static Dictionary SummaryNames = GetJournalSummaryNames(); - protected virtual JournalTypeEnum IconEventType + private static Dictionary GetJournalSummaryNames() { - get - { - return EventTypeID; - } + var v = Enum.GetValues(typeof(JournalTypeEnum)).OfType(); + return v.ToDictionary(e => e, e => e.ToString().SplitCapsWord().Tx(typeof(JournalTypeEnum),e.ToString())); } - public virtual System.Drawing.Image Icon + #endregion + + #region Formatting control and Icons + + protected virtual JournalTypeEnum IconEventType // entry may be overridden to dynamically change icon event for an event { get { - return JournalTypeIcons[this.IconEventType]; + return EventTypeID; } } public abstract void FillInformation(out string info, out string detailed); // all entries must implement - public virtual string FillSummary { get { return EventTypeStr.SplitCapsWord(); } } // entries may override if required + public virtual string FillSummary { get { return SummaryNames[EventTypeID]; } } // entry may be overridden for specialist output #endregion diff --git a/EliteDangerous/JournalEvents/JournalAfmuRepair.cs b/EliteDangerous/JournalEvents/JournalAfmuRepair.cs index bfa73135ec..2572a7d17e 100644 --- a/EliteDangerous/JournalEvents/JournalAfmuRepair.cs +++ b/EliteDangerous/JournalEvents/JournalAfmuRepair.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,18 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - /* - When written: when repairing modules using the Auto Field Maintenance Unit (AFMU) - Parameters: -  Module: module name -  FullyRepaired: (bool) -  Health; (float 0.0..1.0) - If the AFMU runs out of ammo, the module may not be fully repaired. - Example: - { "timestamp":"2017-08-14T15:41:50Z", "event":"AfmuRepairs", - "Module":"$modularcargobaydoor_name;", "Module_Localised":"Cargo Hatch", - "FullyRepaired":true, "Health":1.000000 } - */ [JournalEntryType(JournalTypeEnum.AfmuRepairs)] public class JournalAfmuRepairs : JournalEntry { @@ -48,9 +36,8 @@ public JournalAfmuRepairs(JObject evt) : base(evt, JournalTypeEnum.AfmuRepairs) public bool FullyRepaired { get; set; } public float Health { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", ModuleLocalised, "Health:;%", (int)Health, ";Fully Repaired", FullyRepaired); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalApproachBody.cs b/EliteDangerous/JournalEvents/JournalApproachBody.cs index aa0b942aa0..f217d21968 100644 --- a/EliteDangerous/JournalEvents/JournalApproachBody.cs +++ b/EliteDangerous/JournalEvents/JournalApproachBody.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,13 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when approaching an astronomical body - //Parameters: - // • StarSystem - // • SystemAddress - // • Body - // • BodyID - [JournalEntryType(JournalTypeEnum.ApproachBody)] public class JournalApproachBody : JournalEntry, IBodyNameAndID { @@ -43,9 +36,8 @@ public JournalApproachBody(JObject evt) : base(evt, JournalTypeEnum.ApproachBody public string BodyType { get { return "Planet"; } } public string BodyDesignation { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Body; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalApproachSettlement.cs b/EliteDangerous/JournalEvents/JournalApproachSettlement.cs index cd87f56484..cff5b061f8 100644 --- a/EliteDangerous/JournalEvents/JournalApproachSettlement.cs +++ b/EliteDangerous/JournalEvents/JournalApproachSettlement.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when approaching a planetary settlement - //Parameters: - // • Name - [JournalEntryType(JournalTypeEnum.ApproachSettlement)] public class JournalApproachSettlement : JournalEntry { @@ -36,9 +32,8 @@ public JournalApproachSettlement(JObject evt) : base(evt, JournalTypeEnum.Approa public string Name_Localised { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Name_Localised; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalBounty.cs b/EliteDangerous/JournalEvents/JournalBounty.cs index b00f67023e..243e4a215a 100644 --- a/EliteDangerous/JournalEvents/JournalBounty.cs +++ b/EliteDangerous/JournalEvents/JournalBounty.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -20,12 +20,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: player is awarded a bounty for a kill - //Parameters: - //• Faction: the faction awarding the bounty - //• Reward: the reward value - //• VictimFaction: the victim’s faction - //• SharedWithOthers: whether shared with other players [JournalEntryType(JournalTypeEnum.Bounty)] public class JournalBounty : JournalEntry, ILedgerNoCashJournalEntry { @@ -70,16 +64,13 @@ public JournalBounty(JObject evt) : base(evt, JournalTypeEnum.Bounty) public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) { - string n = (VictimFactionLocalised.Length > 0) ? VictimFactionLocalised : VictimFaction; - n += " total " + TotalReward.ToString("N0"); - - mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, n); + mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, string.Format("{0} total {1:N0}".Txb(this,"LegBounty"), VictimFactionLocalised, TotalReward)); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("; cr;N0", TotalReward, "Target:", (string)Target, "Victim faction:", VictimFactionLocalised); + info = BaseUtils.FieldBuilder.Build("; cr;N0", TotalReward, "Target:".Txb(this), (string)Target, "Victim faction:".Txb(this), VictimFactionLocalised); detailed = ""; if ( Rewards!=null) @@ -89,7 +80,7 @@ public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) if (detailed.Length > 0) detailed += ", "; - detailed += BaseUtils.FieldBuilder.Build("Faction:", r.Faction, "; cr;N0", r.Reward); + detailed += BaseUtils.FieldBuilder.Build("Faction:".Txb(this), r.Faction, "; cr;N0", r.Reward); } } } diff --git a/EliteDangerous/JournalEvents/JournalBuyAmmo.cs b/EliteDangerous/JournalEvents/JournalBuyAmmo.cs index 29bc592c11..488e7fc96a 100644 --- a/EliteDangerous/JournalEvents/JournalBuyAmmo.cs +++ b/EliteDangerous/JournalEvents/JournalBuyAmmo.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when purchasing ammunition - //Parameters: - //• Cost [JournalEntryType(JournalTypeEnum.BuyAmmo)] public class JournalBuyAmmo : JournalEntry, ILedgerJournalEntry { @@ -36,9 +33,8 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "", -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("; cr;N0", Cost); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalBuyDrones.cs b/EliteDangerous/JournalEvents/JournalBuyDrones.cs index fcc9b3df31..88395307a1 100644 --- a/EliteDangerous/JournalEvents/JournalBuyDrones.cs +++ b/EliteDangerous/JournalEvents/JournalBuyDrones.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.BuyDrones)] public class JournalBuyDrones : JournalEntry, ILedgerJournalEntry, IMaterialCommodityJournalEntry { @@ -49,10 +44,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Type + " " + Count + " drones", -TotalCost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Type:", Type, "Count:", Count, "Total Cost:; cr;N0", TotalCost, "each:; cr;N0", BuyPrice); + info = BaseUtils.FieldBuilder.Build("Type:".Txb(this), Type, "Count:".Txb(this), Count, "Total Cost:; cr;N0".Txb(this), TotalCost, "each:; cr;N0".Txb(this), BuyPrice); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalBuyExplorationData.cs b/EliteDangerous/JournalEvents/JournalBuyExplorationData.cs index 7e7614bae0..74bfe7683a 100644 --- a/EliteDangerous/JournalEvents/JournalBuyExplorationData.cs +++ b/EliteDangerous/JournalEvents/JournalBuyExplorationData.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when buying system data via the galaxy map - //Parameters: - //• System - //• Cost [JournalEntryType(JournalTypeEnum.BuyExplorationData)] public class JournalBuyExplorationData : JournalEntry, ILedgerJournalEntry { @@ -39,10 +35,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, System, -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("System:", System, "Cost:; cr;N0", Cost); + info = BaseUtils.FieldBuilder.Build("System:".Txb(this), System, "Cost:; cr;N0".Txb(this), Cost); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalBuyTradeData.cs b/EliteDangerous/JournalEvents/JournalBuyTradeData.cs index a14a18f81e..52ff1e8013 100644 --- a/EliteDangerous/JournalEvents/JournalBuyTradeData.cs +++ b/EliteDangerous/JournalEvents/JournalBuyTradeData.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.BuyTradeData)] public class JournalBuyTradeData : JournalEntry, ILedgerJournalEntry { @@ -40,10 +35,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, System, -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("System:", System, "Cost:; cr;N0", Cost); + info = BaseUtils.FieldBuilder.Build("System:".Txb(this), System, "Cost:; cr;N0".Txb(this), Cost); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCapShipBond.cs b/EliteDangerous/JournalEvents/JournalCapShipBond.cs index f5f0b847ed..c37e049194 100644 --- a/EliteDangerous/JournalEvents/JournalCapShipBond.cs +++ b/EliteDangerous/JournalEvents/JournalCapShipBond.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,11 +21,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: The player has been rewarded for a capital ship combat - //Parameters: - //• Reward: value of award - //• AwardingFaction - //• VictimFaction [JournalEntryType(JournalTypeEnum.CapShipBond)] public class JournalCapShipBond : JournalEntry, ILedgerNoCashJournalEntry { @@ -50,11 +45,10 @@ public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, AwardingFaction_Localised.Alt(AwardingFaction) + " " + Reward); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("; cr;N0", Reward, "< from ", AwardingFaction_Localised, - "< , due to ", VictimFaction_Localised); + info = BaseUtils.FieldBuilder.Build("; cr;N0", Reward, "< from ".Txb(this), AwardingFaction_Localised, + "< , due to ".Txb(this), VictimFaction_Localised); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCargo.cs b/EliteDangerous/JournalEvents/JournalCargo.cs index 14bb793682..7c967aa815 100644 --- a/EliteDangerous/JournalEvents/JournalCargo.cs +++ b/EliteDangerous/JournalEvents/JournalCargo.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,13 +21,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: at startup, when loading from main menu -//Parameters: -//• Inventory: array of cargo, with Name and Count for each - -//Example: -//{ "timestamp":"2017-02-10T14:25:51Z", "event":"Cargo", "Inventory":[ { "Name":"syntheticmeat", "Count":2 }, { "Name":"evacuationshelter", "Count":1 }, { "Name":"progenitorcells", "Count":3 }, { "Name":"bioreducinglichen", "Count":1 }, { "Name":"neofabricinsulation", "Count":2 } ] } - [JournalEntryType(JournalTypeEnum.Cargo)] public class JournalCargo : JournalEntry, IMaterialCommodityJournalEntry { @@ -57,10 +50,10 @@ public JournalCargo(JObject evt) : base(evt, JournalTypeEnum.Cargo) public Cargo[] Inventory { get; set; } // may be NULL - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = "No Cargo"; + info = "No Cargo".Txb(this); detailed = ""; if (Inventory != null && Inventory.Length > 0) @@ -69,7 +62,7 @@ public JournalCargo(JObject evt) : base(evt, JournalTypeEnum.Cargo) foreach (Cargo c in Inventory) total += c.Count; - info = "Cargo, " + total + " items"; + info = string.Format("Cargo, {0} items".Txb(this), total); detailed = ""; foreach (Cargo c in Inventory) @@ -79,7 +72,7 @@ public JournalCargo(JObject evt) : base(evt, JournalTypeEnum.Cargo) int? stolen = null; if (c.Stolen > 0) stolen = c.Stolen; - detailed += BaseUtils.FieldBuilder.Build("", c.FriendlyName, "; items", c.Count , "(;)" , stolen); + detailed += BaseUtils.FieldBuilder.Build("", c.FriendlyName, "; items".Txb(this), c.Count , "(;)" , stolen); } } } diff --git a/EliteDangerous/JournalEvents/JournalCargoDepot.cs b/EliteDangerous/JournalEvents/JournalCargoDepot.cs index 15024f9892..51178af780 100644 --- a/EliteDangerous/JournalEvents/JournalCargoDepot.cs +++ b/EliteDangerous/JournalEvents/JournalCargoDepot.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -67,20 +67,20 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con mc.Change(MaterialCommodities.CommodityCategory, CargoType, (UpdateEnum == UpdateTypeEnum.Collect) ? Count : -Count, 0, conn); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { if (UpdateEnum == UpdateTypeEnum.Collect) { - info = BaseUtils.FieldBuilder.Build("Collected:", Count, "< of " , FriendlyCargoType, "Total:", ItemsDelivered, "To Go:", ItemsToGo, "Progress:;%;N1", ProgressPercent); + info = BaseUtils.FieldBuilder.Build("Collected:".Txb(this), Count, "< of ".Txb(this), FriendlyCargoType, "Total:".Txb(this), ItemsDelivered, "To Go:", ItemsToGo, "Progress:;%;N1".Txb(this), ProgressPercent); } else if (UpdateEnum == UpdateTypeEnum.Deliver) { - info = BaseUtils.FieldBuilder.Build("Delivered:", Count, "< of ", FriendlyCargoType, "Total:", ItemsDelivered, "To Go:", ItemsToGo , "Progress:;%;N1", ProgressPercent); + info = BaseUtils.FieldBuilder.Build("Delivered:".Txb(this), Count, "< of ".Txb(this), FriendlyCargoType, "Total:".Txb(this), ItemsDelivered, "To Go:", ItemsToGo , "Progress:;%;N1".Txb(this), ProgressPercent); } else if (UpdateEnum == UpdateTypeEnum.WingUpdate) { - info = BaseUtils.FieldBuilder.Build("Update, Collected:", ItemsCollected, "Delivered:", ItemsDelivered, "To Go:", ItemsToGo , "Progress Left:;%;N1", ProgressPercent); + info = BaseUtils.FieldBuilder.Build("Update, Collected:".Txb(this), ItemsCollected, "Delivered:".Txb(this), ItemsDelivered, "To Go:".Txb(this), ItemsToGo , "Progress Left:;%;N1".Txb(this), ProgressPercent); } else { diff --git a/EliteDangerous/JournalEvents/JournalChangeCrewRole.cs b/EliteDangerous/JournalEvents/JournalChangeCrewRole.cs index 395517e56c..f39ab4fa7c 100644 --- a/EliteDangerous/JournalEvents/JournalChangeCrewRole.cs +++ b/EliteDangerous/JournalEvents/JournalChangeCrewRole.cs @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when in a crew on someone else's ship, player switched crew role -//Parameters: -//• Role: name of selected role(Idle, FireCon, FighterCon) [JournalEntryType(JournalTypeEnum.ChangeCrewRole)] public class JournalChangeCrewRole : JournalEntry { @@ -31,9 +28,8 @@ public JournalChangeCrewRole(JObject evt) : base(evt, JournalTypeEnum.ChangeCrew public string Role { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Role; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalClearSavedGame.cs b/EliteDangerous/JournalEvents/JournalClearSavedGame.cs index f5af989955..90103b820a 100644 --- a/EliteDangerous/JournalEvents/JournalClearSavedGame.cs +++ b/EliteDangerous/JournalEvents/JournalClearSavedGame.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: If you should ever reset your game - // Parameters: - //• Name: commander name [JournalEntryType(JournalTypeEnum.ClearSavedGame)] public class JournalClearSavedGame : JournalEntry { @@ -31,9 +28,8 @@ public JournalClearSavedGame(JObject evt) : base(evt, JournalTypeEnum.ClearSaved } public string Name { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Name; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalCockpitBreached.cs b/EliteDangerous/JournalEvents/JournalCockpitBreached.cs index eff101fc4b..32376a9388 100644 --- a/EliteDangerous/JournalEvents/JournalCockpitBreached.cs +++ b/EliteDangerous/JournalEvents/JournalCockpitBreached.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,19 +18,15 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when cockpit canopy is breached - //Parameters: none [JournalEntryType(JournalTypeEnum.CockpitBreached)] public class JournalCockpitBreached : JournalEntry { public JournalCockpitBreached(JObject evt ) : base(evt, JournalTypeEnum.CockpitBreached) { - } - public override void FillInformation(out string info, out string detailed) //V - { - + public override void FillInformation(out string info, out string detailed) + { info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalCollectCargo.cs b/EliteDangerous/JournalEvents/JournalCollectCargo.cs index 787c7b8f39..fca5067c69 100644 --- a/EliteDangerous/JournalEvents/JournalCollectCargo.cs +++ b/EliteDangerous/JournalEvents/JournalCollectCargo.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when scooping cargo from space or planet surface - //Parameters: - //• Type: cargo type - //• Stolen: whether stolen goods [JournalEntryType(JournalTypeEnum.CollectCargo)] public class JournalCollectCargo : JournalEntry, IMaterialCommodityJournalEntry, ILedgerNoCashJournalEntry { @@ -49,10 +45,9 @@ public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, FriendlyType ); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Type_Localised, ";Stolen", Stolen); + info = BaseUtils.FieldBuilder.Build("", Type_Localised, ";Stolen".Txb(this), Stolen); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCommander.cs b/EliteDangerous/JournalEvents/JournalCommander.cs index aa09fd9b77..aa2e54c9e6 100644 --- a/EliteDangerous/JournalEvents/JournalCommander.cs +++ b/EliteDangerous/JournalEvents/JournalCommander.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: target is under attack - //Parameters: - //* Target [JournalEntryType(JournalTypeEnum.Commander)] public class JournalCommander : JournalEntry { @@ -31,9 +28,8 @@ public JournalCommander(JObject evt ) : base(evt, JournalTypeEnum.Commander) public string Name { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Cmdr ", Name); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalCommitCrime.cs b/EliteDangerous/JournalEvents/JournalCommitCrime.cs index f7457246f1..f63018eb2b 100644 --- a/EliteDangerous/JournalEvents/JournalCommitCrime.cs +++ b/EliteDangerous/JournalEvents/JournalCommitCrime.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,14 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when a crime is recorded against the player - //Parameters: - //• CrimeType - //• Faction - //Optional parameters (depending on crime) - //• Victim - //• Fine - //• Bounty [JournalEntryType(JournalTypeEnum.CommitCrime)] public class JournalCommitCrime : JournalEntry, ILedgerNoCashJournalEntry { @@ -54,18 +46,17 @@ public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) v = Faction; if (Fine.HasValue) - v += " Fine " + Fine.Value.ToString("N0"); + v += string.Format(" Fine {0:N0}".Tx(this), Fine.Value); if (Bounty.HasValue) - v += " Bounty " + Bounty.Value.ToString("N0"); + v += string.Format(" Bounty {0:N0}".Tx(this,"Bounty"), Bounty.Value); - mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, CrimeType + " on " + v); + mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, string.Format("{0} on {1}".Txb(this) , CrimeType , v)); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", CrimeType, "< on faction ", Faction, "Against ", VictimLocalised, "Cost ; cr;N0", Fine, "Bounty ; cr;N0", Bounty); + info = BaseUtils.FieldBuilder.Build("", CrimeType, "< on faction ".Txb(this), Faction, "Against ".Txb(this), VictimLocalised, "Cost:; cr;N0".Txb(this), Fine, "Bounty:; cr;N0".Txb(this), Bounty); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCommunityGoal.cs b/EliteDangerous/JournalEvents/JournalCommunityGoal.cs index cdf1221cbc..195fe67b10 100644 --- a/EliteDangerous/JournalEvents/JournalCommunityGoal.cs +++ b/EliteDangerous/JournalEvents/JournalCommunityGoal.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,35 +21,6 @@ namespace EliteDangerousCore.JournalEvents { - - /* - When written: when checking the status of a community goal - This event contains the current status of all community goals the player is currently subscribed to - Parameters: -  CurrentGoals: an array with an entry for each CG, containing: - o CGID: a unique ID number for this CG - o Title: the description of the CG - o SystemName - o MarketName - o Expiry: time and date - o IsComplete: Boolean - o CurrentTotal - o PlayerContribution - o NumContributors - o PlayerPercentileBand - If the community goal is constructed with a fixed-size top rank (ie max reward for top 10 players) - o TopRankSize: (integer) - o PlayerInTopRank: (Boolean) - If the community goal has reached the first success tier: - o TierReached - o Bonus - Example: - { "timestamp":"2017-08-14T13:20:28Z", "event":"CommunityGoal", "CurrentGoals":[ { "CGID":726, - "Title":"Alliance Research Initiative – Trade", "SystemName":"Kaushpoos", "MarketName":"Neville - Horizons", "Expiry":"2017-08-17T14:58:14Z", "IsComplete":false, "CurrentTotal":10062, - "PlayerContribution":562, "NumContributors":101, "TopRankSize":10, "PlayerInTopRank":false, - "TierReached":"Tier 1", "PlayerPercentileBand":50, "Bonus":200000 } ] } - */ [JournalEntryType(JournalTypeEnum.CommunityGoal)] public class JournalCommunityGoal : JournalEntry { @@ -117,11 +88,11 @@ public override string ToString() exp = exp.ToLocalTime(); return BaseUtils.FieldBuilder.Build( - "Title:", Title, "System:", SystemName, - nl,"At:", MarketName, "Expires:", exp, - nl,"Not Complete;Complete", IsComplete, "Current Total:" , CurrentTotal, "Contribution:", PlayerContribution, "Num Contributors:", NumContributors, - nl,"Player % Band:", PlayerPercentileBand, "Top Rank:", TopRankSize, "Not In Top Rank;In Top Rank", PlayerInTopRank, - nl,"Tier Reached:", TierReached, "Bonus:" , Bonus, "Top Tier Name", TopTierName , "TT. Bonus" , TopTierBonus + "Title:".Tx(this), Title, "System:".Tx(this), SystemName, + nl,"At:".Tx(this), MarketName, "Expires:".Tx(this), exp, + nl,"Not Complete;Complete".Tx(this), IsComplete, "Current Total:".Tx(this), CurrentTotal, "Contribution:".Tx(this), PlayerContribution, "Num Contributors:".Tx(this), NumContributors, + nl,"Player % Band:".Tx(this), PlayerPercentileBand, "Top Rank:".Tx(this), TopRankSize, "Not In Top Rank;In Top Rank".Tx(this), PlayerInTopRank, + nl,"Tier Reached:".Tx(this), TierReached, "Bonus:".Tx(this), Bonus, "Top Tier Name".Tx(this), TopTierName , "TT. Bonus".Tx(this), TopTierBonus ); } } @@ -148,9 +119,8 @@ public JournalCommunityGoal(JObject evt ) : base(evt, JournalTypeEnum.CommunityG public List CommunityGoals; public string CommunityGoalList; - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = CommunityGoalList; detailed = ""; if ( CommunityGoals!=null ) diff --git a/EliteDangerous/JournalEvents/JournalCommunityGoalDiscard.cs b/EliteDangerous/JournalEvents/JournalCommunityGoalDiscard.cs index 5c68ec0189..19fcbdedb4 100644 --- a/EliteDangerous/JournalEvents/JournalCommunityGoalDiscard.cs +++ b/EliteDangerous/JournalEvents/JournalCommunityGoalDiscard.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //Parameters: - //• Name - //• System [JournalEntryType(JournalTypeEnum.CommunityGoalDiscard)] public class JournalCommunityGoalDiscard : JournalEntry { @@ -35,10 +32,9 @@ public JournalCommunityGoalDiscard(JObject evt) : base(evt, JournalTypeEnum.Comm public string Name { get; set; } public string System { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Name, "< at ; Star System", System); + info = BaseUtils.FieldBuilder.Build("", Name, "< at ; Star System".Txb(this,"CGS"), System); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCommunityGoalJoin.cs b/EliteDangerous/JournalEvents/JournalCommunityGoalJoin.cs index 0c22da1b4a..50c5ceb002 100644 --- a/EliteDangerous/JournalEvents/JournalCommunityGoalJoin.cs +++ b/EliteDangerous/JournalEvents/JournalCommunityGoalJoin.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when signing up to a community goal - //Parameters: - //• Name - //• System [JournalEntryType(JournalTypeEnum.CommunityGoalJoin)] public class JournalCommunityGoalJoin : JournalEntry { @@ -35,10 +31,10 @@ public JournalCommunityGoalJoin(JObject evt ) : base(evt, JournalTypeEnum.Commun public string Name { get; set; } public string System { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Name, "< at ; Star System", System); + + info = BaseUtils.FieldBuilder.Build("", Name, "< at ; Star System".Txb(this,"CGS"), System); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCommunityGoalReward.cs b/EliteDangerous/JournalEvents/JournalCommunityGoalReward.cs index 8e40ceab74..65f872ffe1 100644 --- a/EliteDangerous/JournalEvents/JournalCommunityGoalReward.cs +++ b/EliteDangerous/JournalEvents/JournalCommunityGoalReward.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when receiving a reward for a community goal - //Parameters: - //• Name - //• System - //• Reward [JournalEntryType(JournalTypeEnum.CommunityGoalReward)] public class JournalCommunityGoalReward : JournalEntry, ILedgerJournalEntry { @@ -43,10 +38,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Name + " " + System, Reward); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Name, "< at ; Star System", System, "Reward ; cr;N0", Reward); + info = BaseUtils.FieldBuilder.Build("", Name, "< at ; Star System".Txb(this,"CGS"), System, "Reward:; cr;N0".Txb(this), Reward); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalContinued.cs b/EliteDangerous/JournalEvents/JournalContinued.cs index 5e768aa8a8..41275d8e1b 100644 --- a/EliteDangerous/JournalEvents/JournalContinued.cs +++ b/EliteDangerous/JournalEvents/JournalContinued.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: if the journal file grows to 500k lines, we write this event, close the file, and start a new one - // Parameters: - // • Part: next part number [JournalEntryType(JournalTypeEnum.Continued)] public class JournalContinued : JournalEntry { @@ -31,9 +28,8 @@ public JournalContinued(JObject evt ) : base(evt, JournalTypeEnum.Continued) public int Part { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Part.ToString(); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalCrewAssign.cs b/EliteDangerous/JournalEvents/JournalCrewAssign.cs index d96f0f1839..b1fecb8276 100644 --- a/EliteDangerous/JournalEvents/JournalCrewAssign.cs +++ b/EliteDangerous/JournalEvents/JournalCrewAssign.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when changing the task assignment of a member of crew - //Parameters: - //• Name - //• Role [JournalEntryType(JournalTypeEnum.CrewAssign)] public class JournalCrewAssign : JournalEntry { @@ -36,10 +32,10 @@ public JournalCrewAssign(JObject evt) : base(evt, JournalTypeEnum.CrewAssign) public string Name { get; set; } public string Role { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", Name, "< to role ;", Role); + info = BaseUtils.FieldBuilder.Build("", Name, "< to role ;".Txb(this), Role); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCrewFire.cs b/EliteDangerous/JournalEvents/JournalCrewFire.cs index d682c62f22..c4e22e1e3d 100644 --- a/EliteDangerous/JournalEvents/JournalCrewFire.cs +++ b/EliteDangerous/JournalEvents/JournalCrewFire.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When Written: when selling unwanted drones back to the market - //Parameters: - //• Type - //• Count - //• SellPrice - //• TotalSale [JournalEntryType(JournalTypeEnum.CrewFire)] public class JournalCrewFire : JournalEntry { @@ -36,10 +30,9 @@ public JournalCrewFire(JObject evt) : base(evt, JournalTypeEnum.CrewFire) public long NpcCrewID { get; set; } public string Name { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("; fired", Name); + info = BaseUtils.FieldBuilder.Build("; fired".Txb(this), Name); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCrewHire.cs b/EliteDangerous/JournalEvents/JournalCrewHire.cs index b371619de1..46a0905597 100644 --- a/EliteDangerous/JournalEvents/JournalCrewHire.cs +++ b/EliteDangerous/JournalEvents/JournalCrewHire.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -47,10 +47,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Name + " " + Faction, -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Hired ;", Name, "< of faction ", Faction, " Rank ", CombatRank.ToString().SplitCapsWord(), "Cost ; cr;N0", Cost); + info = BaseUtils.FieldBuilder.Build("Hired:;".Txb(this), Name, "< of faction ".Txb(this), Faction, "Rank:".Txb(this), CombatRank.ToString().SplitCapsWord(), "Cost:; cr;N0".Txb(this), Cost); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalCrewLaunchFighter.cs b/EliteDangerous/JournalEvents/JournalCrewLaunchFighter.cs index 78a076221d..2932e4d8dd 100644 --- a/EliteDangerous/JournalEvents/JournalCrewLaunchFighter.cs +++ b/EliteDangerous/JournalEvents/JournalCrewLaunchFighter.cs @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: When another player joins your ship's crew - //Parameters: - //• Crew: player's commander name - //{ "timestamp":"2017-04-19T20:12:53Z", "event":"CrewLaunchFighter", "Crew":"[cmdr name]" } - [JournalEntryType(JournalTypeEnum.CrewLaunchFighter)] public class JournalCrewLaunchFighter : JournalEntry { @@ -33,9 +28,8 @@ public JournalCrewLaunchFighter(JObject evt) : base(evt, JournalTypeEnum.CrewLau } public string Crew { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Crew; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalCrewMemberJoins.cs b/EliteDangerous/JournalEvents/JournalCrewMemberJoins.cs index f02d6b046c..5a044866da 100644 --- a/EliteDangerous/JournalEvents/JournalCrewMemberJoins.cs +++ b/EliteDangerous/JournalEvents/JournalCrewMemberJoins.cs @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: When another player joins your ship's crew -//Parameters: -//• Crew: player's commander name - [JournalEntryType(JournalTypeEnum.CrewMemberJoins)] public class JournalCrewMemberJoins : JournalEntry { @@ -32,9 +28,8 @@ public JournalCrewMemberJoins(JObject evt) : base(evt, JournalTypeEnum.CrewMembe } public string Crew { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Crew; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalCrewMemberQuits.cs b/EliteDangerous/JournalEvents/JournalCrewMemberQuits.cs index 5e536eff92..659034f3e0 100644 --- a/EliteDangerous/JournalEvents/JournalCrewMemberQuits.cs +++ b/EliteDangerous/JournalEvents/JournalCrewMemberQuits.cs @@ -19,10 +19,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: When another player leaves your ship's crew -//Parameters: -//• Crew: player's commander name - [JournalEntryType(JournalTypeEnum.CrewMemberQuits)] public class JournalCrewMemberQuits : JournalEntry { @@ -33,9 +29,8 @@ public JournalCrewMemberQuits(JObject evt) : base(evt, JournalTypeEnum.CrewMembe } public string Crew { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Crew; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalCrewMemberRoleChange.cs b/EliteDangerous/JournalEvents/JournalCrewMemberRoleChange.cs index a497bb848c..a356f8604e 100644 --- a/EliteDangerous/JournalEvents/JournalCrewMemberRoleChange.cs +++ b/EliteDangerous/JournalEvents/JournalCrewMemberRoleChange.cs @@ -19,11 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: When another player leaves your ship's crew - //Parameters: - //• Crew: player's commander name - // Role: - // { "timestamp":"2017-04-11T18:11:06Z", "event":"CrewMemberRoleChange", "Crew":"[cmdr name]", "Role":"Idle" } [JournalEntryType(JournalTypeEnum.CrewMemberRoleChange)] public class JournalCrewMemberRoleChange : JournalEntry { @@ -32,14 +27,13 @@ public JournalCrewMemberRoleChange(JObject evt) : base(evt, JournalTypeEnum.Crew Crew = evt["Crew"].Str(); Role = evt["Role"].Str().SplitCapsWord(); } + public string Crew { get; set; } public string Role { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - //info = Crew; - info = BaseUtils.FieldBuilder.Build("Crew:", Crew, "Role:", Role); + info = BaseUtils.FieldBuilder.Build("Crew:".Txb(this), Crew, "Role:".Txb(this), Role); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalDataScanned.cs b/EliteDangerous/JournalEvents/JournalDataScanned.cs index 3765381ef9..659790f585 100644 --- a/EliteDangerous/JournalEvents/JournalDataScanned.cs +++ b/EliteDangerous/JournalEvents/JournalDataScanned.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when scanning a data link - //Parameters: - //• Message: message from data link - //• MessageLocalised: message from data link [JournalEntryType(JournalTypeEnum.DataScanned)] public class JournalDataScanned : JournalEntry { @@ -32,9 +28,8 @@ public JournalDataScanned(JObject evt) : base(evt, JournalTypeEnum.DataScanned) public string Type { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Type; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalDatalinkScan.cs b/EliteDangerous/JournalEvents/JournalDatalinkScan.cs index 93d752be44..304122f9c8 100644 --- a/EliteDangerous/JournalEvents/JournalDatalinkScan.cs +++ b/EliteDangerous/JournalEvents/JournalDatalinkScan.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when scanning a data link - //Parameters: - //• Message: message from data link [JournalEntryType(JournalTypeEnum.DatalinkScan)] public class JournalDatalinkScan : JournalEntry { @@ -33,9 +30,8 @@ public JournalDatalinkScan(JObject evt ) : base(evt, JournalTypeEnum.DatalinkSca public string Message { get; set; } public string MessageLocalised { get; set; } - public override void FillInformation(out string info, out string detailed) //V - { - + public override void FillInformation(out string info, out string detailed) + { info = MessageLocalised; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalDatalinkVoucher.cs b/EliteDangerous/JournalEvents/JournalDatalinkVoucher.cs index f95df3df9e..7e224b4f5f 100644 --- a/EliteDangerous/JournalEvents/JournalDatalinkVoucher.cs +++ b/EliteDangerous/JournalEvents/JournalDatalinkVoucher.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when scanning a datalink generates a reward -// Parameters: -//• Reward: value in credits -//• VictimFaction -//• PayeeFaction [JournalEntryType(JournalTypeEnum.DatalinkVoucher)] public class JournalDatalinkVoucher : JournalEntry, ILedgerNoCashJournalEntry { @@ -31,8 +26,8 @@ public JournalDatalinkVoucher(JObject evt) : base(evt, JournalTypeEnum.DatalinkV VictimFaction = evt["VictimFaction"].Str(); Reward = evt["Reward"].Long(); PayeeFaction = evt["PayeeFaction"].Str(); - } + public string PayeeFaction { get; set; } public long Reward { get; set; } public string VictimFaction { get; set; } @@ -42,10 +37,10 @@ public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, PayeeFaction + " " + Reward.ToString("N0")); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Reward ; cr;N0", Reward, "< from faction ", PayeeFaction, "against ", VictimFaction); + info = BaseUtils.FieldBuilder.Build("Reward:; cr;N0".Txb(this), Reward, "< from faction ".Txb(this), PayeeFaction, "Against ".Txb(this), VictimFaction); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalDied.cs b/EliteDangerous/JournalEvents/JournalDied.cs index a3129b9da8..e722576b00 100644 --- a/EliteDangerous/JournalEvents/JournalDied.cs +++ b/EliteDangerous/JournalEvents/JournalDied.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,14 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: player was killed - //Parameters: - //• KillerName - //• KillerShip - //• KillerRank - //When written: player was killed by a wing - //Parameters: - //• Killers: a JSON array of objects containing player name, ship, and rank [JournalEntryType(JournalTypeEnum.Died)] public class JournalDied : JournalEntry, IMissions, IMaterialCommodityJournalEntry { @@ -82,23 +74,17 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con mc.Died(); } - - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; if (Killers != null) { - info = "Killed by "; - bool comma = false; - foreach (Killer k in Killers) { - if (comma) - info += ", "; - comma = true; - info += k.Name_Localised + " in ship type " + k.Ship + " rank " + k.Rank; + info = info.AppendPrePad(string.Format("{0} in ship type {1} rank {2}".Txb(this,"Died") , k.Name_Localised , k.Ship , k.Rank) , ", "); } + + info = "Killed by ".Txb(this) + info; } detailed = ""; diff --git a/EliteDangerous/JournalEvents/JournalDiscoveryScan.cs b/EliteDangerous/JournalEvents/JournalDiscoveryScan.cs index 58bd18e0e1..76ee70e038 100644 --- a/EliteDangerous/JournalEvents/JournalDiscoveryScan.cs +++ b/EliteDangerous/JournalEvents/JournalDiscoveryScan.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.DiscoveryScan)] public class JournalDiscoveryScan : JournalEntry { @@ -31,10 +30,9 @@ public JournalDiscoveryScan(JObject evt) : base(evt, JournalTypeEnum.DiscoverySc public long SystemAddress { get; set; } public int Bodies { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("New bodies discovered:", Bodies); + info = BaseUtils.FieldBuilder.Build("New bodies discovered:".Txb(this,"Dscan"), Bodies); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalDockFighter.cs b/EliteDangerous/JournalEvents/JournalDockFighter.cs index 0d7185e230..b965992c07 100644 --- a/EliteDangerous/JournalEvents/JournalDockFighter.cs +++ b/EliteDangerous/JournalEvents/JournalDockFighter.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,8 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when docking a fighter back with the mothership - //Parameters: none [JournalEntryType(JournalTypeEnum.DockFighter)] public class JournalDockFighter : JournalEntry, IShipInformation { @@ -32,9 +30,8 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.DockFighter(); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalDockSRV.cs b/EliteDangerous/JournalEvents/JournalDockSRV.cs index 884163d755..db81271a03 100644 --- a/EliteDangerous/JournalEvents/JournalDockSRV.cs +++ b/EliteDangerous/JournalEvents/JournalDockSRV.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,14 +18,11 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when docking an SRV with the ship - //Parameters: none [JournalEntryType(JournalTypeEnum.DockSRV)] public class JournalDockSRV : JournalEntry, IShipInformation { public JournalDockSRV(JObject evt ) : base(evt, JournalTypeEnum.DockSRV) { - } public void ShipInformation(ShipInformationList shp, string whereami, ISystem system, DB.SQLiteConnectionUser conn) @@ -33,9 +30,8 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.DockSRV(); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalDocked.cs b/EliteDangerous/JournalEvents/JournalDocked.cs index e4cd5f12dc..617c14ccbe 100644 --- a/EliteDangerous/JournalEvents/JournalDocked.cs +++ b/EliteDangerous/JournalEvents/JournalDocked.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,36 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - - /* - When written: when landing at landing pad in a space station, outpost, or surface settlement - Parameters: -  StationName: name of station -  StationType: type of station -  StarSystem: name of system -  CockpitBreach:true (only if landing with breached cockpit) -  StationFaction: station’s controlling faction -  FactionState -  StationAllegiance -  StationEconomy -  StationGovernment -  DistFromStarLS -  StationServices: (Array of strings) - Example: - { "timestamp":"2017-08-18T10:52:26Z", "event":"Docked", "StationName":"Goddard Hub", - "StationType":"Coriolis", "StarSystem":"HR 3499", "StationFaction":"Labour of HR 3499", - "StationGovernment":"$government_Democracy;", "StationGovernment_Localised":"Democracy", - "StationAllegiance":"Federation", "StationServices":[ "Dock", "Autodock", "BlackMarket", - "Commodities", "Contacts", "Exploration", "Missions", "Outfitting", "CrewLounge", "Rearm", - "Refuel", "Repair", "Shipyard", "Tuning", "MissionsGenerated", "FlightController", - "StationOperations", "Powerplay", "SearchAndRescue" ], "StationEconomy":"$economy_Industrial;", - "StationEconomy_Localised":"Industrial", "DistFromStarLS":129.454132 } - StationServices can include: - Dock, Autodock, BlackMarket, Commodities, Contacts, Exploration, Initiatives, Missions, - Outfitting,CrewLounge, Rearm, Refuel, Repair, Shipyard, Tuning, Workshop, MissionsGenerated, - Facilitator, Research, FlightController, StationOperations, OnDockMission, Powerplay, - SearchAndRescue, - */ [JournalEntryType(JournalTypeEnum.Docked)] public class JournalDocked : JournalEntry, ISystemStationEntry { @@ -110,19 +80,21 @@ public class Economies public double Proportion; } - public override string FillSummary { get { return $"At {StationName}"; } } + public override string FillSummary { get { return string.Format("At {0}".Tx(this), StationName); } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Type ", StationType, "< in system ", StarSystem, ";Wanted" , Wanted, "Faction:", Faction, "< in state ", FactionState); - detailed = BaseUtils.FieldBuilder.Build("Allegiance:", Allegiance, "Economy:", Economy_Localised, "Government:", Government_Localised); + info = BaseUtils.FieldBuilder.Build("Type:".Txb(this), StationType, "< in system ".Txb(this), StarSystem, ";(Wanted)".Txb(this), Wanted, + "Faction:".Txb(this), Faction, "< in state ".Txb(this), FactionState); + + detailed = BaseUtils.FieldBuilder.Build("Allegiance:".Txb(this), Allegiance, "Economy:".Txb(this), Economy_Localised, "Government:".Txb(this), Government_Localised); if (StationServices != null) { string l = ""; foreach (string s in StationServices) l = l.AppendPrePad(s, ", "); - detailed += System.Environment.NewLine + "Station services:" + l; + detailed += System.Environment.NewLine + "Station services:".Txb(this) + l; } if ( EconomyList != null ) @@ -130,7 +102,7 @@ public class Economies string l = ""; foreach (Economies e in EconomyList) l = l.AppendPrePad(e.Name_Localised.Alt(e.Name) + " " + (e.Proportion * 100).ToString("0.#") + "%", ", "); - detailed += System.Environment.NewLine + "Economies:" + l; + detailed += System.Environment.NewLine + "Economies:".Txb(this) + l; } } diff --git a/EliteDangerous/JournalEvents/JournalDockingCancelled.cs b/EliteDangerous/JournalEvents/JournalDockingCancelled.cs index cded53f784..62a1701332 100644 --- a/EliteDangerous/JournalEvents/JournalDockingCancelled.cs +++ b/EliteDangerous/JournalEvents/JournalDockingCancelled.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when the player cancels a docking request - //Parameters: - //• StationName: name of station [JournalEntryType(JournalTypeEnum.DockingCancelled)] public class JournalDockingCancelled : JournalEntry { @@ -35,9 +32,8 @@ public JournalDockingCancelled(JObject evt ) : base(evt, JournalTypeEnum.Docking public string StationType { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = StationName; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalDockingDenied.cs b/EliteDangerous/JournalEvents/JournalDockingDenied.cs index 3ff81e6b17..0c56e94262 100644 --- a/EliteDangerous/JournalEvents/JournalDockingDenied.cs +++ b/EliteDangerous/JournalEvents/JournalDockingDenied.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when the station denies a docking request - //Parameters: - //• StationName: name of station - //• Reason: reason for denial - // - //Reasons include: NoSpace, TooLarge, Hostile, Offences, Distance, ActiveFighter, NoReason [JournalEntryType(JournalTypeEnum.DockingDenied)] public class JournalDockingDenied : JournalEntry { @@ -40,10 +34,9 @@ public JournalDockingDenied(JObject evt ) : base(evt, JournalTypeEnum.DockingDen public string StationType { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("At ", StationName, "", Reason); + info = BaseUtils.FieldBuilder.Build("", StationName, "", Reason); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalDockingGranted.cs b/EliteDangerous/JournalEvents/JournalDockingGranted.cs index 25ccace68e..e9fab36172 100644 --- a/EliteDangerous/JournalEvents/JournalDockingGranted.cs +++ b/EliteDangerous/JournalEvents/JournalDockingGranted.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -34,10 +34,9 @@ public JournalDockingGranted(JObject evt ) : base(evt, JournalTypeEnum.DockingGr public string StationType { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("At ", StationName, "< on pad ", LandingPad); + info = BaseUtils.FieldBuilder.Build("", StationName, "< on pad ".Txb(this), LandingPad); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalDockingRequested.cs b/EliteDangerous/JournalEvents/JournalDockingRequested.cs index ae7802d631..25ba814167 100644 --- a/EliteDangerous/JournalEvents/JournalDockingRequested.cs +++ b/EliteDangerous/JournalEvents/JournalDockingRequested.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when the player requests docking at a station - //Parameters: - //• StationName: name of station [JournalEntryType(JournalTypeEnum.DockingRequested)] public class JournalDockingRequested : JournalEntry { @@ -35,9 +32,8 @@ public JournalDockingRequested(JObject evt ) : base(evt, JournalTypeEnum.Docking public string StationType { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = StationName; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalDockingTimeout.cs b/EliteDangerous/JournalEvents/JournalDockingTimeout.cs index 557c03399e..75fc63bc7f 100644 --- a/EliteDangerous/JournalEvents/JournalDockingTimeout.cs +++ b/EliteDangerous/JournalEvents/JournalDockingTimeout.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when a docking request has timed out - //Parameters: - //• StationName: name of station [JournalEntryType(JournalTypeEnum.DockingTimeout)] public class JournalDockingTimeout : JournalEntry { @@ -35,9 +32,8 @@ public JournalDockingTimeout(JObject evt ) : base(evt, JournalTypeEnum.DockingTi public string StationType { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = StationName; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalEDDCommodityPrices.cs b/EliteDangerous/JournalEvents/JournalEDDCommodityPrices.cs index 4ad2a929a3..0eca805744 100644 --- a/EliteDangerous/JournalEvents/JournalEDDCommodityPrices.cs +++ b/EliteDangerous/JournalEvents/JournalEDDCommodityPrices.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: by EDD when a user manually sets an item count (material or commodity) [JournalEntryType(JournalTypeEnum.EDDCommodityPrices)] public class JournalEDDCommodityPrices : JournalCommodityPricesBase { @@ -28,7 +27,7 @@ public JournalEDDCommodityPrices(JObject evt) : base(evt, JournalTypeEnum.EDDCom Station = evt["station"].Str(); Faction = evt["faction"].Str(); Commodities = new List(); - + JArray jcommodities = null; if (!evt["commodities"].Empty()) jcommodities = (JArray)evt["commodities"]; @@ -58,22 +57,28 @@ public JournalCommodityPricesBase(JObject evt, JournalTypeEnum en) : base(evt,en public long? MarketID { get; set; } public List Commodities { get; protected set; } // never null - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Prices on ; items", Commodities.Count, "< at " , Station , "< in " , StarSystem); + info = BaseUtils.FieldBuilder.Build("Prices on ; items".Tx(typeof(JournalCommodityPricesBase),"PON"), Commodities.Count, + "< at ".Tx(typeof(JournalCommodityPricesBase), "CPBat"), Station , + "< in ".Tx(typeof(JournalCommodityPricesBase), "CPBin"), StarSystem); int col = 0; int maxcol = Commodities.Count > 60 ? 2 : 1; - detailed = "Items to buy:" + System.Environment.NewLine; + detailed = "Items to buy:".Tx(typeof(JournalCommodityPricesBase)) + System.Environment.NewLine; foreach (CCommodities c in Commodities) { if (c.buyPrice > 0) { if (c.sellPrice > 0) - detailed += string.Format("{0}: {1} sell {2} Diff {3} {4}% ", c.fdname, c.buyPrice, c.sellPrice, c.buyPrice - c.sellPrice, ((double)(c.buyPrice - c.sellPrice) / (double)c.sellPrice * 100.0).ToString("0.#")); + { + detailed += string.Format("{0}: {1} sell {2} Diff {3} {4}% ".Tx(typeof(JournalCommodityPricesBase), "CPBBuySell"), + c.fdname, c.buyPrice, c.sellPrice, c.buyPrice - c.sellPrice, + ((double)(c.buyPrice - c.sellPrice) / (double)c.sellPrice * 100.0).ToString("0.#")); + } else - detailed += string.Format("{0}: {1} ", c.fdname, c.buyPrice); + detailed += string.Format("{0}: {1} ".Tx(typeof(JournalCommodityPricesBase), "CPBBuy"), c.fdname, c.buyPrice); if (++col == maxcol) { @@ -87,12 +92,12 @@ public JournalCommodityPricesBase(JObject evt, JournalTypeEnum en) : base(evt,en detailed += System.Environment.NewLine; col = 0; - detailed += "Sell only Items:" + System.Environment.NewLine; + detailed += "Sell only Items:".Tx(typeof(JournalCommodityPricesBase),"SO") + System.Environment.NewLine; foreach (CCommodities c in Commodities) { if (c.buyPrice <= 0) { - detailed += string.Format("{0}: {1} ", c.fdname, c.sellPrice); + detailed += string.Format("{0}: {1} ".Tx(typeof(JournalCommodityPricesBase), "CPBBuy"), c.fdname, c.sellPrice); if (++col == maxcol) { detailed += System.Environment.NewLine; diff --git a/EliteDangerous/JournalEvents/JournalEDDItemSet.cs b/EliteDangerous/JournalEvents/JournalEDDItemSet.cs index 9c6a95b384..a47686516b 100644 --- a/EliteDangerous/JournalEvents/JournalEDDItemSet.cs +++ b/EliteDangerous/JournalEvents/JournalEDDItemSet.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -46,7 +46,7 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { info = ""; @@ -58,7 +58,7 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con if (comma) info += ", "; comma = true; - info += BaseUtils.FieldBuilder.Build("Name:", JournalFieldNaming.RMat(m.Name), "", m.Count); + info += BaseUtils.FieldBuilder.Build("Name:".Txb(this), JournalFieldNaming.RMat(m.Name), "", m.Count); } } @@ -69,7 +69,7 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con if (comma) info += ", "; comma = true; - info += BaseUtils.FieldBuilder.Build("Name:", JournalFieldNaming.RMat(m.Name), "", m.Count); + info += BaseUtils.FieldBuilder.Build("Name:".Txb(this), JournalFieldNaming.RMat(m.Name), "", m.Count); } } detailed = ""; diff --git a/EliteDangerous/JournalEvents/JournalEjectCargo.cs b/EliteDangerous/JournalEvents/JournalEjectCargo.cs index 611aa1f919..6c26305690 100644 --- a/EliteDangerous/JournalEvents/JournalEjectCargo.cs +++ b/EliteDangerous/JournalEvents/JournalEjectCargo.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,13 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When Written: - //Parameters: - //• Type: cargo type - //• Count: number of units - //• Abandoned: whether ‘abandoned’ -// If the cargo is related to powerplay: -//• PowerplayOrigin [JournalEntryType(JournalTypeEnum.EjectCargo)] public class JournalEjectCargo : JournalEntry, IMaterialCommodityJournalEntry, ILedgerNoCashJournalEntry { @@ -58,10 +51,9 @@ public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, FriendlyType + " " + Count); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Type_Localised, "Count:", Count, ";Abandoned", Abandoned, "PowerPlay:", PowerplayOrigin); + info = BaseUtils.FieldBuilder.Build("", Type_Localised, "Count:".Txb(this), Count, ";Abandoned".Txb(this), Abandoned, "PowerPlay:".Txb(this), PowerplayOrigin); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalEndCrewSession.cs b/EliteDangerous/JournalEvents/JournalEndCrewSession.cs index bf893c4c73..bf6c371a87 100644 --- a/EliteDangerous/JournalEvents/JournalEndCrewSession.cs +++ b/EliteDangerous/JournalEvents/JournalEndCrewSession.cs @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when the captain in multicrew disbands the crew -//Parameters: -// OnCrime: (bool) true if crew disbanded as a result of a crime in a lawful session - // { "timestamp":"2017-04-12T11:32:30Z", "event":"EndCrewSession", "OnCrime":false } [JournalEntryType(JournalTypeEnum.EndCrewSession)] public class JournalEndCrewSession : JournalEntry { @@ -32,10 +28,9 @@ public JournalEndCrewSession(JObject evt) : base(evt, JournalTypeEnum.EndCrewSes } public bool OnCrime { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build(";Crime", OnCrime); + info = BaseUtils.FieldBuilder.Build("; Due to Crime".Txb(this), OnCrime); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalEngineerApply.cs b/EliteDangerous/JournalEvents/JournalEngineerApply.cs index 42cf546778..4aa361a0e1 100644 --- a/EliteDangerous/JournalEvents/JournalEngineerApply.cs +++ b/EliteDangerous/JournalEvents/JournalEngineerApply.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -40,10 +40,10 @@ public JournalEngineerApply(JObject evt ) : base(evt, JournalTypeEnum.EngineerAp public int Level { get; set; } public string Override { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", Engineer, "Blueprint:", Blueprint, "Level:", Level, "Override:", Override); + info = BaseUtils.FieldBuilder.Build("", Engineer, "Blueprint:".Txb(this), Blueprint, "Level:".Txb(this), Level, "Override:".Txb(this), Override); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalEngineerContribution.cs b/EliteDangerous/JournalEvents/JournalEngineerContribution.cs index ad640db22b..2d52bf8092 100644 --- a/EliteDangerous/JournalEvents/JournalEngineerContribution.cs +++ b/EliteDangerous/JournalEvents/JournalEngineerContribution.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,7 @@ namespace EliteDangerousCore.JournalEvents { - //{ "timestamp":"2017-06-27T01:32:36Z", "event":"EngineerContribution", "Engineer":"Liz Ryder", "Type":"Commodity", "Commodity":"landmines", "Quantity":200, "TotalQuantity":200 } - //{ "timestamp":"2017-06-27T03:02:37Z", "event":"EngineerContribution", "Engineer":"Tiana Fortune", "Type":"Materials", "Material":"decodedemissiondata", "Quantity":50, "TotalQuantity":50 } - -[JournalEntryType(JournalTypeEnum.EngineerContribution)] + [JournalEntryType(JournalTypeEnum.EngineerContribution)] public class JournalEngineerContribution : JournalEntry , ILedgerJournalEntry , IMaterialCommodityJournalEntry { public JournalEngineerContribution(JObject evt ) : base(evt, JournalTypeEnum.EngineerContribution) @@ -81,13 +78,13 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) protected override JournalTypeEnum IconEventType { get { return unknownType ? JournalTypeEnum.EngineerContribution_Unknown : JournalTypeEnum.EngineerContribution_MatCommod; } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - if (unknownType==true) info = "Report to EDDiscovery team an unknown EngineerContribution type: " + Type; else - info = BaseUtils.FieldBuilder.Build("", Engineer, "Type:", Type, "Commodity:", Commodity_Localised, "Material:", Material_Localised, "Quantity:", Quantity, "TotalQuantity:", TotalQuantity); + info = BaseUtils.FieldBuilder.Build("", Engineer, "Type:".Txb(this), Type, "Commodity:".Txb(this), Commodity_Localised, + "Material:".Txb(this), Material_Localised, "Quantity:".Txb(this), Quantity, "TotalQuantity:".Txb(this), TotalQuantity); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalEngineerCraft.cs b/EliteDangerous/JournalEvents/JournalEngineerCraft.cs index f374339a1b..1bec65ed92 100644 --- a/EliteDangerous/JournalEvents/JournalEngineerCraft.cs +++ b/EliteDangerous/JournalEvents/JournalEngineerCraft.cs @@ -19,14 +19,11 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when requesting an engineer upgrade - [JournalEntryType(JournalTypeEnum.EngineerCraft)] public class JournalEngineerCraft : JournalEngineerCraftBase { public JournalEngineerCraft(JObject evt) : base(evt, JournalTypeEnum.EngineerCraft) { - } } @@ -100,10 +97,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("In ", Slot , "" , Module, "By ", Engineering.Engineer, "Blueprint ", Engineering.FriendlyBlueprintName, "Level ", Engineering.Level); + info = BaseUtils.FieldBuilder.Build("In Slot:".Txb(this), Slot , "" , Module, "By:".Txb(this), Engineering.Engineer, "Blueprint:".Txb(this), Engineering.FriendlyBlueprintName, "Level:".Txb(this), Engineering.Level); detailed = ""; if (Ingredients != null) @@ -112,8 +108,5 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy detailed += BaseUtils.FieldBuilder.Build("", JournalFieldNaming.RMat(k.Key), "", k.Value) + "; "; } } - - // Engineering data - used here and for Loadout. - } } diff --git a/EliteDangerous/JournalEvents/JournalEngineerLegacyConvert.cs b/EliteDangerous/JournalEvents/JournalEngineerLegacyConvert.cs index 3789f46989..b30adf0cc0 100644 --- a/EliteDangerous/JournalEvents/JournalEngineerLegacyConvert.cs +++ b/EliteDangerous/JournalEvents/JournalEngineerLegacyConvert.cs @@ -26,7 +26,6 @@ public class JournalLegacyConvert : JournalEngineerCraftBase { public JournalLegacyConvert(JObject evt) : base(evt, JournalTypeEnum.EngineerLegacyConvert) // same as craft. { - } } } diff --git a/EliteDangerous/JournalEvents/JournalEngineerProgress.cs b/EliteDangerous/JournalEvents/JournalEngineerProgress.cs index b296a53031..11f83f9ea6 100644 --- a/EliteDangerous/JournalEvents/JournalEngineerProgress.cs +++ b/EliteDangerous/JournalEvents/JournalEngineerProgress.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.EngineerProgress)] public class JournalEngineerProgress : JournalEntry { @@ -39,10 +34,9 @@ public JournalEngineerProgress(JObject evt ) : base(evt, JournalTypeEnum.Enginee public string Progress { get; set; } public int? Rank { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Engineer, "Rank:", Rank, "Progress:", Progress); + info = BaseUtils.FieldBuilder.Build("", Engineer, "Rank:".Txb(this), Rank, "Progress:".Tx(this), Progress); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalEscapeInterdiction.cs b/EliteDangerous/JournalEvents/JournalEscapeInterdiction.cs index 54e2a09aab..2e29756a4a 100644 --- a/EliteDangerous/JournalEvents/JournalEscapeInterdiction.cs +++ b/EliteDangerous/JournalEvents/JournalEscapeInterdiction.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: Player has escaped interdiction - //Parameters: - //• Interdictor: interdicting pilot name - //• IsPlayer: whether player or npc [JournalEntryType(JournalTypeEnum.EscapeInterdiction)] public class JournalEscapeInterdiction : JournalEntry { @@ -36,9 +32,9 @@ public JournalEscapeInterdiction(JObject evt ) : base(evt, JournalTypeEnum.Escap public string Interdictor_Localised { get; set; } public bool IsPlayer { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("By ", Interdictor_Localised, "< (NPC);(Player)", IsPlayer); + info = BaseUtils.FieldBuilder.Build("By:".Txb(this), Interdictor_Localised, "< (NPC);(Player)".Txb(this), IsPlayer); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalFSDJump.cs b/EliteDangerous/JournalEvents/JournalFSDJump.cs index 081a80509d..e3ab3aeb03 100644 --- a/EliteDangerous/JournalEvents/JournalFSDJump.cs +++ b/EliteDangerous/JournalEvents/JournalFSDJump.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -62,34 +62,34 @@ public JournalFSDJump(DateTime utc, ISystem sys, int colour, bool first, int syn public bool RealJournalEvent { get; private set; } // True if real ED 2.2+ journal event and not pre 2.2 imported. public bool EDSMFirstDiscover { get; set; } - public override string FillSummary { get { return "Jump to " + StarSystem; } } + public override string FillSummary { get { return string.Format("Jump to {0}".Tx(this), StarSystem); } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { info = ""; if (JumpDist > 0) info += JumpDist.ToString("0.00") + " ly"; if (FuelUsed > 0) - info += ", Fuel " + FuelUsed.ToString("0.0") + "t"; + info += "," +" Fuel ".Tx(this) + FuelUsed.ToString("0.0") + "t"; if (FuelLevel > 0) - info += " left " + FuelLevel.ToString("0.0") + "t"; + info += " left ".Tx(this) + FuelLevel.ToString("0.0") + "t"; string econ = Economy_Localised.Alt(Economy); if (econ.Equals("None")) econ = ""; info += " "; - info += BaseUtils.FieldBuilder.Build("Faction:", Faction, "<;(Wanted) ", Wanted, "State:", FactionState, "Allegiance:", Allegiance, "Economy:", econ, "Population:", Population); + info += BaseUtils.FieldBuilder.Build("Faction:".Txb(this), Faction, "<;(Wanted) ".Txb(this), Wanted, "State:".Txb(this), FactionState, "Allegiance:".Txb(this), Allegiance, "Economy:".Txb(this), econ, "Population:".Txb(this), Population); detailed = ""; if ( Factions != null ) { foreach (FactionInformation i in Factions) { - detailed += BaseUtils.FieldBuilder.Build("", i.Name, "State:", i.FactionState, "Gov:", i.Government, "Inf:;%", (i.Influence * 100.0).ToString("0.0"), "Alg:", i.Allegiance) ; + detailed += BaseUtils.FieldBuilder.Build("", i.Name, "State:".Txb(this), i.FactionState, "Government:".Txb(this), i.Government, "Inf:;%".Txb(this), (i.Influence * 100.0).ToString("0.0"), "Allegiance:".Txb(this), i.Allegiance) ; if (i.PendingStates != null) { - detailed += BaseUtils.FieldBuilder.Build(",", "Pending State:"); + detailed += BaseUtils.FieldBuilder.Build(",", "Pending State:".Txb(this)); foreach (JournalLocation.PowerStatesInfo state in i.PendingStates) detailed += BaseUtils.FieldBuilder.Build(",", state.State, "", state.Trend); @@ -97,7 +97,7 @@ public JournalFSDJump(DateTime utc, ISystem sys, int colour, bool first, int syn if (i.RecoveringStates != null) { - detailed += BaseUtils.FieldBuilder.Build(",", "Recovering State:"); + detailed += BaseUtils.FieldBuilder.Build(",", "Recovering State:".Txb(this)); foreach (JournalLocation.PowerStatesInfo state in i.RecoveringStates) detailed += BaseUtils.FieldBuilder.Build(",", state.State, "", state.Trend); } diff --git a/EliteDangerous/JournalEvents/JournalFactionKillBond.cs b/EliteDangerous/JournalEvents/JournalFactionKillBond.cs index d68ed745aa..e99cb38da9 100644 --- a/EliteDangerous/JournalEvents/JournalFactionKillBond.cs +++ b/EliteDangerous/JournalEvents/JournalFactionKillBond.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -46,11 +46,11 @@ public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, AwardingFaction_Localised.Alt(AwardingFaction) + " " + Reward.ToString("N0")); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Reward:;N0", Reward, "< from ", AwardingFaction_Localised, - "< , due to ", VictimFaction_Localised); + info = BaseUtils.FieldBuilder.Build("Reward:; cr;N0".Txb(this), Reward, "< from ".Txb(this), AwardingFaction_Localised, + "< , due to ".Txb(this), VictimFaction_Localised); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalFetchRemoteModule.cs b/EliteDangerous/JournalEvents/JournalFetchRemoteModule.cs index 06bb2f1f27..4aa329af2e 100644 --- a/EliteDangerous/JournalEvents/JournalFetchRemoteModule.cs +++ b/EliteDangerous/JournalEvents/JournalFetchRemoteModule.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -17,15 +17,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when requesting a module is transferred from storage at another station -//Parameters: -//• StorageSlot -//• StoredItem -//• ServerId -//• TransferCost -//• Ship -//• ShipId -//* TransferTime: (in seconds) [JournalEntryType(JournalTypeEnum.FetchRemoteModule)] public class JournalFetchRemoteModule : JournalEntry, ILedgerJournalEntry { @@ -65,10 +56,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, StoredItemLocalised + " on " + Ship, -TransferCost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", StoredItemLocalised, "Cost:", TransferCost, "into ship:", Ship, "Transfer Time:", FriendlyTransferTime); + info = BaseUtils.FieldBuilder.Build("", StoredItemLocalised, "Cost:; cr;N0".Txb(this), TransferCost, "Into ship:".Txb(this), Ship, "Transfer Time:".Txb(this), FriendlyTransferTime); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalFighterDestroyed.cs b/EliteDangerous/JournalEvents/JournalFighterDestroyed.cs index 5b451e7aa3..a2693a985c 100644 --- a/EliteDangerous/JournalEvents/JournalFighterDestroyed.cs +++ b/EliteDangerous/JournalEvents/JournalFighterDestroyed.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.FighterDestroyed)] public class JournalFighterDestroyed : JournalEntry, IShipInformation { @@ -31,9 +30,8 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.FighterDestroyed(); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalFighterRebuilt.cs b/EliteDangerous/JournalEvents/JournalFighterRebuilt.cs index 9e36d12fbf..4d607cac20 100644 --- a/EliteDangerous/JournalEvents/JournalFighterRebuilt.cs +++ b/EliteDangerous/JournalEvents/JournalFighterRebuilt.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.FighterRebuilt)] public class JournalFighterRebuilt : JournalEntry { @@ -29,9 +28,8 @@ public JournalFighterRebuilt(JObject evt ) : base(evt, JournalTypeEnum.FighterRe public string Loadout { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", Loadout); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalFileheader.cs b/EliteDangerous/JournalEvents/JournalFileheader.cs index 5075baa012..a4698d6a87 100644 --- a/EliteDangerous/JournalEvents/JournalFileheader.cs +++ b/EliteDangerous/JournalEvents/JournalFileheader.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -51,10 +51,9 @@ public override bool Beta } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Version:", GameVersion , "Build:" , Build , "Part:", Part); + info = BaseUtils.FieldBuilder.Build("Version:".Txb(this), GameVersion , "Build:".Txb(this), Build , "Part:".Txb(this), Part); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalFriends.cs b/EliteDangerous/JournalEvents/JournalFriends.cs index 5962dfe19c..07e11b102f 100644 --- a/EliteDangerous/JournalEvents/JournalFriends.cs +++ b/EliteDangerous/JournalEvents/JournalFriends.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,7 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - //{ "timestamp":"2017-06-26T17:06:50Z", "event":"Friends", "Status":"Offline", "Name":"Finwen" } [JournalEntryType(JournalTypeEnum.Friends)] public class JournalFriends : JournalEntry { @@ -58,7 +57,7 @@ public void AddFriend(JournalFriends next) public int OnlineCount { get; set; } // always counts public int OfflineCount { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { detailed = ""; @@ -67,13 +66,13 @@ public void AddFriend(JournalFriends next) { info = ""; if (OfflineCount + OnlineCount < NameList.Count) - info = BaseUtils.FieldBuilder.Build("Number of Statuses:", NameList.Count); + info = BaseUtils.FieldBuilder.Build("Number of Statuses:".Txb(this), NameList.Count); if (OnlineCount > 0) - info = info.AppendPrePad("Online:" + OnlineCount.ToStringInvariant(), ", "); + info = info.AppendPrePad("Online:".Txb(this) + OnlineCount.ToStringInvariant(), ", "); if (OfflineCount > 0) - info = info.AppendPrePad("Offline:" + OfflineCount.ToStringInvariant(), ", "); + info = info.AppendPrePad("Offline:".Txb(this) + OfflineCount.ToStringInvariant(), ", "); for ( int i = 0; i < StatusList.Count; i++ ) detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("", NameList[i], "", StatusList[i]) , System.Environment.NewLine); diff --git a/EliteDangerous/JournalEvents/JournalFuelScope.cs b/EliteDangerous/JournalEvents/JournalFuelScope.cs index 430b5a1307..37d0af85fe 100644 --- a/EliteDangerous/JournalEvents/JournalFuelScope.cs +++ b/EliteDangerous/JournalEvents/JournalFuelScope.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when scooping fuel from a star - //Parameters: - //• Scooped: tons fuel scooped - //• Total: total fuel level after scooping [JournalEntryType(JournalTypeEnum.FuelScoop)] public class JournalFuelScoop : JournalEntry, IShipInformation { @@ -33,10 +29,9 @@ public JournalFuelScoop(JObject evt ) : base(evt, JournalTypeEnum.FuelScoop) public double Scooped { get; set; } public double Total { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build(";t;0.0" , Scooped, "Total:;t;0.0" , Total); + info = BaseUtils.FieldBuilder.Build(";t;0.0" , Scooped, "Total:;t;0.0".Tx(this), Total); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalHeatDamage.cs b/EliteDangerous/JournalEvents/JournalHeatDamage.cs index d80aa32246..c898784255 100644 --- a/EliteDangerous/JournalEvents/JournalHeatDamage.cs +++ b/EliteDangerous/JournalEvents/JournalHeatDamage.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: Player rewarded for taking part in a combat zone - //Parameters: - //• Reward - //• AwardingFaction - //• VictimFaction [JournalEntryType(JournalTypeEnum.HeatDamage)] public class JournalHeatDamage : JournalEntry { @@ -30,9 +25,8 @@ public JournalHeatDamage(JObject evt ) : base(evt, JournalTypeEnum.HeatDamage) { } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalHeatWarning.cs b/EliteDangerous/JournalEvents/JournalHeatWarning.cs index ca97cf3dd2..51cae33105 100644 --- a/EliteDangerous/JournalEvents/JournalHeatWarning.cs +++ b/EliteDangerous/JournalEvents/JournalHeatWarning.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,8 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: player was HeatWarning by player or npc - //Parameters: [JournalEntryType(JournalTypeEnum.HeatWarning)] public class JournalHeatWarning : JournalEntry { @@ -27,9 +25,8 @@ public JournalHeatWarning(JObject evt ) : base(evt, JournalTypeEnum.HeatWarning) { } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalHullDamage.cs b/EliteDangerous/JournalEvents/JournalHullDamage.cs index ac182ed794..490bffd090 100644 --- a/EliteDangerous/JournalEvents/JournalHullDamage.cs +++ b/EliteDangerous/JournalEvents/JournalHullDamage.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,8 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: player was HullDamage by player or npc - //Parameters: [JournalEntryType(JournalTypeEnum.HullDamage)] public class JournalHullDamage : JournalEntry { @@ -30,9 +28,8 @@ public JournalHullDamage(JObject evt ) : base(evt, JournalTypeEnum.HullDamage) } public double Health { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build(";%",(int)(Health*100)); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalInterdicted.cs b/EliteDangerous/JournalEvents/JournalInterdicted.cs index fcb5b07cbc..7eb67980f8 100644 --- a/EliteDangerous/JournalEvents/JournalInterdicted.cs +++ b/EliteDangerous/JournalEvents/JournalInterdicted.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,14 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: player was interdicted by player or npc - //Parameters: - //• Submitted: true or false - //• Interdictor: interdicting pilot name - //• IsPlayer: whether player or npc - //• CombatRank: if player - //• Faction: if npc - //• Power: if npc working for a power [JournalEntryType(JournalTypeEnum.Interdicted)] public class JournalInterdicted : JournalEntry { @@ -49,10 +41,10 @@ public JournalInterdicted(JObject evt ) : base(evt, JournalTypeEnum.Interdicted) public string Faction { get; set; } public string Power { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build(";Submitted", Submitted, "< To ", Interdictor_Localised, "< (NPC);(Player)", IsPlayer, "Rank:", CombatRank.ToString().SplitCapsWord(), "Faction:", Faction, "Power:", Power); + info = BaseUtils.FieldBuilder.Build(";Submitted".Txb(this), Submitted, "< to ".Txb(this), Interdictor_Localised, "< (NPC);(Player)".Txb(this), IsPlayer, "Rank:", CombatRank.ToString().SplitCapsWord(), "Faction:".Txb(this), Faction, "Power:".Txb(this), Power); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalInterdiction.cs b/EliteDangerous/JournalEvents/JournalInterdiction.cs index 0db6aa5f0d..c635651069 100644 --- a/EliteDangerous/JournalEvents/JournalInterdiction.cs +++ b/EliteDangerous/JournalEvents/JournalInterdiction.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -49,10 +49,10 @@ public JournalInterdiction(JObject evt ) : base(evt, JournalTypeEnum.Interdictio public string Faction { get; set; } public string Power { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Failed to interdict;Interdicted", Success, "< ", Interdicted_Localised, "< (NPC);(Player)", IsPlayer, "Rank:", CombatRank.ToString().SplitCapsWord(), "Faction:", Faction, "Power:", Power); + info = BaseUtils.FieldBuilder.Build("Failed to interdict;Interdicted".Txb(this), Success, "< ", Interdicted_Localised, "< (NPC);(Player)".Txb(this), IsPlayer, "Rank:", CombatRank.ToString().SplitCapsWord(), "Faction:".Txb(this), Faction, "Power:".Txb(this), Power); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalJetConeBoost.cs b/EliteDangerous/JournalEvents/JournalJetConeBoost.cs index 11a403d8c8..abeb640756 100644 --- a/EliteDangerous/JournalEvents/JournalJetConeBoost.cs +++ b/EliteDangerous/JournalEvents/JournalJetConeBoost.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when enough material has been collected from a solar jet code (at a white dwarf or neutron star) for a jump boost - //Parameters: - //• BoostValue [JournalEntryType(JournalTypeEnum.JetConeBoost)] public class JournalJetConeBoost : JournalEntry { @@ -31,10 +28,9 @@ public JournalJetConeBoost(JObject evt ) : base(evt, JournalTypeEnum.JetConeBoos } public double BoostValue { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Boost:;;0.0", BoostValue); + info = BaseUtils.FieldBuilder.Build("Boost:;;0.0".Txb(this), BoostValue); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalJetConeDamage.cs b/EliteDangerous/JournalEvents/JournalJetConeDamage.cs index 9b3280e134..589c8ad5e5 100644 --- a/EliteDangerous/JournalEvents/JournalJetConeDamage.cs +++ b/EliteDangerous/JournalEvents/JournalJetConeDamage.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when passing through the jet code from a white dwarf or neutron star has caused damage to a ship module - //Parameters: - //• Module: the name of the module that has taken some damage [JournalEntryType(JournalTypeEnum.JetConeDamage)] public class JournalJetConeDamage : JournalEntry { @@ -38,9 +35,8 @@ public JournalJetConeDamage(JObject evt ) : base(evt, JournalTypeEnum.JetConeDam public string ModuleFD { get; set; } public string ModuleLocalised { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ModuleLocalised; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalJoinACrew.cs b/EliteDangerous/JournalEvents/JournalJoinACrew.cs index a0887d2f26..f85ba87348 100644 --- a/EliteDangerous/JournalEvents/JournalJoinACrew.cs +++ b/EliteDangerous/JournalEvents/JournalJoinACrew.cs @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: When you join another player ship's crew -//Parameters: -//• Captain: Helm player's commander name - [JournalEntryType(JournalTypeEnum.JoinACrew)] public class JournalJoinACrew : JournalEntry { @@ -32,10 +28,10 @@ public JournalJoinACrew(JObject evt) : base(evt, JournalTypeEnum.JoinACrew) } public string Captain { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Captain:" , Captain); + info = BaseUtils.FieldBuilder.Build("Captain:".Txb(this), Captain); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalKickCrewMember.cs b/EliteDangerous/JournalEvents/JournalKickCrewMember.cs index 68225d1d0f..3cf27ccdd5 100644 --- a/EliteDangerous/JournalEvents/JournalKickCrewMember.cs +++ b/EliteDangerous/JournalEvents/JournalKickCrewMember.cs @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: When you force another player to leave your ship's crew -//Parameters: -//• Crew: player's commander name - [JournalEntryType(JournalTypeEnum.KickCrewMember)] public class JournalKickCrewMember : JournalEntry { @@ -34,10 +30,9 @@ public JournalKickCrewMember(JObject evt) : base(evt, JournalTypeEnum.KickCrewMe public string Crew { get; set; } public bool OnCrime { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("; removed", Crew , "; Crime", OnCrime); + info = BaseUtils.FieldBuilder.Build("Crew Member:".Txb(this), Crew , "; Due to Crime".Txb(this), OnCrime); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalLaunchDrone.cs b/EliteDangerous/JournalEvents/JournalLaunchDrone.cs index 27ac1e5f66..3c44ddaf86 100644 --- a/EliteDangerous/JournalEvents/JournalLaunchDrone.cs +++ b/EliteDangerous/JournalEvents/JournalLaunchDrone.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.LaunchDrone)] public class JournalLaunchDrone : JournalEntry, IMaterialCommodityJournalEntry { @@ -36,10 +35,9 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con mc.Change(MaterialCommodities.CommodityCategory, "drones", -1, 0, conn); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Type:", FriendlyType); + info = BaseUtils.FieldBuilder.Build("Type:".Txb(this), FriendlyType); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalLaunchFighter.cs b/EliteDangerous/JournalEvents/JournalLaunchFighter.cs index d322a01d17..51e1b53973 100644 --- a/EliteDangerous/JournalEvents/JournalLaunchFighter.cs +++ b/EliteDangerous/JournalEvents/JournalLaunchFighter.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when launching a fighter - //Parameters: - //• Loadout - //• PlayerControlled: whether player is controlling the fighter from launch [JournalEntryType(JournalTypeEnum.LaunchFighter)] public class JournalLaunchFighter : JournalEntry, IShipInformation { @@ -38,12 +34,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.LaunchFighter(PlayerControlled); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Loadout:", Loadout); - if (!PlayerControlled) - info += ", NPC Controlled"; + info = BaseUtils.FieldBuilder.Build("Loadout:".Txb(this), Loadout) + BaseUtils.FieldBuilder.Build(", NPC Controlled;".Txb(this), PlayerControlled); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalLaunchSRV.cs b/EliteDangerous/JournalEvents/JournalLaunchSRV.cs index b05305aeda..1cb477dfc4 100644 --- a/EliteDangerous/JournalEvents/JournalLaunchSRV.cs +++ b/EliteDangerous/JournalEvents/JournalLaunchSRV.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: deploying the SRV from a ship onto planet surface - //Parameters: - //• Loadout [JournalEntryType(JournalTypeEnum.LaunchSRV)] public class JournalLaunchSRV : JournalEntry, IShipInformation { @@ -38,12 +35,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.LaunchSRV(); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Loadout:", Loadout); - if (!PlayerControlled) - info += ", NPC Controlled"; + info = BaseUtils.FieldBuilder.Build("Loadout:".Txb(this), Loadout) + BaseUtils.FieldBuilder.Build(", NPC Controlled;".Txb(this), PlayerControlled); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalLeaveBody.cs b/EliteDangerous/JournalEvents/JournalLeaveBody.cs index d6463b07ab..109a9dc2fe 100644 --- a/EliteDangerous/JournalEvents/JournalLeaveBody.cs +++ b/EliteDangerous/JournalEvents/JournalLeaveBody.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,13 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when leaving an astronomical body - //Parameters: - // • StarSystem - // • SystemAddress - // • Body - // • BodyID - [JournalEntryType(JournalTypeEnum.LeaveBody)] public class JournalLeaveBody : JournalEntry, IBodyNameAndID { @@ -43,9 +36,8 @@ public JournalLeaveBody(JObject evt) : base(evt, JournalTypeEnum.LeaveBody) public string BodyDesignation { get; set; } public string BodyType { get { return "Planet"; } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Body; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalLiftoff.cs b/EliteDangerous/JournalEvents/JournalLiftoff.cs index d1ffe778ee..8256a0011c 100644 --- a/EliteDangerous/JournalEvents/JournalLiftoff.cs +++ b/EliteDangerous/JournalEvents/JournalLiftoff.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,13 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when taking off from planet surface -//Parameters: -//• Latitude(only if player flying in ship) -//• Longitude(only if player flying in ship) -//• PlayerControlled: (bool) false if ship dismissed when player is in SRV, true if player is taking off - - [JournalEntryType(JournalTypeEnum.Liftoff)] public class JournalLiftoff : JournalEntry { @@ -38,10 +31,9 @@ public JournalLiftoff(JObject evt ) : base(evt, JournalTypeEnum.Liftoff) public double Longitude { get; set; } public bool? PlayerControlled { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = JournalFieldNaming.RLat(Latitude) + " " + JournalFieldNaming.RLong(Longitude) + BaseUtils.FieldBuilder.Build(", NPC Controlled;", PlayerControlled); + info = JournalFieldNaming.RLat(Latitude) + " " + JournalFieldNaming.RLong(Longitude) + BaseUtils.FieldBuilder.Build(", NPC Controlled;".Txb(this), PlayerControlled); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalLoadGame.cs b/EliteDangerous/JournalEvents/JournalLoadGame.cs index 0ceb2ae361..412519e8eb 100644 --- a/EliteDangerous/JournalEvents/JournalLoadGame.cs +++ b/EliteDangerous/JournalEvents/JournalLoadGame.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -73,18 +73,18 @@ public JournalLoadGame(JObject evt ) : base(evt, JournalTypeEnum.LoadGame) public bool? Horizons { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Cmdr ", LoadGameCommander, "Ship:", Ship, "Name:", ShipName, "Ident:", ShipIdent, "Credits:;;N0", Credits); - detailed = BaseUtils.FieldBuilder.Build("Mode:", GameMode , "Group:" , Group , "Not Landed;Landed" , StartLanded , "Fuel Level:;;0.0", FuelLevel , "Capacity:;;0.0" , FuelCapacity); + info = BaseUtils.FieldBuilder.Build("Cmdr ", LoadGameCommander, "Ship:".Txb(this), Ship, "Name:".Txb(this), ShipName, "Ident:".Txb(this), ShipIdent, "Credits:;;N0".Txb(this), Credits); + detailed = BaseUtils.FieldBuilder.Build("Mode:".Txb(this), GameMode , "Group:".Txb(this), Group , "Not Landed;Landed".Txb(this), StartLanded , "Fuel Level:;;0.0".Txb(this), FuelLevel , "Capacity:;;0.0".Txb(this), FuelCapacity); } public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) { if (mcl.CashTotal != Credits) { - mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "Cash total differs, adjustment", Credits - mcl.CashTotal); + mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "Cash total differs, adjustment".Txb(this), Credits - mcl.CashTotal); } } diff --git a/EliteDangerous/JournalEvents/JournalLoadout.cs b/EliteDangerous/JournalEvents/JournalLoadout.cs index 921714902e..f2a25908d9 100644 --- a/EliteDangerous/JournalEvents/JournalLoadout.cs +++ b/EliteDangerous/JournalEvents/JournalLoadout.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -90,10 +90,11 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.Loadout(ShipId, Ship, ShipFD, ShipName, ShipIdent, ShipModules, HullValue?? 0, ModulesValue ?? 0, Rebuy ?? 0); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Ship:", Ship, "Name:", ShipName, "Ident:", ShipIdent, "Modules:", ShipModules.Count , "Hull:; cr;N0", HullValue , "Modules:; cr;N0" , ModulesValue , "Rebuy:; cr;N0", Rebuy); + info = BaseUtils.FieldBuilder.Build("Ship:".Txb(this), Ship, "Name:".Txb(this), ShipName, "Ident:".Txb(this), ShipIdent, + "Modules:".Tx(this), ShipModules.Count , "Hull:; cr;N0".Txb(this), HullValue , "Modules:; cr;N0".Txb(this), ModulesValue , "Rebuy:; cr;N0".Txb(this), Rebuy); detailed = ""; foreach (ShipModule m in ShipModules) @@ -101,7 +102,7 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy if (detailed.Length > 0) detailed += Environment.NewLine; - detailed += BaseUtils.FieldBuilder.Build("", m.Slot, "<:", m.Item , "" , m.PE(), "Blueprint:" , m.Engineering?.FriendlyBlueprintName, "<+" , m.Engineering?.ExperimentalEffect_Localised, "< by " , m.Engineering?.Engineer ); + detailed += BaseUtils.FieldBuilder.Build("", m.Slot, "<:", m.Item , "" , m.PE(), "Blueprint:".Txb(this), m.Engineering?.FriendlyBlueprintName, "<+" , m.Engineering?.ExperimentalEffect_Localised, "< " , m.Engineering?.Engineer ); } } } diff --git a/EliteDangerous/JournalEvents/JournalLocOrJump.cs b/EliteDangerous/JournalEvents/JournalLocOrJump.cs index d80e4ebb59..4db144e471 100644 --- a/EliteDangerous/JournalEvents/JournalLocOrJump.cs +++ b/EliteDangerous/JournalEvents/JournalLocOrJump.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at diff --git a/EliteDangerous/JournalEvents/JournalLocation.cs b/EliteDangerous/JournalEvents/JournalLocation.cs index 55dcfa8575..bf6cd26032 100644 --- a/EliteDangerous/JournalEvents/JournalLocation.cs +++ b/EliteDangerous/JournalEvents/JournalLocation.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -22,19 +22,6 @@ namespace EliteDangerousCore.JournalEvents { //When written: at startup, or when being resurrected at a station - //Parameters: - //• StarSystem: name of destination starsystem - //• StarPos: star position, as a Json array [x, y, z], in light years - //• Body: star’s body name - //• Docked: true (if docked) - //• StationName: station name, (if docked) - //• StationType: (if docked) - //• Faction: star system controlling faction - //• FactionState - //• Allegiance - //• Economy - //• Government - //• Security [JournalEntryType(JournalTypeEnum.Location)] public class JournalLocation : JournalLocOrJump, ISystemStationEntry, IBodyNameAndID { @@ -71,29 +58,29 @@ public class JournalLocation : JournalLocOrJump, ISystemStationEntry, IBodyNameA public override string FillSummary { get { if (Docked) - return "At " + StationName; + return string.Format("At {0}".Tx(this, "AtStat"), StationName); else if (Latitude.HasValue && Longitude.HasValue) - return "Landed on " + Body; + return string.Format("Landed on {0}".Tx(this, "LND"), Body); else - return "At " + StarSystem; + return string.Format("At {0}".Tx(this, "AtStar"), StarSystem); } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { if (Docked) { - info = BaseUtils.FieldBuilder.Build("Type ", StationType, "< in system ", StarSystem); - detailed = BaseUtils.FieldBuilder.Build(";Wanted", Wanted, "Allegiance:", Allegiance, "Economy:", Economy_Localised, "Government:", Government_Localised, "Security:", Security_Localised); + info = BaseUtils.FieldBuilder.Build("Type ".Txb(this), StationType, "< in system ".Txb(this), StarSystem); + detailed = BaseUtils.FieldBuilder.Build("<;(Wanted) ".Txb(this), Wanted, "Allegiance:".Txb(this), Allegiance, "Economy:".Txb(this), Economy_Localised, "Government:".Txb(this), Government_Localised, "Security:".Txb(this), Security_Localised); if (Factions != null) foreach (FactionInformation f in Factions) { detailed += Environment.NewLine; - detailed += BaseUtils.FieldBuilder.Build("", f.Name, "State:", f.FactionState, "Gov:", f.Government, "Inf:;%", (int)(f.Influence * 100), "Allegiance:", f.Allegiance); + detailed += BaseUtils.FieldBuilder.Build("", f.Name, "State:".Txb(this), f.FactionState, "Government:".Txb(this), f.Government, "Inf:;%".Txb(this), (int)(f.Influence * 100), "Allegiance:".Txb(this), f.Allegiance); if (f.PendingStates != null) { - detailed += BaseUtils.FieldBuilder.Build(",", "Pending State:"); + detailed += BaseUtils.FieldBuilder.Build(",", "Pending State:".Txb(this)); foreach (JournalLocation.PowerStatesInfo state in f.PendingStates) detailed += BaseUtils.FieldBuilder.Build(",", state.State, "", state.Trend); @@ -101,7 +88,7 @@ public class JournalLocation : JournalLocOrJump, ISystemStationEntry, IBodyNameA if (f.RecoveringStates != null) { - detailed += BaseUtils.FieldBuilder.Build(",", "Recovering State:"); + detailed += BaseUtils.FieldBuilder.Build(",", "Recovering State:".Txb(this)); foreach (JournalLocation.PowerStatesInfo state in f.RecoveringStates) detailed += BaseUtils.FieldBuilder.Build(",", state.State, "", state.Trend); } @@ -115,7 +102,7 @@ public class JournalLocation : JournalLocOrJump, ISystemStationEntry, IBodyNameA } else { - info = BaseUtils.FieldBuilder.Build("In space near ", Body, "< of type ", BodyType); + info = BaseUtils.FieldBuilder.Build("In space near ".Txb(this), Body, "< of type ".Txb(this), BodyType); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalMarket.cs b/EliteDangerous/JournalEvents/JournalMarket.cs index 7553c23741..be2d12d924 100644 --- a/EliteDangerous/JournalEvents/JournalMarket.cs +++ b/EliteDangerous/JournalEvents/JournalMarket.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at diff --git a/EliteDangerous/JournalEvents/JournalMarketBuy.cs b/EliteDangerous/JournalEvents/JournalMarketBuy.cs index 11b74a326b..6dd32ba3e3 100644 --- a/EliteDangerous/JournalEvents/JournalMarketBuy.cs +++ b/EliteDangerous/JournalEvents/JournalMarketBuy.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when purchasing goods in the market - //Parameters: - //• Type: cargo type - //• Count: number of units - //• BuyPrice: cost per unit - //• TotalCost: total cost [JournalEntryType(JournalTypeEnum.MarketBuy)] public class JournalMarketBuy : JournalEntry, IMaterialCommodityJournalEntry, ILedgerJournalEntry { @@ -57,10 +51,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, FriendlyType + " " + Count,-TotalCost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Type_Localised, "", Count, "< at ; cr;N0", BuyPrice, "Total:; cr;N0", TotalCost); + info = BaseUtils.FieldBuilder.Build("", Type_Localised, "", Count, "< buy price ; cr;N0".Txb(this), BuyPrice, "Total Cost:; cr;N0".Txb(this), TotalCost); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalMarketSell.cs b/EliteDangerous/JournalEvents/JournalMarketSell.cs index 0f53cd6495..fc582c7fc6 100644 --- a/EliteDangerous/JournalEvents/JournalMarketSell.cs +++ b/EliteDangerous/JournalEvents/JournalMarketSell.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,16 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when selling goods in the market - //Parameters: - //• Type: cargo type - //• Count: number of units - //• SellPrice: price per unit - //• TotalSale: total sale value - //• AvgPricePaid: average price paid - //• IllegalGoods: (not always present) whether goods are illegal here - //• StolenGoods: (not always present) whether goods were stolen - //• BlackMarket: (not always present) whether selling in a black market [JournalEntryType(JournalTypeEnum.MarketSell)] public class JournalMarketSell : JournalEntry, IMaterialCommodityJournalEntry, ILedgerJournalEntry { @@ -70,12 +60,11 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, FriendlyType + " " + Count + " Avg " + AvgPricePaid, TotalSale, (double)(SellPrice - AvgPricePaid)); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - long profit = TotalSale - (AvgPricePaid * Count); - info = BaseUtils.FieldBuilder.Build("", Type_Localised, "", Count, "< at ; cr;N0", SellPrice, "Total:; cr;N0", TotalSale, "Profit:; cr;N0", profit); - detailed = BaseUtils.FieldBuilder.Build("Legal;Illegal", IllegalGoods, "Not Stolen;Stolen", StolenGoods, "Market;BlackMarket", BlackMarket); + info = BaseUtils.FieldBuilder.Build("", Type_Localised, "", Count, "< sell price ; cr;N0".Txb(this), SellPrice, "Total Cost:; cr;N0".Txb(this), TotalSale, "Profit:; cr;N0".Txb(this), profit); + detailed = BaseUtils.FieldBuilder.Build("Legal;Illegal".Txb(this), IllegalGoods, "Not Stolen;Stolen".Txb(this), StolenGoods, "Market;BlackMarket".Txb(this), BlackMarket); } } } diff --git a/EliteDangerous/JournalEvents/JournalMassModuleStore.cs b/EliteDangerous/JournalEvents/JournalMassModuleStore.cs index e771ac5e7d..7b882cf180 100644 --- a/EliteDangerous/JournalEvents/JournalMassModuleStore.cs +++ b/EliteDangerous/JournalEvents/JournalMassModuleStore.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,15 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when putting multiple modules into storage -//Parameters: -//• Ship -//• ShipId -//• Items: Array of records -//o Slot -//o Name -//o EngineerModifications(only present if modified) - [JournalEntryType(JournalTypeEnum.MassModuleStore)] public class JournalMassModuleStore : JournalEntry, IShipInformation { @@ -62,18 +53,16 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.MassModuleStore(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Total modules:", ModuleItems?.Count()); + info = BaseUtils.FieldBuilder.Build("Total modules:".Txb(this), ModuleItems?.Count()); detailed = ""; if ( ModuleItems != null ) foreach (ModuleItem m in ModuleItems) { - detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("", m.Name, ";(Hot)", m.Hot), ", "); + detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("", m.Name, ";(Hot)".Txb(this), m.Hot), ", "); } - } public class ModuleItem diff --git a/EliteDangerous/JournalEvents/JournalMaterialCollected.cs b/EliteDangerous/JournalEvents/JournalMaterialCollected.cs index 337cf33967..59361dcbde 100644 --- a/EliteDangerous/JournalEvents/JournalMaterialCollected.cs +++ b/EliteDangerous/JournalEvents/JournalMaterialCollected.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: whenever materials are collected - //Parameters: - //• Category: type of material (Raw/Encoded/Manufactured) - //• Name: name of material [JournalEntryType(JournalTypeEnum.MaterialCollected)] public class JournalMaterialCollected : JournalEntry, IMaterialCommodityJournalEntry { @@ -43,10 +39,9 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con mc.Change(Category, Name, Count, 0, conn); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", FriendlyName, "< ; items", Count); + info = BaseUtils.FieldBuilder.Build("", FriendlyName, "< ; items".Txb(this,"MatC"), Count); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalMaterialDiscarded.cs b/EliteDangerous/JournalEvents/JournalMaterialDiscarded.cs index a5af04618c..ec8ff211b6 100644 --- a/EliteDangerous/JournalEvents/JournalMaterialDiscarded.cs +++ b/EliteDangerous/JournalEvents/JournalMaterialDiscarded.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -39,10 +39,9 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con mc.Change(Category, Name, -Count, 0, conn); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", FriendlyName, "< ; items", Count); + info = BaseUtils.FieldBuilder.Build("", FriendlyName, "< ; items".Txb(this,"MatC"), Count); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalMaterialDiscovered.cs b/EliteDangerous/JournalEvents/JournalMaterialDiscovered.cs index 69d1072592..be187374b8 100644 --- a/EliteDangerous/JournalEvents/JournalMaterialDiscovered.cs +++ b/EliteDangerous/JournalEvents/JournalMaterialDiscovered.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -39,12 +39,11 @@ public JournalMaterialDiscovered(JObject evt ) : base(evt, JournalTypeEnum.Mater public string FriendlyName { get; set; } public int DiscoveryNumber { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", FriendlyName); if (DiscoveryNumber > 0) - info += ", Discovery " + DiscoveryNumber.ToStringInvariant(); + info += string.Format(", Discovery {0}".Tx(this,"DN"), DiscoveryNumber ); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalMaterialTrade.cs b/EliteDangerous/JournalEvents/JournalMaterialTrade.cs index 1e253755fc..15a9517bb8 100644 --- a/EliteDangerous/JournalEvents/JournalMaterialTrade.cs +++ b/EliteDangerous/JournalEvents/JournalMaterialTrade.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.MaterialTrade)] public class JournalMaterialTrade : JournalEntry, IMaterialCommodityJournalEntry { @@ -73,15 +72,14 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = detailed = ""; if (Paid != null && Received != null) { - info = BaseUtils.FieldBuilder.Build("Sold: ", Paid.Quantity, "< ", Paid.Material_Localised, - "Received: ", Received.Quantity, "< ", Received.Material_Localised); + info = BaseUtils.FieldBuilder.Build("Sold:".Txb(this), Paid.Quantity, "< ", Paid.Material_Localised, + "Received:".Txb(this), Received.Quantity, "< ", Received.Material_Localised); } } } diff --git a/EliteDangerous/JournalEvents/JournalMaterials.cs b/EliteDangerous/JournalEvents/JournalMaterials.cs index c94f0f08db..aa57790a4e 100644 --- a/EliteDangerous/JournalEvents/JournalMaterials.cs +++ b/EliteDangerous/JournalEvents/JournalMaterials.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,15 +21,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: at startup, when loading from main menu into game - //Parameters: - //• Raw: array of raw materials(each with name and count) - //• Manufactured: array of manufactured items - //• Encoded: array of scanned data - - //Example: - //{ "timestamp":"2017-02-10T14:25:51Z", "event":"Materials", "Raw":[ { "Name":"chromium", "Count":28 }, { "Name":"zinc", "Count":18 }, { "Name":"iron", "Count":23 }, { "Name":"sulphur", "Count":19 } ], "Manufactured":[ { "Name":"refinedfocuscrystals", "Count":10 }, { "Name":"highdensitycomposites", "Count":3 }, { "Name":"mechanicalcomponents", "Count":3 } ], "Encoded":[ { "Name":"emissiondata", "Count":32 }, { "Name":"shielddensityreports", "Count":23 } } ] } - [JournalEntryType(JournalTypeEnum.Materials)] public class JournalMaterials : JournalEntry, IMaterialCommodityJournalEntry { @@ -69,29 +60,29 @@ void FixNames(Material[] a) } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { info = ""; detailed = ""; if (Raw != null && Raw.Length>0) { - info += BaseUtils.FieldBuilder.Build("Raw:; ", Raw.Length); - detailed += "Raw:" + List(Raw); + info += BaseUtils.FieldBuilder.Build("Raw:".Tx(this) + "; ", Raw.Length); + detailed += "Raw:".Tx(this) + List(Raw); } if (Manufactured != null && Manufactured.Length>0) { - info += BaseUtils.FieldBuilder.Build("Manufactured:; ", Manufactured.Length);// NOT DONE + info += BaseUtils.FieldBuilder.Build("Manufactured:".Tx(this) + "; ", Manufactured.Length);// NOT DONE if (detailed.Length > 0) detailed += Environment.NewLine; - detailed += "Manufactured:" + List(Manufactured); + detailed += "Manufactured:".Tx(this) + List(Manufactured); } if (Encoded != null && Encoded.Length > 0) { - info += BaseUtils.FieldBuilder.Build("Encoded:; ", Encoded.Length);// NOT DONE + info += BaseUtils.FieldBuilder.Build("Encoded:".Tx(this) + "; ", Encoded.Length);// NOT DONE if (detailed.Length > 0) detailed += Environment.NewLine; - detailed += "Manufactured:" + List(Encoded); + detailed += "Encoded:".Tx(this) + List(Encoded); } } @@ -102,7 +93,7 @@ public string List(Material[] mat) foreach (Material m in mat) { sb.Append(Environment.NewLine); - sb.Append(BaseUtils.FieldBuilder.Build(" ", m.FriendlyName, "; items", m.Count)); + sb.Append(BaseUtils.FieldBuilder.Build(" ", m.FriendlyName, "; items".Txb(this), m.Count)); } return sb.ToString(); } diff --git a/EliteDangerous/JournalEvents/JournalMiningRefined.cs b/EliteDangerous/JournalEvents/JournalMiningRefined.cs index dc64bb84dc..d06384d102 100644 --- a/EliteDangerous/JournalEvents/JournalMiningRefined.cs +++ b/EliteDangerous/JournalEvents/JournalMiningRefined.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when mining fragments are converted unto a unit of cargo by refinery - //Parameters: - //• Type: $cargo_name; - //• Type_Localised: cargo type [JournalEntryType(JournalTypeEnum.MiningRefined)] public class JournalMiningRefined : JournalEntry, IMaterialCommodityJournalEntry, ILedgerNoCashJournalEntry { @@ -44,12 +40,11 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con public void LedgerNC(Ledger mcl, DB.SQLiteConnectionUser conn) { - mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, FriendlyType ); + mcl.AddEventNoCash(Id, EventTimeUTC, EventTypeID, Type_Localised); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Type_Localised; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalMissionAbandoned.cs b/EliteDangerous/JournalEvents/JournalMissionAbandoned.cs index 0c12645553..0bc5f8fff5 100644 --- a/EliteDangerous/JournalEvents/JournalMissionAbandoned.cs +++ b/EliteDangerous/JournalEvents/JournalMissionAbandoned.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when a mission has been abandoned - //Parameters: - //• Name: name of mission [JournalEntryType(JournalTypeEnum.MissionAbandoned)] public class JournalMissionAbandoned : JournalEntry, IMissions { @@ -37,10 +34,9 @@ public JournalMissionAbandoned(JObject evt ) : base(evt, JournalTypeEnum.Mission public int MissionId { get; set; } public long? Fine { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Name, "Fine:", Fine); + info = BaseUtils.FieldBuilder.Build("", Name, "Fine:".Txb(this), Fine); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalMissionAccepted.cs b/EliteDangerous/JournalEvents/JournalMissionAccepted.cs index 29766692db..2ec31744fa 100644 --- a/EliteDangerous/JournalEvents/JournalMissionAccepted.cs +++ b/EliteDangerous/JournalEvents/JournalMissionAccepted.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -22,31 +22,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when starting a mission - //Parameters: - //• Name: name of mission - //• Faction: faction offering mission - //• MissionID - //• Influence: effect on influence(None/Low/Med/High) - //• Reputation: effect on reputation(None/Low/Med/High) - - //Optional Parameters (depending on mission type) - //• Commodity: $Commodity_Name; - //• Commodity_Localised: commodity type - //• Count: number required / to deliver - //• Target: name of target - //• TargetType: type of target - //• TargetFaction: target’s faction - //• Expiry: mission expiry time, in ISO 8601 - //• DestinationSystem - //• DestinationStation - //• PassengerCount - //• PassengerVIPs: bool - //• PassengerWanted: bool - //• PassengerType: eg Tourist, Soldier, Explorer,... - //• Reward: Credit reward for completing the mission - - [JournalEntryType(JournalTypeEnum.MissionAccepted)] public class JournalMissionAccepted : JournalEntry, IMissions, IMaterialCommodityJournalEntry { @@ -132,7 +107,7 @@ public JournalMissionAccepted(JObject evt ) : base(evt, JournalTypeEnum.MissionA public bool? Wing { get; private set; } // 3.02 - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { info = MissionBasicInfo(); detailed = MissionDetailedInfo(); diff --git a/EliteDangerous/JournalEvents/JournalMissionCompleted.cs b/EliteDangerous/JournalEvents/JournalMissionCompleted.cs index ed581fb5b4..fc11523a90 100644 --- a/EliteDangerous/JournalEvents/JournalMissionCompleted.cs +++ b/EliteDangerous/JournalEvents/JournalMissionCompleted.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,20 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when a mission is completed - //Parameters: - //• Name: mission type - //• Faction: faction name - //Optional parameters (depending on mission type) - //• Commodity: $Commodity_Name; - //• Commodity_Localised: commodity type - //• Count - //• Target - //• TargetType - //• TargetFaction - //• Reward: value of reward - //• Donation: donation offered (for altruism missions) - //• PermitsAwarded:[] (names of any permits awarded, as a JSON array) [JournalEntryType(JournalTypeEnum.MissionCompleted)] public class JournalMissionCompleted : JournalEntry, IMaterialCommodityJournalEntry, ILedgerJournalEntry, IMissions { @@ -154,20 +140,20 @@ public void UpdateMissions(MissionListAccumulator mlist, EliteDangerousCore.ISys mlist.Completed(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { info = BaseUtils.FieldBuilder.Build("", Name, - "< from ", Faction, - "Reward:; cr;N0", Reward, - "Donation:", Donation, - "System:", DestinationSystem, - "Station:", DestinationStation); + "< from ".Txb(this), Faction, + "Reward:; cr;N0".Txb(this), Reward, + "Donation:".Txb(this), Donation, + "System:".Txb(this), DestinationSystem, + "Station:".Txb(this), DestinationStation); - detailed = BaseUtils.FieldBuilder.Build("Commodity:", CommodityLocalised, - "Target:", TargetLocalised, - "Type:", TargetTypeLocalised, - "Target Faction:", TargetFaction); + detailed = BaseUtils.FieldBuilder.Build("Commodity:".Txb(this), CommodityLocalised, + "Target:".Txb(this), TargetLocalised, + "Type:".Txb(this), TargetTypeLocalised, + "Target Faction:".Txb(this), TargetFaction); detailed += PermitsList(); detailed += CommoditiesList(); @@ -180,7 +166,7 @@ public string PermitsList(bool pretty = true) if (PermitsAwarded != null && PermitsAwarded.Length > 0) { if (pretty) - detailed += "Permits:"; + detailed += "Permits:".Txb(this); for (int i = 0; i < PermitsAwarded.Length; i++) detailed += ((i > 0) ? "," : "") + PermitsAwarded[i]; @@ -197,7 +183,7 @@ public string CommoditiesList(bool pretty = true) if (CommodityReward != null && CommodityReward.Length > 0) { if (pretty) - detailed += "Rewards:"; + detailed += "Rewards:".Txb(this); for (int i = 0; i < CommodityReward.Length; i++) { CommodityRewards c = CommodityReward[i]; @@ -216,7 +202,8 @@ public string MaterialList(bool pretty = true) if (MaterialsReward != null && MaterialsReward.Length > 0) { if (pretty) - detailed += "Rewards:"; + detailed += "Rewards:".Txb(this); + for (int i = 0; i < MaterialsReward.Length; i++) { MaterialRewards m = MaterialsReward[i]; diff --git a/EliteDangerous/JournalEvents/JournalMissionFailed.cs b/EliteDangerous/JournalEvents/JournalMissionFailed.cs index c465e9d8d6..f1533a1ef6 100644 --- a/EliteDangerous/JournalEvents/JournalMissionFailed.cs +++ b/EliteDangerous/JournalEvents/JournalMissionFailed.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when a mission has failed - //Parameters: - //• Name: name of mission [JournalEntryType(JournalTypeEnum.MissionFailed)] public class JournalMissionFailed : JournalEntry, IMissions { @@ -37,10 +34,10 @@ public JournalMissionFailed(JObject evt ) : base(evt, JournalTypeEnum.MissionFai public int MissionId { get; set; } public long? Fine { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", Name,"Fine:",Fine); + info = BaseUtils.FieldBuilder.Build("", Name,"Fine:".Txb(this), Fine); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalMissionRedirected.cs b/EliteDangerous/JournalEvents/JournalMissionRedirected.cs index 406af72f9f..9c3240685e 100644 --- a/EliteDangerous/JournalEvents/JournalMissionRedirected.cs +++ b/EliteDangerous/JournalEvents/JournalMissionRedirected.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -41,13 +41,12 @@ public JournalMissionRedirected(JObject evt ) : base(evt, JournalTypeEnum.Missio public string Name { get; set; } public string FDName { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = info = BaseUtils.FieldBuilder.Build("Mission name:", Name, - "From:", OldDestinationSystem, + info = info = BaseUtils.FieldBuilder.Build("Mission name:".Txb(this), Name, + "From:".Tx(this), OldDestinationSystem, "", OldDestinationStation, - "To:", NewDestinationSystem, + "To:".Tx(this), NewDestinationSystem, "", NewDestinationStation); detailed = ""; diff --git a/EliteDangerous/JournalEvents/JournalMissions.cs b/EliteDangerous/JournalEvents/JournalMissions.cs index 57257e4c85..e9602ae32f 100644 --- a/EliteDangerous/JournalEvents/JournalMissions.cs +++ b/EliteDangerous/JournalEvents/JournalMissions.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,14 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: when starting game - //Parameters: - //• Active: Array of records - //o id - //o Name - //o PassengerMission - //o Expires - [JournalEntryType(JournalTypeEnum.Missions)] public class JournalMissions : JournalEntry { @@ -44,25 +36,25 @@ public JournalMissions(JObject evt) : base(evt, JournalTypeEnum.Missions) public MissionItem[] FailedMissions { get; set; } public MissionItem[] CompletedMissions { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Active ", ActiveMissions?.Length, "Failed ", FailedMissions?.Length, "Completed ", CompletedMissions?.Length); + info = BaseUtils.FieldBuilder.Build("Active:".Txb(this), ActiveMissions?.Length, "Failed:".Txb(this), FailedMissions?.Length, "Completed:".Txb(this), CompletedMissions?.Length); detailed = ""; if (ActiveMissions != null && ActiveMissions.Length>0) { - detailed = detailed.AppendPrePad("Active:" , Environment.NewLine); + detailed = detailed.AppendPrePad("Active:".Txb(this), Environment.NewLine); foreach (var x in ActiveMissions) detailed = detailed.AppendPrePad(" " + x.Format(), Environment.NewLine); } if (FailedMissions != null && FailedMissions.Length>0) { - detailed = detailed.AppendPrePad("Failed:" , Environment.NewLine); + detailed = detailed.AppendPrePad("Failed:".Txb(this), Environment.NewLine); foreach (var x in FailedMissions) detailed = detailed.AppendPrePad(" " + x.Format(), Environment.NewLine); } if (CompletedMissions != null && CompletedMissions.Length > 0) { - detailed = detailed.AppendPrePad("Completed:" , Environment.NewLine); + detailed = detailed.AppendPrePad("Completed:".Txb(this), Environment.NewLine); foreach (var x in CompletedMissions) detailed = detailed.AppendPrePad(" " + x.Format(), Environment.NewLine); } @@ -94,7 +86,7 @@ public void Normalise(DateTime utcnow) public string Format() { - return BaseUtils.FieldBuilder.Build("", FriendlyName, "<;(Passenger)", PassengerMission, " Expires ", ExpiryTimeUTC.ToLocalTime()); + return BaseUtils.FieldBuilder.Build("", FriendlyName, "<;(Passenger)".Tx(this), PassengerMission, " " + "Expires:".Tx(this), ExpiryTimeUTC.ToLocalTime()); } } } diff --git a/EliteDangerous/JournalEvents/JournalModuleBuy.cs b/EliteDangerous/JournalEvents/JournalModuleBuy.cs index 4a8da491b6..13d3a0a1a7 100644 --- a/EliteDangerous/JournalEvents/JournalModuleBuy.cs +++ b/EliteDangerous/JournalEvents/JournalModuleBuy.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,15 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when buying a module in outfitting - //Parameters: - //• Slot: the outfitting slot - //• BuyItem: the module being purchased - //• BuyPrice: price paid - //• Ship: the players ship - //If replacing an existing module: - //• SellItem: item being sold - //• SellPrice: sale price [JournalEntryType(JournalTypeEnum.ModuleBuy)] public class JournalModuleBuy : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -91,14 +82,14 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.ModuleBuy(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", BuyItemLocalised, "< into ", Slot, "Cost:; cr;N0", BuyPrice); + info = BaseUtils.FieldBuilder.Build("", BuyItemLocalised, "< into ".Txb(this), Slot, "Cost:; cr;N0".Txb(this), BuyPrice); if (SellItem.Length > 0) - info += ", " + BaseUtils.FieldBuilder.Build("Sold:", SellItemLocalised, "Price:; cr;N0", SellPrice); + info += ", " + BaseUtils.FieldBuilder.Build("Sold:".Txb(this), SellItemLocalised, "Price:; cr;N0".Txb(this), SellPrice); if (StoredItem.Length > 0) - info += ", " + BaseUtils.FieldBuilder.Build("Stored:", StoredItemLocalised); + info += ", " + BaseUtils.FieldBuilder.Build("Stored:".Txb(this), StoredItemLocalised); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalModuleInfo.cs b/EliteDangerous/JournalEvents/JournalModuleInfo.cs index 4d0ca962c6..e2a5e23bd1 100644 --- a/EliteDangerous/JournalEvents/JournalModuleInfo.cs +++ b/EliteDangerous/JournalEvents/JournalModuleInfo.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -22,14 +22,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: - //Parameters: - //• Modules: array of installed items, each with: - //o Slot: slot name - //o Item: module name - //o Power: module power - //o Priority: power priority - [System.Diagnostics.DebuggerDisplay("{ShipId} {Ship} {ShipModules.Count}")] [JournalEntryType(JournalTypeEnum.ModuleInfo)] public class JournalModuleInfo : JournalEntry , IAdditionalFiles @@ -58,10 +50,10 @@ public void Rescan(JObject evt) itemfdname, null, // unknown jo["Priority"].IntNull(), - null, //aclip - null, //ahooper - null, //health - null, //value + null, // aclip + null, // ahooper + null, // health + null, // Value jo["Power"].DoubleNull(), null //engineering ); @@ -85,10 +77,10 @@ public bool ReadAdditionalFiles(string directory, ref JObject jo) public List ShipModules; - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Modules:", ShipModules.Count); + info = BaseUtils.FieldBuilder.Build("Modules:".Txb(this), ShipModules.Count); detailed = ""; foreach (ShipModule m in ShipModules) diff --git a/EliteDangerous/JournalEvents/JournalModuleRetrieve.cs b/EliteDangerous/JournalEvents/JournalModuleRetrieve.cs index 6d61239cc1..b116265b54 100644 --- a/EliteDangerous/JournalEvents/JournalModuleRetrieve.cs +++ b/EliteDangerous/JournalEvents/JournalModuleRetrieve.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,15 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when fetching a previously stored module - //Parameters: - //• Slot - //• Ship - //• ShipID - //• RetrievedItem - //• EngineerModifications: name of modification blueprint, if any - //• SwapOutItem (if slot was not empty) - //• Cost [JournalEntryType(JournalTypeEnum.ModuleRetrieve)] public class JournalModuleRetrieve : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -88,15 +79,15 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.ModuleRetrieve(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", RetrievedItemLocalised, "< into ", Slot ,";Hot!", Hot ); + info = BaseUtils.FieldBuilder.Build("", RetrievedItemLocalised, "< into ".Txb(this), Slot ,";(Hot)".Txb(this), Hot ); if ( Cost>0) - info += " " + BaseUtils.FieldBuilder.Build("Cost:; cr;N0", Cost); + info += " " + BaseUtils.FieldBuilder.Build("Cost:; cr;N0".Txb(this), Cost); if (SwapOutItem.Length > 0) - info += ", " + BaseUtils.FieldBuilder.Build("Stored:", SwapOutItemLocalised); + info += ", " + BaseUtils.FieldBuilder.Build("Stored:".Txb(this), SwapOutItemLocalised); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalModuleSell.cs b/EliteDangerous/JournalEvents/JournalModuleSell.cs index 8e095ac311..839f8acb58 100644 --- a/EliteDangerous/JournalEvents/JournalModuleSell.cs +++ b/EliteDangerous/JournalEvents/JournalModuleSell.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when selling a module in outfitting - //Parameters: - //• Slot - //• SellItem - //• SellPrice - //• Ship [JournalEntryType(JournalTypeEnum.ModuleSell)] public class JournalModuleSell : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -67,10 +61,10 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy { shp.ModuleSell(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", SellItemLocalised, "< from ", Slot, "Price:; cr;N0", SellPrice); + info = BaseUtils.FieldBuilder.Build("", SellItemLocalised, "< from ".Txb(this), Slot, "Price:; cr;N0".Txb(this), SellPrice); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalModuleSellRemote.cs b/EliteDangerous/JournalEvents/JournalModuleSellRemote.cs index 7d6f403c70..869beaefcf 100644 --- a/EliteDangerous/JournalEvents/JournalModuleSellRemote.cs +++ b/EliteDangerous/JournalEvents/JournalModuleSellRemote.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -17,12 +17,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when selling a module in outfitting - //Parameters: - //• Slot - //• SellItem - //• SellPrice - //• Ship [JournalEntryType(JournalTypeEnum.ModuleSellRemote)] public class JournalModuleSellRemote : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -65,11 +59,11 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.ModuleSellRemote(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Item:", SellItemLocalised, "Price:; cr;N0", SellPrice); - detailed = BaseUtils.FieldBuilder.Build("Ship:", Ship); + info = BaseUtils.FieldBuilder.Build("Item:".Txb(this), SellItemLocalised, "Price:; cr;N0".Txb(this), SellPrice); + detailed = BaseUtils.FieldBuilder.Build("Ship:".Txb(this), Ship); } } } diff --git a/EliteDangerous/JournalEvents/JournalModuleStore.cs b/EliteDangerous/JournalEvents/JournalModuleStore.cs index 905a6da4a4..531e652c34 100644 --- a/EliteDangerous/JournalEvents/JournalModuleStore.cs +++ b/EliteDangerous/JournalEvents/JournalModuleStore.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,15 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when storing a module in Outfitting -// Parameters: -//• Slot -//• Ship -//• ShipID -//• StoredItem -//• EngineerModifications: name of modification blueprint, if any -//• ReplacementItem(if a core module) -//• Cost(if any) [JournalEntryType(JournalTypeEnum.ModuleStore)] public class JournalModuleStore : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -79,7 +70,7 @@ public JournalModuleStore(JObject evt) : base(evt, JournalTypeEnum.ModuleStore) public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) { string s = (StoredItemLocalised.Length > 0) ? StoredItemLocalised : StoredItem; - mcl.AddEvent(Id, EventTimeUTC, EventTypeID, s +" on " + Ship, -Cost); + mcl.AddEvent(Id, EventTimeUTC, EventTypeID, s +" on ".Txb(this) + Ship, -Cost); } public void ShipInformation(ShipInformationList shp, string whereami, ISystem system, DB.SQLiteConnectionUser conn) @@ -87,13 +78,13 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.ModuleStore(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", StoredItemLocalised, "< from ", Slot , ";Hot!", Hot, "Cost:" , Cost); + info = BaseUtils.FieldBuilder.Build("", StoredItemLocalised, "< from ".Txb(this), Slot , ";(Hot)".Txb(this), Hot, "Cost:; cr;N0".Txb(this), Cost); if (ReplacementItem.Length > 0) - info = ", " + BaseUtils.FieldBuilder.Build("Replaced by:", ReplacementItemLocalised); - detailed = BaseUtils.FieldBuilder.Build("Modifications:", EngineerModifications); + info = ", " + BaseUtils.FieldBuilder.Build("Replaced by:".Txb(this), ReplacementItemLocalised); + detailed = BaseUtils.FieldBuilder.Build("Modifications:".Txb(this), EngineerModifications); } } } diff --git a/EliteDangerous/JournalEvents/JournalModuleSwap.cs b/EliteDangerous/JournalEvents/JournalModuleSwap.cs index b4293df64c..f2d6ef3fac 100644 --- a/EliteDangerous/JournalEvents/JournalModuleSwap.cs +++ b/EliteDangerous/JournalEvents/JournalModuleSwap.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,13 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when moving a module to a different slot on the ship - //Parameters: - //• FromSlot - //• ToSlot - //• FromItem - //• ToItem - //• Ship [JournalEntryType(JournalTypeEnum.ModuleSwap)] public class JournalModuleSwap : JournalEntry, IShipInformation { @@ -73,12 +66,12 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.ModuleSwap(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("From ", FromSlot , "< to " , ToSlot , "Item:" , FromItemLocalised); + info = BaseUtils.FieldBuilder.Build("Slot:".Txb(this), FromSlot , "< to ".Txb(this), ToSlot , "Item:".Txb(this), FromItemLocalised); if (ToItem.Length > 0 ) - info += ", Swapped with " + ToItemLocalised; + info += ", Swapped with ".Txb(this) + ToItemLocalised; detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalMusic.cs b/EliteDangerous/JournalEvents/JournalMusic.cs index 70d4a0ff20..c6ebd7de10 100644 --- a/EliteDangerous/JournalEvents/JournalMusic.cs +++ b/EliteDangerous/JournalEvents/JournalMusic.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,17 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - /* -When written: when the game music 'mood' changes -Parameters: - MusicTrack: (name) -Possible track names are: NoTrack, MainMenu, CQCMenu, SystemMap, GalaxyMap, GalacticPowers -CQC, DestinationFromHyperspace, DestinationFromSupercruise, Supercruise, Combat_Unknown -Unknown_Encounter, CapitalShip, CombatLargeDogFight, Combat_Dogfight, Combat_SRV -Unknown_Settlement, DockingComputer, Starport, Unknown_Exploration, Exploration -Note: Other music track names may be used in future - */ - public enum EDMusicTrackEnum { None = 0, Unknown = 1, @@ -51,10 +40,9 @@ public JournalMusic(JObject evt ) : base(evt, JournalTypeEnum.Music) public string MusicTrack { get; set; } public EDMusicTrackEnum MusicTrackID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("MusicTrack:", MusicTrack); + info = BaseUtils.FieldBuilder.Build("Music Track:".Txb(this), MusicTrack); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalNavBeaconScan.cs b/EliteDangerous/JournalEvents/JournalNavBeaconScan.cs index 9eb60cd134..85a7324e7b 100644 --- a/EliteDangerous/JournalEvents/JournalNavBeaconScan.cs +++ b/EliteDangerous/JournalEvents/JournalNavBeaconScan.cs @@ -18,13 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - /* - When written: when scanning a navigation beacon, before the scan data for all the bodies in the - system is written into the journal - Parameters: -  NumBodies - */ - [JournalEntryType(JournalTypeEnum.NavBeaconScan)] public class JournalNavBeaconScan : JournalEntry { @@ -37,10 +30,9 @@ public JournalNavBeaconScan(JObject evt) : base(evt, JournalTypeEnum.NavBeaconSc public int NumBodies { get; set; } public long? SystemAddress{ get; set; } - public override void FillInformation(out string info, out string detailed) //V - { - - info = BaseUtils.FieldBuilder.Build("Bodies:", NumBodies); + public override void FillInformation(out string info, out string detailed) + { + info = BaseUtils.FieldBuilder.Build("Bodies:".Txb(this), NumBodies); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalNewCommander.cs b/EliteDangerous/JournalEvents/JournalNewCommander.cs index 4481943f11..d070efba4d 100644 --- a/EliteDangerous/JournalEvents/JournalNewCommander.cs +++ b/EliteDangerous/JournalEvents/JournalNewCommander.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: Creating a new commander - //Parameters: - //• Name: (new) commander name - //• Package: selected starter package [JournalEntryType(JournalTypeEnum.NewCommander)] public class JournalNewCommander : JournalEntry { @@ -34,10 +30,10 @@ public JournalNewCommander(JObject evt ) : base(evt, JournalTypeEnum.NewCommande public string Name { get; set; } public string Package { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Cmdr ", Name , "Starting Package:", Package); + info = BaseUtils.FieldBuilder.Build("Cmdr ", Name , "Starting Package:".Txb(this), Package); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalNpcCrewPaidWage.cs b/EliteDangerous/JournalEvents/JournalNpcCrewPaidWage.cs index ad1ac91eab..9382f35a30 100644 --- a/EliteDangerous/JournalEvents/JournalNpcCrewPaidWage.cs +++ b/EliteDangerous/JournalEvents/JournalNpcCrewPaidWage.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.NpcCrewPaidWage)] public class JournalNpcCrewPaidWage : JournalEntry, ILedgerJournalEntry { @@ -33,16 +32,15 @@ public JournalNpcCrewPaidWage(JObject evt ) : base(evt, JournalTypeEnum.NpcCrewP public string Name { get; set; } public long Amount { get; set; } - public override void FillInformation(out string info, out string detailed) //V - { - + public override void FillInformation(out string info, out string detailed) + { info = BaseUtils.FieldBuilder.Build("<", Name , "; Cr" , Amount); detailed = ""; } public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) { - mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "Wages for " + Name, -Amount); + mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "Wages for ".Txb(this) + Name, -Amount); } } } diff --git a/EliteDangerous/JournalEvents/JournalNpcCrewRank.cs b/EliteDangerous/JournalEvents/JournalNpcCrewRank.cs index 2363560ca7..72af9eb9e2 100644 --- a/EliteDangerous/JournalEvents/JournalNpcCrewRank.cs +++ b/EliteDangerous/JournalEvents/JournalNpcCrewRank.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.NpcCrewRank)] public class JournalNpcCrewRank : JournalEntry { @@ -33,10 +32,9 @@ public JournalNpcCrewRank(JObject evt ) : base(evt, JournalTypeEnum.NpcCrewRank) public string Name { get; set; } public CombatRank RankCombat { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("<", Name, "Rank:", RankCombat.ToString().SplitCapsWord()); + info = BaseUtils.FieldBuilder.Build("<", Name, "Rank:".Txb(this), RankCombat.ToString().SplitCapsWord()); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalOutfitting.cs b/EliteDangerous/JournalEvents/JournalOutfitting.cs index 5082d67ffa..0ce217c36a 100644 --- a/EliteDangerous/JournalEvents/JournalOutfitting.cs +++ b/EliteDangerous/JournalEvents/JournalOutfitting.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -52,15 +52,14 @@ public bool ReadAdditionalFiles(string directory, ref JObject jo) public bool? Horizons { get; set; } public bool? AllowCobraMkIV { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; if (ItemList.Items != null) { - info = ItemList.Items.Length.ToString() + " items available"; + info = ItemList.Items.Length.ToString() + " items available".Txb(this); int itemno = 0; foreach (Outfitting.OutfittingItem m in ItemList.Items) { diff --git a/EliteDangerous/JournalEvents/JournalPVPKill.cs b/EliteDangerous/JournalEvents/JournalPVPKill.cs index 868a62c387..e56e30ec29 100644 --- a/EliteDangerous/JournalEvents/JournalPVPKill.cs +++ b/EliteDangerous/JournalEvents/JournalPVPKill.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,27 +18,21 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when this player has killed another player - //Parameters: - //• Victim: name of victim - //• CombatRank: victim’s rank in range 0..8 [JournalEntryType(JournalTypeEnum.PVPKill)] public class JournalPVPKill : JournalEntry { public JournalPVPKill(JObject evt) : base(evt, JournalTypeEnum.PVPKill) { Victim = evt["Victim"].Str(); - CombatRank = (CombatRank)evt["CombatRank"].Int(); - } + public string Victim { get; set; } public CombatRank CombatRank { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("",Victim, "Rank:" , CombatRank.ToString().SplitCapsWord()); + info = BaseUtils.FieldBuilder.Build("",Victim, "Rank:".Txb(this) , CombatRank.ToString().SplitCapsWord()); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPassengers.cs b/EliteDangerous/JournalEvents/JournalPassengers.cs index 23ddbef327..18ac8fe770 100644 --- a/EliteDangerous/JournalEvents/JournalPassengers.cs +++ b/EliteDangerous/JournalEvents/JournalPassengers.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,15 +21,6 @@ namespace EliteDangerousCore.JournalEvents { -//The "Passengers" event contains: - -//"Manifest": array of passenger records, each containing: -//o MissionID (int) -//o Type (string) -//o VIP (bool) -//o Wanted (bool) -//o Count (int) -//from hchalkley [JournalEntryType(JournalTypeEnum.Passengers)] public class JournalPassengers : JournalEntry { @@ -43,6 +34,7 @@ public class Passengers public Passengers() { } + public Passengers(int i, string t, bool v, bool w, int c) { MissionID = i; Type = t; VIP = v; Wanted = w; Count = c; @@ -68,8 +60,7 @@ public JournalPassengers(JObject evt) : base(evt, JournalTypeEnum.Passengers) public override void FillInformation(out string info, out string detailed) //U { - - info = "No Passengers"; + info = "No Passengers".Txb(this); if (Manifest != null && Manifest.Length > 0) { @@ -78,7 +69,7 @@ public JournalPassengers(JObject evt) : base(evt, JournalTypeEnum.Passengers) { if (info.Length > 0) info += ", "; - info += BaseUtils.FieldBuilder.Build("", p.Type , "< ", p.Count , "; (VIP)" , p.VIP , "; (Wanted)" , p.Wanted); + info += BaseUtils.FieldBuilder.Build("", p.Type , "< ", p.Count , "; (VIP)" , p.VIP , ";(Wanted)".Txb(this), p.Wanted); } } diff --git a/EliteDangerous/JournalEvents/JournalPayBounties.cs b/EliteDangerous/JournalEvents/JournalPayBounties.cs index 12d061c7a1..bf06290cf5 100644 --- a/EliteDangerous/JournalEvents/JournalPayBounties.cs +++ b/EliteDangerous/JournalEvents/JournalPayBounties.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -43,12 +43,12 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, (Faction_Localised.Length > 0 ? "Faction " + Faction_Localised : "") + " Broker " + BrokerPercentage.ToString("0.0") + "%", -Amount); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0", Amount, "< To ", Faction_Localised); + info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0".Txb(this), Amount, "< to ".Txb(this), Faction_Localised); if (BrokerPercentage > 0) - info += ", Broker took " + BrokerPercentage.ToString("0") + "%"; + info += string.Format(", Broker took {0:N0}%".Txb(this), BrokerPercentage); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPayFines.cs b/EliteDangerous/JournalEvents/JournalPayFines.cs index a413ea8724..e56b77c603 100644 --- a/EliteDangerous/JournalEvents/JournalPayFines.cs +++ b/EliteDangerous/JournalEvents/JournalPayFines.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When Written: when paying fines -// Parameters: -//• Amount: (total amount paid , including any broker fee) -//• BrokerPercentage(present if paid via a Broker) [JournalEntryType(JournalTypeEnum.PayFines)] public class JournalPayFines : JournalEntry, ILedgerJournalEntry { @@ -47,12 +43,11 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, (Faction_Localised.Length > 0 ? "Faction " + Faction_Localised : "") + " Broker " + BrokerPercentage.ToString("0.0") + "%", -Amount); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0", Amount, "< To ", Faction_Localised); + info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0".Txb(this), Amount, "< to ".Txb(this), Faction_Localised); if (BrokerPercentage > 0) - info += ", Broker took " + BrokerPercentage.ToString("0") + "%"; + info += string.Format(", Broker took {0:N0}%".Txb(this), BrokerPercentage); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPayLegacyFines.cs b/EliteDangerous/JournalEvents/JournalPayLegacyFines.cs index 223ee5a7a6..5a801b05f6 100644 --- a/EliteDangerous/JournalEvents/JournalPayLegacyFines.cs +++ b/EliteDangerous/JournalEvents/JournalPayLegacyFines.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When Written: when paying legacy fines - // Parameters: - //• Amount: (total amount paid , including any broker fee) - //• BrokerPercentage(present if paid via a Broker) [JournalEntryType(JournalTypeEnum.PayLegacyFines)] public class JournalPayLegacyFines : JournalEntry, ILedgerJournalEntry { @@ -38,12 +34,11 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "Broker " + BrokerPercentage.ToString("0.0") + "%", -Amount); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0", Amount); + info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0".Txb(this), Amount); if (BrokerPercentage > 0) - info += ", Broker took " + BrokerPercentage.ToString("0") + "%"; + info += string.Format(", Broker took {0:N0}%".Txb(this), BrokerPercentage); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplay.cs b/EliteDangerous/JournalEvents/JournalPowerplay.cs index 3092a6ad45..f5c040013d 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplay.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplay.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when collecting powerplay commodities for delivery - //Parameters: - //• Power: name of power - //• Type: type of commodity - //• Count: number of units [JournalEntryType(JournalTypeEnum.Powerplay)] public class JournalPowerplay : JournalEntry { @@ -45,10 +40,9 @@ public JournalPowerplay(JObject evt) : base(evt, JournalTypeEnum.Powerplay) public TimeSpan TimePledgedSpan { get; set; } public string TimePledgedString { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Power, "Rank:", Rank, "Merits:", Merits, "Votes:", Votes, "Pledged:" , TimePledgedString); + info = BaseUtils.FieldBuilder.Build("", Power, "Rank:".Txb(this), Rank, "Merits:".Txb(this), Merits, "Votes:".Txb(this), Votes, "Pledged:".Txb(this), TimePledgedString); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayCollect.cs b/EliteDangerous/JournalEvents/JournalPowerplayCollect.cs index ba96ac0a55..586c88571e 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayCollect.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayCollect.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when collecting powerplay commodities for delivery - //Parameters: - //• Power: name of power - //• Type: type of commodity - //• Count: number of units [JournalEntryType(JournalTypeEnum.PowerplayCollect)] public class JournalPowerplayCollect : JournalEntry { @@ -39,10 +34,9 @@ public JournalPowerplayCollect(JObject evt) : base(evt, JournalTypeEnum.Powerpla public string Type_Localised { get; set; } public int Count { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Power, "Type:", Type_Localised, "Count:", Count); + info = BaseUtils.FieldBuilder.Build("", Power, "Type:".Txb(this), Type_Localised, "Count:".Txb(this), Count); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayDefect.cs b/EliteDangerous/JournalEvents/JournalPowerplayDefect.cs index c103630931..d7412045ae 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayDefect.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayDefect.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when a player defects from one power to another - //Parameters: - //• FromPower - //• ToPower [JournalEntryType(JournalTypeEnum.PowerplayDefect)] public class JournalPowerplayDefect : JournalEntry { @@ -29,16 +25,14 @@ public JournalPowerplayDefect(JObject evt) : base(evt, JournalTypeEnum.Powerplay { FromPower = evt["FromPower"].Str(); ToPower = evt["ToPower"].Str(); - } public string FromPower { get; set; } public string ToPower { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("From:", FromPower, "To:", ToPower); + info = BaseUtils.FieldBuilder.Build("From Power:".Txb(this), FromPower, "To Power:".Txb(this), ToPower); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayDeliver.cs b/EliteDangerous/JournalEvents/JournalPowerplayDeliver.cs index f0138969f4..419fe053d4 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayDeliver.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayDeliver.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when delivering powerplay commodities - //Parameters: - //• Power - //• Type - //• Count [JournalEntryType(JournalTypeEnum.PowerplayDeliver)] public class JournalPowerplayDeliver : JournalEntry { @@ -32,17 +27,16 @@ public JournalPowerplayDeliver(JObject evt) : base(evt, JournalTypeEnum.Powerpla Type = evt["Type"].Str(); Type_Localised = JournalFieldNaming.CheckLocalisation(evt["Type_Localised"].Str(),Type); Count = evt["Count"].Int(); - } + public string Power { get; set; } public string Type { get; set; } public string Type_Localised { get; set; } public int Count { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Power, "Type:", Type_Localised, "Count:", Count); + info = BaseUtils.FieldBuilder.Build("", Power, "Type:".Txb(this), Type_Localised, "Count:".Txb(this), Count); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayFastTrack.cs b/EliteDangerous/JournalEvents/JournalPowerplayFastTrack.cs index 19b59e93c8..b26fedebb1 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayFastTrack.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayFastTrack.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when paying to fast-track allocation of commodities - //Parameters: - //• Power - //• Cost [JournalEntryType(JournalTypeEnum.PowerplayFastTrack)] public class JournalPowerplayFastTrack : JournalEntry, ILedgerJournalEntry { @@ -29,8 +25,8 @@ public JournalPowerplayFastTrack(JObject evt) : base(evt, JournalTypeEnum.Powerp { Power = evt["Power"].Str(); Cost = evt["Cost"].Long(); - } + public string Power { get; set; } public long Cost { get; set; } @@ -39,10 +35,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Power, -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Power, "Cost:; cr;N0", Cost); + info = BaseUtils.FieldBuilder.Build("", Power, "Cost:; cr;N0".Txb(this), Cost); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayJoin.cs b/EliteDangerous/JournalEvents/JournalPowerplayJoin.cs index 76763584c1..ba6b55b655 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayJoin.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayJoin.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,22 +18,18 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when joining up with a power - //Parameters: - //• Power [JournalEntryType(JournalTypeEnum.PowerplayJoin)] public class JournalPowerplayJoin : JournalEntry { public JournalPowerplayJoin(JObject evt) : base(evt, JournalTypeEnum.PowerplayJoin) { Power = evt["Power"].Str(); - } + public string Power { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Power; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayLeave.cs b/EliteDangerous/JournalEvents/JournalPowerplayLeave.cs index 5af2406b81..f48bbc8f6b 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayLeave.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayLeave.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,22 +18,18 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when leaving a power - //Parameters: - //• Power [JournalEntryType(JournalTypeEnum.PowerplayLeave)] public class JournalPowerplayLeave : JournalEntry { public JournalPowerplayLeave(JObject evt) : base(evt, JournalTypeEnum.PowerplayLeave) { Power = evt["Power"].Str(); - } + public string Power { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Power; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalPowerplaySalary.cs b/EliteDangerous/JournalEvents/JournalPowerplaySalary.cs index 7e26b3b943..5a08b117b8 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplaySalary.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplaySalary.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when receiving salary payment from a power - //Parameters: - //• Power - //• Amount [JournalEntryType(JournalTypeEnum.PowerplaySalary)] public class JournalPowerplaySalary : JournalEntry, ILedgerJournalEntry { @@ -30,6 +26,7 @@ public JournalPowerplaySalary(JObject evt) : base(evt, JournalTypeEnum.Powerplay Power = evt["Power"].Str(); Amount = evt["Amount"].Long(); } + public string Power { get; set; } public long Amount { get; set; } @@ -38,10 +35,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Power, Amount); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Power, "Amount:; cr;N0", Amount); + info = BaseUtils.FieldBuilder.Build("", Power, "Amount:; cr;N0".Txb(this), Amount); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayVote.cs b/EliteDangerous/JournalEvents/JournalPowerplayVote.cs index a594e4c5fe..15bc72e0f0 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayVote.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayVote.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when voting for a system expansion - //Parameters: - //• Power - //• Votes - //• System [JournalEntryType(JournalTypeEnum.PowerplayVote)] public class JournalPowerplayVote : JournalEntry { @@ -32,14 +27,14 @@ public JournalPowerplayVote(JObject evt) : base(evt, JournalTypeEnum.PowerplayVo System = evt["System"].Str(); Votes = evt["Votes"].Int(); } + public string Power { get; set; } public string System { get; set; } public int Votes { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Power, "System:", System, "Votes:", Votes); + info = BaseUtils.FieldBuilder.Build("", Power, "System:".Txb(this), System, "Votes:".Txb(this), Votes); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPowerplayVoucher.cs b/EliteDangerous/JournalEvents/JournalPowerplayVoucher.cs index 710ae3212e..33066e5a48 100644 --- a/EliteDangerous/JournalEvents/JournalPowerplayVoucher.cs +++ b/EliteDangerous/JournalEvents/JournalPowerplayVoucher.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when receiving payment for powerplay combat - //Parameters: - //• Power - //• Systems:[name,name] [JournalEntryType(JournalTypeEnum.PowerplayVoucher)] public class JournalPowerplayVoucher : JournalEntry { @@ -34,13 +30,13 @@ public JournalPowerplayVoucher(JObject evt) : base(evt, JournalTypeEnum.Powerpla public string Power { get; set; } public string[] Systems { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Power; + if ( Systems!=null) { - info += ", Systems:"; + info += ", Systems:".Txb(this); bool comma = false; foreach( string s in Systems) diff --git a/EliteDangerous/JournalEvents/JournalProgress.cs b/EliteDangerous/JournalEvents/JournalProgress.cs index 1edf1faaf2..519e5dbb68 100644 --- a/EliteDangerous/JournalEvents/JournalProgress.cs +++ b/EliteDangerous/JournalEvents/JournalProgress.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,18 +18,9 @@ namespace EliteDangerousCore.JournalEvents { - //When written: at startup - //Parameters: - //• Combat: percent progress to next rank - //• Trade: “ - //• Explore: “ - //• Empire: “ - //• Federation: “ - //• CQC: “ ranks: 0=’Helpless’, 1=’Mostly Helpless’, 2=’Amateur’, 3=’Semi Professional’, 4=’Professional’, 5=’Champion’, 6=’Hero’, 7=’Legend’, 8=’Elite’ [JournalEntryType(JournalTypeEnum.Progress)] public class JournalProgress : JournalEntry { - public JournalProgress(JObject evt ) : base(evt, JournalTypeEnum.Progress) { Combat = evt["Combat"].Int(); @@ -47,15 +38,14 @@ public JournalProgress(JObject evt ) : base(evt, JournalTypeEnum.Progress) public int Federation { get; set; } public int CQC { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Combat:;%", Combat, - "Trade:;%", Trade, - "Exploration:;%", Explore, - "Federation:;%", Federation, - "Empire:;%", Empire, - "CQC:;%", CQC); + info = BaseUtils.FieldBuilder.Build("Combat:;%".Tx(this), Combat, + "Trade:;%".Tx(this), Trade, + "Exploration:;%".Tx(this), Explore, + "Federation:;%".Tx(this), Federation, + "Empire:;%".Tx(this), Empire, + "CQC:;%".Tx(this), CQC); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalPromotion.cs b/EliteDangerous/JournalEvents/JournalPromotion.cs index adb6186de5..864586a868 100644 --- a/EliteDangerous/JournalEvents/JournalPromotion.cs +++ b/EliteDangerous/JournalEvents/JournalPromotion.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,13 +21,6 @@ namespace EliteDangerousCore.JournalEvents [JournalEntryType(JournalTypeEnum.Promotion)] public class JournalPromotion : JournalEntry { - // When written: when the player’s rank increases - //Parameters: one of the following - //• Combat: new rank - //• Trade: new rank - //• Explore: new rank - //• CQC: new rank - public JournalPromotion(JObject evt) : base(evt, JournalTypeEnum.Promotion) { int? c = evt["Combat"].IntNull(); @@ -62,15 +55,14 @@ public JournalPromotion(JObject evt) : base(evt, JournalTypeEnum.Promotion) public FederationRank? Federation { get; set; } public EmpireRank? Empire { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Combat:", Combat.HasValue ? Combat.ToString() : null, - "Trade:", Trade.HasValue ? Trade.ToString() : null, - "Exploration:", Explore.HasValue ? Explore.ToString() : null, - "Empire:", Empire.HasValue ? Empire.ToString() : null, - "Federation:", Federation.HasValue ? Federation.ToString() : null, - "CQC:", CQC.HasValue ? CQC.ToString() : null); + info = BaseUtils.FieldBuilder.Build("Combat:".Tx(this), Combat.HasValue ? Combat.ToString() : null, + "Trade:".Tx(this), Trade.HasValue ? Trade.ToString() : null, + "Exploration:".Tx(this), Explore.HasValue ? Explore.ToString() : null, + "Empire:".Tx(this), Empire.HasValue ? Empire.ToString() : null, + "Federation:".Tx(this), Federation.HasValue ? Federation.ToString() : null, + "CQC:".Tx(this), CQC.HasValue ? CQC.ToString() : null); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalQuitACrew.cs b/EliteDangerous/JournalEvents/JournalQuitACrew.cs index d2518e84af..e3ded53f8a 100644 --- a/EliteDangerous/JournalEvents/JournalQuitACrew.cs +++ b/EliteDangerous/JournalEvents/JournalQuitACrew.cs @@ -18,25 +18,19 @@ namespace EliteDangerousCore.JournalEvents { -// When written: When you leave another player ship's crew -//Parameters: -//• Captain: Helm player's commander name - - [JournalEntryType(JournalTypeEnum.QuitACrew)] public class JournalQuitACrew : JournalEntry { public JournalQuitACrew(JObject evt) : base(evt, JournalTypeEnum.QuitACrew) { Captain = evt["Captain"].Str(); - } + public string Captain { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Captain:",Captain); + info = BaseUtils.FieldBuilder.Build("Captain:".Txb(this),Captain); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalRank.cs b/EliteDangerous/JournalEvents/JournalRank.cs index fbccd6a6e2..d6600b0340 100644 --- a/EliteDangerous/JournalEvents/JournalRank.cs +++ b/EliteDangerous/JournalEvents/JournalRank.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,26 +18,9 @@ namespace EliteDangerousCore.JournalEvents { - //When written: at startup - //Parameters: - //• Combat: rank on scale 0-8 - //• Trade: rank on scale 0-8 - //• Explore: rank on scale 0-8 - //• Empire: military rank - //• Federation: military rank - //• CQC: rank on scale 0-8 - - //Ranks - //Combat ranks: 0='Harmless', 1='Mostly Harmless', 2='Novice', 3='Competent', 4='Expert', 5='Master', 6='Dangerous', 7='Deadly', 8='Elite’ - //Trade ranks: 0='Penniless', 1='Mostly Pennliess', 2='Peddler', 3='Dealer', 4='Merchant', 5='Broker', 6='Entrepreneur', 7='Tycoon', 8='Elite' - //Exploration ranks: 0='Aimless', 1='Mostly Aimless', 2='Scout', 3='Surveyor', 4='Explorer', 5='Pathfinder', 6='Ranger', 7='Pioneer', 8='Elite' - //Federation ranks: 0='None', 1='Recruit', 2='Cadet', 3='Midshipman', 4='Petty Officer', 5='Chief Petty Officer', 6='Warrant Officer', 7='Ensign', 8='Lieutenant', 9='Lt. Commander', 10='Post Commander', 11= 'Post Captain', 12= 'Rear Admiral', 13='Vice Admiral', 14=’Admiral’ - //Empire ranks: 0='None', 1='Outsider', 2='Serf', 3='Master', 4='Squire', 5='Knight', 6='Lord', 7='Baron', 8='Viscount ', 9=’Count', 10= 'Earl', 11='Marquis' 12='Duke', 13='Prince', 14=’King’ - //CQC ranks: 0=’Helpless’, 1=’Mostly Helpless’, 2=’Amateur’, 3=’Semi Professional’, 4=’Professional’, 5=’Champion’, 6=’Hero’, 7=’Legend’, 8=’Elite’ [JournalEntryType(JournalTypeEnum.Rank)] public class JournalRank : JournalEntry { - public JournalRank(JObject evt ) : base(evt, JournalTypeEnum.Rank) { Combat = (CombatRank)evt["Combat"].Int(); @@ -46,8 +29,8 @@ public JournalRank(JObject evt ) : base(evt, JournalTypeEnum.Rank) Empire = (EmpireRank)evt["Empire"].Int(); Federation = (FederationRank)evt["Federation"].Int(); CQC = (CQCRank)evt["CQC"].Int(); - } + public CombatRank Combat { get; set; } public TradeRank Trade { get; set; } public ExplorationRank Explore { get; set; } @@ -55,9 +38,8 @@ public JournalRank(JObject evt ) : base(evt, JournalTypeEnum.Rank) public FederationRank Federation { get; set; } public CQCRank CQC { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", Combat.ToString().SplitCapsWord(), "", Trade.ToString().SplitCapsWord(), "", Explore.ToString().SplitCapsWord(), diff --git a/EliteDangerous/JournalEvents/JournalRebootRepair.cs b/EliteDangerous/JournalEvents/JournalRebootRepair.cs index 4e0b0f0c93..6f686c536f 100644 --- a/EliteDangerous/JournalEvents/JournalRebootRepair.cs +++ b/EliteDangerous/JournalEvents/JournalRebootRepair.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when the ‘reboot repair’ function is used -// Parameters: -//• Modules: JSON array of names of modules repaired - [JournalEntryType(JournalTypeEnum.RebootRepair)] public class JournalRebootRepair : JournalEntry { @@ -40,9 +36,8 @@ public JournalRebootRepair(JObject evt) : base(evt, JournalTypeEnum.RebootRepair public string[] Slots { get; set; } public string[] FriendlySlots { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; if (FriendlySlots != null) info = string.Join(",", FriendlySlots); diff --git a/EliteDangerous/JournalEvents/JournalReceiveText.cs b/EliteDangerous/JournalEvents/JournalReceiveText.cs index 1b791a88ae..9550477513 100644 --- a/EliteDangerous/JournalEvents/JournalReceiveText.cs +++ b/EliteDangerous/JournalEvents/JournalReceiveText.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: when a text message is received from another player - //Parameters: - //• From - //• Message - [JournalEntryType(JournalTypeEnum.ReceiveText)] public class JournalReceiveText : JournalEntry { @@ -33,18 +28,17 @@ public JournalReceiveText(JObject evt) : base(evt, JournalTypeEnum.ReceiveText) Message = evt["Message"].Str(); MessageLocalised = JournalFieldNaming.CheckLocalisation(evt["Message_Localised"].Str(),Message); Channel = evt["Channel"].Str(); - } + public string From { get; set; } public string FromLocalised { get; set; } public string Message { get; set; } public string MessageLocalised { get; set; } public string Channel { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("From:", FromLocalised, "Msg:", MessageLocalised, "Channel:", Channel); + info = BaseUtils.FieldBuilder.Build("From:".Tx(this), FromLocalised, "Msg:".Tx(this), MessageLocalised, "Channel:".Tx(this), Channel); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalRedeemVoucher.cs b/EliteDangerous/JournalEvents/JournalRedeemVoucher.cs index b61d0d6bce..ca1bcbad44 100644 --- a/EliteDangerous/JournalEvents/JournalRedeemVoucher.cs +++ b/EliteDangerous/JournalEvents/JournalRedeemVoucher.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When Written: when claiming payment for combat bounties and bonds - //Parameters: - //• Type - //• Amount: (Net amount received, after any broker fee) - //• Faction: name of faction - //• BrokerPercenentage [JournalEntryType(JournalTypeEnum.RedeemVoucher)] public class JournalRedeemVoucher : JournalEntry, ILedgerJournalEntry { @@ -34,6 +28,7 @@ public JournalRedeemVoucher(JObject evt) : base(evt, JournalTypeEnum.RedeemVouch Faction = evt["Faction"].Str(); BrokerPercentage = evt["BrokerPercentage"].Double(); } + public string Type { get; set; } public long Amount { get; set; } public string Faction { get; set; } @@ -44,12 +39,11 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Type + " Broker " + BrokerPercentage.ToString("0.0") + "%", Amount); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Type:" , Type , "Amount:; cr;N0", Amount, "Faction:" , Faction); + info = BaseUtils.FieldBuilder.Build("Type:".Txb(this), Type , "Amount:; cr;N0".Txb(this), Amount, "Faction:".Txb(this), Faction); if (BrokerPercentage > 0) - info += ", Broker took " + BrokerPercentage.ToString("0") + "%"; + info += string.Format(", Broker took {0:N0}%".Txb(this), BrokerPercentage); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalRefuelAll.cs b/EliteDangerous/JournalEvents/JournalRefuelAll.cs index e492a6e373..750761b980 100644 --- a/EliteDangerous/JournalEvents/JournalRefuelAll.cs +++ b/EliteDangerous/JournalEvents/JournalRefuelAll.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.RefuelAll)] public class JournalRefuelAll : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -37,13 +32,12 @@ public JournalRefuelAll(JObject evt ) : base(evt, JournalTypeEnum.RefuelAll) public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) { - mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "Amount " + Amount.ToString() + "t", -Cost); + mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Amount.ToString() + "t", -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0", Cost, "Fuel:; tons;0.0", Amount); + info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0".Txb(this), Cost, "Fuel:; tons;0.0".Txb(this), Amount); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalRefuelPartial.cs b/EliteDangerous/JournalEvents/JournalRefuelPartial.cs index 0bc4530de4..bd2a67d16f 100644 --- a/EliteDangerous/JournalEvents/JournalRefuelPartial.cs +++ b/EliteDangerous/JournalEvents/JournalRefuelPartial.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.RefuelPartial)] public class JournalRefuelPartial : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -31,18 +26,18 @@ public JournalRefuelPartial(JObject evt ) : base(evt, JournalTypeEnum.RefuelPart Cost = evt["Cost"].Long(); Amount = evt["Amount"].Int(); } + public long Cost { get; set; } public int Amount { get; set; } public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) { - mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "Amount " + Amount.ToString() +"t", -Cost); + mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Amount.ToString() +"t", -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0", Cost, "Fuel:; tons;0.0", Amount); + info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0".Txb(this), Cost, "Fuel:; tons;0.0".Txb(this), Amount); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalRepair.cs b/EliteDangerous/JournalEvents/JournalRepair.cs index 1c60ce4274..a98e1eb75e 100644 --- a/EliteDangerous/JournalEvents/JournalRepair.cs +++ b/EliteDangerous/JournalEvents/JournalRepair.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when repairing the ship - //Parameters: - //• Item: all, wear, hull, paint, or name of module - //• Cost: cost of repair [JournalEntryType(JournalTypeEnum.Repair)] public class JournalRepair : JournalEntry, ILedgerJournalEntry { @@ -43,10 +39,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Item, -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("",ItemLocalised, "Cost:; cr;N0" , Cost ); + info = BaseUtils.FieldBuilder.Build("",ItemLocalised, "Cost:; cr;N0".Txb(this) , Cost ); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalRepairAll.cs b/EliteDangerous/JournalEvents/JournalRepairAll.cs index 088f290d7f..5993dcf12a 100644 --- a/EliteDangerous/JournalEvents/JournalRepairAll.cs +++ b/EliteDangerous/JournalEvents/JournalRepairAll.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,18 +18,14 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when repairing the ship - //Parameters: - //• Item: all, wear, hull, paint, or name of module - //• Cost: cost of repair [JournalEntryType(JournalTypeEnum.RepairAll)] public class JournalRepairAll : JournalEntry, ILedgerJournalEntry { public JournalRepairAll(JObject evt) : base(evt, JournalTypeEnum.RepairAll) { Cost = evt["Cost"].Long(); - } + public long Cost { get; set; } public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) @@ -37,10 +33,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, "", -Cost); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0",Cost); + info = BaseUtils.FieldBuilder.Build("Cost:; cr;N0".Txb(this) ,Cost); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalRepairDrone.cs b/EliteDangerous/JournalEvents/JournalRepairDrone.cs index afc622ef5e..61e7d5622d 100644 --- a/EliteDangerous/JournalEvents/JournalRepairDrone.cs +++ b/EliteDangerous/JournalEvents/JournalRepairDrone.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,14 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - /* - When written: when the player's ship has been repaired by a repair drone - Parameters: -  HullRepaired -  CockpitRepaired -  CorrosionRepaired - Each of these is a number indicating the amount of damage that has been repaired - */ [JournalEntryType(JournalTypeEnum.RepairDrone)] public class JournalRepairDrone : JournalEntry { @@ -40,10 +32,10 @@ public JournalRepairDrone(JObject evt ) : base(evt, JournalTypeEnum.RepairDrone) public double CockpitRepaired { get; set; } public double CorrosionRepaired { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Hull:", HullRepaired.ToString("0.0"), "Cockpit:", CockpitRepaired.ToString("0.0"), "Corrosion:", CorrosionRepaired.ToString("0.0")); + info = BaseUtils.FieldBuilder.Build("Hull:".Tx(this), HullRepaired.ToString("0.0"), "Cockpit:".Txb(this), CockpitRepaired.ToString("0.0"), + "Corrosion:".Txb(this), CorrosionRepaired.ToString("0.0")); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalReputation.cs b/EliteDangerous/JournalEvents/JournalReputation.cs index 51425048e5..eded8ed39f 100644 --- a/EliteDangerous/JournalEvents/JournalReputation.cs +++ b/EliteDangerous/JournalEvents/JournalReputation.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: target is under attack - //Parameters: - //* Target [JournalEntryType(JournalTypeEnum.Reputation)] public class JournalReputation : JournalEntry { @@ -37,10 +34,9 @@ public JournalReputation(JObject evt ) : base(evt, JournalTypeEnum.Reputation) public double? Independent { get; set; } public double? Alliance { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Federation:;;0.#",Federation , "Empire:;;0.#" , Empire, "Independent:;;0.#", Independent , "Alliance:;;0.#", Alliance); + info = BaseUtils.FieldBuilder.Build("Federation:;;0.#".Tx(this), Federation , "Empire:;;0.#".Tx(this), Empire, "Independent:;;0.#".Tx(this), Independent , "Alliance:;;0.#".Tx(this), Alliance); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalRestockVehicle.cs b/EliteDangerous/JournalEvents/JournalRestockVehicle.cs index b03d94a9f7..854550f63a 100644 --- a/EliteDangerous/JournalEvents/JournalRestockVehicle.cs +++ b/EliteDangerous/JournalEvents/JournalRestockVehicle.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when purchasing an SRV or Fighter - //Parameters: - //• Type: type of vehicle being purchased (SRV or fighter model) - //• Loadout: variant - //• Cost: purchase cost - //• Count: number of vehicles purchased [JournalEntryType(JournalTypeEnum.RestockVehicle)] public class JournalRestockVehicle : JournalEntry, ILedgerJournalEntry { @@ -34,6 +28,7 @@ public JournalRestockVehicle(JObject evt ) : base(evt, JournalTypeEnum.RestockVe Cost = evt["Cost"].Long(); Count = evt["Count"].Int(); } + public string Type { get; set; } public string Loadout { get; set; } public long Cost { get; set; } @@ -46,10 +41,9 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) protected override JournalTypeEnum IconEventType { get { return Type.Contains("SRV") ? JournalTypeEnum.RestockVehicle_SRV : JournalTypeEnum.RestockVehicle_Fighter; } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("",Type , "Cost:; cr;N0" , Cost , "Count:" , Count , "Loadout:" , Loadout); + info = BaseUtils.FieldBuilder.Build("",Type , "Cost:; cr;N0".Txb(this), Cost , "Count:".Txb(this), Count , "Loadout:".Txb(this), Loadout); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalResurrect.cs b/EliteDangerous/JournalEvents/JournalResurrect.cs index abfacbc450..713a339c18 100644 --- a/EliteDangerous/JournalEvents/JournalResurrect.cs +++ b/EliteDangerous/JournalEvents/JournalResurrect.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when the player restarts after death - //Parameters: - //• Option: the option selected on the insurance rebuy screen - //• Cost: the price paid - //• Bankrupt: whether the commander declared bankruptcy [JournalEntryType(JournalTypeEnum.Resurrect)] public class JournalResurrect : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -47,9 +42,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.Resurrect(Option.Equals("free", System.StringComparison.InvariantCultureIgnoreCase)); // if free, we did not rebuy the ship } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Option:", Option, "Cost:; cr;N0", Cost, ";Bankrupt", Bankrupt); + info = BaseUtils.FieldBuilder.Build("Option:".Txb(this), Option, "Cost:; cr;N0".Txb(this), Cost, ";Bankrupt".Txb(this), Bankrupt); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalSRVDestroyed.cs b/EliteDangerous/JournalEvents/JournalSRVDestroyed.cs index a5df90d876..ab17bfe097 100644 --- a/EliteDangerous/JournalEvents/JournalSRVDestroyed.cs +++ b/EliteDangerous/JournalEvents/JournalSRVDestroyed.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,14 +18,11 @@ namespace EliteDangerousCore.JournalEvents { - //When written: SRV is destroyed - //Parameters: none [JournalEntryType(JournalTypeEnum.SRVDestroyed)] public class JournalSRVDestroyed : JournalEntry, IShipInformation { public JournalSRVDestroyed(JObject evt ) : base(evt, JournalTypeEnum.SRVDestroyed) { - } public void ShipInformation(ShipInformationList shp, string whereami, ISystem system, DB.SQLiteConnectionUser conn) @@ -33,9 +30,8 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.DestroyedSRV(); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalScan.cs b/EliteDangerous/JournalEvents/JournalScan.cs index ea1b21086a..3c79f10d22 100644 --- a/EliteDangerous/JournalEvents/JournalScan.cs +++ b/EliteDangerous/JournalEvents/JournalScan.cs @@ -22,44 +22,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: detailed discovery scan of a star, planet or moon - //Parameters(star) - //• Bodyname: name of body - //• DistanceFromArrivalLS - //• StarType: Stellar classification (for a star) - //• StellarMass: mass as multiple of Sol’s mass - //• Radius - //• AbsoluteMagnitude - //• OrbitalPeriod (seconds) - //• RotationPeriod (seconds) - //• Rings: [ array ] - if present - // - //Parameters(Planet/Moon) - //• Bodyname: name of body - //• DistanceFromArrivalLS - //• TidalLock: 1 if tidally locked - //• TerraformState: Terraformable, Terraforming, Terraformed, or null - //• PlanetClass - //• Atmosphere - //• Volcanism - //• SurfaceGravity - //• SurfaceTemperature - //• SurfacePressure - //• Landable: true (if landable) - //• Materials: JSON object with material names and percentage occurrence - //• OrbitalPeriod (seconds) - //• RotationPeriod (seconds) - //• Rings [ array of info ] - if rings present - //• ReserveLevel: (Pristine/Major/Common/Low/Depleted) – if rings present - //• Composition - // - // Rings properties - //• Name - //• RingClass - //• MassMT - ie in megatons - //• InnerRad - //• OuterRad - // [JournalEntryType(JournalTypeEnum.Scan)] public class JournalScan : JournalEntry { @@ -160,24 +122,24 @@ public class StarPlanetRing public string RingInformation(double scale = 1, string scaletype = " MT", bool parentIsStar = false) { StringBuilder scanText = new StringBuilder(); - scanText.AppendFormat(" {0} ({1})\n", Name.Alt("Unknown"), DisplayStringFromRingClass(RingClass)); - scanText.AppendFormat(" Mass: {0}{1}\n", (MassMT * scale).ToString("N4"), scaletype); + scanText.AppendFormat(" {0} ({1})\n", Name.Alt("Unknown".Tx()), DisplayStringFromRingClass(RingClass)); + scanText.AppendFormat(" Mass: {0:N4}{1}\n".Tx(typeof(StarPlanetRing)), MassMT * scale, scaletype); if (parentIsStar && InnerRad > 3000000) { - scanText.AppendFormat(" Inner Radius: {0:0.00}ls\n", (InnerRad / oneLS_m)); - scanText.AppendFormat(" Outer Radius: {0:0.00}ls\n", (OuterRad / oneLS_m)); + scanText.AppendFormat(" Inner Radius: {0:0.00}ls\n".Tx(typeof(StarPlanetRing)), (InnerRad / oneLS_m)); + scanText.AppendFormat(" Outer Radius: {0:0.00}ls\n".Tx(typeof(StarPlanetRing)), (OuterRad / oneLS_m)); } else { - scanText.AppendFormat(" Inner Radius: {0}km\n", (InnerRad / 1000).ToString("N0")); - scanText.AppendFormat(" Outer Radius: {0}km\n", (OuterRad / 1000).ToString("N0")); + scanText.AppendFormat(" Inner Radius: {0}km\n".Tx(typeof(StarPlanetRing),"IK"), (InnerRad / 1000).ToString("N0")); + scanText.AppendFormat(" Outer Radius: {0}km\n".Tx(typeof(StarPlanetRing),"OK"), (OuterRad / 1000).ToString("N0")); } return scanText.ToNullSafeString(); } public string RingInformationMoons(bool parentIsStar = false) { - return RingInformation(1 / oneMoon_MT, " Moons", parentIsStar); + return RingInformation(1 / oneMoon_MT, " Moons".Tx(typeof(StarPlanetRing)), parentIsStar); } public static string DisplayStringFromRingClass(string ringClass) @@ -185,17 +147,17 @@ public static string DisplayStringFromRingClass(string ringClass) switch (ringClass) { case null: - return "Unknown"; + return "Unknown".Tx(); case "eRingClass_Icy": - return "Icy"; + return "Icy".Tx(typeof(StarPlanetRing)); case "eRingClass_Rocky": - return "Rocky"; + return "Rocky".Tx(typeof(StarPlanetRing)); case "eRingClass_MetalRich": - return "Metal Rich"; + return "Metal Rich".Tx(typeof(StarPlanetRing)); case "eRingClass_Metalic": - return "Metallic"; + return "Metallic".Tx(typeof(StarPlanetRing)); case "eRingClass_RockyIce": - return "Rocky Ice"; + return "Rocky Ice".Tx(typeof(StarPlanetRing)); default: return ringClass.Replace("eRingClass_", ""); } @@ -354,12 +316,11 @@ public JournalScan(JObject evt) : base(evt, JournalTypeEnum.Scan) EDSMDiscoveryUTC = discovery["date"].DateTimeUTC(); } - } - + } - public override string FillSummary { get { return "Scan of " + BodyName; } } + public override string FillSummary { get { return string.Format("Scan of {0}".Tx(this), BodyName); } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { if (IsStar) { @@ -367,7 +328,9 @@ public JournalScan(JObject evt) : base(evt, JournalTypeEnum.Scan) if (r.HasValue) r = r / solarRadius_m; - info = BaseUtils.FieldBuilder.Build("", GetStarTypeName(), "Mass:;SM;0.00", nStellarMass, "Age:;my;0.0", nAge, "Radius:;SR;0.00", r); + info = BaseUtils.FieldBuilder.Build("", GetStarTypeName(), "Mass:;SM;0.00".Tx(this,"MSM"), nStellarMass, + "Age:;my;0.0".Tx(this), nAge, + "Radius:;SR;0.00".Tx(this,"RS"), r); } else { @@ -378,7 +341,10 @@ public JournalScan(JObject evt) : base(evt, JournalTypeEnum.Scan) if (g.HasValue) g = g / oneGee_m_s2; - info = BaseUtils.FieldBuilder.Build("", PlanetClass, "Mass:;EM;0.00", nMassEM, "<;, Landable", IsLandable, "<;, Terraformable", TerraformState == "Terraformable", "", Atmosphere, "Gravity:;G;0.0", g, "Radius:;km;0", r); + info = BaseUtils.FieldBuilder.Build("", PlanetClass, "Mass:;EM;0.00".Tx(this,"MEM"), nMassEM, + "<;, Landable".Tx(this), IsLandable, + "<;, Terraformable".Tx(this), TerraformState == "Terraformable", "", Atmosphere, + "Gravity:;G;0.0".Tx(this), g, "Radius:;km;0".Tx(this,"RK"), r); } detailed = DisplayString(0, false); @@ -412,12 +378,12 @@ public string DisplayString(int indent = 0, bool includefront = true , MaterialC if (!PlanetClass.ToLower().Contains("gas")) { - scanText.AppendFormat((Atmosphere == null || Atmosphere == String.Empty) ? ", No Atmosphere" : (", " + Atmosphere)); + scanText.AppendFormat((Atmosphere == null || Atmosphere == String.Empty) ? ", No Atmosphere".Tx(this) : (", " + Atmosphere)); } } if (IsLandable) - scanText.AppendFormat(", Landable"); + scanText.AppendFormat(", Landable".Tx(this,"LandC")); scanText.AppendFormat("\n"); @@ -431,89 +397,97 @@ public string DisplayString(int indent = 0, bool includefront = true , MaterialC scanText.Append("\n\n"); if (nAge.HasValue) - scanText.AppendFormat("Age: {0} million years\n", nAge.Value.ToString("N0")); + scanText.AppendFormat("Age: {0} my\n".Tx(this,"AMY"), nAge.Value.ToString("N0")); if (nStellarMass.HasValue) - scanText.AppendFormat("Solar Masses: {0:0.00}\n", nStellarMass.Value); + scanText.AppendFormat("Solar Masses: {0:0.00}\n".Tx(this), nStellarMass.Value); if (nMassEM.HasValue) - scanText.AppendFormat("Earth Masses: {0:0.0000}\n", nMassEM.Value); + scanText.AppendFormat("Earth Masses: {0:0.0000}\n".Tx(this), nMassEM.Value); if (nRadius.HasValue) { if (IsStar) - scanText.AppendFormat("Solar Radius: {0:0.00} Sols\n", (nRadius.Value / solarRadius_m)); + scanText.AppendFormat("Solar Radius: {0:0.00} Sols\n".Tx(this), (nRadius.Value / solarRadius_m)); else - scanText.AppendFormat("Body Radius: {0:0.00}km\n", (nRadius.Value / 1000)); + scanText.AppendFormat("Body Radius: {0:0.00}km\n".Tx(this), (nRadius.Value / 1000)); } } if (nSurfaceTemperature.HasValue) - scanText.AppendFormat("Surface Temp: {0}K\n", nSurfaceTemperature.Value.ToString("N0")); + scanText.AppendFormat("Surface Temp: {0}K\n".Tx(this), nSurfaceTemperature.Value.ToString("N0")); if (Luminosity != null) - scanText.AppendFormat("Luminosity: {0}\n", Luminosity); + scanText.AppendFormat("Luminosity: {0}\n".Tx(this), Luminosity); if (nSurfaceGravity.HasValue) - scanText.AppendFormat("Gravity: {0:0.0}g\n", nSurfaceGravity.Value / oneGee_m_s2); + scanText.AppendFormat("Gravity: {0:0.0}g\n".Tx(this,"GV"), nSurfaceGravity.Value / oneGee_m_s2); if (nSurfacePressure.HasValue && nSurfacePressure.Value > 0.00 && !PlanetClass.ToLower().Contains("gas")) - if (nSurfacePressure.Value > 1000) { scanText.AppendFormat("Surface Pressure: {0} Atmospheres\n", (nSurfacePressure.Value / oneAtmosphere_Pa).ToString("N2")); } - else { { scanText.AppendFormat("Surface Pressure: {0} Pa\n", (nSurfacePressure.Value).ToString("N2")); } } + { + if (nSurfacePressure.Value > 1000) + { + scanText.AppendFormat("Surface Pressure: {0} Atmospheres\n".Tx(this,"SPA"), (nSurfacePressure.Value / oneAtmosphere_Pa).ToString("N2")); + } + else + { + scanText.AppendFormat("Surface Pressure: {0} Pa\n".Tx(this,"SPP"), (nSurfacePressure.Value).ToString("N2")); + } + } if (Volcanism != null) - scanText.AppendFormat("Volcanism: {0}\n", Volcanism == String.Empty ? "No Volcanism" : System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo. + scanText.AppendFormat("Volcanism: {0}\n".Tx(this), Volcanism == String.Empty ? "No Volcanism".Tx(this) : System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo. ToTitleCase(Volcanism.ToLower())); if (DistanceFromArrivalLS > 0) - scanText.AppendFormat("Distance from Arrival Point {0:N1}ls\n", DistanceFromArrivalLS); + scanText.AppendFormat("Distance from Arrival Point {0:N1}ls\n".Tx(this), DistanceFromArrivalLS); if (nOrbitalPeriod.HasValue && nOrbitalPeriod > 0) - scanText.AppendFormat("Orbital Period: {0} days\n", (nOrbitalPeriod.Value / oneDay_s).ToString("N1")); + scanText.AppendFormat("Orbital Period: {0} days\n".Tx(this), (nOrbitalPeriod.Value / oneDay_s).ToString("N1")); if (nSemiMajorAxis.HasValue) { if (IsStar || nSemiMajorAxis.Value > oneAU_m / 10) - scanText.AppendFormat("Semi Major Axis: {0:0.00}AU\n", (nSemiMajorAxis.Value / oneAU_m)); + scanText.AppendFormat("Semi Major Axis: {0:0.00}AU\n".Tx(this,"SMA"), (nSemiMajorAxis.Value / oneAU_m)); else - scanText.AppendFormat("Semi Major Axis: {0}km\n", (nSemiMajorAxis.Value / 1000).ToString("N1")); + scanText.AppendFormat("Semi Major Axis: {0}km\n".Tx(this,"SMK"), (nSemiMajorAxis.Value / 1000).ToString("N1")); } if (nEccentricity.HasValue) - scanText.AppendFormat("Orbital Eccentricity: {0:0.000}\n", nEccentricity.Value); + scanText.AppendFormat("Orbital Eccentricity: {0:0.000}\n".Tx(this), nEccentricity.Value); if (nOrbitalInclination.HasValue) - scanText.AppendFormat("Orbital Inclination: {0:0.000}°\n", nOrbitalInclination.Value); + scanText.AppendFormat("Orbital Inclination: {0:0.000}°\n".Tx(this), nOrbitalInclination.Value); if (nPeriapsis.HasValue) - scanText.AppendFormat("Arg Of Periapsis: {0:0.000}°\n", nPeriapsis.Value); + scanText.AppendFormat("Arg Of Periapsis: {0:0.000}°\n".Tx(this), nPeriapsis.Value); if (nAbsoluteMagnitude.HasValue) - scanText.AppendFormat("Absolute Magnitude: {0:0.00}\n", nAbsoluteMagnitude.Value); + scanText.AppendFormat("Absolute Magnitude: {0:0.00}\n".Tx(this), nAbsoluteMagnitude.Value); if (nAxialTilt.HasValue) - scanText.AppendFormat("Axial tilt: {0:0.00}°\n", nAxialTilt.Value*180.0/Math.PI); + scanText.AppendFormat("Axial tilt: {0:0.00}°\n".Tx(this), nAxialTilt.Value*180.0/Math.PI); if (nRotationPeriod.HasValue) - scanText.AppendFormat("Rotation Period: {0} days\n", (nRotationPeriod.Value / oneDay_s).ToString("N1")); + scanText.AppendFormat("Rotation Period: {0} days\n".Tx(this), (nRotationPeriod.Value / oneDay_s).ToString("N1")); if (nTidalLock.HasValue && nTidalLock.Value) - scanText.Append("Tidally locked\n"); + scanText.Append("Tidally locked\n".Tx(this)); if (Terraformable) - scanText.Append("Candidate for terraforming\n"); + scanText.Append("Candidate for terraforming\n".Tx(this)); if (HasRings) { scanText.Append("\n"); if (IsStar) { - scanText.AppendFormat("Belt{0}", Rings.Count() == 1 ? ":" : "s:"); + scanText.AppendFormat("Belt{0}".Tx(this), Rings.Count() == 1 ? ":" : "s:"); for (int i = 0; i < Rings.Length; i++) { if (Rings[i].MassMT > (oneMoon_MT / 10000)) { - scanText.Append("\n" + RingInformation(i, 1.0 / oneMoon_MT, " Moons")); + scanText.Append("\n" + RingInformation(i, 1.0 / oneMoon_MT, " Moons".Tx(this))); } else { @@ -523,7 +497,7 @@ public string DisplayString(int indent = 0, bool includefront = true , MaterialC } else { - scanText.AppendFormat("Ring{0}", Rings.Count() == 1 ? ":" : "s:"); + scanText.AppendFormat("Ring{0}".Tx(this), Rings.Count() == 1 ? ":" : "s:"); for (int i = 0; i < Rings.Length; i++) scanText.Append("\n" + RingInformation(i)); @@ -543,10 +517,10 @@ public string DisplayString(int indent = 0, bool includefront = true , MaterialC scanText.Remove(scanText.Length - 1, 1); if (EstimatedValue > 0) - scanText.AppendFormat("\nEstimated value: {0:N0}", EstimatedValue); + scanText.AppendFormat("\nEstimated value: {0:N0}".Tx(this,"EV"), EstimatedValue); if (EDSMDiscoveryCommander != null) - scanText.AppendFormat("\n\nDiscovered by {0} on {1}", EDSMDiscoveryCommander, EDSMDiscoveryUTC.ToStringZulu()); + scanText.AppendFormat("\n\nDiscovered by {0} on {1}".Tx(this,"DB"), EDSMDiscoveryCommander, EDSMDiscoveryUTC.ToStringZulu()); return scanText.ToNullSafeString().Replace("\n", "\n" + inds); } @@ -568,10 +542,10 @@ public string HabZoneString() if (IsStar && HabitableZoneInner.HasValue && HabitableZoneOuter.HasValue) { StringBuilder habZone = new StringBuilder(); - habZone.AppendFormat("Habitable Zone Approx. {0} ({1}-{2} AU)\n", GetHabZoneStringLs(), + habZone.AppendFormat("Habitable Zone Approx. {0} ({1}-{2} AU)\n".Tx(this), GetHabZoneStringLs(), (HabitableZoneInner.Value / oneAU_LS).ToString("N2"), (HabitableZoneOuter.Value / oneAU_LS).ToString("N2")); if (nSemiMajorAxis.HasValue && nSemiMajorAxis.Value > 0) - habZone.AppendFormat(" (Others stars not considered)\n"); + habZone.AppendFormat(" (Others stars not considered)\n".Tx(this)); return habZone.ToNullSafeString(); } @@ -588,7 +562,7 @@ public string DisplayMaterials(int indent = 0, MaterialCommoditiesList historicm { string indents = new string(' ', indent); - scanText.Append("Materials:\n"); + scanText.Append("Materials:\n".Tx(this)); foreach (KeyValuePair mat in Materials) { scanText.Append(indents + DisplayMaterial(mat.Key, mat.Value, historicmatlist, currentmatlist)); @@ -634,7 +608,7 @@ public string DisplayAtmosphere(int indent = 0) StringBuilder scanText = new StringBuilder(); string indents = new string(' ', indent); - scanText.Append(indents + "Atmospheric Composition:\n"); + scanText.Append(indents + "Atmospheric Composition:\n".Tx(this)); foreach (KeyValuePair comp in AtmosphereComposition) { scanText.AppendFormat(indents + indents + "{0} - {1}%\n", comp.Key, comp.Value.ToString("N2")); @@ -651,7 +625,7 @@ public string DisplayComposition(int indent = 0) StringBuilder scanText = new StringBuilder(); string indents = new string(' ', indent); - scanText.Append(indents + "Planetary Composition:\n"); + scanText.Append(indents + "Planetary Composition:\n".Tx(this)); foreach (KeyValuePair comp in PlanetComposition) { if (comp.Value > 0) @@ -666,7 +640,7 @@ public string DisplayComposition(int indent = 0) public string RingInformationMoons(int ringno) { - return RingInformation(ringno, 1 / oneMoon_MT, " Moons"); + return RingInformation(ringno, 1 / oneMoon_MT, " Moons".Tx(this)); } public string RingInformation(int ringno, double scale = 1, string scaletype = " MT") diff --git a/EliteDangerous/JournalEvents/JournalScanned.cs b/EliteDangerous/JournalEvents/JournalScanned.cs index b5a7c9050f..f8d8bb39ad 100644 --- a/EliteDangerous/JournalEvents/JournalScanned.cs +++ b/EliteDangerous/JournalEvents/JournalScanned.cs @@ -18,14 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when the player's ship has been scanned -//(note the "Scan Detected" indication is at the start of the scan, this is written at the end of a successful scan) -//Parameters: -//• ScanType: Cargo, Crime, Cabin, Data or Unknown - -//Example: -//{ "timestamp":"2017-02-13T12:30:09Z", "event":"Scanned", "ScanType":"Cargo" } - [JournalEntryType(JournalTypeEnum.Scanned)] public class JournalScanned : JournalEntry { @@ -33,11 +25,11 @@ public JournalScanned(JObject evt) : base(evt, JournalTypeEnum.Scanned) { ScanType = evt["ScanType"].Str().SplitCapsWordFull(); } + public string ScanType { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ScanType; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalScientificResearch.cs b/EliteDangerous/JournalEvents/JournalScientificResearch.cs index 417c2945ae..dd8302637c 100644 --- a/EliteDangerous/JournalEvents/JournalScientificResearch.cs +++ b/EliteDangerous/JournalEvents/JournalScientificResearch.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -34,10 +34,9 @@ public JournalScientificResearch(JObject evt) : base(evt, JournalTypeEnum.Scient public string Category { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("",Name, "Count:", Count , "Category:", Category); + info = BaseUtils.FieldBuilder.Build("",Name, "Count:".Txb(this), Count , "Category:".Txb(this), Category); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalScreenshot.cs b/EliteDangerous/JournalEvents/JournalScreenshot.cs index c9405c7d96..e44550c06e 100644 --- a/EliteDangerous/JournalEvents/JournalScreenshot.cs +++ b/EliteDangerous/JournalEvents/JournalScreenshot.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,22 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - /* - When Written: when a screen snapshot is saved - Parameters: -  Filename: filename of screenshot -  Width: size in pixels -  Height: size in pixels -  System: current star system -  Body: name of nearest body -  Latitude -  Longitude - The latitude and longitude will be included if on a planet or in low-altitude flight - Example: - { "timestamp":"2016-06-10T14:32:03Z","event":"Screenshot", - "Filename":"_Screenshots/Screenshot_0151.bmp", "Width":1600, "Height":900, "System":"Shinrarta - Dezhra", "Body":"Founders World" } - */ [JournalEntryType(JournalTypeEnum.Screenshot)] public class JournalScreenshot : JournalEntry { @@ -50,6 +34,7 @@ public JournalScreenshot(JObject evt ) : base(evt, JournalTypeEnum.Screenshot) nAltitude = evt["Altitude"].DoubleNull(); nHeading = evt["Heading"].DoubleNull(); } + public string Filename { get; set; } public int Width { get; set; } public int Height { get; set; } @@ -60,10 +45,9 @@ public JournalScreenshot(JObject evt ) : base(evt, JournalTypeEnum.Screenshot) public double? nAltitude { get; set; } public double? nHeading { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("At " , Body , "< in " , System , "File:", Filename, "Width:", Width , "Height:", Height, "Latitude:", JournalFieldNaming.RLat(nLatitude), "Longitude:", JournalFieldNaming.RLong(nLongitude)); + info = BaseUtils.FieldBuilder.Build("At ".Tx(this), Body , "< in ".Tx(this), System , "File:".Tx(this), Filename, "Width:".Tx(this), Width , "Height:".Tx(this), Height, "Latitude:".Txb(this), JournalFieldNaming.RLat(nLatitude), "Longitude:".Txb(this), JournalFieldNaming.RLong(nLongitude)); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalSearchAndRescue.cs b/EliteDangerous/JournalEvents/JournalSearchAndRescue.cs index 414d0ed0c0..788a52ae23 100644 --- a/EliteDangerous/JournalEvents/JournalSearchAndRescue.cs +++ b/EliteDangerous/JournalEvents/JournalSearchAndRescue.cs @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -//When written: when delivering items to a Search and Rescue contact -//Parameters: -// Name -// Count -// Reward - [JournalEntryType(JournalTypeEnum.SearchAndRescue)] public class JournalSearchAndRescue : JournalEntry { @@ -43,10 +37,9 @@ public JournalSearchAndRescue(JObject evt) : base(evt, JournalTypeEnum.SearchAnd public long Reward { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("",FriendlyName , "Num:" , Count, "Reward:" , Reward); + info = BaseUtils.FieldBuilder.Build("",FriendlyName , "Num:".Txb(this), Count, "Reward:".Tx(this), Reward); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalSelfDestruct.cs b/EliteDangerous/JournalEvents/JournalSelfDestruct.cs index 68199677bd..76e1658010 100644 --- a/EliteDangerous/JournalEvents/JournalSelfDestruct.cs +++ b/EliteDangerous/JournalEvents/JournalSelfDestruct.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,24 +18,16 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.SelfDestruct)] public class JournalSelfDestruct: JournalEntry { public JournalSelfDestruct(JObject evt ) : base(evt, JournalTypeEnum.SelfDestruct) { - - } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = "Boom!"; + info = "Boom!".Txb(this); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalSellDrones.cs b/EliteDangerous/JournalEvents/JournalSellDrones.cs index ec688068bf..301f7564a5 100644 --- a/EliteDangerous/JournalEvents/JournalSellDrones.cs +++ b/EliteDangerous/JournalEvents/JournalSellDrones.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When Written: when selling unwanted drones back to the market - //Parameters: - //• Type - //• Count - //• SellPrice - //• TotalSale [JournalEntryType(JournalTypeEnum.SellDrones)] public class JournalSellDrones : JournalEntry, ILedgerJournalEntry, IMaterialCommodityJournalEntry { @@ -46,13 +40,12 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) { - mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Count.ToString() + " drones", TotalSale); + mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Count.ToString() + " " + "Drones".Txb(this), TotalSale); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", Type, "Count:", Count, "Each:; cr;N0", SellPrice, "Amount:; cr;N0", TotalSale); + info = BaseUtils.FieldBuilder.Build("", Type, "Count:".Txb(this), Count, "Price:; cr;N0".Txb(this), SellPrice, "Amount:; cr;N0".Txb(this), TotalSale); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalSellExplorationData.cs b/EliteDangerous/JournalEvents/JournalSellExplorationData.cs index 9ace86210e..801a52f327 100644 --- a/EliteDangerous/JournalEvents/JournalSellExplorationData.cs +++ b/EliteDangerous/JournalEvents/JournalSellExplorationData.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,12 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when selling exploration data in Cartographics - //Parameters: - //• Systems: JSON array of system names - //• Discovered: JSON array of discovered bodies - //• BaseValue: value of systems - //• Bonus: bonus for first discoveries [JournalEntryType(JournalTypeEnum.SellExplorationData)] public class JournalSellExplorationData : JournalEntry, ILedgerJournalEntry { @@ -50,20 +44,20 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) mcl.AddEvent(Id, EventTimeUTC, EventTypeID, Systems.Length + " systems", TotalEarnings); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Amount:; cr;N0", BaseValue, "Bonus:; cr;N0", Bonus , "Total:; cr (inc any PVP bonus);N0", TotalEarnings); + info = BaseUtils.FieldBuilder.Build("Amount:; cr;N0".Txb(this), BaseValue, "Bonus:; cr;N0".Txb(this), Bonus , + "Total:; cr;N0".Tx(this), TotalEarnings); detailed = ""; if (Systems != null) { - detailed += "Scanned:"; + detailed += "Scanned:".Txb(this); foreach (string s in Systems) detailed += s + " "; } if (Discovered != null) { - detailed += System.Environment.NewLine + "Discovered:"; + detailed += System.Environment.NewLine + "Discovered:".Txb(this); foreach (string s in Discovered) detailed += s + " "; } diff --git a/EliteDangerous/JournalEvents/JournalSellShipOnRebuy.cs b/EliteDangerous/JournalEvents/JournalSellShipOnRebuy.cs index 0164feb76f..ef9ddc75dd 100644 --- a/EliteDangerous/JournalEvents/JournalSellShipOnRebuy.cs +++ b/EliteDangerous/JournalEvents/JournalSellShipOnRebuy.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,17 +19,6 @@ namespace EliteDangerousCore.JournalEvents { -/* - When written: When selling a stored ship to raise funds when on insurance/rebuy screen -Parameters: - ShipType - System - SellShipId - ShipPrice -Example: -{ "timestamp":"2017-07-20T08:56:39Z", "event":"SellShipOnRebuy", "ShipType":"Dolphin", -"System":"Shinrarta Dezhra", "SellShipId":4, "ShipPrice":4110183 } - */ [JournalEntryType(JournalTypeEnum.SellShipOnRebuy)] public class JournalSellShipOnRebuy : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -40,7 +29,6 @@ public JournalSellShipOnRebuy(JObject evt) : base(evt, JournalTypeEnum.SellShipO System = evt["System"].Str(); SellShipId = evt["SellShipId"].Int(); ShipPrice = evt["ShipPrice"].Long(); - } public string ShipTypeFD { get; set; } @@ -56,14 +44,12 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) public void ShipInformation(ShipInformationList shp, string whereami, ISystem system, DB.SQLiteConnectionUser conn) { - Debug.WriteLine(EventTimeUTC + " SELLREBUY"); shp.Sell(ShipType, SellShipId); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Ship:",ShipType, "System:" , System, "Price:" , ShipPrice); + info = BaseUtils.FieldBuilder.Build("Ship:".Txb(this), ShipType, "System:".Txb(this), System, "Price:; cr;N0".Txb(this), ShipPrice); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalSendText.cs b/EliteDangerous/JournalEvents/JournalSendText.cs index f4a0e478db..a7d183c685 100644 --- a/EliteDangerous/JournalEvents/JournalSendText.cs +++ b/EliteDangerous/JournalEvents/JournalSendText.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: when a text message is sent to another player - //Parameters: - //• To - //• Message [JournalEntryType(JournalTypeEnum.SendText)] public class JournalSendText : JournalEntry { @@ -31,14 +27,14 @@ public JournalSendText(JObject evt) : base(evt, JournalTypeEnum.SendText) To_Localised = JournalFieldNaming.CheckLocalisation(evt["To_Localised"].Str(),To); Message = evt["Message"].Str(); } + public string To { get; set; } public string To_Localised { get; set; } public string Message { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("To:", To_Localised, "Msg:", Message); + info = BaseUtils.FieldBuilder.Build("To:".Tx(this), To_Localised, "Msg:".Tx(this), Message); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalSetUserShipName.cs b/EliteDangerous/JournalEvents/JournalSetUserShipName.cs index b7b396e417..3f0c477897 100644 --- a/EliteDangerous/JournalEvents/JournalSetUserShipName.cs +++ b/EliteDangerous/JournalEvents/JournalSetUserShipName.cs @@ -18,18 +18,7 @@ namespace EliteDangerousCore.JournalEvents { -// When written: when assigning a name to the ship in Starport Services -//Parameters: -//• Ship: Ship model(eg CobraMkIII) -//• ShipID: player's ship ID number -//• UserShipName: selected name -//• UserShipId: selected ship id - -//Example: -//{ "timestamp":"2017-01-24T10:42:38Z", "event":"SetUserShipName", "Ship":"cobramkiii", "ShipID":2, "UserShipName":"Enterprise", "UserShipId":"NCC 1701" } - - -[JournalEntryType(JournalTypeEnum.SetUserShipName)] + [JournalEntryType(JournalTypeEnum.SetUserShipName)] public class JournalSetUserShipName : JournalEntry , IShipInformation { public JournalSetUserShipName(JObject evt) : base(evt, JournalTypeEnum.SetUserShipName) @@ -52,10 +41,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.SetUserShipName(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("",ShipName,"", ShipIdent, "On:" , Ship); + info = BaseUtils.FieldBuilder.Build("",ShipName,"", ShipIdent, "On:".Tx(this) , Ship); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalShieldState.cs b/EliteDangerous/JournalEvents/JournalShieldState.cs index 2c853a513c..a5bdc79f59 100644 --- a/EliteDangerous/JournalEvents/JournalShieldState.cs +++ b/EliteDangerous/JournalEvents/JournalShieldState.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,27 +18,21 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.ShieldState)] public class JournalShieldState : JournalEntry { public JournalShieldState(JObject evt ) : base(evt, JournalTypeEnum.ShieldState) { ShieldsUp = evt["ShieldsUp"].Bool(); - } + public bool ShieldsUp { get; set; } protected override JournalTypeEnum IconEventType { get { return ShieldsUp ? JournalTypeEnum.ShieldState_ShieldsUp : JournalTypeEnum.ShieldState_ShieldsDown; } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Shields Down;Shields Up",ShieldsUp); + info = BaseUtils.FieldBuilder.Build("Shields Down;Shields Up".Txb(this),ShieldsUp); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalShipTargeted.cs b/EliteDangerous/JournalEvents/JournalShipTargeted.cs index 9d9dccbb3a..dbdd601292 100644 --- a/EliteDangerous/JournalEvents/JournalShipTargeted.cs +++ b/EliteDangerous/JournalEvents/JournalShipTargeted.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,16 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: player has a ship targeted - //Parameters: - //* TargetLocked - //* Ship - //* Ship_Localised - //* ScanStage - //* PilotName - //* PilotName_Localised - //* PilotRank - [JournalEntryType(JournalTypeEnum.ShipTargeted)] public class JournalShipTargeted : JournalEntry { @@ -74,9 +64,8 @@ public JournalShipTargeted(JObject evt ) : base(evt, JournalTypeEnum.ShipTargete public string SubSystem { get; set; } // 3 null public double? SubSystemHealth { get; set; } // 3 null - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - if (TargetLocked) { if (ScanStage == null) @@ -90,27 +79,27 @@ public JournalShipTargeted(JObject evt ) : base(evt, JournalTypeEnum.ShipTargete } else if (ScanStage.Value == 1) { - info = BaseUtils.FieldBuilder.Build("", PilotName_Localised, " Rank ", PilotRank, " in ", Ship_Localised); + info = BaseUtils.FieldBuilder.Build("", PilotName_Localised, "Rank:".Txb(this), PilotRank, "< in ".Txb(this), Ship_Localised); } else if (ScanStage.Value == 2) { - info = BaseUtils.FieldBuilder.Build("Shield ;;0.0", ShieldHealth, "Hull ;;0.0", HullHealth, - "", PilotName_Localised, " Rank ", PilotRank, " in ", Ship_Localised); + info = BaseUtils.FieldBuilder.Build("Shield ;;N1".Txb(this), ShieldHealth, "Hull ;;N1".Tx(this), HullHealth, + "", PilotName_Localised, "Rank:".Txb(this), PilotRank, "< in ".Txb(this), Ship_Localised); } else if (ScanStage.Value == 3) { - info = BaseUtils.FieldBuilder.Build("Faction ", Faction, - "", LegalStatus, "Bounty ", Bounty, - "", SubSystem, "< at ;;0.0", SubSystemHealth, - "Shield ;;0.0", ShieldHealth, "Hull ;;0.0", HullHealth, - "", PilotName_Localised, " Rank ", PilotRank, " in ", Ship_Localised); + info = BaseUtils.FieldBuilder.Build("Faction:".Txb(this), Faction, + "", LegalStatus, "Bounty:; cr;N0".Txb(this), Bounty, + "", SubSystem, "< at ;;N1".Tx(this), SubSystemHealth, + "Shield ;;N1".Txb(this), ShieldHealth, "Hull ;;N1".Tx(this), HullHealth, + "", PilotName_Localised, " " + "Rank:".Txb(this), PilotRank, "< in ".Txb(this), Ship_Localised); } else info = "Unknown Scan Stage type - report to EDD team"; } else - info = "Lost Target"; + info = "Lost Target".Txb(this); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalShipyard.cs b/EliteDangerous/JournalEvents/JournalShipyard.cs index 09f2413877..ed12e7e2d4 100644 --- a/EliteDangerous/JournalEvents/JournalShipyard.cs +++ b/EliteDangerous/JournalEvents/JournalShipyard.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,16 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: when opening shipyard - //Parameters: - //• MarketID - //• StationName - //• StarSystem - //• PriceList: Array of records - //o id - //o Name - //o ShipPrice - [JournalEntryType(JournalTypeEnum.Shipyard)] public class JournalShipyard : JournalEntry, IAdditionalFiles { @@ -60,9 +50,8 @@ public bool ReadAdditionalFiles(string directory, ref JObject jo) public bool? Horizons { get; set; } public bool? AllowCobraMkIV { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; @@ -74,7 +63,7 @@ public bool ReadAdditionalFiles(string directory, ref JObject jo) info = info.AppendPrePad(m.ShipType_Localised.Alt(m.ShipType), ", "); } else - info = Yard.Ships.Length.ToString() + " ships"; + info = Yard.Ships.Length.ToString() + " " + "Ships".Txb(this); foreach (ShipYard.ShipyardItem m in Yard.Ships) { diff --git a/EliteDangerous/JournalEvents/JournalShipyardBuy.cs b/EliteDangerous/JournalEvents/JournalShipyardBuy.cs index b1d064a0f9..70d4198a4f 100644 --- a/EliteDangerous/JournalEvents/JournalShipyardBuy.cs +++ b/EliteDangerous/JournalEvents/JournalShipyardBuy.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,17 +21,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when buying a new ship in the shipyard - //Parameters: - //• ShipType: ship being purchased - //• ShipPrice: purchase cost - //• StoreOldShip: (if storing old ship) ship type being stored - //• StoreShipID - //• SellOldShip: (if selling current ship) ship type being sold - //• SellShipID - //• SellPrice: (if selling current ship) ship sale price - // - //Note: the new ship’s ShipID will be logged in a separate event after the purchase [JournalEntryType(JournalTypeEnum.ShipyardBuy)] public class JournalShipyardBuy : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -86,7 +75,6 @@ public void Ledger(Ledger mcl, DB.SQLiteConnectionUser conn) public void ShipInformation(ShipInformationList shp, string whereami, ISystem system, DB.SQLiteConnectionUser conn) { // new will come along and provide the new ship info - //System.Diagnostics.Debug.WriteLine(EventTimeUTC + " Buy"); if (StoreOldShipId != null && StoreOldShipFD!=null) shp.Store(StoreOldShipFD, StoreOldShipId.Value, whereami, system.Name); @@ -95,14 +83,13 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.Sell(SellOldShipFD, SellOldShipId.Value); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", ShipType, "Amount:; cr;N0", ShipPrice); + info = BaseUtils.FieldBuilder.Build("", ShipType, "Amount:; cr;N0".Txb(this), ShipPrice); if (StoreOldShip != null) - info += ", " + BaseUtils.FieldBuilder.Build("Stored:", StoreOldShip); + info += ", " + BaseUtils.FieldBuilder.Build("Stored:".Txb(this), StoreOldShip); if (SellOldShip != null) - info += ", " + BaseUtils.FieldBuilder.Build("Sold:", StoreOldShip, "Amount:; cr;N0", SellPrice); + info += ", " + BaseUtils.FieldBuilder.Build("Sold:".Txb(this), StoreOldShip, "Amount:; cr;N0".Txb(this), SellPrice); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalShipyardNew.cs b/EliteDangerous/JournalEvents/JournalShipyardNew.cs index 4921365cab..66c339c49d 100644 --- a/EliteDangerous/JournalEvents/JournalShipyardNew.cs +++ b/EliteDangerous/JournalEvents/JournalShipyardNew.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,10 +21,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: after a new ship has been purchased - //Parameters: - //• ShipType - //• ShipID [JournalEntryType(JournalTypeEnum.ShipyardNew)] public class JournalShipyardNew : JournalEntry , IShipInformation { @@ -45,9 +41,8 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.ShipyardNew(ShipType, ShipFD, ShipId); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ShipType; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalShipyardSell.cs b/EliteDangerous/JournalEvents/JournalShipyardSell.cs index f047eb910c..6bb28c2f67 100644 --- a/EliteDangerous/JournalEvents/JournalShipyardSell.cs +++ b/EliteDangerous/JournalEvents/JournalShipyardSell.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -22,16 +22,9 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.ShipyardSell)] public class JournalShipyardSell : JournalEntry, ILedgerJournalEntry, IShipInformation { - //When Written: when selling a ship stored in the shipyard - //Parameters: - //• ShipType: type of ship being sold - //• SellShipID - //• ShipPrice: sale price - //• System: (if ship is in another system) name of system public JournalShipyardSell(JObject evt ) : base(evt, JournalTypeEnum.ShipyardSell) { MarketID = evt["MarketID"].LongNull(); @@ -60,10 +53,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.Sell(ShipTypeFD, SellShipId); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", ShipType, "Amount:; cr;N0", ShipPrice , "At:" , System); + info = BaseUtils.FieldBuilder.Build("", ShipType, "Amount:; cr;N0".Txb(this), ShipPrice , "At:".Tx(this) , System); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalShipyardSwap.cs b/EliteDangerous/JournalEvents/JournalShipyardSwap.cs index 541a92c3a5..af072b8c7c 100644 --- a/EliteDangerous/JournalEvents/JournalShipyardSwap.cs +++ b/EliteDangerous/JournalEvents/JournalShipyardSwap.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,14 +21,6 @@ namespace EliteDangerousCore.JournalEvents { - //When Written: when switching to another ship already stored at this station - //Parameters: - //• ShipType: type of ship being switched to - //• ShipID - //• StoreOldShip: (if storing old ship) type of ship being stored - //• StoreShipID - //• SellOldShip: (if selling old ship) type of ship being sold -- NO EVIDENCE - //• SellShipID -- NO EVIDENCE [JournalEntryType(JournalTypeEnum.ShipyardSwap)] public class JournalShipyardSwap : JournalEntry, IShipInformation { @@ -43,6 +35,8 @@ public JournalShipyardSwap(JObject evt ) : base(evt, JournalTypeEnum.ShipyardSwa StoreShipId = evt["StoreShipID"].IntNull(); MarketID = evt["MarketID"].LongNull(); + + //• SellShipID -- NO EVIDENCE seen } public string ShipFD { get; set; } @@ -61,10 +55,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.ShipyardSwap(this, whereami, system.Name); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Swap ",StoreOldShip, "< for a " , ShipType); + info = BaseUtils.FieldBuilder.Build("Swap ".Tx(this),StoreOldShip, "< for a ".Tx(this) , ShipType); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalShipyardTransfer.cs b/EliteDangerous/JournalEvents/JournalShipyardTransfer.cs index f6986c4169..1264258706 100644 --- a/EliteDangerous/JournalEvents/JournalShipyardTransfer.cs +++ b/EliteDangerous/JournalEvents/JournalShipyardTransfer.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -21,19 +21,6 @@ namespace EliteDangerousCore.JournalEvents { - /* - When Written: when requesting a ship at another station be transported to this station - Parameters: -  ShipType: type of ship -  ShipID -  System: where it is -  Distance: how far away -  TransferPrice: cost of transfer -  TransferTime: time taken in seconds - Example: - { "timestamp":"2016-07-21T15:19:49Z", "event":"ShipyardTransfer", "ShipType":"SideWinder", - "ShipID":7, "System":"Eranin", "Distance":85.639145, "TransferPrice":580 } - * */ [JournalEntryType(JournalTypeEnum.ShipyardTransfer)] public class JournalShipyardTransfer : JournalEntry, ILedgerJournalEntry, IShipInformation { @@ -80,10 +67,9 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.Transfer(ShipType, ShipTypeFD, ShipId, FromSystem, system.Name, whereami, arrival); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Of ", ShipType, "< from " , FromSystem , "Distance:; ly;0.0" , Distance , "Price:; cr;N0", TransferPrice, "TransferTime:", FriendlyTransferTime); + info = BaseUtils.FieldBuilder.Build("Of ".Tx(this), ShipType, "< from ".Txb(this), FromSystem , "Distance:; ly;0.0".Txb(this), Distance , "Price:; cr;N0", TransferPrice, "Transfer Time:".Txb(this), FriendlyTransferTime); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalShutdown.cs b/EliteDangerous/JournalEvents/JournalShutdown.cs index 8e4cd65442..e2764c67c3 100644 --- a/EliteDangerous/JournalEvents/JournalShutdown.cs +++ b/EliteDangerous/JournalEvents/JournalShutdown.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,19 +18,15 @@ namespace EliteDangerousCore.JournalEvents { - //When written: the game has been exited - //Parameters: none [JournalEntryType(JournalTypeEnum.Shutdown)] public class JournalShutdown : JournalEntry { public JournalShutdown(JObject evt ) : base(evt, JournalTypeEnum.Shutdown) { - } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalStartJump.cs b/EliteDangerous/JournalEvents/JournalStartJump.cs index 6f8c66688f..2d77b9575a 100644 --- a/EliteDangerous/JournalEvents/JournalStartJump.cs +++ b/EliteDangerous/JournalEvents/JournalStartJump.cs @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: at the start of a Hyperspace or Supercruise jump(start of countdown) -//Parameters: -//• JumpType: "Hyperspace" or "Supercruise" -//• StarClass: star type(only for a hyperspace jump) - [JournalEntryType(JournalTypeEnum.StartJump)] public class JournalStartJump : JournalEntry { @@ -43,11 +38,11 @@ public JournalStartJump(JObject evt) : base(evt, JournalTypeEnum.StartJump) public string StarClass { get; set; } public string FriendlyStarClass { get; set; } - public override string FillSummary { get { return "Charging FSD"; } } + public override string FillSummary { get { return "Charging FSD".Tx(this); } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", JumpType, "< to ",StarSystem, "" , FriendlyStarClass); + info = BaseUtils.FieldBuilder.Build("", JumpType, "< to ".Txb(this), StarSystem, "" , FriendlyStarClass); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalStatistics.cs b/EliteDangerous/JournalEvents/JournalStatistics.cs index 91422856f6..603ce55524 100644 --- a/EliteDangerous/JournalEvents/JournalStatistics.cs +++ b/EliteDangerous/JournalEvents/JournalStatistics.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,8 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: loading the game - //Parameters: statistics broken down by group [JournalEntryType(JournalTypeEnum.Statistics)] public class JournalStatistics : JournalEntry { @@ -59,24 +57,24 @@ public JournalStatistics(JObject evt ) : base(evt, JournalTypeEnum.Statistics) public CQCClass CQC { get; set; } public JObject Json { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("Wealth:;cr;N", BankAccount.CurrentWealth, "Notoriety Index:;;N0" , Crime.Notoriety); + info = BaseUtils.FieldBuilder.Build("Wealth:;cr;N".Txb(this), BankAccount.CurrentWealth, "Notoriety Index:;;N0".Txb(this), Crime.Notoriety); - detailed = "Bank Account" + Environment.NewLine + BankAccount?.Format() + Environment.NewLine + - "Combat" + Environment.NewLine + Combat?.Format() + Environment.NewLine + - "Crime" + Environment.NewLine + Crime?.Format() + Environment.NewLine + - "Smuggling" + Environment.NewLine + Smuggling?.Format() + Environment.NewLine + - "Trading" + Environment.NewLine + Trading?.Format() + Environment.NewLine + - "Mining" + Environment.NewLine + Mining?.Format() + Environment.NewLine + - "Exploration" + Environment.NewLine + Exploration?.Format() + Environment.NewLine + - "Passengers" + Environment.NewLine + PassengerMissions?.Format() + Environment.NewLine + - "Search and Rescue" + Environment.NewLine + SearchAndRescue?.Format() + Environment.NewLine + - "Engineers" + Environment.NewLine + Crafting?.Format() + Environment.NewLine + - "Crew" + Environment.NewLine + Crew?.Format() + Environment.NewLine + - "Multicrew" + Environment.NewLine + Multicrew?.Format() + Environment.NewLine + - "Materials and Commodity Trading" + Environment.NewLine + MaterialTraderStats?.Format() + Environment.NewLine + - "CQC" + Environment.NewLine + CQC?.Format(); + detailed = "Bank Account".Tx(this) + Environment.NewLine + BankAccount?.Format() + Environment.NewLine + + "Combat".Tx(this) + Environment.NewLine + Combat?.Format() + Environment.NewLine + + "Crime".Tx(this) + Environment.NewLine + Crime?.Format() + Environment.NewLine + + "Smuggling".Tx(this) + Environment.NewLine + Smuggling?.Format() + Environment.NewLine + + "Trading".Tx(this) + Environment.NewLine + Trading?.Format() + Environment.NewLine + + "Mining".Tx(this) + Environment.NewLine + Mining?.Format() + Environment.NewLine + + "Exploration".Tx(this) + Environment.NewLine + Exploration?.Format() + Environment.NewLine + + "Passengers".Tx(this) + Environment.NewLine + PassengerMissions?.Format() + Environment.NewLine + + "Search and Rescue".Tx(this) + Environment.NewLine + SearchAndRescue?.Format() + Environment.NewLine + + "Engineers".Tx(this) + Environment.NewLine + Crafting?.Format() + Environment.NewLine + + "Crew".Tx(this) + Environment.NewLine + Crew?.Format() + Environment.NewLine + + "Multicrew".Tx(this) + Environment.NewLine + Multicrew?.Format() + Environment.NewLine + + "Materials and Commodity Trading".Tx(this) + Environment.NewLine + MaterialTraderStats?.Format() + Environment.NewLine + + "CQC".Tx(this) + Environment.NewLine + CQC?.Format(); } public class BankAccountClass @@ -93,9 +91,14 @@ public class BankAccountClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Wealth:;cr;N0", CurrentWealth, "Spent on Ships:;cr;N0", SpentOnShips, - "Spent on Outfitting:;cr;N0", SpentOnOutfitting, "Spent on Repairs:;cr;N0", SpentOnRepairs, "Spent on Fuel:;cr;N0", SpentOnFuel, - "Spend on Ammo:;cr;N0", SpentOnAmmoConsumables, "Insurance Claims:;;N0", InsuranceClaims, "Spent on Insurance:;cr;N0", SpentOnInsurance); + "Wealth:;cr;N0".Tx(this), CurrentWealth, + "Spent on Ships:;cr;N0".Tx(this), SpentOnShips, + "Spent on Outfitting:;cr;N0".Tx(this), SpentOnOutfitting, + "Spent on Repairs:;cr;N0".Tx(this), SpentOnRepairs, + "Spent on Fuel:;cr;N0".Tx(this), SpentOnFuel, + "Spend on Ammo:;cr;N0".Tx(this), SpentOnAmmoConsumables, + "Insurance Claims:;;N0".Tx(this), InsuranceClaims, + "Spent on Insurance:;cr;N0".Tx(this), SpentOnInsurance); } } @@ -113,10 +116,14 @@ public class CombatClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Bounties :;;N0", BountiesClaimed, "Bounty Profits:;cr;N0", BountyHuntingProfit, - "Combat Bonds:;;N0", CombatBonds, "Combat Bond Profits:;cr;N0", CombatBondProfits, - "Assassinations:;;N0", Assassinations, "Assassination Profits:;cr;N0", AssassinationProfits, - "Highest Reward:;cr;N0", HighestSingleReward, "Skimmers Killed:;;N0", SkimmersKilled); + "Bounties :;;N0".Tx(this), BountiesClaimed, + "Bounty Profits:;cr;N0".Tx(this), BountyHuntingProfit, + "Combat Bonds:;;N0".Tx(this), CombatBonds, + "Combat Bond Profits:;cr;N0".Tx(this), CombatBondProfits, + "Assassinations:;;N0".Tx(this), Assassinations, + "Assassination Profits:;cr;N0".Tx(this), AssassinationProfits, + "Highest Reward:;cr;N0".Tx(this), HighestSingleReward, + "Skimmers Killed:;;N0".Tx(this), SkimmersKilled); } } @@ -132,9 +139,12 @@ public class CrimeClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Notoriety Index:;;N0", Notoriety, "Fines:;;N0", Fines, - "Total Fines:;cr;N0", TotalFines, "Bounties:;;N0", BountiesReceived, - "Total Bounties:;cr;N0", TotalBounties, "Highest Bounty:;cr;N0", HighestBounty); + "Notoriety Index:;;N0".Tx(this), Notoriety, + "Fines:;;N0".Tx(this), Fines, + "Total Fines:;cr;N0".Tx(this), TotalFines, + "Bounties:;;N0".Tx(this), BountiesReceived, + "Total Bounties:;cr;N0".Tx(this), TotalBounties, + "Highest Bounty:;cr;N0".Tx(this), HighestBounty); } } @@ -149,9 +159,11 @@ public class SmugglingClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Black Markets:;;N0", BlackMarketsTradedWith, "Black Market Profits:;cr;N0", BlackMarketsProfits, - "Resources Smuggled:;;N0", ResourcesSmuggled, "Average Profit:;cr;N0", AverageProfit, - "Highest Single Transaction:;cr;N0", HighestSingleTransaction); + "Black Markets:;;N0".Tx(this), BlackMarketsTradedWith, + "Black Market Profits:;cr;N0".Tx(this), BlackMarketsProfits, + "Resources Smuggled:;;N0".Tx(this), ResourcesSmuggled, + "Average Profit:;cr;N0".Tx(this), AverageProfit, + "Highest Single Transaction:;cr;N0".Tx(this), HighestSingleTransaction); } } @@ -166,8 +178,11 @@ public class TradingClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Markets Traded:;;N0", MarketsTradedWith, "Profits:;cr;N0", MarketProfits, "No. of Resources:;;N0", ResourcesTraded, - "Average Profit:;cr;N0", AverageProfit, "Highest Single Transaction:;cr;N0", HighestSingleTransaction); + "Markets Traded:;;N0".Tx(this), MarketsTradedWith, + "Profits:;cr;N0".Tx(this), MarketProfits, + "No. of Resources:;;N0".Tx(this), ResourcesTraded, + "Average Profit:;cr;N0".Tx(this), AverageProfit, + "Highest Single Transaction:;cr;N0".Tx(this), HighestSingleTransaction); } } @@ -179,7 +194,9 @@ public class MiningClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Profits:;cr;N0", MiningProfits, "Quantity:;;N0", QuantityMined, "Materials Types Collected:;;N0", MaterialsCollected); + "Profits:;cr;N0".Tx(this), MiningProfits, + "Quantity:;;N0".Tx(this), QuantityMined, + "Materials Types Collected:;;N0".Tx(this), MaterialsCollected); } @@ -199,11 +216,15 @@ public class ExplorationClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Systems Visited:;;N0", SystemsVisited, "Profits:;cr;N0", ExplorationProfits, - "Level 2 Scans:;;N0", PlanetsScannedToLevel2, "Level 3 Scans:;;N0", PlanetsScannedToLevel3, - "Highest Payout:;cr;N0", HighestPayout, "Total Distance:;;N0", TotalHyperspaceDistance, - "No of Jumps:;;N0", TotalHyperspaceJumps, - "Greatest Distance:;;N0", GreatestDistanceFromStart, "Time Played:", TimePlayed.SecondsToWeeksDaysHoursMinutesSeconds()); + "Systems Visited:;;N0".Tx(this), SystemsVisited, + "Profits:;cr;N0".Tx(this), ExplorationProfits, + "Level 2 Scans:;;N0".Tx(this), PlanetsScannedToLevel2, + "Level 3 Scans:;;N0".Tx(this), PlanetsScannedToLevel3, + "Highest Payout:;cr;N0".Tx(this), HighestPayout, + "Total Distance:;;N0".Tx(this), TotalHyperspaceDistance, + "No of Jumps:;;N0".Tx(this), TotalHyperspaceJumps, + "Greatest Distance:;;N0".Tx(this), GreatestDistanceFromStart, + "Time Played:".Tx(this), TimePlayed.SecondsToWeeksDaysHoursMinutesSeconds()); } } @@ -216,7 +237,10 @@ public class PassengerMissionsClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Bulk Mission Passengers:;;N0", Bulk, "VIP Mission Passengers:;;N0", VIP, "Passengers Delivered:;;N0", Delivered, "Passengers Ejected:;;N0", Ejected); + "Bulk Mission Passengers:;;N0".Tx(this), Bulk, + "VIP Mission Passengers:;;N0".Tx(this), VIP, + "Passengers Delivered:;;N0".Tx(this), Delivered, + "Passengers Ejected:;;N0".Tx(this), Ejected); } } @@ -228,7 +252,9 @@ public class SearchAndRescueClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Total Items Rescued:;;N0", Traded, "Profit:;cr;N0", Profit, "Total Rescue Transactions:;;N0", Count); + "Total Items Rescued:;;N0".Tx(this), Traded, + "Profit:;cr;N0".Tx(this), Profit, + "Total Rescue Transactions:;;N0".Tx(this), Count); } } @@ -244,9 +270,13 @@ public class CraftingClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Engineers Used:;;N0", CountOfUsedEngineers, "Blueprints:;;N0", RecipesGenerated, - "At Level 1:;;N0", RecipesGeneratedRank1, "At Level 2:;;N0", RecipesGeneratedRank2, "At Level 3:;;N0", RecipesGeneratedRank3, - "At Level 4:;;N0", RecipesGeneratedRank4, "At Level 5:;;N0", RecipesGeneratedRank5); + "Engineers Used:;;N0".Tx(this), CountOfUsedEngineers, + "Blueprints:;;N0".Tx(this), RecipesGenerated, + "At Level 1:;;N0".Tx(this), RecipesGeneratedRank1, + "At Level 2:;;N0".Tx(this), RecipesGeneratedRank2, + "At Level 3:;;N0".Tx(this), RecipesGeneratedRank3, + "At Level 4:;;N0".Tx(this), RecipesGeneratedRank4, + "At Level 5:;;N0".Tx(this), RecipesGeneratedRank5); } } @@ -259,7 +289,8 @@ public class CrewClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Total Wages:;cr;N0", NpcCrewTotalWages, "Hired:;;N0", NpcCrewHired, "Fired:;;N0", NpcCrewFired, "Killed in Action:;;N0", NpcCrewDied); + "Total Wages:;cr;N0".Tx(this), NpcCrewTotalWages, "Hired:;;N0".Tx(this), NpcCrewHired, + "Fired:;;N0".Tx(this), NpcCrewFired, "Killed in Action:;;N0".Tx(this), NpcCrewDied); } } @@ -274,11 +305,11 @@ public class MulticrewClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Total Time:", TimeTotal.SecondsToWeeksDaysHoursMinutesSeconds(), - "Gunner Time:;;N0", GunnerTimeTotal.SecondsToWeeksDaysHoursMinutesSeconds(), - "Fighter Time:;;N0", FighterTimeTotal.SecondsToWeeksDaysHoursMinutesSeconds(), - "Credits:;cr;N0", CreditsTotal, - "Fines:;cr;N0", FinesTotal); + "Total Time:".Tx(this), TimeTotal.SecondsToWeeksDaysHoursMinutesSeconds(), + "Gunner Time:;;N0".Tx(this), GunnerTimeTotal.SecondsToWeeksDaysHoursMinutesSeconds(), + "Fighter Time:;;N0".Tx(this), FighterTimeTotal.SecondsToWeeksDaysHoursMinutesSeconds(), + "Credits:;cr;N0".Tx(this), CreditsTotal, + "Fines:;cr;N0".Tx(this), FinesTotal); } } @@ -289,7 +320,7 @@ public class MaterialTraderStatsClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Commodity Trades:;;N0", TradesCompleted, "Material Traded:;;N0", MaterialsTraded); + "Commodity Trades:;;N0".Tx(this), TradesCompleted, "Material Traded:;;N0".Tx(this), MaterialsTraded); } } @@ -303,10 +334,10 @@ public class CQCClass public string Format(string frontline = " ") { return frontline + BaseUtils.FieldBuilder.BuildSetPad(Environment.NewLine + frontline, - "Time Played:;;N0", TimePlayed.SecondsToWeeksDaysHoursMinutesSeconds(), - "KD Ratio:;;N", KD, - "Kills:;;N0", Kills, - "Win/Loss:;;N", WL); + "Time Played:;;N0".Tx(this), TimePlayed.SecondsToWeeksDaysHoursMinutesSeconds(), + "KD Ratio:;;N".Tx(this), KD, + "Kills:;;N0".Tx(this), Kills, + "Win/Loss:;;N".Tx(this), WL); } } } diff --git a/EliteDangerous/JournalEvents/JournalStoredModules.cs b/EliteDangerous/JournalEvents/JournalStoredModules.cs index a83f0429e0..e8878ed2dd 100644 --- a/EliteDangerous/JournalEvents/JournalStoredModules.cs +++ b/EliteDangerous/JournalEvents/JournalStoredModules.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.StoredModules)] public class JournalStoredModules : JournalEntry, IShipInformation { @@ -48,18 +47,19 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.UpdateStoredModules(this); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Total:", ModuleItems?.Count()); + info = BaseUtils.FieldBuilder.Build("Total:".Txb(this), ModuleItems?.Count()); detailed = ""; if (ModuleItems != null) { foreach (ModulesInStore.StoredModule m in ModuleItems) { - detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("", m.Name, "< at ", m.StarSystem, "Transfer Cost:; cr;N0", m - .TransferCost, "Time:", m.TransferTimeString, "Value:; cr;N0", m.TransferCost, ";(Hot)", m.Hot), System.Environment.NewLine); + detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("", m.Name, "< at ".Txb(this), m.StarSystem, + "Transfer Cost:; cr;N0".Txb(this), m.TransferCost, + "Time:".Txb(this), m.TransferTimeString, + "Value:; cr;N0".Txb(this), m.TransferCost, ";(Hot)".Txb(this), m.Hot), System.Environment.NewLine); } } } diff --git a/EliteDangerous/JournalEvents/JournalStoredShips.cs b/EliteDangerous/JournalEvents/JournalStoredShips.cs index 811a363375..67c519eb17 100644 --- a/EliteDangerous/JournalEvents/JournalStoredShips.cs +++ b/EliteDangerous/JournalEvents/JournalStoredShips.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,25 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - // When written: when opening shipyard - //Parameters: - //• MarketID - //• StationName - //• StarSystem - //• ShipsHere: Array of records - //o ShipID - //o ShipType - //o Name - //o Value - //• ShipsRemote: Array of records - //o ShipID - //o ShipType - //o StarSystem - //o ShipMarketID - //o TransferPrice - //o TransferTime - //o Value - [JournalEntryType(JournalTypeEnum.StoredShips)] public class JournalStoredShips : JournalEntry, IShipInformation { @@ -69,27 +50,27 @@ public JournalStoredShips(JObject evt) : base(evt, JournalTypeEnum.StoredShips) public StoredShipInformation[] ShipsHere { get; set; } public StoredShipInformation[] ShipsRemote { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("At starport:",ShipsHere?.Count(),"Other locations:",ShipsRemote?.Count() ); + info = BaseUtils.FieldBuilder.Build("At starport:".Tx(this), ShipsHere?.Count(),"Other locations:".Tx(this), ShipsRemote?.Count() ); detailed = ""; if (ShipsHere != null) { foreach (StoredShipInformation m in ShipsHere) - detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("", m.ShipType, "; cr;N0", m.Value, ";(Hot)", m.Hot), System.Environment.NewLine); + detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("", m.ShipType, "; cr;N0".Tx(this,"SSP"), m.Value, ";(Hot)".Txb(this), m.Hot), System.Environment.NewLine); } if (ShipsRemote != null) { - detailed = detailed.AppendPrePad("Remote:", System.Environment.NewLine + System.Environment.NewLine); + detailed = detailed.AppendPrePad("Remote:".Tx(this), System.Environment.NewLine + System.Environment.NewLine); foreach (StoredShipInformation m in ShipsRemote) { if (m.InTransit) { detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build("; ",m.Name, - "<; in transit", m.ShipType, - "Value:; cr;N0", m.Value, ";(Hot)", m.Hot), System.Environment.NewLine); + "<; in transit".Tx(this), m.ShipType, + "Value:; cr;N0".Txb(this), m.Value, ";(Hot)".Txb(this), m.Hot), System.Environment.NewLine); } else @@ -97,9 +78,9 @@ public JournalStoredShips(JObject evt) : base(evt, JournalTypeEnum.StoredShips) detailed = detailed.AppendPrePad(BaseUtils.FieldBuilder.Build( "; ", m.Name, "<", m.ShipType, - "< at ", m.StarSystem, - "Transfer Cost:; cr;N0", m.TransferPrice, "Time:", m.TransferTimeString, - "Value:; cr;N0", m.Value, ";(Hot)", m.Hot), System.Environment.NewLine); + "< at ".Txb(this), m.StarSystem, + "Transfer Cost:; cr;N0".Txb(this), m.TransferPrice, "Time:".Txb(this), m.TransferTimeString, + "Value:; cr;N0".Txb(this), m.Value, ";(Hot)".Txb(this), m.Hot), System.Environment.NewLine); } } } diff --git a/EliteDangerous/JournalEvents/JournalSupercruiseEntry.cs b/EliteDangerous/JournalEvents/JournalSupercruiseEntry.cs index a89ea6a3ed..1a9a7708bf 100644 --- a/EliteDangerous/JournalEvents/JournalSupercruiseEntry.cs +++ b/EliteDangerous/JournalEvents/JournalSupercruiseEntry.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -19,9 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: entering supercruise from normal space - //Parameters: - //• Starsystem [JournalEntryType(JournalTypeEnum.SupercruiseEntry)] public class JournalSupercruiseEntry : JournalEntry, IShipInformation { @@ -34,9 +31,8 @@ public JournalSupercruiseEntry(JObject evt ) : base(evt, JournalTypeEnum.Supercr public string StarSystem { get; set; } public long? SystemAddress { get; set; } - public override void FillInformation(out string info, out string detailed)//V + public override void FillInformation(out string info, out string detailed) { - info = StarSystem; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalSupercruiseExit.cs b/EliteDangerous/JournalEvents/JournalSupercruiseExit.cs index a2a1f89324..428cc6c63e 100644 --- a/EliteDangerous/JournalEvents/JournalSupercruiseExit.cs +++ b/EliteDangerous/JournalEvents/JournalSupercruiseExit.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: leaving supercruise for normal space - //Parameters: - //• Starsystem - //• Body [JournalEntryType(JournalTypeEnum.SupercruiseExit)] public class JournalSupercruiseExit : JournalEntry, IBodyNameAndID { @@ -42,10 +38,9 @@ public JournalSupercruiseExit(JObject evt ) : base(evt, JournalTypeEnum.Supercru public string BodyType { get; set; } public string BodyDesignation { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("At ", Body , "< in ", StarSystem, "Type:" , BodyType); + info = BaseUtils.FieldBuilder.Build("At ".Tx(this,"At"), Body , "< in ".Txb(this), StarSystem, "Type:".Txb(this) , BodyType); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalSynthesis.cs b/EliteDangerous/JournalEvents/JournalSynthesis.cs index 4be75006fd..36152ac3d7 100644 --- a/EliteDangerous/JournalEvents/JournalSynthesis.cs +++ b/EliteDangerous/JournalEvents/JournalSynthesis.cs @@ -19,10 +19,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when synthesis is used to repair or rearm - //Parameters: - //• Name: synthesis blueprint - //• Materials: JSON object listing materials used and quantities [JournalEntryType(JournalTypeEnum.Synthesis)] public class JournalSynthesis : JournalEntry, IMaterialCommodityJournalEntry { @@ -68,9 +64,8 @@ public void MaterialList(MaterialCommoditiesList mc, DB.SQLiteConnectionUser con } } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Name; if (Materials != null) foreach (KeyValuePair k in Materials) diff --git a/EliteDangerous/JournalEvents/JournalSystemsShutdown.cs b/EliteDangerous/JournalEvents/JournalSystemsShutdown.cs index e34701bf91..e886f3fe25 100644 --- a/EliteDangerous/JournalEvents/JournalSystemsShutdown.cs +++ b/EliteDangerous/JournalEvents/JournalSystemsShutdown.cs @@ -18,16 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: shortly after a certain scripted hyperdiction event begins. - //Parameters: - // • N/A: No parameters. - // - //Example: - // { - // "timestamp": "2017-01-09T16:21:57Z", - // "event": "SystemsShutdown" - // } - [JournalEntryType(JournalTypeEnum.SystemsShutdown)] public class JournalSystemsShutdown : JournalEntry { @@ -35,7 +25,6 @@ public class JournalSystemsShutdown : JournalEntry public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalTechnologyBroker.cs b/EliteDangerous/JournalEvents/JournalTechnologyBroker.cs index 4783046a49..6dce8dc5f4 100644 --- a/EliteDangerous/JournalEvents/JournalTechnologyBroker.cs +++ b/EliteDangerous/JournalEvents/JournalTechnologyBroker.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,7 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - [JournalEntryType(JournalTypeEnum.TechnologyBroker)] public class JournalTechnologyBroker : JournalEntry { @@ -78,10 +77,9 @@ public class Materials public int Count; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Type:", BrokerType); + info = BaseUtils.FieldBuilder.Build("Type:".Txb(this), BrokerType); if (ItemsUnlocked != null) { diff --git a/EliteDangerous/JournalEvents/JournalTouchdown.cs b/EliteDangerous/JournalEvents/JournalTouchdown.cs index cf6b7f1fd0..e0eaf9ad4d 100644 --- a/EliteDangerous/JournalEvents/JournalTouchdown.cs +++ b/EliteDangerous/JournalEvents/JournalTouchdown.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -17,12 +17,6 @@ namespace EliteDangerousCore.JournalEvents { -// When written: landing on a planet surface -// Parameters: -//• Latitude(only if player is landing) -//• Longitude(only if player is landing) -//• PlayerControlled: (bool) false if ship was recalled from SRV, true if player is landing - [JournalEntryType(JournalTypeEnum.Touchdown)] public class JournalTouchdown : JournalEntry { @@ -36,10 +30,9 @@ public JournalTouchdown(JObject evt ) : base(evt, JournalTypeEnum.Touchdown) public double Longitude { get; set; } public bool? PlayerControlled { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = JournalFieldNaming.RLat(Latitude) + " " + JournalFieldNaming.RLong(Longitude) + BaseUtils.FieldBuilder.Build(", NPC Controlled;", PlayerControlled); + info = JournalFieldNaming.RLat(Latitude) + " " + JournalFieldNaming.RLong(Longitude) + BaseUtils.FieldBuilder.Build(", NPC Controlled;".Txb(this), PlayerControlled); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalUSSDrop.cs b/EliteDangerous/JournalEvents/JournalUSSDrop.cs index bffffa24cc..28bdd14b03 100644 --- a/EliteDangerous/JournalEvents/JournalUSSDrop.cs +++ b/EliteDangerous/JournalEvents/JournalUSSDrop.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,10 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when dropping from Supercruise at a USS - //Parameters: - //• USSType: description of USS - //• USSThreat: threat level [JournalEntryType(JournalTypeEnum.USSDrop)] public class JournalUSSDrop : JournalEntry { @@ -31,14 +27,14 @@ public JournalUSSDrop(JObject evt ) : base(evt, JournalTypeEnum.USSDrop) USSTypeLocalised = JournalFieldNaming.CheckLocalisation(evt["USSType_Localised"].Str(),USSType); USSThreat = evt["USSThreat"].Int(); } + public string USSType { get; set; } public int USSThreat { get; set; } public string USSTypeLocalised { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("Type:",USSTypeLocalised, "Threat:" , USSThreat); + info = BaseUtils.FieldBuilder.Build("Type:".Txb(this), USSTypeLocalised, "Threat:".Txb(this), USSThreat); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalUnderAttack.cs b/EliteDangerous/JournalEvents/JournalUnderAttack.cs index 2bee36da23..b9443b53f0 100644 --- a/EliteDangerous/JournalEvents/JournalUnderAttack.cs +++ b/EliteDangerous/JournalEvents/JournalUnderAttack.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: target is under attack - //Parameters: - //* Target [JournalEntryType(JournalTypeEnum.UnderAttack)] public class JournalUnderAttack : JournalEntry { @@ -31,9 +28,8 @@ public JournalUnderAttack(JObject evt ) : base(evt, JournalTypeEnum.UnderAttack) public string Target { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = BaseUtils.FieldBuilder.Build("", Target); detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalUndocked.cs b/EliteDangerous/JournalEvents/JournalUndocked.cs index 3ffc0e5b38..f118e99a51 100644 --- a/EliteDangerous/JournalEvents/JournalUndocked.cs +++ b/EliteDangerous/JournalEvents/JournalUndocked.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,11 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: liftoff from a landing pad in a station, outpost or settlement - //Parameters: - //• StationName: name of station - - //• Security [JournalEntryType(JournalTypeEnum.Undocked)] public class JournalUndocked : JournalEntry { @@ -32,14 +27,14 @@ public JournalUndocked(JObject evt ) : base(evt, JournalTypeEnum.Undocked) StationType = evt["StationType"].Str().SplitCapsWord(); MarketID = evt["MarketID"].LongNull(); } + public string StationName { get; set; } public string StationType { get; set; } public long? MarketID { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - - info = BaseUtils.FieldBuilder.Build("", StationName, "Type:", StationType); + info = BaseUtils.FieldBuilder.Build("", StationName, "Type:".Txb(this), StationType); detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalUnknown.cs b/EliteDangerous/JournalEvents/JournalUnknown.cs index 0d593d9e6a..38b1ff4540 100644 --- a/EliteDangerous/JournalEvents/JournalUnknown.cs +++ b/EliteDangerous/JournalEvents/JournalUnknown.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -33,9 +33,9 @@ public JournalUnknown(JObject evt) : base(evt, JournalTypeEnum.Unknown) eventname = evt["event"].Str("No event tag"); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = "Unhandled Journal event, Report to EDDiscovery team. " + Environment.NewLine + json; + info = "Unhandled Journal event, Report to EDDiscovery team. ".Tx(this) + Environment.NewLine + json; detailed = ""; } } diff --git a/EliteDangerous/JournalEvents/JournalVehicleSwitch.cs b/EliteDangerous/JournalEvents/JournalVehicleSwitch.cs index 8d514a1792..531a372554 100644 --- a/EliteDangerous/JournalEvents/JournalVehicleSwitch.cs +++ b/EliteDangerous/JournalEvents/JournalVehicleSwitch.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: when switching control between the main ship and a fighter - //Parameters: - //• To: ( Mothership/Fighter) [JournalEntryType(JournalTypeEnum.VehicleSwitch)] public class JournalVehicleSwitch : JournalEntry, IShipInformation { @@ -39,9 +36,8 @@ public void ShipInformation(ShipInformationList shp, string whereami, ISystem sy shp.VehicleSwitch(To); } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = To; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalWingAdd.cs b/EliteDangerous/JournalEvents/JournalWingAdd.cs index 8f28cece2c..4ab636e29f 100644 --- a/EliteDangerous/JournalEvents/JournalWingAdd.cs +++ b/EliteDangerous/JournalEvents/JournalWingAdd.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,23 +18,18 @@ namespace EliteDangerousCore.JournalEvents { - //When written: another player has joined the wing - //Parameters: - //• Name [JournalEntryType(JournalTypeEnum.WingAdd)] public class JournalWingAdd : JournalEntry { public JournalWingAdd(JObject evt ) : base(evt, JournalTypeEnum.WingAdd) { Name = evt["Name"].Str(); - } public string Name { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Name; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalWingInvite.cs b/EliteDangerous/JournalEvents/JournalWingInvite.cs index 01f6fa2924..c47b1d8b2a 100644 --- a/EliteDangerous/JournalEvents/JournalWingInvite.cs +++ b/EliteDangerous/JournalEvents/JournalWingInvite.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,7 @@ namespace EliteDangerousCore.JournalEvents { - //{ "timestamp": "2017-06-27T14:35:43Z", "event": "WingInvite", "Name": "" } - -[JournalEntryType(JournalTypeEnum.WingInvite)] + [JournalEntryType(JournalTypeEnum.WingInvite)] public class JournalWingInvite : JournalEntry { public JournalWingInvite(JObject evt ) : base(evt, JournalTypeEnum.WingInvite) @@ -30,9 +28,8 @@ public JournalWingInvite(JObject evt ) : base(evt, JournalTypeEnum.WingInvite) public string Name { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = Name; detailed = ""; } diff --git a/EliteDangerous/JournalEvents/JournalWingJoin.cs b/EliteDangerous/JournalEvents/JournalWingJoin.cs index f83d9111bc..218a686e21 100644 --- a/EliteDangerous/JournalEvents/JournalWingJoin.cs +++ b/EliteDangerous/JournalEvents/JournalWingJoin.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,9 +18,6 @@ namespace EliteDangerousCore.JournalEvents { - //When written: this player has joined a wing - //Parameters: - //• Others: JSON array of other player names already in wing [JournalEntryType(JournalTypeEnum.WingJoin)] public class JournalWingJoin : JournalEntry { @@ -31,9 +28,8 @@ public JournalWingJoin(JObject evt ) : base(evt, JournalTypeEnum.WingJoin) public string[] Others { get; set; } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; if (Others != null) foreach (string s in Others) diff --git a/EliteDangerous/JournalEvents/JournalWingLeave.cs b/EliteDangerous/JournalEvents/JournalWingLeave.cs index 462fb7daf9..8b46762020 100644 --- a/EliteDangerous/JournalEvents/JournalWingLeave.cs +++ b/EliteDangerous/JournalEvents/JournalWingLeave.cs @@ -1,5 +1,5 @@ /* - * Copyright © 2016 EDDiscovery development team + * Copyright © 2016-2018 EDDiscovery development team * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this * file except in compliance with the License. You may obtain a copy of the License at @@ -18,19 +18,15 @@ namespace EliteDangerousCore.JournalEvents { - //When written: this player has left a wing - //Parameters: none [JournalEntryType(JournalTypeEnum.WingLeave)] public class JournalWingLeave : JournalEntry { public JournalWingLeave(JObject evt ) : base(evt, JournalTypeEnum.WingLeave) { - } - public override void FillInformation(out string info, out string detailed) //V + public override void FillInformation(out string info, out string detailed) { - info = ""; detailed = ""; } diff --git a/TestNetLogEntry/Program.cs b/TestNetLogEntry/Program.cs index ff9292c30d..c64dc3c8a4 100644 --- a/TestNetLogEntry/Program.cs +++ b/TestNetLogEntry/Program.cs @@ -133,8 +133,21 @@ static void Main(string[] stringargs) } else if (arg1.Equals("scantranslate", StringComparison.InvariantCultureIgnoreCase)) { - FileInfo[] allFiles = Directory.EnumerateFiles(".", args.Next, SearchOption.TopDirectoryOnly).Select(f => new FileInfo(f)).OrderBy(p => p.FullName).ToArray(); - string ret = ScanTranslate.Process(allFiles); + string path = args.Next; + FileInfo[] allFiles = Directory.EnumerateFiles(".", path, SearchOption.TopDirectoryOnly).Select(f => new FileInfo(f)).OrderBy(p => p.FullName).ToArray(); + bool combine = false; + bool showrepeat = false; + + while( args.More ) + { + string a = args.Next.ToLower(); + if (a == "combine") + combine = true; + if (a == "showrepeats" ) + showrepeat = true; + } + + string ret = ScanTranslate.Process(allFiles,combine, showrepeat); Console.WriteLine(ret); } else @@ -186,7 +199,7 @@ static void Help() "CorolisShip name - process corolis-data\\ships\n" + "Coroliseng rootfolder - process corolis-data\\modifications\n" + "FrontierData rootfolder - process cvs file exports of frontier data\n" + - "scantranslate filespecwildcard - process source files and look for .Tx( definitions\n" + "scantranslate filespecwildcard [Combine] [ShowRepeats]- process source files and look for .Tx definitions\n" ); } diff --git a/TestNetLogEntry/ScanTranslate.cs b/TestNetLogEntry/ScanTranslate.cs index d7f62740f1..f900a6961c 100644 --- a/TestNetLogEntry/ScanTranslate.cs +++ b/TestNetLogEntry/ScanTranslate.cs @@ -10,7 +10,16 @@ namespace NetLogEntry { public static class ScanTranslate { - static public Tuple ProcessLine(string combinedline, string curline, int txpos, List localsdone, List globalsdone) + public class Definition + { + public Definition(string t, string x, string l) { token = t;text = x; firstdeflocation = l; } + public string token; + public string text; + public string firstdeflocation; + }; + + static public Tuple ProcessLine(string combinedline, string curline, int txpos, int parapos , bool warnoldidchange) + { bool ok = false; bool local = true; @@ -31,8 +40,16 @@ public static class ScanTranslate if (t.Item2) txphrase += t.Item1; + else if (ns == "+Environment.NewLine+Environment.NewLine+") + txphrase += "\\r\\n\\r\\n"; + else if (ns == "+Environment.NewLine+Environment.NewLine") + txphrase += "\\r\\n\\r\\n"; else if (ns == "+Environment.NewLine+") txphrase += "\\r\\n"; + else if (ns == "Environment.NewLine+") + txphrase += "\\r\\n"; + else if (ns == "+Environment.NewLine") + txphrase += "\\r\\n"; else if (ns == "+") txphrase += ""; else @@ -44,7 +61,7 @@ public static class ScanTranslate if (txphrase != null) { - StringParser s1 = new StringParser(combinedline, txpos + 4); + StringParser s1 = new StringParser(combinedline, parapos); string nextword = s1.NextWord(",)"); @@ -66,7 +83,9 @@ public static class ScanTranslate } else if (s1.IsCharMoveOn(')')) { - keyword = nextword + "."+ txphrase.ReplaceNonAlphaNumeric(); + if (warnoldidchange && txphrase.FirstAlphaNumericText() != txphrase.ReplaceNonAlphaNumeric()) + Console.WriteLine("Warning : Changed ID " + txphrase + " " + txphrase.FirstAlphaNumericText() + " old " + txphrase.ReplaceNonAlphaNumeric()); + keyword = nextword + "."+ txphrase.FirstAlphaNumericText(); ok = true; } } @@ -79,19 +98,24 @@ public static class ScanTranslate if (keyword != null) { - keyword = "." + keyword; ok = true; } } else if (s1.IsCharMoveOn(')')) { - keyword = "." + txphrase.ReplaceNonAlphaNumeric(); + keyword = txphrase.FirstAlphaNumericText(); + + if (warnoldidchange && keyword != txphrase.ReplaceNonAlphaNumeric()) + Console.WriteLine("Warning : Changed ID " + txphrase + " " + txphrase.FirstAlphaNumericText() + " old " + txphrase.ReplaceNonAlphaNumeric()); + ok = true; } } else if (s1.IsCharMoveOn(')')) { - keyword = txphrase.ReplaceNonAlphaNumeric(); + keyword = txphrase.FirstAlphaNumericText(); + if (warnoldidchange && keyword != txphrase.ReplaceNonAlphaNumeric()) + Console.WriteLine("Warning : Changed ID " + txphrase + " " + txphrase.FirstAlphaNumericText() + " old " + txphrase.ReplaceNonAlphaNumeric()); local = false; ok = true; } @@ -99,41 +123,16 @@ public static class ScanTranslate } } - if (!ok) - return new Tuple("Miss formed " + curline + Environment.NewLine,false); - else if ( local ) - { - if (localsdone.Contains(keyword)) - { - return new Tuple(null, false); - } - else - { - localsdone.Add(keyword); - return new Tuple(keyword + ": " + txphrase.AlwaysQuoteString() + " @" + Environment.NewLine,false); - } - } - else - { - if ( globalsdone.Contains(keyword)) - { - return new Tuple(null, true); - } - else - { - globalsdone.Add(keyword); - return new Tuple(keyword + ": " + txphrase.AlwaysQuoteString() + " @" + Environment.NewLine,true); - } - } - + return (ok) ? new Tuple(keyword, txphrase, local) : null; } - static public string Process(FileInfo[] files) // overall index of items + static public string Process(FileInfo[] files, bool combinedone, bool showrepeats) // overall index of items { string locals = ""; - string globals = "////////////////// Globals " + Environment.NewLine; - string designers = ""; - List globalsdone = new List(); + string globals = ""; + bool doneglobalstitle = false; + List globalsdone = new List(); + List localsdone = new List(); foreach (var fi in files) { @@ -141,45 +140,121 @@ public static class ScanTranslate using (StreamReader sr = new StreamReader(fi.FullName, utc8nobom)) // read directly from file.. presume UTF8 no bom { - string classname = ""; + List classes = new List(); + List baseclasses = new List(); + List classeslevel = new List(); + int bracketlevel = 0; - List done = new List(); + if ( !combinedone ) + localsdone = new List(); bool donelocaltitle = false; - bool donedesignerstitle = false; string line,previoustext=""; + int lineno = 0; while ((line = sr.ReadLine()) != null) { + lineno++; + int startpos = previoustext.Length; string combined = previoustext + line; while (true) { + bool usebasename = false; + int txpos = combined.IndexOf(".Tx(", startpos); + int txbpos = combined.IndexOf(".Txb(", startpos); + int parapos = txpos + 4; + + if ( txbpos >= 0 && (txpos ==-1 || txpos > txbpos )) + { + txpos = txbpos; + parapos = txpos + 5; + usebasename = true; + } if (txpos != -1) { - Tuple ret = ProcessLine(combined, line, txpos,done , globalsdone); + Tuple ret = ProcessLine(combined, line, txpos, parapos, false); + + string localtext = ""; + string globaltext = ""; - if (ret.Item1 != null) + if (ret == null) + localtext = fi.FullName + ":" + lineno + ":Miss formed line around " + combined.Mid(txpos, 30) + Environment.NewLine; + else { - if (ret.Item2 == false) + bool local = ret.Item3; + + string classprefix = ""; + + if ( !ret.Item1.Contains(".")) // typeof is already has class name sksksk.skksks + classprefix = local ? (usebasename ? (baseclasses.Count > 0 ? (baseclasses.Last()+".") : null) : (classes.Count > 0 ? (classes.Last()+".") : null)) : ""; + + if (classprefix == null) { - if (!donelocaltitle) + localtext = fi.FullName + ":" + lineno + ":ERROR: No class to assign name to - probably not reading {} properly " + ret.Item1 + Environment.NewLine; + } + else + { + string id = classprefix + ret.Item1; + + Definition def = (local ? localsdone : globalsdone).Find(x => x.token.Equals(id, StringComparison.InvariantCultureIgnoreCase)); + + string res = ""; + if (def != null) + { + if (def.text != ret.Item2) + res = fi.FullName + ":" + lineno + ":ERROR: ID has different text " + id + " " + ret.Item2.AlwaysQuoteString() + " orginal " + def.text.AlwaysQuoteString() + " at " + def.firstdeflocation; + else if (showrepeats) + res = "//Repeat " + id + " " + ret.Item2.AlwaysQuoteString(); + else + res = null; // indicate no output + } + else + { + (local ? localsdone : globalsdone).Add(new Definition(id, ret.Item2, fi.FullName + ":" + lineno)); + } + + if (res != null) { - locals += "///////////////////////////////////////////////////// " + Path.GetFileNameWithoutExtension(fi.FullName) + Environment.NewLine; - donelocaltitle = true; + if (!res.HasChars()) + res = id + ": " + ret.Item2.AlwaysQuoteString() + " @"; + + res += Environment.NewLine; + + if (local) + localtext = res; + else + globaltext = res; } - locals += ret.Item1; } - else - globals += ret.Item1; } - startpos = txpos + 4; + if (localtext.HasChars()) + { + if (!donelocaltitle) + { + locals += "///////////////////////////////////////////////////// " + (classes.Count>0 ? classes[0] : "?")+ Environment.NewLine; + donelocaltitle = true; + } + locals += localtext; + } + + if ( globaltext.HasChars()) + { + if (!doneglobalstitle) + { + globals += "///////////////////////////////////////////////////// Globals" + Environment.NewLine; + doneglobalstitle = true; + } + globals += globaltext; + } + + startpos = parapos; } else break; @@ -190,52 +265,100 @@ public static class ScanTranslate previoustext = previoustext.Substring(10000); - int textpos = line.IndexOf(".Text = "); - int thispos = line.IndexOf("this."); + line = line.Trim(); + + int clspos = line.IndexOf("partial class "); + if (clspos == -1) + clspos = line.IndexOf("public class "); + if (clspos == -1) + clspos = line.IndexOf("abstract class "); - if ( textpos > 0 && thispos > 0) + if (clspos >= 0) { - StringParser p = new StringParser(line.Substring(textpos + 7)); - string text = p.NextQuotedWord(); - //Console.WriteLine(line); + StringParser sp = new StringParser(line, clspos); + sp.NextWord(" "); + sp.NextWord(" "); + classes.Add(sp.NextWord(":").Trim()); + baseclasses.Add(sp.IsCharMoveOn(':') ? sp.NextWord(",") : null); + classeslevel.Add(bracketlevel); + System.Diagnostics.Debug.WriteLine(lineno + " {" + bracketlevel * 4 + " Push " + classes.Last() + " " + baseclasses.Last()); + } - int namelength = textpos - thispos - 5; + if (line.StartsWith("{")) + { + if (line.Length == 1 || !line.Substring(1).Trim().StartsWith("}")) + { + System.Diagnostics.Debug.WriteLine(lineno + " {" + bracketlevel * 4); + bracketlevel++; + } + else + System.Diagnostics.Debug.WriteLine(lineno + " Rejected {" + bracketlevel * 4); + } - if (namelength > 0) + if (line.StartsWith("}")) + { + if (line.Length == 1 || line.Substring(1).Trim()[0] == '/' || line.Substring(1).Trim()[0] == ';') { - string name = line.Substring(thispos + 5, namelength); - - if (text != "" && - !name.Contains("comboBox", StringComparison.InvariantCultureIgnoreCase) && - !name.Contains("Vscroll", StringComparison.InvariantCultureIgnoreCase) && - !name.Contains("TextBox", StringComparison.InvariantCultureIgnoreCase) && - !name.Contains("RichText", StringComparison.InvariantCultureIgnoreCase) - ) + if (classeslevel.Count > 0 && classeslevel.Last() == bracketlevel - 1) { - if (!donedesignerstitle) - { - designers += "///////////////////////////////////////////////////// " + Path.GetFileNameWithoutExtension(fi.FullName) + Environment.NewLine; - donedesignerstitle = true; - } - - designers += classname + "." + name + ": " + text.AlwaysQuoteString() + " @" + Environment.NewLine; - + System.Diagnostics.Debug.WriteLine(lineno + " Pop {" + (bracketlevel-1) * 4 + " " + classes.Last()); + classes.RemoveAt(classes.Count - 1); + classeslevel.RemoveAt(classeslevel.Count - 1); + baseclasses.RemoveAt(baseclasses.Count - 1); } + bracketlevel--; + System.Diagnostics.Debug.WriteLine(lineno + " }" + bracketlevel * 4); } - } - - int clspos = line.IndexOf("partial class "); - - if (clspos >= 0) - classname = line.Substring(clspos + 13).Trim(); + else + System.Diagnostics.Debug.WriteLine(lineno + " Rejected }" + bracketlevel * 4); - // TBD tooltips this.toolTip.SetToolTip(this.checkBoxMoveToTop, "Select if cursor moves to top entry when a new entry is received"); + } } } } - return locals + Environment.NewLine + globals + Environment.NewLine + designers; + return locals + globals; } } } + + +//// look for designer items.. experimental.. + +//int textpos = line.IndexOf(".Text = "); +//int thispos = line.IndexOf("this."); + +//if ( textpos > 0 && thispos > 0) +//{ +// StringParser p = new StringParser(line.Substring(textpos + 7)); +// string text = p.NextQuotedWord(); +// //Console.WriteLine(line); + +// int namelength = textpos - thispos - 5; + +// if (namelength > 0) +// { +// string name = line.Substring(thispos + 5, namelength); + +// if (text != "" && +// !name.Contains("comboBox", StringComparison.InvariantCultureIgnoreCase) && +// !name.Contains("Vscroll", StringComparison.InvariantCultureIgnoreCase) && +// !name.Contains("TextBox", StringComparison.InvariantCultureIgnoreCase) && +// !name.Contains("RichText", StringComparison.InvariantCultureIgnoreCase) +// ) +// { +// if (!donedesignerstitle) +// { +// designers += "///////////////////////////////////////////////////// " + Path.GetFileNameWithoutExtension(fi.FullName) + Environment.NewLine; +// donedesignerstitle = true; +// } + +// designers += classes.Last() + "." + name + ": " + text.AlwaysQuoteString() + " @" + Environment.NewLine; + +// } +// } +//} + +//// TBD tooltips this.toolTip.SetToolTip(this.checkBoxMoveToTop, "Select if cursor moves to top entry when a new entry is received"); + diff --git a/translator/example-ex.tlf b/translator/example-ex.tlf new file mode 100644 index 0000000000..f52ddb9098 --- /dev/null +++ b/translator/example-ex.tlf @@ -0,0 +1,2501 @@ +// ID is case sensitive. +// @ at end means : Debug mode : repeat english with '' around to show translation - this is for development. +// : Release mode : repeat in program english exactly. This means that you don't want to translate this section, or have not got to it yet +// The english part after the colon is a guide for what you should be replacing. Its not actually used in the program. It could be blank for instance and EDD would +// work ok. + +//////////////////////////////////////////////////////////////// GENERIC UCs + +Warning: "Warning" @ +Today: "Today" @ +24h: "24h" @ +7days: "7 days" @ +All: "All" @ +OK: "OK" @ +Cancel: "Cancel" @ +Delete: "Delete" @ +Campaign: "Campaign" @ +NoScan: "No Scan" @ +Systemnotknown: "System not known" @ +Travel: "Travel" @ +GameTime: "Game Time" @ +Time: "Time" @ +NoData: "No Data" @ +None: "None" @ +on: "on" @ +Off: "Off" @ +Unknown: "Unknown" @ +Information: "Information" @ +NoPos: "No Pos" @ + +//////////////////////////////////////////////////////////////// POP OUT AREA + +PopOutInfo.Log.Description: "Program log" => "" +PopOutInfo.Log.Title: "Log" => "" +PopOutInfo.Journal.Description: "Journal grid view" => "" +PopOutInfo.Journal.Title: "Journal" => "" +PopOutInfo.TravelGrid.Description: "History grid view" => "" +PopOutInfo.TravelGrid.Title: "Travel History" => "" +PopOutInfo.StarList.Description: "Visited star list" => "" +PopOutInfo.StarList.Title: "Star List" => "" +PopOutInfo.Materials.Description: "Materials count" => "" +PopOutInfo.Materials.Title: "Materials" => "" +PopOutInfo.Commodities.Description: "Commodity count" => "" +PopOutInfo.Commodities.Title: "Commodities" => "" +PopOutInfo.Ledger.Description: "Ledger of cash related entries" => "" +PopOutInfo.Ledger.Title: "Ledger" => "" +PopOutInfo.Missions.Description: "Mission list" => "" +PopOutInfo.Missions.Title: "Missions" => "" +PopOutInfo.Modules.Description: "Ships and their loadouts plus stored modules" => "" +PopOutInfo.Modules.Title: "Ships/Loadout" => "" +PopOutInfo.Statistics.Description: "Statistics Information" => "" +PopOutInfo.Statistics.Title: "Statistics" => "" +PopOutInfo.MarketData.Description: "Market data view, giving commodity price information where available" => "" +PopOutInfo.MarketData.Title: "Market Data" => "" +PopOutInfo.ShipYardPanel.Description: "Information on ship yards from places you have visited" => "" +PopOutInfo.ShipYardPanel.Title: "Ship Yards" => "" +PopOutInfo.OutfittingPanel.Description: "Information on outfitting items in ship yards from places you have visited" => "" +PopOutInfo.OutfittingPanel.Title: "Outfitting" => "" +PopOutInfo.Synthesis.Description: "Synthesis planner" => "" +PopOutInfo.Synthesis.Title: "Synthesis" => "" +PopOutInfo.Engineering.Description: "Engineering planner" => "" +PopOutInfo.Engineering.Title: "Engineering" => "" +PopOutInfo.ShoppingList.Description: "Shopping list planner combining synthesis and engineering" => "" +PopOutInfo.ShoppingList.Title: "Shopping List" => "" +PopOutInfo.Scan.Description: "Scan data on system" => "" +PopOutInfo.Scan.Title: "Scan" => "" +PopOutInfo.ScanGrid.Description: "Scan data on system in a grid" => "" +PopOutInfo.ScanGrid.Title: "Scan Grid" => "" +PopOutInfo.StarDistance.Description: "List of nearest stars" => "" +PopOutInfo.StarDistance.Title: "Nearest Stars" => "" +PopOutInfo.EstimatedValues.Description: "Estimated scan values of bodies in system" => "" +PopOutInfo.EstimatedValues.Title: "Estimated Values" => "" +PopOutInfo.LocalMap.Description: "3D Map of systems in range" => "<3D Map of systems in range>" +PopOutInfo.LocalMap.Title: "Local Map" => "" +PopOutInfo.Plot.Description: "2D Plot of systems in range" => "<2D Plot of systems in range>" +PopOutInfo.Plot.Title: "2D Plot" => "<2D Plot>" +PopOutInfo.EDSM.Description: "EDSM Star finder" => "" +PopOutInfo.EDSM.Title: "EDSM Star Finder" => "" +PopOutInfo.Trilateration.Description: "Trilateration of stars with unknown positions" => "" +PopOutInfo.Trilateration.Title: "Trilateration" => "" +PopOutInfo.BookmarkManager.Description: "Manage System and planetary bookmarks" => "" +PopOutInfo.BookmarkManager.Title: "Bookmarks" => "" +PopOutInfo.CombatPanel.Description: "Display combat statistics" => "" +PopOutInfo.CombatPanel.Title: "Combat" => "" +PopOutInfo.Route.Description: "Route Finder from stored star data" => "" +PopOutInfo.Route.Title: "Route Finder" => "" +PopOutInfo.Expedition.Description: "Expedition Planner, make up a expedition route" => "" +PopOutInfo.Expedition.Title: "Expedition" => "" +PopOutInfo.Exploration.Description: "Exploration Planner, make a list of the stars to explore" => "" +PopOutInfo.Exploration.Title: "Exploration" => "" +PopOutInfo.SystemInformation.Description: "System Information" => "" +PopOutInfo.SystemInformation.Title: "System Information" => "" +PopOutInfo.Spanel.Description: "Summary panel overlay" => "" +PopOutInfo.Spanel.Title: "Summary Panel" => "" +PopOutInfo.Trippanel.Description: "Trip computer overlay" => "" +PopOutInfo.Trippanel.Title: "Trip Computer" => "" +PopOutInfo.NotePanel.Description: "System notes overlay" => "" +PopOutInfo.NotePanel.Title: "Notes" => "" +PopOutInfo.RouteTracker.Description: "Route tracker overlay" => "" +PopOutInfo.RouteTracker.Title: "Route Tracker" => "" +PopOutInfo.Compass.Description: "Ground compass overlay to show bearing to planetary coordinates" => "" +PopOutInfo.Compass.Title: "Compass" => "" +PopOutInfo.Settings.Description: "Settings for ED Discovery " => "" +PopOutInfo.Settings.Title: "Settings" => "" +PopOutInfo.ScreenShot.Description: "Screen shot view" => "" +PopOutInfo.ScreenShot.Title: "Screen Shot" => "" +PopOutInfo.Grid.Description: "Grid (allows other panels to be placed in the it)" => "" +PopOutInfo.Grid.Title: "Grid" => "" +PopOutInfo.SplitterControl.Description: "Splitter (allows other panels to be placed in the it)" => "" +PopOutInfo.SplitterControl.Title: "Splitter" => "" +PopOutInfo.PanelSelector.Description: "" => "" +PopOutInfo.PanelSelector.Title: "+" => "+" + +//////////////////////////////////////////////////////////////// DISCOVERY FORM + +EDDiscoveryForm.toolsToolStripMenuItem: "&Tools" => "<&Tools>" +EDDiscoveryForm.toolsToolStripMenuItem.settingsToolStripMenuItem: "Settings" => "" +EDDiscoveryForm.toolsToolStripMenuItem.show2DMapsToolStripMenuItem: "Show &2D maps" => "" +EDDiscoveryForm.toolsToolStripMenuItem.show3DMapsToolStripMenuItem: "Show &3D maps" => "" +EDDiscoveryForm.toolsToolStripMenuItem.showAllPopoutsInTaskBarToolStripMenuItem: "&Pop-outs" => "<&Pop-outs>" +EDDiscoveryForm.toolsToolStripMenuItem.showAllPopoutsInTaskBarToolStripMenuItem.showAllInTaskBarToolStripMenuItem: "&Show All In Task Bar" => "<&Show All In Task Bar>" +EDDiscoveryForm.toolsToolStripMenuItem.showAllPopoutsInTaskBarToolStripMenuItem.turnOffAllTransparencyToolStripMenuItem: "&Turn Off All Transparency" => "<&Turn Off All Transparency>" +EDDiscoveryForm.toolsToolStripMenuItem.exitToolStripMenuItem: "E&xit" => "" +EDDiscoveryForm.adminToolStripMenuItem: "A&dmin" => "" +EDDiscoveryForm.adminToolStripMenuItem.forceEDDBUpdateToolStripMenuItem: "Synchronise with EDDB" => "" +EDDiscoveryForm.adminToolStripMenuItem.syncEDSMSystemsToolStripMenuItem: "Synchronise with EDSM" => "" +EDDiscoveryForm.adminToolStripMenuItem.showLogfilesToolStripMenuItem: "Show journal files directory of current commander" => "" +EDDiscoveryForm.adminToolStripMenuItem.dEBUGResetAllHistoryToFirstCommandeToolStripMenuItem: "Reset all history to current commander" => "" +EDDiscoveryForm.adminToolStripMenuItem.read21AndFormerLogFilesToolStripMenuItem: "Read 2.1 and former log files" => "" +EDDiscoveryForm.adminToolStripMenuItem.read21AndFormerLogFilesToolStripMenuItem.read21AndFormerLogFiles_forceReloadLogsToolStripMenuItem: "Force reload logs" => "" +EDDiscoveryForm.adminToolStripMenuItem.rescanAllJournalFilesToolStripMenuItem: "Re-scan all journal files" => "" +EDDiscoveryForm.adminToolStripMenuItem.deleteDuplicateFSDJumpEntriesToolStripMenuItem: "Delete duplicate FSD Jump entries" => "" +EDDiscoveryForm.adminToolStripMenuItem.sendUnsuncedEDDNEventsToolStripMenuItem: "Send unsynced EDDN events" => "" +EDDiscoveryForm.adminToolStripMenuItem.sendUnsyncedEGOScansToolStripMenuItem: "Send unsynced EGO scans" => "" +EDDiscoveryForm.adminToolStripMenuItem.sendHistoricDataToInaraToolStripMenuItem: "Send to Inara historic data (previous ships, stored modules)" => "" +EDDiscoveryForm.adminToolStripMenuItem.clearEDSMIDAssignedToAllRecordsForCurrentCommanderToolStripMenuItem: "Clear EDSM ID assigned to all records for current commander" => "" +EDDiscoveryForm.adminToolStripMenuItem.exportVistedStarsListToEliteDangerousToolStripMenuItem: "Export Visted Stars List to Elite Dangerous" => "" +EDDiscoveryForm.addOnsToolStripMenuItem: "&Add-Ons" => "<&Add-Ons>" +EDDiscoveryForm.addOnsToolStripMenuItem.manageAddOnsToolStripMenuItem: "&Manage Add-Ons" => "<&Manage Add-Ons>" +EDDiscoveryForm.addOnsToolStripMenuItem.configureAddOnActionsToolStripMenuItem: "&Edit Add-On Action Files" => "<&Edit Add-On Action Files>" +EDDiscoveryForm.addOnsToolStripMenuItem.editLastActionPackToolStripMenuItem: "Edit Last Action Pack" => "" +EDDiscoveryForm.addOnsToolStripMenuItem.stopCurrentlyRunningActionProgramToolStripMenuItem: "&Stop currently running Action Program" => "<&Stop currently running Action Program>" +EDDiscoveryForm.helpToolStripMenuItem: "&Help" => "<&Help>" +EDDiscoveryForm.helpToolStripMenuItem.aboutToolStripMenuItem: "&About" => "<&About>" +EDDiscoveryForm.helpToolStripMenuItem.eDDiscoveryHomepageToolStripMenuItem: "&View Help" => "<&View Help>" +EDDiscoveryForm.helpToolStripMenuItem.eDDiscoveryChatDiscordToolStripMenuItem: "&Discord - EDD Community Chat" => "<&Discord - EDD Community Chat>" +EDDiscoveryForm.helpToolStripMenuItem.frontierForumThreadToolStripMenuItem: "&Frontier Forum Thread" => "<&Frontier Forum Thread>" +EDDiscoveryForm.helpToolStripMenuItem.gitHubToolStripMenuItem: "&Project Page (GitHub)" => "<&Project Page (GitHub)>" +EDDiscoveryForm.helpToolStripMenuItem.reportIssueIdeasToolStripMenuItem: "&Report Issue / Idea" => "<&Report Issue / Idea>" +EDDiscoveryForm.helpToolStripMenuItem.howToRunInSafeModeToResetVariousParametersToolStripMenuItem: "How to Run in Safe Mode to reset various parameters" => "" +EDDiscoveryForm.helpToolStripMenuItem.checkForNewReleaseToolStripMenuItem: "&Check for Updates" => "<&Check for Updates>" + +EDDiscoveryForm.tabControlMain.ToolTip: "Right click to add/remove tabs, Left click drag to reorder" @ + +EDDiscoveryForm.comboBoxCustomProfiles.ToolTip: "Use to select new profile or edit profile settings" => "" +EDDiscoveryForm.comboBoxCommander.ToolTip: "Select the commander to view" => "" +UserControlCombatPanel.buttonExtEditCampaign.ToolTip: "Edit user defined campaign" => "" + +.Kills: "Kills:" @ +.Faction: "Faction:" @ +.Crimes: "Crimes:" @ +.Bal: "Bal:" @ +.NewCampaign: "New Campaign" @ +.SinceLastDock: "Since Last Dock" @ +.Name: "Name:" @ +.C1: "Give name to campaign" @ +.C2: "Optional faction to target" @ +.Start: "Start:" @ +.C3: "Select Start time" @ +.End: "End:" @ +.C4: "Select Start time" @ +.C5: "Press to Accept" @ +.C6: "Press to Cancel" @ +.C7: "Press to Delete" @ +.NoOverwrite: "Name of campaign already in use, cannot overwrite" @ +.Condel: "Confirm deletion of {0}" @ +.NC: "Name changed - can't delete" @ + +//////////////////////////////////////////////////////////////// Compass + +UserControlCompass.labelBookmark: "System Bookmarks" @ +UserControlCompass.checkBoxHideTransparent: "Hide In Transparent" @ +UserControlCompass.labelTargetLat: "Target" @ + +//////////////////////////////////////////////////////////////// EDSM + +UserControlEDSM.mapGotoStartoolStripMenuItem: "Go to star on 3D Map" @ +UserControlEDSM.viewOnEDSMToolStripMenuItem: "View on EDSM" @ + +UserControlEDSM.ColumnStar: "Star" => "" +UserControlEDSM.ColumnCentreDistance: "Centre Distance" => "" +UserControlEDSM.ColumnCurrentDistance: "Current Distance" => "" +UserControlEDSM.ColumnPosition: "Position" => "" +UserControlEDSM.ColumnID: "ID" => "" + +//////////////////////////////////////////////////////////////// Engineering + +UserControlEngineering.UpgradeCol: "Upgrade/Mat" => "" +UserControlEngineering.ModuleCol: "Module" => "" +UserControlEngineering.LevelCol: "Level" => "" +UserControlEngineering.MaxCol: "Max" => "" +UserControlEngineering.WantedCol: "Wanted" => "" +UserControlEngineering.AvailableCol: "Avail." => "" +UserControlEngineering.NotesCol: "Notes" => "" +UserControlEngineering.RecipeCol: "Recipe" => "" +UserControlEngineering.EngineersCol: "Engineers" => "" +UserControlEngineering.chkHistoric: "Use Cursor Positon" => "" +UserControlEngineering.buttonClear: "Clear Wanted" => "" +UserControlEngineering.buttonFilterMaterial: "Filter By Material" => "" +UserControlEngineering.buttonFilterUpgrade: "Filter By Upgrade" => "" +UserControlEngineering.buttonFilterLevel: "Filter By Level" => "" +UserControlEngineering.buttonFilterEngineer: "Filter By Engineer" => "" +UserControlEngineering.buttonFilterModule: "Filter By Module" => "" +UserControlEngineering.ToolTip: "Left click and drag on grid to reorder" => "" +UserControlEngineering.chkHistoric.ToolTip: "When clicked on, use the materials at the cursor to estimate, when off always use the latest materials." => "" +UserControlEngineering.buttonClear.ToolTip: "Set all wanted values to zero" => "" +UserControlEngineering.buttonFilterMaterial.ToolTip: "Filter the table by material" => "" +UserControlEngineering.buttonFilterUpgrade.ToolTip: "Filter the table by upgrade type" => "" +UserControlEngineering.buttonFilterLevel.ToolTip: "Filter the table by level" => "" +UserControlEngineering.buttonFilterEngineer.ToolTip: "Filter the table by engineer" => "" +UserControlEngineering.buttonFilterModule.ToolTip: "Filter the table by module type" => "" + +/////////////////////////////////////////////////////////////// Estimated Values + +UserControlEstimatedValues.BodyName: "Body Name" => "" +UserControlEstimatedValues.EstValue: "Est Value" => "" +.SV: "Estimated Scan Values for {0}" => "" + +/////////////////////////////////////////////////////////////// Expedition + +UserControlExpedition.SystemName: "System Name" => "" +UserControlExpedition.Distance: "Dist." => "" +UserControlExpedition.Note: "Note" => "" +UserControlExpedition.labelCml: "Cml Distance:" => "" +UserControlExpedition.labelP2P: "P2P Distance:" => "" +UserControlExpedition.buttonReverseRoute: "Reverse" => "" +UserControlExpedition.labelEndDate: "End Date:" => "" +UserControlExpedition.labelDateStart: "Start Date:" => "" +UserControlExpedition.labelRouteName: "Route Name:" => "" +UserControlExpedition.toolStripButtonNew: "New Route" => "" +UserControlExpedition.toolStripButtonImportFile: "Import file" => "" +UserControlExpedition.toolStripButtonImportRoute: "Import route" => "" +UserControlExpedition.toolStripButtonSave: "Save Route" => "" +UserControlExpedition.toolStripButtonExport: "Export" => "" +UserControlExpedition.toolStripButtonDelete: "Delete Route" => "" +UserControlExpedition.toolStripButtonShowOn3DMap: "Show on 3D Map" => "" +UserControlExpedition.copyToolStripMenuItem: "Copy" => "" +UserControlExpedition.pasteToolStripMenuItem: "Paste" => "" +UserControlExpedition.insertCopiedToolStripMenuItem: "Insert Copied Rows" => "" +UserControlExpedition.deleteRowsToolStripMenuItem: "Delete Rows" => "" +UserControlExpedition.setTargetToolStripMenuItem: "Set Target" => "" +UserControlExpedition.editBookmarkToolStripMenuItem: "Edit bookmark" => "" +UserControlExpedition.ctxMenuItemUndelete: "&Undelete" => "<&Undelete>" + +.NoRoute: "No route set up. Please add at least two systems." @ +.Delete: "Are you sure you want to delete this route?" @ +.SelRoute: "Select a route file" @ +.FileE: "There was an error reading file" @ +.Nonames: "The imported file contains no known system names" @ +UserControlExpedition.Createroute: "Please create a route on a route panel" @ +UserControlExpedition.NoRouteExport: "There is no route to export " @ +.Export: "Export route" @ +.UnknownS: "Unknown system, system is without co-ordinates" @ +.Unsaved: "There are unsaved changes to the current route.\r\nWould you like to save the current route before proceeding?" @ +.Specify: "Please specify a name for the route." @ +.Conflict: "The current route name conflicts with a well-known expedition.\r\nPlease specify a new name to save your changes." @ +.Overwrite: "Warning: route already exists. Would you like to overwrite it?" @ +.EDSMUnk: "System not known to EDSM" @ + +/////////////////////////////////////////////////////////////// Exploration + +UserControlExploration.ColumnSystemName: "System Name" => "" +UserControlExploration.ColumnDist: "Dist" => "" +UserControlExploration.ColumnX: "X" => "" +UserControlExploration.ColumnY: "Y" => "" +UserControlExploration.ColumnZ: "Z" => "" +UserControlExploration.ColumnVisits: "Visits" => "" +UserControlExploration.ColumnScans: "Scans" => "" +UserControlExploration.ColumnPrimaryStar: "Pri star" => "" +UserControlExploration.ColumnInfo: "Info" => "" +UserControlExploration.ColumnNote: "Note" => "" +UserControlExploration.labelFilename: "Filename" => "" +UserControlExploration.labelName: "Exploration set:" => "" +UserControlExploration.toolStripButtonNew: "New" => "" +UserControlExploration.toolStripButtonLoad: "Load" => "" +UserControlExploration.toolStripButtonSave: "Save" => "" +UserControlExploration.tsbAddSystems: "Add Systems" => "" +UserControlExploration.toolStripButtonImportFile: "Import Text File" => "" +UserControlExploration.toolStripButtonExport: "Export Text File" => "" +UserControlExploration.toolStripButtonClear: "Clear List" => "" +UserControlExploration.copyToolStripMenuItem: "Copy" => "" +UserControlExploration.pasteToolStripMenuItem: "Paste" => "" +UserControlExploration.insertCopiedToolStripMenuItem: "Insert Copied Rows" => "" +UserControlExploration.deleteRowsToolStripMenuItem: "Delete Rows" => "" +UserControlExploration.setTargetToolStripMenuItem: "Set Target" => "" +UserControlExploration.editBookmarkToolStripMenuItem: "Edit bookmark" => "" + +.Saved: "Saved to {0} Exploration Set" @ +.SelectSet: "Select a exploration set file" @ +.OpenE: "There was a problem opening file {0}" @ +.NoSys: "The imported file contains no known system names" @ +.NoRoute: "There is no route to export" @ +.Export: "Export route" @ +.ErrorW: "Error exporting route. Is file {0} open?" @ +.Clear: "Are you sure you want to clear the route list?" @ +.AddSys: "Add Systems" @ +.EDSMUnk: "System not known to EDSM" @ +.UnknownS: "Unknown system, system is without co-ordinates" @ + +/////////////////////////////////////////////////////////////////// Journal + +UserControlJournalGrid.ColumnTime: "Time" => "