diff --git a/ARKBreedingStats/ARKBreedingStats.csproj b/ARKBreedingStats/ARKBreedingStats.csproj index 630ee8ff..360e832d 100644 --- a/ARKBreedingStats/ARKBreedingStats.csproj +++ b/ARKBreedingStats/ARKBreedingStats.csproj @@ -844,6 +844,7 @@ TamingControl.cs + Designer TamingFoodControl.cs diff --git a/ARKBreedingStats/App.config b/ARKBreedingStats/App.config index d2e8cf10..fdd9247e 100644 --- a/ARKBreedingStats/App.config +++ b/ARKBreedingStats/App.config @@ -490,6 +490,9 @@ False + + + diff --git a/ARKBreedingStats/Form1.l10n.cs b/ARKBreedingStats/Form1.l10n.cs index fac34847..09fe6783 100644 --- a/ARKBreedingStats/Form1.l10n.cs +++ b/ARKBreedingStats/Form1.l10n.cs @@ -4,7 +4,7 @@ public partial class Form1 { private void InitLocalization() { - Loc.LoadResourceFile(); + Loc.LoadResourceFile(Properties.Settings.Default.language, Properties.Settings.Default.language2); Utils.InitializeLocalizations(); } diff --git a/ARKBreedingStats/Form1.library.cs b/ARKBreedingStats/Form1.library.cs index d78f2413..2dd3a51b 100644 --- a/ARKBreedingStats/Form1.library.cs +++ b/ARKBreedingStats/Form1.library.cs @@ -733,18 +733,16 @@ private Creature EnsurePlaceholderCreature(List placeholders, Creature /// private void UpdateIncubationParents(CreatureCollection cc) { - foreach (Creature c in cc.creatures) + if (!cc.incubationListEntries.Any()) return; + + var dict = cc.creatures.ToDictionary(c => c.guid); + + foreach (IncubationTimerEntry it in cc.incubationListEntries) { - if (c.guid != Guid.Empty) - { - foreach (IncubationTimerEntry it in cc.incubationListEntries) - { - if (c.guid == it.motherGuid) - it.mother = c; - else if (c.guid == it.fatherGuid) - it.father = c; - } - } + if (it.motherGuid != Guid.Empty && dict.TryGetValue(it.motherGuid, out var m)) + it.Mother = m; + if (it.fatherGuid != Guid.Empty && dict.TryGetValue(it.fatherGuid, out var f)) + it.Father = f; } } @@ -1594,7 +1592,7 @@ private void ExportForSpreadsheet() } if (listViewLibrary.SelectedIndices.Count > 0) { - var exportCount = ExportImportCreatures.ExportTable(listViewLibrary.SelectedIndices.Cast().Select(i => _creaturesDisplayed[i])); + var exportCount = ExportImportCreatures.ExportTable(listViewLibrary.SelectedIndices.Cast().Select(i => _creaturesDisplayed[i]).ToArray()); if (exportCount != 0) SetMessageLabelText($"{exportCount} creatures were exported to the clipboard for pasting in a spreadsheet.", MessageBoxIcon.Information); diff --git a/ARKBreedingStats/IncubationTimerEntry.cs b/ARKBreedingStats/IncubationTimerEntry.cs index 9d1ea836..83c4aeb8 100644 --- a/ARKBreedingStats/IncubationTimerEntry.cs +++ b/ARKBreedingStats/IncubationTimerEntry.cs @@ -12,8 +12,8 @@ public class IncubationTimerEntry public TimeSpan incubationDuration; [JsonProperty] public DateTime incubationEnd; - public Creature _mother; - public Creature _father; + private Creature _mother; + private Creature _father; [JsonProperty] public Guid motherGuid; [JsonProperty] @@ -21,18 +21,12 @@ public class IncubationTimerEntry public string kind; // contains "Egg" or "Gestation", depending on the species public bool expired; - public IncubationTimerEntry() - { - mother = new Creature(); - father = new Creature(); - incubationDuration = new TimeSpan(); - incubationEnd = new DateTime(); - } + public IncubationTimerEntry() { } public IncubationTimerEntry(Creature mother, Creature father, TimeSpan incubationDuration, bool incubationStarted) { - this.mother = mother; - this.father = father; + Mother = mother; + Father = father; this.incubationDuration = incubationDuration; incubationEnd = new DateTime(); if (incubationStarted) @@ -64,7 +58,7 @@ public void StartStopTimer(bool start) else PauseTimer(); } - public Creature mother + public Creature Mother { get => _mother; set @@ -74,7 +68,7 @@ public Creature mother } } - public Creature father + public Creature Father { get => _father; set diff --git a/ARKBreedingStats/Loc.cs b/ARKBreedingStats/Loc.cs index 4725ef27..46caeb9a 100644 --- a/ARKBreedingStats/Loc.cs +++ b/ARKBreedingStats/Loc.cs @@ -10,39 +10,52 @@ namespace ARKBreedingStats /// internal static class Loc { - private static ResourceManager rm; + private static ResourceManager _rm; + /// + /// Second language can be used in parts of the app. + /// + private static CultureInfo _secondaryCulture; - public static void LoadResourceFile() + public static void LoadResourceFile(string language, string language2 = null) { - CultureInfo culture; - if (string.IsNullOrEmpty(Properties.Settings.Default.language)) - { - culture = CultureInfo.CurrentCulture; - } - else + CultureInfo LoadCultureInfo(string l) { + if (string.IsNullOrEmpty(l)) + { + return null; + } try { - culture = new CultureInfo(Properties.Settings.Default.language); + return new CultureInfo(l); } catch (CultureNotFoundException) { - culture = CultureInfo.CurrentCulture; + return null; } } - Thread.CurrentThread.CurrentUICulture = culture; + if (!string.IsNullOrEmpty(language2) && language2 != language) + _secondaryCulture = LoadCultureInfo(language2); + else _secondaryCulture = null; - rm = new ResourceManager("ARKBreedingStats.local.strings", typeof(Form1).Assembly); + var culture = LoadCultureInfo(language) ?? CultureInfo.CurrentCulture; + Thread.CurrentThread.CurrentUICulture = culture; + if (_rm == null) + _rm = new ResourceManager("ARKBreedingStats.local.strings", typeof(Form1).Assembly); } + public static bool UseSecondaryCulture => _secondaryCulture != null; + /// /// Returns the localized string. /// - public static string S(string key, bool returnKeyIfValueNa = true) + public static string S(string key, bool returnKeyIfValueNa = true, bool secondaryCulture = false) { - if (rm == null) return null; - string s = rm.GetString(key); + if (_rm == null) return null; + if (secondaryCulture && _secondaryCulture != null) + return S(key, _secondaryCulture, returnKeyIfValueNa); + + var s = _rm.GetString(key); //if (string.IsNullOrEmpty(s) && !key.EndsWith("TT")) System.Console.WriteLine("missing: " + key); // for debugging return s ?? (returnKeyIfValueNa ? key : null); } @@ -52,8 +65,8 @@ public static string S(string key, bool returnKeyIfValueNa = true) /// public static string S(string key, CultureInfo culture, bool returnKeyIfValueNa = true) { - if (rm == null) return null; - string s = rm.GetString(key, culture); + if (_rm == null) return null; + string s = _rm.GetString(key, culture); //if (string.IsNullOrEmpty(s) && !key.EndsWith("TT")) System.Console.WriteLine("missing: " + key); // for debugging return s ?? (returnKeyIfValueNa ? key : null); } diff --git a/ARKBreedingStats/Properties/AssemblyInfo.cs b/ARKBreedingStats/Properties/AssemblyInfo.cs index 3a12e5f3..3abe69d1 100644 --- a/ARKBreedingStats/Properties/AssemblyInfo.cs +++ b/ARKBreedingStats/Properties/AssemblyInfo.cs @@ -30,6 +30,6 @@ // Revision // [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("0.53.1.0")] +[assembly: AssemblyFileVersion("0.54.0.0")] [assembly: NeutralResourcesLanguage("en")] diff --git a/ARKBreedingStats/Properties/Settings.Designer.cs b/ARKBreedingStats/Properties/Settings.Designer.cs index fe53e14b..c1499a63 100644 --- a/ARKBreedingStats/Properties/Settings.Designer.cs +++ b/ARKBreedingStats/Properties/Settings.Designer.cs @@ -2194,5 +2194,17 @@ public byte[][] CustomStatWeightOddEven { this["CustomStatWeightOddEven"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string language2 { + get { + return ((string)(this["language2"])); + } + set { + this["language2"] = value; + } + } } } diff --git a/ARKBreedingStats/Properties/Settings.settings b/ARKBreedingStats/Properties/Settings.settings index e05bf72d..c4f46cfb 100644 --- a/ARKBreedingStats/Properties/Settings.settings +++ b/ARKBreedingStats/Properties/Settings.settings @@ -551,5 +551,8 @@ + + + \ No newline at end of file diff --git a/ARKBreedingStats/Taming.cs b/ARKBreedingStats/Taming.cs index bbdcaf91..d59ac33f 100644 --- a/ARKBreedingStats/Taming.cs +++ b/ARKBreedingStats/Taming.cs @@ -17,7 +17,7 @@ public static class Taming public static void TamingTimes(Species species, int level, double tamingSpeedMultiplier, double tamingFoodRateMultiplier, List usedFood, List foodAmount, out List foodAmountUsed, out TimeSpan duration, - out int neededNarcoberries, out int neededAscerbicMushrooms, out int neededNarcotics, out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood) + out int neededNarcoberries, out int neededAscerbicMushrooms, out int neededNarcotics, out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood, bool useSanguineElixir = false) { double totalTorpor = 0; double torporDepletionPerSecond = 0; @@ -41,7 +41,7 @@ public static void TamingTimes(Species species, int level, double tamingSpeedMul if (species != null && species.taming != null) { - double affinityNeeded = species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level; + double affinityNeeded = (species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level) * (useSanguineElixir ? 0.7 : 1); // test if creature is tamed non-violently, then use wakeTame multipliers if (!species.taming.nonViolent) @@ -147,19 +147,19 @@ public static void TamingTimes(Species species, int level, double tamingSpeedMul public static void TamingTimes(Species species, int level, double tamingSpeedMultiplier, double tamingFoodRateMultiplier, string usedFood, int foodAmount, out List foodAmountUsed, out TimeSpan duration, out int neededNarcoberries, out int neededAscerbicMushrooms, out int neededNarcotics, - out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood) + out int neededBioToxins, out double te, out double hunger, out int bonusLevel, out bool enoughFood, bool useSanguineElixir = false) { TamingTimes(species, level, tamingSpeedMultiplier, tamingFoodRateMultiplier, new List { usedFood }, new List { foodAmount }, out foodAmountUsed, out duration, out neededNarcoberries, out neededAscerbicMushrooms, out neededNarcotics, out neededBioToxins, - out te, out hunger, out bonusLevel, out enoughFood); + out te, out hunger, out bonusLevel, out enoughFood, useSanguineElixir); } - public static int FoodAmountNeeded(Species species, int level, double tamingSpeedMultiplier, string foodName, bool nonViolent = false) + public static int FoodAmountNeeded(Species species, int level, double tamingSpeedMultiplier, string foodName, bool nonViolent = false, bool useSanguineElixir = false) { if (species != null) { - double affinityNeeded = species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level; + double affinityNeeded = (species.taming.affinityNeeded0 + species.taming.affinityIncreasePL * level) * (useSanguineElixir ? 0.7 : 1); var food = Values.V.GetTamingFood(species, foodName); if (food == null) return 0; diff --git a/ARKBreedingStats/TamingControl.Designer.cs b/ARKBreedingStats/TamingControl.Designer.cs index 6a3d23ab..b8fc072d 100644 --- a/ARKBreedingStats/TamingControl.Designer.cs +++ b/ARKBreedingStats/TamingControl.Designer.cs @@ -34,6 +34,7 @@ private void InitializeComponent() this.lbMax = new System.Windows.Forms.Label(); this.lbUsed = new System.Windows.Forms.Label(); this.gpTorporTime = new System.Windows.Forms.GroupBox(); + this.numericUpDownCurrentTorpor = new ARKBreedingStats.uiControls.Nud(); this.btAddWakeUpTimer = new System.Windows.Forms.Button(); this.lbTimeUntilWakingUp = new System.Windows.Forms.Label(); this.lbCurrentTorpor = new System.Windows.Forms.Label(); @@ -41,19 +42,28 @@ private void InitializeComponent() this.gbWeaponDamage = new System.Windows.Forms.GroupBox(); this.flcBodyDamageMultipliers = new System.Windows.Forms.FlowLayoutPanel(); this.rbBoneDamageDefault = new System.Windows.Forms.RadioButton(); + this.nudWDmHarpoon = new ARKBreedingStats.uiControls.Nud(); this.chkbDmHarpoon = new System.Windows.Forms.CheckBox(); + this.nudWDmProd = new ARKBreedingStats.uiControls.Nud(); this.chkbDmCrossbow = new System.Windows.Forms.CheckBox(); this.chkbDmBow = new System.Windows.Forms.CheckBox(); this.chkbDmSlingshot = new System.Windows.Forms.CheckBox(); this.chkbDmClub = new System.Windows.Forms.CheckBox(); this.chkbDmLongneck = new System.Windows.Forms.CheckBox(); + this.nudWDmSlingshot = new ARKBreedingStats.uiControls.Nud(); this.chkbDmProd = new System.Windows.Forms.CheckBox(); + this.nudWDmClub = new ARKBreedingStats.uiControls.Nud(); + this.nudWDmBow = new ARKBreedingStats.uiControls.Nud(); + this.nudWDmCrossbow = new ARKBreedingStats.uiControls.Nud(); + this.nudWDmLongneck = new ARKBreedingStats.uiControls.Nud(); this.gbKOInfo = new System.Windows.Forms.GroupBox(); this.lbKOInfo = new System.Windows.Forms.Label(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.panel3 = new System.Windows.Forms.Panel(); this.gpStarvingTime = new System.Windows.Forms.GroupBox(); + this.nudTotalFood = new ARKBreedingStats.uiControls.Nud(); this.label3 = new System.Windows.Forms.Label(); + this.nudCurrentFood = new ARKBreedingStats.uiControls.Nud(); this.btnAddStarvingTimer = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.lbTimeUntilStarving = new System.Windows.Forms.Label(); @@ -63,42 +73,33 @@ private void InitializeComponent() this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel(); this.flpTamingFood = new System.Windows.Forms.FlowLayoutPanel(); this.panel2 = new System.Windows.Forms.Panel(); + this.CbSanguineElixir = new System.Windows.Forms.CheckBox(); this.checkBoxAugmented = new System.Windows.Forms.CheckBox(); this.linkLabelWikiPage = new System.Windows.Forms.LinkLabel(); this.nudLevel = new ARKBreedingStats.uiControls.Nud(); - this.nudWDmHarpoon = new ARKBreedingStats.uiControls.Nud(); - this.nudWDmProd = new ARKBreedingStats.uiControls.Nud(); - this.nudWDmSlingshot = new ARKBreedingStats.uiControls.Nud(); - this.nudWDmClub = new ARKBreedingStats.uiControls.Nud(); - this.nudWDmBow = new ARKBreedingStats.uiControls.Nud(); - this.nudWDmCrossbow = new ARKBreedingStats.uiControls.Nud(); - this.nudWDmLongneck = new ARKBreedingStats.uiControls.Nud(); - this.numericUpDownCurrentTorpor = new ARKBreedingStats.uiControls.Nud(); - this.nudTotalFood = new ARKBreedingStats.uiControls.Nud(); - this.nudCurrentFood = new ARKBreedingStats.uiControls.Nud(); this.gpTorporTime.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownCurrentTorpor)).BeginInit(); this.gbWeaponDamage.SuspendLayout(); this.flcBodyDamageMultipliers.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmHarpoon)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmProd)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmSlingshot)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmClub)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmBow)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmCrossbow)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmLongneck)).BeginInit(); this.gbKOInfo.SuspendLayout(); this.groupBox3.SuspendLayout(); this.panel3.SuspendLayout(); this.gpStarvingTime.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudTotalFood)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudCurrentFood)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); this.panel1.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout(); this.tableLayoutPanel3.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudLevel)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmHarpoon)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmProd)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmSlingshot)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmClub)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmBow)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmCrossbow)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmLongneck)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownCurrentTorpor)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudTotalFood)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudCurrentFood)).BeginInit(); this.SuspendLayout(); // // labelResult @@ -133,6 +134,29 @@ private void InitializeComponent() this.gpTorporTime.Name = "gpTorporTime"; this.gpTorporTime.TabStop = false; // + // numericUpDownCurrentTorpor + // + this.numericUpDownCurrentTorpor.DecimalPlaces = 1; + this.numericUpDownCurrentTorpor.ForeColor = System.Drawing.SystemColors.GrayText; + this.numericUpDownCurrentTorpor.Increment = new decimal(new int[] { + 10, + 0, + 0, + 0}); + resources.ApplyResources(this.numericUpDownCurrentTorpor, "numericUpDownCurrentTorpor"); + this.numericUpDownCurrentTorpor.Maximum = new decimal(new int[] { + 100000000, + 0, + 0, + 0}); + this.numericUpDownCurrentTorpor.Name = "numericUpDownCurrentTorpor"; + this.numericUpDownCurrentTorpor.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); + this.numericUpDownCurrentTorpor.ValueChanged += new System.EventHandler(this.numericUpDownCurrentTorpor_ValueChanged); + // // btAddWakeUpTimer // resources.ApplyResources(this.btAddWakeUpTimer, "btAddWakeUpTimer"); @@ -193,208 +217,6 @@ private void InitializeComponent() this.rbBoneDamageDefault.UseVisualStyleBackColor = true; this.rbBoneDamageDefault.CheckedChanged += new System.EventHandler(this.rbBoneDamage_CheckedChanged); // - // chkbDmHarpoon - // - resources.ApplyResources(this.chkbDmHarpoon, "chkbDmHarpoon"); - this.chkbDmHarpoon.Name = "chkbDmHarpoon"; - this.chkbDmHarpoon.UseVisualStyleBackColor = true; - this.chkbDmHarpoon.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); - // - // chkbDmCrossbow - // - resources.ApplyResources(this.chkbDmCrossbow, "chkbDmCrossbow"); - this.chkbDmCrossbow.Checked = true; - this.chkbDmCrossbow.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkbDmCrossbow.Name = "chkbDmCrossbow"; - this.chkbDmCrossbow.UseVisualStyleBackColor = true; - this.chkbDmCrossbow.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); - // - // chkbDmBow - // - resources.ApplyResources(this.chkbDmBow, "chkbDmBow"); - this.chkbDmBow.Name = "chkbDmBow"; - this.chkbDmBow.UseVisualStyleBackColor = true; - this.chkbDmBow.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); - // - // chkbDmSlingshot - // - resources.ApplyResources(this.chkbDmSlingshot, "chkbDmSlingshot"); - this.chkbDmSlingshot.Name = "chkbDmSlingshot"; - this.chkbDmSlingshot.UseVisualStyleBackColor = true; - this.chkbDmSlingshot.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); - // - // chkbDmClub - // - resources.ApplyResources(this.chkbDmClub, "chkbDmClub"); - this.chkbDmClub.Name = "chkbDmClub"; - this.chkbDmClub.UseVisualStyleBackColor = true; - this.chkbDmClub.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); - // - // chkbDmLongneck - // - resources.ApplyResources(this.chkbDmLongneck, "chkbDmLongneck"); - this.chkbDmLongneck.Checked = true; - this.chkbDmLongneck.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkbDmLongneck.Name = "chkbDmLongneck"; - this.chkbDmLongneck.UseVisualStyleBackColor = true; - this.chkbDmLongneck.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); - // - // chkbDmProd - // - resources.ApplyResources(this.chkbDmProd, "chkbDmProd"); - this.chkbDmProd.Name = "chkbDmProd"; - this.chkbDmProd.UseVisualStyleBackColor = true; - this.chkbDmProd.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); - // - // gbKOInfo - // - this.gbKOInfo.Controls.Add(this.lbKOInfo); - resources.ApplyResources(this.gbKOInfo, "gbKOInfo"); - this.gbKOInfo.Name = "gbKOInfo"; - this.gbKOInfo.TabStop = false; - // - // lbKOInfo - // - resources.ApplyResources(this.lbKOInfo, "lbKOInfo"); - this.lbKOInfo.Name = "lbKOInfo"; - // - // groupBox3 - // - this.tableLayoutPanel1.SetColumnSpan(this.groupBox3, 2); - this.groupBox3.Controls.Add(this.panel3); - resources.ApplyResources(this.groupBox3, "groupBox3"); - this.groupBox3.Name = "groupBox3"; - this.tableLayoutPanel1.SetRowSpan(this.groupBox3, 2); - this.groupBox3.TabStop = false; - // - // panel3 - // - resources.ApplyResources(this.panel3, "panel3"); - this.panel3.Controls.Add(this.labelResult); - this.panel3.Name = "panel3"; - // - // gpStarvingTime - // - this.gpStarvingTime.Controls.Add(this.nudTotalFood); - this.gpStarvingTime.Controls.Add(this.label3); - this.gpStarvingTime.Controls.Add(this.nudCurrentFood); - this.gpStarvingTime.Controls.Add(this.btnAddStarvingTimer); - this.gpStarvingTime.Controls.Add(this.label2); - this.gpStarvingTime.Controls.Add(this.lbTimeUntilStarving); - resources.ApplyResources(this.gpStarvingTime, "gpStarvingTime"); - this.gpStarvingTime.Name = "gpStarvingTime"; - this.gpStarvingTime.TabStop = false; - // - // label3 - // - resources.ApplyResources(this.label3, "label3"); - this.label3.Name = "label3"; - // - // btnAddStarvingTimer - // - resources.ApplyResources(this.btnAddStarvingTimer, "btnAddStarvingTimer"); - this.btnAddStarvingTimer.Name = "btnAddStarvingTimer"; - this.btnAddStarvingTimer.UseVisualStyleBackColor = true; - this.btnAddStarvingTimer.Click += new System.EventHandler(this.btnAddStarvingTimer_Click); - // - // label2 - // - resources.ApplyResources(this.label2, "label2"); - this.label2.Name = "label2"; - // - // lbTimeUntilStarving - // - resources.ApplyResources(this.lbTimeUntilStarving, "lbTimeUntilStarving"); - this.lbTimeUntilStarving.Name = "lbTimeUntilStarving"; - // - // tableLayoutPanel1 - // - resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); - this.tableLayoutPanel1.Controls.Add(this.gpTorporTime, 0, 0); - this.tableLayoutPanel1.Controls.Add(this.gbKOInfo, 2, 2); - this.tableLayoutPanel1.Controls.Add(this.groupBox3, 0, 1); - this.tableLayoutPanel1.Controls.Add(this.gbWeaponDamage, 2, 0); - this.tableLayoutPanel1.Controls.Add(this.gpStarvingTime, 1, 0); - this.tableLayoutPanel1.Name = "tableLayoutPanel1"; - // - // panel1 - // - this.panel1.Controls.Add(this.lbMax); - this.panel1.Controls.Add(this.lbUsed); - this.panel1.Controls.Add(this.lbTamingTime); - resources.ApplyResources(this.panel1, "panel1"); - this.panel1.Name = "panel1"; - // - // tableLayoutPanel2 - // - resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 0, 0); - this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel1, 1, 0); - this.tableLayoutPanel2.Name = "tableLayoutPanel2"; - // - // tableLayoutPanel3 - // - resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); - this.tableLayoutPanel3.Controls.Add(this.panel1, 0, 1); - this.tableLayoutPanel3.Controls.Add(this.flpTamingFood, 0, 2); - this.tableLayoutPanel3.Controls.Add(this.panel2, 0, 0); - this.tableLayoutPanel3.Name = "tableLayoutPanel3"; - // - // flpTamingFood - // - resources.ApplyResources(this.flpTamingFood, "flpTamingFood"); - this.flpTamingFood.Name = "flpTamingFood"; - // - // panel2 - // - this.panel2.Controls.Add(this.checkBoxAugmented); - this.panel2.Controls.Add(this.linkLabelWikiPage); - this.panel2.Controls.Add(this.nudLevel); - this.panel2.Controls.Add(this.label1); - resources.ApplyResources(this.panel2, "panel2"); - this.panel2.Name = "panel2"; - // - // checkBoxAugmented - // - resources.ApplyResources(this.checkBoxAugmented, "checkBoxAugmented"); - this.checkBoxAugmented.Name = "checkBoxAugmented"; - this.checkBoxAugmented.UseVisualStyleBackColor = true; - this.checkBoxAugmented.CheckedChanged += new System.EventHandler(this.checkBoxAugmented_CheckedChanged); - // - // linkLabelWikiPage - // - resources.ApplyResources(this.linkLabelWikiPage, "linkLabelWikiPage"); - this.linkLabelWikiPage.Name = "linkLabelWikiPage"; - this.linkLabelWikiPage.TabStop = true; - this.linkLabelWikiPage.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelWikiPage_LinkClicked); - // - // nudLevel - // - this.nudLevel.ForeColor = System.Drawing.SystemColors.WindowText; - resources.ApplyResources(this.nudLevel, "nudLevel"); - this.nudLevel.Maximum = new decimal(new int[] { - 10000, - 0, - 0, - 0}); - this.nudLevel.Minimum = new decimal(new int[] { - 1, - 0, - 0, - 0}); - this.nudLevel.Name = "nudLevel"; - this.nudLevel.NeutralNumber = new decimal(new int[] { - 0, - 0, - 0, - 0}); - this.nudLevel.Value = new decimal(new int[] { - 30, - 0, - 0, - 0}); - this.nudLevel.ValueChanged += new System.EventHandler(this.nudLevel_ValueChanged); - // // nudWDmHarpoon // this.nudWDmHarpoon.DecimalPlaces = 1; @@ -423,6 +245,13 @@ private void InitializeComponent() 0}); this.nudWDmHarpoon.ValueChanged += new System.EventHandler(this.nudWDm_ValueChanged); // + // chkbDmHarpoon + // + resources.ApplyResources(this.chkbDmHarpoon, "chkbDmHarpoon"); + this.chkbDmHarpoon.Name = "chkbDmHarpoon"; + this.chkbDmHarpoon.UseVisualStyleBackColor = true; + this.chkbDmHarpoon.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); + // // nudWDmProd // this.nudWDmProd.DecimalPlaces = 1; @@ -451,6 +280,45 @@ private void InitializeComponent() 0}); this.nudWDmProd.ValueChanged += new System.EventHandler(this.nudWDm_ValueChanged); // + // chkbDmCrossbow + // + resources.ApplyResources(this.chkbDmCrossbow, "chkbDmCrossbow"); + this.chkbDmCrossbow.Checked = true; + this.chkbDmCrossbow.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkbDmCrossbow.Name = "chkbDmCrossbow"; + this.chkbDmCrossbow.UseVisualStyleBackColor = true; + this.chkbDmCrossbow.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); + // + // chkbDmBow + // + resources.ApplyResources(this.chkbDmBow, "chkbDmBow"); + this.chkbDmBow.Name = "chkbDmBow"; + this.chkbDmBow.UseVisualStyleBackColor = true; + this.chkbDmBow.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); + // + // chkbDmSlingshot + // + resources.ApplyResources(this.chkbDmSlingshot, "chkbDmSlingshot"); + this.chkbDmSlingshot.Name = "chkbDmSlingshot"; + this.chkbDmSlingshot.UseVisualStyleBackColor = true; + this.chkbDmSlingshot.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); + // + // chkbDmClub + // + resources.ApplyResources(this.chkbDmClub, "chkbDmClub"); + this.chkbDmClub.Name = "chkbDmClub"; + this.chkbDmClub.UseVisualStyleBackColor = true; + this.chkbDmClub.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); + // + // chkbDmLongneck + // + resources.ApplyResources(this.chkbDmLongneck, "chkbDmLongneck"); + this.chkbDmLongneck.Checked = true; + this.chkbDmLongneck.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkbDmLongneck.Name = "chkbDmLongneck"; + this.chkbDmLongneck.UseVisualStyleBackColor = true; + this.chkbDmLongneck.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); + // // nudWDmSlingshot // this.nudWDmSlingshot.DecimalPlaces = 1; @@ -479,6 +347,13 @@ private void InitializeComponent() 0}); this.nudWDmSlingshot.ValueChanged += new System.EventHandler(this.nudWDm_ValueChanged); // + // chkbDmProd + // + resources.ApplyResources(this.chkbDmProd, "chkbDmProd"); + this.chkbDmProd.Name = "chkbDmProd"; + this.chkbDmProd.UseVisualStyleBackColor = true; + this.chkbDmProd.CheckedChanged += new System.EventHandler(this.chkbDm_CheckedChanged); + // // nudWDmClub // this.nudWDmClub.DecimalPlaces = 1; @@ -591,28 +466,44 @@ private void InitializeComponent() 0}); this.nudWDmLongneck.ValueChanged += new System.EventHandler(this.nudWDm_ValueChanged); // - // numericUpDownCurrentTorpor + // gbKOInfo // - this.numericUpDownCurrentTorpor.DecimalPlaces = 1; - this.numericUpDownCurrentTorpor.ForeColor = System.Drawing.SystemColors.GrayText; - this.numericUpDownCurrentTorpor.Increment = new decimal(new int[] { - 10, - 0, - 0, - 0}); - resources.ApplyResources(this.numericUpDownCurrentTorpor, "numericUpDownCurrentTorpor"); - this.numericUpDownCurrentTorpor.Maximum = new decimal(new int[] { - 100000000, - 0, - 0, - 0}); - this.numericUpDownCurrentTorpor.Name = "numericUpDownCurrentTorpor"; - this.numericUpDownCurrentTorpor.NeutralNumber = new decimal(new int[] { - 0, - 0, - 0, - 0}); - this.numericUpDownCurrentTorpor.ValueChanged += new System.EventHandler(this.numericUpDownCurrentTorpor_ValueChanged); + this.gbKOInfo.Controls.Add(this.lbKOInfo); + resources.ApplyResources(this.gbKOInfo, "gbKOInfo"); + this.gbKOInfo.Name = "gbKOInfo"; + this.gbKOInfo.TabStop = false; + // + // lbKOInfo + // + resources.ApplyResources(this.lbKOInfo, "lbKOInfo"); + this.lbKOInfo.Name = "lbKOInfo"; + // + // groupBox3 + // + this.tableLayoutPanel1.SetColumnSpan(this.groupBox3, 2); + this.groupBox3.Controls.Add(this.panel3); + resources.ApplyResources(this.groupBox3, "groupBox3"); + this.groupBox3.Name = "groupBox3"; + this.tableLayoutPanel1.SetRowSpan(this.groupBox3, 2); + this.groupBox3.TabStop = false; + // + // panel3 + // + resources.ApplyResources(this.panel3, "panel3"); + this.panel3.Controls.Add(this.labelResult); + this.panel3.Name = "panel3"; + // + // gpStarvingTime + // + this.gpStarvingTime.Controls.Add(this.nudTotalFood); + this.gpStarvingTime.Controls.Add(this.label3); + this.gpStarvingTime.Controls.Add(this.nudCurrentFood); + this.gpStarvingTime.Controls.Add(this.btnAddStarvingTimer); + this.gpStarvingTime.Controls.Add(this.label2); + this.gpStarvingTime.Controls.Add(this.lbTimeUntilStarving); + resources.ApplyResources(this.gpStarvingTime, "gpStarvingTime"); + this.gpStarvingTime.Name = "gpStarvingTime"; + this.gpStarvingTime.TabStop = false; // // nudTotalFood // @@ -636,6 +527,11 @@ private void InitializeComponent() 0, 0}); // + // label3 + // + resources.ApplyResources(this.label3, "label3"); + this.label3.Name = "label3"; + // // nudCurrentFood // this.nudCurrentFood.DecimalPlaces = 1; @@ -659,6 +555,119 @@ private void InitializeComponent() 0}); this.nudCurrentFood.ValueChanged += new System.EventHandler(this.nudCurrentFood_ValueChanged); // + // btnAddStarvingTimer + // + resources.ApplyResources(this.btnAddStarvingTimer, "btnAddStarvingTimer"); + this.btnAddStarvingTimer.Name = "btnAddStarvingTimer"; + this.btnAddStarvingTimer.UseVisualStyleBackColor = true; + this.btnAddStarvingTimer.Click += new System.EventHandler(this.btnAddStarvingTimer_Click); + // + // label2 + // + resources.ApplyResources(this.label2, "label2"); + this.label2.Name = "label2"; + // + // lbTimeUntilStarving + // + resources.ApplyResources(this.lbTimeUntilStarving, "lbTimeUntilStarving"); + this.lbTimeUntilStarving.Name = "lbTimeUntilStarving"; + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.gpTorporTime, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.gbKOInfo, 2, 2); + this.tableLayoutPanel1.Controls.Add(this.groupBox3, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.gbWeaponDamage, 2, 0); + this.tableLayoutPanel1.Controls.Add(this.gpStarvingTime, 1, 0); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // panel1 + // + this.panel1.Controls.Add(this.lbMax); + this.panel1.Controls.Add(this.lbUsed); + this.panel1.Controls.Add(this.lbTamingTime); + resources.ApplyResources(this.panel1, "panel1"); + this.panel1.Name = "panel1"; + // + // tableLayoutPanel2 + // + resources.ApplyResources(this.tableLayoutPanel2, "tableLayoutPanel2"); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel3, 0, 0); + this.tableLayoutPanel2.Controls.Add(this.tableLayoutPanel1, 1, 0); + this.tableLayoutPanel2.Name = "tableLayoutPanel2"; + // + // tableLayoutPanel3 + // + resources.ApplyResources(this.tableLayoutPanel3, "tableLayoutPanel3"); + this.tableLayoutPanel3.Controls.Add(this.panel1, 0, 1); + this.tableLayoutPanel3.Controls.Add(this.flpTamingFood, 0, 2); + this.tableLayoutPanel3.Controls.Add(this.panel2, 0, 0); + this.tableLayoutPanel3.Name = "tableLayoutPanel3"; + // + // flpTamingFood + // + resources.ApplyResources(this.flpTamingFood, "flpTamingFood"); + this.flpTamingFood.Name = "flpTamingFood"; + // + // panel2 + // + this.panel2.Controls.Add(this.CbSanguineElixir); + this.panel2.Controls.Add(this.checkBoxAugmented); + this.panel2.Controls.Add(this.linkLabelWikiPage); + this.panel2.Controls.Add(this.nudLevel); + this.panel2.Controls.Add(this.label1); + resources.ApplyResources(this.panel2, "panel2"); + this.panel2.Name = "panel2"; + // + // CbSanguineElixir + // + resources.ApplyResources(this.CbSanguineElixir, "CbSanguineElixir"); + this.CbSanguineElixir.Name = "CbSanguineElixir"; + this.CbSanguineElixir.UseVisualStyleBackColor = true; + this.CbSanguineElixir.CheckedChanged += new System.EventHandler(this.CbSanguineElixir_CheckedChanged); + // + // checkBoxAugmented + // + resources.ApplyResources(this.checkBoxAugmented, "checkBoxAugmented"); + this.checkBoxAugmented.Name = "checkBoxAugmented"; + this.checkBoxAugmented.UseVisualStyleBackColor = true; + this.checkBoxAugmented.CheckedChanged += new System.EventHandler(this.checkBoxAugmented_CheckedChanged); + // + // linkLabelWikiPage + // + resources.ApplyResources(this.linkLabelWikiPage, "linkLabelWikiPage"); + this.linkLabelWikiPage.Name = "linkLabelWikiPage"; + this.linkLabelWikiPage.TabStop = true; + this.linkLabelWikiPage.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LinkLabelWikiPage_LinkClicked); + // + // nudLevel + // + this.nudLevel.ForeColor = System.Drawing.SystemColors.WindowText; + resources.ApplyResources(this.nudLevel, "nudLevel"); + this.nudLevel.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.nudLevel.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.nudLevel.Name = "nudLevel"; + this.nudLevel.NeutralNumber = new decimal(new int[] { + 0, + 0, + 0, + 0}); + this.nudLevel.Value = new decimal(new int[] { + 30, + 0, + 0, + 0}); + this.nudLevel.ValueChanged += new System.EventHandler(this.nudLevel_ValueChanged); + // // TamingControl // resources.ApplyResources(this, "$this"); @@ -667,16 +676,26 @@ private void InitializeComponent() this.Name = "TamingControl"; this.gpTorporTime.ResumeLayout(false); this.gpTorporTime.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.numericUpDownCurrentTorpor)).EndInit(); this.gbWeaponDamage.ResumeLayout(false); this.gbWeaponDamage.PerformLayout(); this.flcBodyDamageMultipliers.ResumeLayout(false); this.flcBodyDamageMultipliers.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmHarpoon)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmProd)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmSlingshot)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmClub)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmBow)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmCrossbow)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudWDmLongneck)).EndInit(); this.gbKOInfo.ResumeLayout(false); this.groupBox3.ResumeLayout(false); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); this.gpStarvingTime.ResumeLayout(false); this.gpStarvingTime.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.nudTotalFood)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.nudCurrentFood)).EndInit(); this.tableLayoutPanel1.ResumeLayout(false); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); @@ -685,16 +704,6 @@ private void InitializeComponent() this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudLevel)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmHarpoon)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmProd)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmSlingshot)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmClub)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmBow)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmCrossbow)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudWDmLongneck)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.numericUpDownCurrentTorpor)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudTotalFood)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.nudCurrentFood)).EndInit(); this.ResumeLayout(false); } @@ -747,5 +756,6 @@ private void InitializeComponent() private System.Windows.Forms.FlowLayoutPanel flcBodyDamageMultipliers; private System.Windows.Forms.CheckBox checkBoxAugmented; private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.CheckBox CbSanguineElixir; } } diff --git a/ARKBreedingStats/TamingControl.cs b/ARKBreedingStats/TamingControl.cs index b7e6f1d0..e55a42ec 100644 --- a/ARKBreedingStats/TamingControl.cs +++ b/ARKBreedingStats/TamingControl.cs @@ -191,7 +191,7 @@ private void SetTamingFoodControls(Species species) } if (i > 0) - _foodControls[0].amount = Taming.FoodAmountNeeded(species, (int)nudLevel.Value, _tamingSpeedMultiplier, _foodControls[0].FoodName, td.nonViolent); + _foodControls[0].amount = Taming.FoodAmountNeeded(species, (int)nudLevel.Value, _tamingSpeedMultiplier, _foodControls[0].FoodName, td.nonViolent, CbSanguineElixir.Checked); } /// @@ -274,10 +274,11 @@ private void UpdateTamingData() usedFood.Add(tfc.FoodName); foodAmount.Add(tfc.amount); - tfc.maxFood = Taming.FoodAmountNeeded(_selectedSpecies, level, _tamingSpeedMultiplier, tfc.FoodName, _selectedSpecies.taming.nonViolent); + tfc.maxFood = Taming.FoodAmountNeeded(_selectedSpecies, level, _tamingSpeedMultiplier, tfc.FoodName, _selectedSpecies.taming.nonViolent, CbSanguineElixir.Checked); tfc.tamingDuration = Taming.TamingDuration(_selectedSpecies, tfc.maxFood, tfc.FoodName, _tamingFoodRateMultiplier, _selectedSpecies.taming.nonViolent); } - Taming.TamingTimes(_selectedSpecies, level, _tamingSpeedMultiplier, _tamingFoodRateMultiplier, usedFood, foodAmount, out foodAmountUsed, out duration, out narcoBerries, out ascerbicMushrooms, out narcotics, out bioToxines, out te, out _neededHunger, out bonusLevel, out enoughFood); + Taming.TamingTimes(_selectedSpecies, level, _tamingSpeedMultiplier, _tamingFoodRateMultiplier, usedFood, foodAmount, + out foodAmountUsed, out duration, out narcoBerries, out ascerbicMushrooms, out narcotics, out bioToxines, out te, out _neededHunger, out bonusLevel, out enoughFood, CbSanguineElixir.Checked); for (int f = 0; f < foodAmountUsed.Count; f++) { @@ -524,6 +525,11 @@ private void checkBoxAugmented_CheckedChanged(object sender, EventArgs e) SetSpecies(_selectedSpecies, true); } + private void CbSanguineElixir_CheckedChanged(object sender, EventArgs e) + { + SetSpecies(_selectedSpecies, true); + } + public void SetLocalizations() { SetTamingFoodSortAdorner(Properties.Settings.Default.TamingFoodOrderByTime); diff --git a/ARKBreedingStats/TamingControl.resx b/ARKBreedingStats/TamingControl.resx index d8f8582f..a24067c6 100644 --- a/ARKBreedingStats/TamingControl.resx +++ b/ARKBreedingStats/TamingControl.resx @@ -178,7 +178,7 @@ panel2 - 3 + 4 True @@ -1218,6 +1218,36 @@ 1 + + True + + + NoControl + + + 193, 5 + + + 95, 17 + + + 5 + + + Sanguine Elixir + + + CbSanguineElixir + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel2 + + + 0 + True @@ -1246,7 +1276,7 @@ panel2 - 0 + 1 NoControl @@ -1273,7 +1303,7 @@ panel2 - 1 + 2 45, 3 @@ -1294,7 +1324,7 @@ panel2 - 2 + 3 Fill diff --git a/ARKBreedingStats/Utils.cs b/ARKBreedingStats/Utils.cs index ef0ed1dc..330d4a20 100644 --- a/ARKBreedingStats/Utils.cs +++ b/ARKBreedingStats/Utils.cs @@ -311,7 +311,7 @@ public static CreatureStatus NextStatus(CreatureStatus status) } /// - /// Probability of the occurence of a stat level, assuming a normal distribution of 180 levels on 7 stats. + /// Probability of the occurrence of a stat level, assuming a normal distribution of 180 levels on 7 stats. /// /// /// @@ -374,16 +374,19 @@ public static void InitializeLocalizations() /// /// Dictionary with custom stat names /// - public static string StatName(int statIndex, bool abbreviation = false, Dictionary customStatNames = null) + public static string StatName(int statIndex, bool abbreviation = false, Dictionary customStatNames = null, bool secondaryLanguage = false) { if (_statNames == null || statIndex < 0 || statIndex >= _statNames.Length) return string.Empty; if (customStatNames != null && customStatNames.TryGetValue(statIndex.ToString(), out string statName)) { - return Loc.S(abbreviation ? $"{statName}_Abb" : statName); + return Loc.S(abbreviation ? $"{statName}_Abb" : statName, secondaryCulture: secondaryLanguage); } + if (secondaryLanguage) + return Loc.S(abbreviation ? StatNameKeys[statIndex] + "_Abb" : StatNameKeys[statIndex], secondaryCulture: true); + // use cached names return abbreviation ? _statNamesAbb[statIndex] : _statNames[statIndex]; } diff --git a/ARKBreedingStats/_manifest.json b/ARKBreedingStats/_manifest.json index 051c6d48..56243ce8 100644 --- a/ARKBreedingStats/_manifest.json +++ b/ARKBreedingStats/_manifest.json @@ -4,7 +4,7 @@ "ARK Smart Breeding": { "Id": "ARK Smart Breeding", "Category": "main", - "version": "0.53.1.0" + "version": "0.54.0.0" }, "SpeciesColorImages": { "Id": "SpeciesColorImages", diff --git a/ARKBreedingStats/json/values/_manifest.json b/ARKBreedingStats/json/values/_manifest.json index 38186a2b..b0c124b4 100644 --- a/ARKBreedingStats/json/values/_manifest.json +++ b/ARKBreedingStats/json/values/_manifest.json @@ -145,7 +145,7 @@ "mod": { "id": "1662691167", "tag": "Senior", "title": "Additional Creatures: Senior Class" } }, "1675895024-NoUntameables.json": { - "version": "357.4.1678903474", + "version": "357.18.1683392823", "mod": { "id": "1675895024", "tag": "NoUntameables", "title": "No Untameables" } }, "1676159020-Aquaria.json": { @@ -243,7 +243,7 @@ "mod": { "id": "2000326197", "tag": "ExtraResources", "title": "Event Assets" } }, "2003934830-Beasts.json": { - "version": "357.14.1681745937", + "version": "357.15.1682712826", "mod": { "id": "2003934830", "tag": "Beasts", "title": "Prehistoric Beasts" } }, "2019846325-ApexMod.json": { @@ -291,7 +291,7 @@ "mod": { "id": "2362246280", "tag": "GigaFullTame", "title": "Giga Full Tame" } }, "2447186973-ArkOmega.json": { - "version": "357.15.1682658841", + "version": "357.18.1683354231", "mod": { "id": "2447186973", "tag": "ArkOmega", "title": "Ark Omega" } }, "2493949846-Endemics.json": { @@ -303,7 +303,7 @@ "mod": { "id": "2683373846", "tag": "ZazaCollection_2", "title": "Zaza's Collection" } }, "2804332920-PaleoARKlegends.json": { - "version": "357.14.1681844066", + "version": "357.15.1683080827", "mod": { "id": "2804332920", "tag": "PaleoARKlegends", "title": "Paleo ARK: Legends Expansion!" } }, "2869411055-SDinoVariants.json": { @@ -311,7 +311,7 @@ "mod": { "id": "2869411055", "tag": "SDinoVariants", "title": "SDinoVariants" } }, "710880648-DinoOverHaulMODX.json": { - "version": "357.15.1682737580", + "version": "357.15.1682903614", "mod": { "id": "710880648", "tag": "DinoOverHaulMODX", "title": "DinoOverhaul X -- Hardcore PvE Experience" } }, "729352919-IndomRex.json": { diff --git a/ARKBreedingStats/library/CreatureInfoGraphic.cs b/ARKBreedingStats/library/CreatureInfoGraphic.cs index aff38def..9b4fa425 100644 --- a/ARKBreedingStats/library/CreatureInfoGraphic.cs +++ b/ARKBreedingStats/library/CreatureInfoGraphic.cs @@ -1,6 +1,5 @@ using ARKBreedingStats.Library; using ARKBreedingStats.species; -using ARKBreedingStats.values; using System; using System.Drawing; using System.Linq; @@ -50,6 +49,7 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, bool displayExtraRegionNames, bool displayRegionNamesIfNoImage) { if (creature?.Species == null) return null; + var secondaryCulture = Loc.UseSecondaryCulture; int maxGraphLevel = cc?.maxChartLevel ?? 0; if (maxGraphLevel < 1) maxGraphLevel = 50; @@ -100,11 +100,11 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, else creatureLevel = creature.LevelHatched.ToString(); - string creatureInfos = $"{Loc.S("Level")} {creatureLevel} | {Utils.SexSymbol(creature.sex) + (creature.flags.HasFlag(CreatureFlags.Neutered) ? $" ({Loc.S(creature.sex == Sex.Female ? "Spayed" : "Neutered")})" : string.Empty)}"; + string creatureInfos = $"{Loc.S("Level", secondaryCulture: secondaryCulture)} {creatureLevel} | {Utils.SexSymbol(creature.sex) + (creature.flags.HasFlag(CreatureFlags.Neutered) ? $" ({Loc.S(creature.sex == Sex.Female ? "Spayed" : "Neutered", secondaryCulture: secondaryCulture)})" : string.Empty)}"; if (displayMutations) - creatureInfos += $" | {creature.Mutations} {Loc.S("Mutations")}"; + creatureInfos += $" | {creature.Mutations} {Loc.S("Mutations", secondaryCulture: secondaryCulture)}"; if (displayGenerations) - creatureInfos += $" | {Loc.S("generation")} {creature.generation}"; + creatureInfos += $" | {Loc.S("generation", secondaryCulture: secondaryCulture)} {creature.generation}"; var availableWidth = width - 9 * frameThickness; var textWidth = g.MeasureString(creatureInfos, font).Width; @@ -134,9 +134,9 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, int xRightBrValue = (int)(xRightLevelDomValue + (2 + MaxCharLength(creature.valuesBreeding)) * meanLetterWidth); int maxBoxLength = xRightBrValue - xStatName; int statBoxHeight = Math.Max(2, height / 90); - g.DrawString(Loc.S("Levels"), font, fontBrush, xRightLevelDomValue, currentYPosition, stringFormatRight); + g.DrawString(Loc.S("Levels", secondaryCulture: secondaryCulture), font, fontBrush, xRightLevelDomValue, currentYPosition, stringFormatRight); if (displayStatValues) - g.DrawString(Loc.S("Values"), font, fontBrush, xRightBrValue, currentYPosition, stringFormatRight); + g.DrawString(Loc.S("Values", secondaryCulture: secondaryCulture), font, fontBrush, xRightBrValue, currentYPosition, stringFormatRight); int statDisplayIndex = 0; for (int si = 0; si < Stats.StatsCount; si++) { @@ -166,7 +166,7 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, g.DrawRectangle(p, xStatName, y + statLineHeight - 1, statBoxLength, statBoxHeight); // stat name - g.DrawString($"{Utils.StatName(statIndex, true, creature.Species.statNames)}", + g.DrawString($"{Utils.StatName(statIndex, true, creature.Species.statNames, secondaryCulture)}", font, fontBrush, xStatName, y); // stat level number g.DrawString($"{(creature.levelsWild[statIndex] < 0 ? "?" : creature.levelsWild[statIndex].ToString())}{(displayWithDomLevels ? " +" : null)}", @@ -229,7 +229,7 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, if (creature.colors != null) { - g.DrawString(Loc.S("Colors"), font, fontBrush, xColor, currentYPosition); + g.DrawString(Loc.S("Colors", secondaryCulture: secondaryCulture), font, fontBrush, xColor, currentYPosition); int colorRow = 0; for (int ci = 0; ci < Ark.ColorRegionCount; ci++) { @@ -283,15 +283,15 @@ public static Bitmap InfoGraphic(this Creature creature, CreatureCollection cc, if (displayWithDomLevels) { if (creature.isBred || creature.imprintingBonus > 0) - g.DrawString($"Imp: {creature.imprintingBonus * 100:0.0} %", font, fontBrush, xColor + (int)((Loc.S("Colors").Length + 3) * meanLetterWidth), currentYPosition); + g.DrawString($"Imp: {creature.imprintingBonus * 100:0.0} %", font, fontBrush, xColor + (int)((Loc.S("Colors", secondaryCulture: secondaryCulture).Length + 3) * meanLetterWidth), currentYPosition); else if (creature.tamingEff >= 0) - g.DrawString($"TE: {creature.tamingEff * 100:0.0} %", font, fontBrush, xColor + (int)((Loc.S("Colors").Length + 3) * meanLetterWidth), currentYPosition); + g.DrawString($"TE: {creature.tamingEff * 100:0.0} %", font, fontBrush, xColor + (int)((Loc.S("Colors", secondaryCulture: secondaryCulture).Length + 3) * meanLetterWidth), currentYPosition); } // max wild level on server if (cc != null && displayMaxWildLevel) { - g.DrawString($"{Loc.S("max wild level")}: {cc.maxWildLevel}", + g.DrawString($"{Loc.S("max wild level", secondaryCulture: secondaryCulture)}: {cc.maxWildLevel}", fontSmall, fontBrush, width - 2 * frameThickness, height - frameThickness, stringFormatRightUp); } diff --git a/ARKBreedingStats/library/ExportImportCreatures.cs b/ARKBreedingStats/library/ExportImportCreatures.cs index 01ab2b35..4cb0f563 100644 --- a/ARKBreedingStats/library/ExportImportCreatures.cs +++ b/ARKBreedingStats/library/ExportImportCreatures.cs @@ -24,7 +24,7 @@ public static class ExportImportCreatures /// Export info for a spreadsheet. /// /// - public static int ExportTable(IEnumerable creatures) + public static int ExportTable(IList creatures) { var fields = Properties.Settings.Default.CreatureTableExportFields; if (fields == null) @@ -35,6 +35,7 @@ public static int ExportTable(IEnumerable creatures) if (!fields.Any()) return 0; var output = new StringBuilder(); + var secondaryLanguage = Loc.UseSecondaryCulture; // header foreach (TableExportFields f in fields) @@ -43,19 +44,19 @@ public static int ExportTable(IEnumerable creatures) { case TableExportFields.WildLevels: foreach (var si in Stats.DisplayOrder) - output.Append(Utils.StatName(si, true) + "_w\t"); + output.Append(Utils.StatName(si, true, secondaryLanguage: secondaryLanguage) + "_w\t"); break; case TableExportFields.DomLevels: foreach (var si in Stats.DisplayOrder) - output.Append(Utils.StatName(si, true) + "_d\t"); + output.Append(Utils.StatName(si, true, secondaryLanguage: secondaryLanguage) + "_d\t"); break; case TableExportFields.BreedingValues: foreach (var si in Stats.DisplayOrder) - output.Append(Utils.StatName(si, true) + "_b\t"); + output.Append(Utils.StatName(si, true, secondaryLanguage: secondaryLanguage) + "_b\t"); break; case TableExportFields.CurrentValues: foreach (var si in Stats.DisplayOrder) - output.Append(Utils.StatName(si, true) + "_v\t"); + output.Append(Utils.StatName(si, true, secondaryLanguage: secondaryLanguage) + "_v\t"); break; case TableExportFields.ParentIds: output.Append("MotherId\tFatherId\t"); @@ -95,7 +96,7 @@ public static int ExportTable(IEnumerable creatures) output.Append(c.name + "\t"); break; case TableExportFields.Sex: - output.Append(c.sex + "\t"); + output.Append(Loc.S(c.sex.ToString(), secondaryCulture: secondaryLanguage) + "\t"); break; case TableExportFields.Owner: output.Append(c.owner + "\t"); @@ -132,7 +133,7 @@ public static int ExportTable(IEnumerable creatures) output.Append(c.Mutations + "\t"); break; case TableExportFields.Fertility: - output.Append((c.flags.HasFlag(CreatureFlags.Neutered) ? "neutered" : string.Empty) + "\t"); + output.Append((c.flags.HasFlag(CreatureFlags.Neutered) ? Loc.S("neutered", secondaryCulture: secondaryLanguage) : string.Empty) + "\t"); break; case TableExportFields.Notes: output.Append(c.note + "\t"); @@ -218,6 +219,7 @@ private static StringBuilder CreatureStringInfo(Creature c, bool breeding, bool var maxChartLevel = CreatureCollection.CurrentCreatureCollection?.maxChartLevel ?? 0; double colorFactor = maxChartLevel > 0 ? 100d / maxChartLevel : 1; string modifierText = string.Empty; + var secondaryLanguage = Loc.UseSecondaryCulture; if (!breeding) { if (!c.isDomesticated) @@ -231,13 +233,13 @@ private static StringBuilder CreatureStringInfo(Creature c, bool breeding, bool var output = new StringBuilder((string.IsNullOrEmpty(c.name) ? "noName" : c.name) + " (" + (ARKml ? Utils.GetARKml(c.Species.name, 50, 172, 255) : c.Species.name) + ", Lvl " + (breeding ? c.LevelHatched : c.Level) + modifierText + - (c.sex != Sex.Unknown ? ", " + c.sex : string.Empty) + "): "); + (c.sex != Sex.Unknown ? ", " + Loc.S(c.sex.ToString(), secondaryCulture: secondaryLanguage) : string.Empty) + "): "); for (int s = 0; s < Stats.StatsCount; s++) { int si = Stats.DisplayOrder[s]; if (c.levelsWild[si] >= 0 && c.valuesBreeding[si] > 0) // ignore unknown levels (e.g. oxygen, speed for some species) - output.Append(Utils.StatName(si, true) + ": " + + output.Append(Utils.StatName(si, true, secondaryLanguage: secondaryLanguage) + ": " + (breeding ? c.valuesBreeding[si] : c.valuesDom[si]) * (Utils.Precision(si) == 3 ? 100 : 1) + (Utils.Precision(si) == 3 ? " %" : string.Empty) + " (" + (ARKml @@ -389,9 +391,9 @@ public static bool ImportCreaturesFromTsvFile(string filePath, out List 0) bestLevelPercent = (100 * bestLevel) / MaxChartLevel; } _parentStatValues[s].SetValues( - mother == null ? -1 : (mother.valuesBreeding[s] * (Utils.Precision(s) == 1 ? 1 : 100)), - father == null ? -1 : (father.valuesBreeding[s] * (Utils.Precision(s) == 1 ? 1 : 100)), - mother != null && father != null ? (mother.valuesBreeding[s] > father.valuesBreeding[s] ? 1 : 2) : 0, + mother?.valuesBreeding == null ? -1 : (mother.valuesBreeding[s] * (Utils.Precision(s) == 1 ? 1 : 100)), + father?.valuesBreeding == null ? -1 : (father.valuesBreeding[s] * (Utils.Precision(s) == 1 ? 1 : 100)), + mother?.valuesBreeding != null && father?.valuesBreeding != null ? (mother.valuesBreeding[s] > father.valuesBreeding[s] ? 1 : 2) : 0, bestLevel, bestLevelPercent ); } labelMother.Text = mother == null ? Loc.S("Unknown") : mother.name; labelFather.Text = father == null ? Loc.S("Unknown") : (labelMother.Width > 78 ? "\n" : string.Empty) + father.name; - if (mother != null && father != null) + if (mother?.levelsWild != null && father?.levelsWild != null) { int minLv = 1, maxLv = 1; for (int s = 0; s < 7; s++) diff --git a/ARKBreedingStats/raising/RaisingControl.cs b/ARKBreedingStats/raising/RaisingControl.cs index 04eda0e8..0c2698e8 100644 --- a/ARKBreedingStats/raising/RaisingControl.cs +++ b/ARKBreedingStats/raising/RaisingControl.cs @@ -293,13 +293,13 @@ public void RecreateList() // if both parents of an incubation entry were deleted, remove that entry as well. _cc.incubationListEntries = - _cc.incubationListEntries.Where(t => t.mother != null || t.father != null).ToList(); + _cc.incubationListEntries.Where(t => t.Mother != null || t.Father != null).ToList(); ListViewGroup g = listViewBabies.Groups[0]; // add eggs / pregnancies foreach (IncubationTimerEntry t in _cc.incubationListEntries) { - Species species = t.mother?.Species ?? t.father?.Species; + Species species = t.Mother?.Species ?? t.Father?.Species; if (species?.breeding != null) { t.kind = species.breeding.gestationTimeAdjusted > 0 ? "Gestation" : "Egg"; @@ -392,7 +392,7 @@ public void Tick() { if (lvi.Tag is IncubationTimerEntry ite) { - Species species = ite.mother?.Species ?? ite.father?.Species; + Species species = ite.Mother?.Species ?? ite.Father?.Species; if (species?.breeding != null) { lvi.SubItems[3].Text = Utils.Duration((int)(species.breeding.maturationTimeAdjusted / 10)); @@ -470,7 +470,7 @@ private void extractValuesOfHatchedbornBabyToolStripMenuItem_Click(object sender if (listViewBabies.SelectedIndices.Count > 0 && listViewBabies.SelectedItems[0].Tag is IncubationTimerEntry ite) { - ExtractBaby?.Invoke(ite.mother, ite.father); + ExtractBaby?.Invoke(ite.Mother, ite.Father); } } @@ -480,7 +480,7 @@ private void deleteTimerToolStripMenuItem_Click(object sender, EventArgs e) { if (listViewBabies.SelectedItems[0].Tag is IncubationTimerEntry ite) { - if (MessageBox.Show("Delete this timer?\n" + (ite.mother?.Species?.name ?? "unknown") + + if (MessageBox.Show("Delete this timer?\n" + (ite.Mother?.Species?.name ?? "unknown") + ", ending in " + Utils.TimeLeft(ite.incubationEnd) + (listViewBabies.SelectedIndices.Count > 1 ? "\n\nand " + (listViewBabies.SelectedIndices.Count - 1).ToString() + @@ -562,10 +562,11 @@ private void listViewBabies_SelectedIndexChanged(object sender, EventArgs e) } else if (listViewBabies.SelectedItems[0].Tag is IncubationTimerEntry ite) { - Species species = ite.mother.Species; - SetGlobalSpecies?.Invoke(species); + var species = ite.Mother?.Species ?? ite.Father?.Species; + if (species != null) + SetGlobalSpecies?.Invoke(species); - parentStats1.SetParentValues(ite.mother, ite.father); + parentStats1.SetParentValues(ite.Mother, ite.Father); // edit-box _creatureMaturationEdit = null; @@ -587,7 +588,7 @@ private void SetEditTimer() if (_iteEdit != null) { lEditTimerName.Text = - $"{Loc.S("incubation")}{(_iteEdit.mother != null ? " (" + (_iteEdit.mother.Species?.name ?? Loc.S("Unknown")) + ")" : string.Empty)}"; + $"{Loc.S("incubation")}{(_iteEdit.Mother != null ? " (" + (_iteEdit.Mother.Species?.name ?? Loc.S("Unknown")) + ")" : string.Empty)}"; dateTimePickerEditTimerFinish.Value = _iteEdit.incubationEnd; TimeSpan ts = _iteEdit.incubationEnd.Subtract(DateTime.Now); dhmsInputTimerEditTimer.Timespan = (ts.TotalSeconds > 0 ? ts : TimeSpan.Zero); diff --git a/ARKBreedingStats/settings/Settings.Designer.cs b/ARKBreedingStats/settings/Settings.Designer.cs index 410755e8..00d750a2 100644 --- a/ARKBreedingStats/settings/Settings.Designer.cs +++ b/ARKBreedingStats/settings/Settings.Designer.cs @@ -166,7 +166,7 @@ private void InitializeComponent() this.groupBox20 = new System.Windows.Forms.GroupBox(); this.cbPrettifyJSON = new System.Windows.Forms.CheckBox(); this.groupBox17 = new System.Windows.Forms.GroupBox(); - this.cbbLanguage = new System.Windows.Forms.ComboBox(); + this.CbbLanguage = new System.Windows.Forms.ComboBox(); this.groupBox9 = new System.Windows.Forms.GroupBox(); this.CbNaturalSortIgnoreSpaces = new System.Windows.Forms.CheckBox(); this.CbNaturalSorting = new System.Windows.Forms.CheckBox(); @@ -331,6 +331,8 @@ private void InitializeComponent() this.label1 = new System.Windows.Forms.Label(); this.panel1 = new System.Windows.Forms.Panel(); this.colorDialog1 = new System.Windows.Forms.ColorDialog(); + this.CbbLanguage2 = new System.Windows.Forms.ComboBox(); + this.LbLanguage2 = new System.Windows.Forms.Label(); this.groupBoxMultiplier.SuspendLayout(); this.groupBox2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudTamedDinoCharacterFoodDrain)).BeginInit(); @@ -2295,7 +2297,9 @@ private void InitializeComponent() // // groupBox17 // - this.groupBox17.Controls.Add(this.cbbLanguage); + this.groupBox17.Controls.Add(this.LbLanguage2); + this.groupBox17.Controls.Add(this.CbbLanguage2); + this.groupBox17.Controls.Add(this.CbbLanguage); this.groupBox17.Location = new System.Drawing.Point(329, 642); this.groupBox17.Name = "groupBox17"; this.groupBox17.Size = new System.Drawing.Size(413, 51); @@ -2303,15 +2307,14 @@ private void InitializeComponent() this.groupBox17.TabStop = false; this.groupBox17.Text = "Language (WIP)"; // - // cbbLanguage + // CbbLanguage // - this.cbbLanguage.Dock = System.Windows.Forms.DockStyle.Fill; - this.cbbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbbLanguage.FormattingEnabled = true; - this.cbbLanguage.Location = new System.Drawing.Point(3, 16); - this.cbbLanguage.Name = "cbbLanguage"; - this.cbbLanguage.Size = new System.Drawing.Size(407, 21); - this.cbbLanguage.TabIndex = 0; + this.CbbLanguage.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CbbLanguage.FormattingEnabled = true; + this.CbbLanguage.Location = new System.Drawing.Point(3, 16); + this.CbbLanguage.Name = "CbbLanguage"; + this.CbbLanguage.Size = new System.Drawing.Size(176, 21); + this.CbbLanguage.TabIndex = 0; // // groupBox9 // @@ -3514,7 +3517,7 @@ private void InitializeComponent() this.customSCCustom.Location = new System.Drawing.Point(6, 139); this.customSCCustom.Name = "customSCCustom"; this.customSCCustom.Size = new System.Drawing.Size(401, 23); - this.customSCCustom.SoundFile = null; + this.customSCCustom.SoundFile = ""; this.customSCCustom.TabIndex = 4; // // customSCWakeup @@ -3522,7 +3525,7 @@ private void InitializeComponent() this.customSCWakeup.Location = new System.Drawing.Point(6, 81); this.customSCWakeup.Name = "customSCWakeup"; this.customSCWakeup.Size = new System.Drawing.Size(401, 23); - this.customSCWakeup.SoundFile = ""; + this.customSCWakeup.SoundFile = null; this.customSCWakeup.TabIndex = 2; // // customSCBirth @@ -3530,7 +3533,7 @@ private void InitializeComponent() this.customSCBirth.Location = new System.Drawing.Point(6, 110); this.customSCBirth.Name = "customSCBirth"; this.customSCBirth.Size = new System.Drawing.Size(401, 23); - this.customSCBirth.SoundFile = ""; + this.customSCBirth.SoundFile = null; this.customSCBirth.TabIndex = 3; // // customSCStarving @@ -3538,7 +3541,7 @@ private void InitializeComponent() this.customSCStarving.Location = new System.Drawing.Point(6, 52); this.customSCStarving.Name = "customSCStarving"; this.customSCStarving.Size = new System.Drawing.Size(401, 23); - this.customSCStarving.SoundFile = null; + this.customSCStarving.SoundFile = ""; this.customSCStarving.TabIndex = 1; // // label20 @@ -4189,6 +4192,24 @@ private void InitializeComponent() this.panel1.Size = new System.Drawing.Size(758, 30); this.panel1.TabIndex = 12; // + // CbbLanguage2 + // + this.CbbLanguage2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.CbbLanguage2.FormattingEnabled = true; + this.CbbLanguage2.Location = new System.Drawing.Point(241, 16); + this.CbbLanguage2.Name = "CbbLanguage2"; + this.CbbLanguage2.Size = new System.Drawing.Size(166, 21); + this.CbbLanguage2.TabIndex = 1; + // + // LbLanguage2 + // + this.LbLanguage2.AutoSize = true; + this.LbLanguage2.Location = new System.Drawing.Point(198, 19); + this.LbLanguage2.Name = "LbLanguage2"; + this.LbLanguage2.Size = new System.Drawing.Size(37, 13); + this.LbLanguage2.TabIndex = 2; + this.LbLanguage2.Text = "Export"; + // // Settings // this.AcceptButton = this.buttonOK; @@ -4280,6 +4301,7 @@ private void InitializeComponent() this.groupBox20.ResumeLayout(false); this.groupBox20.PerformLayout(); this.groupBox17.ResumeLayout(false); + this.groupBox17.PerformLayout(); this.groupBox9.ResumeLayout(false); this.groupBox9.PerformLayout(); this.tabPageInfoGraphic.ResumeLayout(false); @@ -4441,7 +4463,7 @@ private void InitializeComponent() private uiControls.Nud nudMaxServerLevel; private System.Windows.Forms.Label lbMaxTotalLevel; private System.Windows.Forms.GroupBox groupBox17; - private System.Windows.Forms.ComboBox cbbLanguage; + private System.Windows.Forms.ComboBox CbbLanguage; private System.Windows.Forms.Label label27; private System.Windows.Forms.Label labelSavegameFileLocationHint; private System.Windows.Forms.TextBox textBoxImportTribeNameFilter; @@ -4651,5 +4673,7 @@ private void InitializeComponent() private System.Windows.Forms.CheckBox CbAtlasSettings; private System.Windows.Forms.CheckBox CbAlwaysShowAllColorRegions; private System.Windows.Forms.CheckBox CbColorIdOnColorRegionButton; + private System.Windows.Forms.Label LbLanguage2; + private System.Windows.Forms.ComboBox CbbLanguage2; } } \ No newline at end of file diff --git a/ARKBreedingStats/settings/Settings.cs b/ARKBreedingStats/settings/Settings.cs index c02c5108..b1efb9fd 100644 --- a/ARKBreedingStats/settings/Settings.cs +++ b/ARKBreedingStats/settings/Settings.cs @@ -149,6 +149,7 @@ private void InitializeData() _tt.SetToolTip(lbMaxTotalLevel, "The max level allowed on the server. Currently creatures with more than 450 levels will be deleted on official servers.\nThis limit can be enabled on unoffical servers with the setting DestroyTamesOverLevelClamp.\nA creature in this library that can be potentially have a higher level than this (if maximally leveled up) will be marked with a orange-red text in the library.\nSet to 0 to disable a warning in the loaded library."); _tt.SetToolTip(CbExportFileRenameAfterImport, "Use a pattern to create the new file name, a subset of the keywords and functions from the naming pattern work."); _tt.SetToolTip(CbHighlightAdjustedMultipliers, "Highlight multipliers that are set to non-official values.\nDoes not update on multiplier change, this button needs to be rechecked then.\nCan be used to share screenshots of these settings."); + _tt.SetToolTip(LbLanguage2, "Here you can specify a different language for exported data, e.g. the info graphics."); // localizations / translations // for a new translation @@ -158,7 +159,6 @@ private void InitializeData() // * the entry in the dictionary below needs to be added _languages = new Dictionary { - { Loc.S("SystemLanguage"), string.Empty}, { "Deutsch", "de"}, { "English", "en"}, { "Español", "es"}, @@ -172,8 +172,17 @@ private void InitializeData() { "简体中文", "zh"}, { "繁體中文", "zh-tw"} }; + + CbbLanguage.Items.Add(Loc.S("SystemLanguage")); + CbbLanguage2.Items.Add("-"); // indicates no secondary language, i.e. the same as primary + foreach (string l in _languages.Keys) - cbbLanguage.Items.Add(l); + { + CbbLanguage.Items.Add(l); + CbbLanguage2.Items.Add(l); + } + + _languages[Loc.S("SystemLanguage")] = string.Empty; foreach (var cm in Enum.GetNames(typeof(ColorModeColors.AsbColorMode))) CbbColorMode.Items.Add(cm); @@ -413,8 +422,12 @@ private void LoadSettings(CreatureCollection cc) cbAdminConsoleCommandWithCheat.Checked = Properties.Settings.Default.AdminConsoleCommandWithCheat; string langKey = _languages.FirstOrDefault(x => x.Value == Properties.Settings.Default.language).Key ?? string.Empty; - int langI = cbbLanguage.Items.IndexOf(langKey); - cbbLanguage.SelectedIndex = langI == -1 ? 0 : langI; + int langI = CbbLanguage.Items.IndexOf(langKey); + CbbLanguage.SelectedIndex = langI == -1 ? 0 : langI; + + langKey = _languages.FirstOrDefault(x => x.Value == Properties.Settings.Default.language2).Key ?? string.Empty; + langI = CbbLanguage2.Items.IndexOf(langKey); + CbbLanguage2.SelectedIndex = langI == -1 ? 0 : langI; CbHideInvisibleColorRegions.Checked = Properties.Settings.Default.HideInvisibleColorRegions; CbAlwaysShowAllColorRegions.Checked = Properties.Settings.Default.AlwaysShowAllColorRegions; @@ -635,9 +648,11 @@ private void SaveSettings() Properties.Settings.Default.AdminConsoleCommandWithCheat = cbAdminConsoleCommandWithCheat.Checked; string oldLanguageSetting = Properties.Settings.Default.language; - string lang = cbbLanguage.SelectedItem.ToString(); - Properties.Settings.Default.language = _languages.ContainsKey(lang) ? _languages[lang] : string.Empty; - LanguageChanged = oldLanguageSetting != Properties.Settings.Default.language; + Properties.Settings.Default.language = _languages.TryGetValue(CbbLanguage.SelectedItem.ToString(), out var languageId) ? languageId : string.Empty; + string oldLanguage2Setting = Properties.Settings.Default.language2; + Properties.Settings.Default.language2 = _languages.TryGetValue(CbbLanguage2.SelectedItem.ToString(), out languageId) ? languageId : string.Empty; + + LanguageChanged = oldLanguageSetting != Properties.Settings.Default.language || oldLanguage2Setting != Properties.Settings.Default.language2; ColorRegionDisplayChanged = CbHideInvisibleColorRegions.Checked != Properties.Settings.Default.HideInvisibleColorRegions || Properties.Settings.Default.AlwaysShowAllColorRegions != CbAlwaysShowAllColorRegions.Checked;