diff --git a/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.Designer.cs b/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.Designer.cs index 61af2d6..d3a788b 100644 --- a/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.Designer.cs +++ b/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.Designer.cs @@ -29,13 +29,7 @@ namespace GrasscutterTools.Forms /// private void InitializeComponent() { - this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormGachaBannerEditor2)); - System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); - System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series2 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series3 = new System.Windows.Forms.DataVisualization.Charting.Series(); - System.Windows.Forms.DataVisualization.Charting.Series series4 = new System.Windows.Forms.DataVisualization.Charting.Series(); this.GrpBannerValues = new System.Windows.Forms.GroupBox(); this.DTPEndTime = new System.Windows.Forms.DateTimePicker(); this.DTPBeginTime = new System.Windows.Forms.DateTimePicker(); @@ -75,15 +69,21 @@ namespace GrasscutterTools.Forms this.BtnGen = new System.Windows.Forms.Button(); this.TxtJson = new System.Windows.Forms.TextBox(); this.BtnParse = new System.Windows.Forms.Button(); - this.ChartWeights = new System.Windows.Forms.DataVisualization.Charting.Chart(); - this.GrpWeights = new System.Windows.Forms.GroupBox(); - this.ListBannerWeights = new System.Windows.Forms.ListView(); - this.ColCount = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.ColWeight = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.MenuCUD = new System.Windows.Forms.ContextMenuStrip(this.components); - this.MenuItemAdd = new System.Windows.Forms.ToolStripMenuItem(); - this.MenuItemRemove = new System.Windows.Forms.ToolStripMenuItem(); - this.MenuItemEdit = new System.Windows.Forms.ToolStripMenuItem(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.LblWeight5 = new System.Windows.Forms.Label(); + this.LblWeight4 = new System.Windows.Forms.Label(); + this.TxtWeight5 = new System.Windows.Forms.TextBox(); + this.TxtWeight4 = new System.Windows.Forms.TextBox(); + this.LnkWeightHelp = new System.Windows.Forms.LinkLabel(); + this.LnkOpenOldEditor = new System.Windows.Forms.LinkLabel(); + this.TxtPoolWeight4 = new System.Windows.Forms.TextBox(); + this.TxtPoolWeight5 = new System.Windows.Forms.TextBox(); + this.LblPoolWeight4 = new System.Windows.Forms.Label(); + this.LblPoolWeight5 = new System.Windows.Forms.Label(); + this.ChkRemoveC6FormPool = new System.Windows.Forms.CheckBox(); + this.LblOptions = new System.Windows.Forms.Label(); + this.ChkAutoStripRateUpFromFallback = new System.Windows.Forms.CheckBox(); this.GrpBannerValues.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.NUDEventChance4)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.NUDEventChance5)).BeginInit(); @@ -93,13 +93,17 @@ namespace GrasscutterTools.Forms this.GrpPurplePool.SuspendLayout(); this.GrpYellowPool.SuspendLayout(); this.GrpJson.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ChartWeights)).BeginInit(); - this.GrpWeights.SuspendLayout(); - this.MenuCUD.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); this.SuspendLayout(); // // GrpBannerValues // + resources.ApplyResources(this.GrpBannerValues, "GrpBannerValues"); + this.GrpBannerValues.Controls.Add(this.ChkAutoStripRateUpFromFallback); + this.GrpBannerValues.Controls.Add(this.LblOptions); + this.GrpBannerValues.Controls.Add(this.ChkRemoveC6FormPool); + this.GrpBannerValues.Controls.Add(this.LnkOpenOldEditor); this.GrpBannerValues.Controls.Add(this.DTPEndTime); this.GrpBannerValues.Controls.Add(this.DTPBeginTime); this.GrpBannerValues.Controls.Add(this.CmbPrefab); @@ -126,7 +130,6 @@ namespace GrasscutterTools.Forms this.GrpBannerValues.Controls.Add(this.LblCostItem); this.GrpBannerValues.Controls.Add(this.LblPrefabPath); this.GrpBannerValues.Controls.Add(this.RbCostItem223); - resources.ApplyResources(this.GrpBannerValues, "GrpBannerValues"); this.GrpBannerValues.Name = "GrpBannerValues"; this.GrpBannerValues.TabStop = false; // @@ -418,104 +421,109 @@ namespace GrasscutterTools.Forms this.BtnParse.UseVisualStyleBackColor = true; this.BtnParse.Click += new System.EventHandler(this.BtnParse_Click); // - // ChartWeights + // groupBox1 // - chartArea1.AxisX.MajorGrid.LineColor = System.Drawing.Color.Gainsboro; - chartArea1.AxisY.MajorGrid.LineColor = System.Drawing.Color.Gainsboro; - chartArea1.Name = "ChartArea1"; - this.ChartWeights.ChartAreas.Add(chartArea1); - resources.ApplyResources(this.ChartWeights, "ChartWeights"); - this.ChartWeights.Name = "ChartWeights"; - series1.ChartArea = "ChartArea1"; - series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series1.Name = "SeriesWeight5"; - series2.ChartArea = "ChartArea1"; - series2.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series2.Name = "SeriesWeight4"; - series3.ChartArea = "ChartArea1"; - series3.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series3.Name = "SeriesPoolWeight5"; - series4.ChartArea = "ChartArea1"; - series4.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; - series4.Name = "SeriesPoolWeight4"; - this.ChartWeights.Series.Add(series1); - this.ChartWeights.Series.Add(series2); - this.ChartWeights.Series.Add(series3); - this.ChartWeights.Series.Add(series4); + resources.ApplyResources(this.groupBox1, "groupBox1"); + this.groupBox1.Controls.Add(this.LnkWeightHelp); + this.groupBox1.Controls.Add(this.TxtWeight4); + this.groupBox1.Controls.Add(this.TxtWeight5); + this.groupBox1.Controls.Add(this.LblWeight4); + this.groupBox1.Controls.Add(this.LblWeight5); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.TabStop = false; // - // GrpWeights + // groupBox2 // - resources.ApplyResources(this.GrpWeights, "GrpWeights"); - this.GrpWeights.Controls.Add(this.ListBannerWeights); - this.GrpWeights.Controls.Add(this.ChartWeights); - this.GrpWeights.Name = "GrpWeights"; - this.GrpWeights.TabStop = false; + resources.ApplyResources(this.groupBox2, "groupBox2"); + this.groupBox2.Controls.Add(this.TxtPoolWeight4); + this.groupBox2.Controls.Add(this.TxtPoolWeight5); + this.groupBox2.Controls.Add(this.LblPoolWeight4); + this.groupBox2.Controls.Add(this.LblPoolWeight5); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.TabStop = false; // - // ListBannerWeights + // LblWeight5 // - this.ListBannerWeights.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.ColCount, - this.ColWeight}); - this.ListBannerWeights.ContextMenuStrip = this.MenuCUD; - this.ListBannerWeights.FullRowSelect = true; - this.ListBannerWeights.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { - ((System.Windows.Forms.ListViewGroup)(resources.GetObject("ListBannerWeights.Groups"))), - ((System.Windows.Forms.ListViewGroup)(resources.GetObject("ListBannerWeights.Groups1"))), - ((System.Windows.Forms.ListViewGroup)(resources.GetObject("ListBannerWeights.Groups2"))), - ((System.Windows.Forms.ListViewGroup)(resources.GetObject("ListBannerWeights.Groups3")))}); - this.ListBannerWeights.HideSelection = false; - resources.ApplyResources(this.ListBannerWeights, "ListBannerWeights"); - this.ListBannerWeights.MultiSelect = false; - this.ListBannerWeights.Name = "ListBannerWeights"; - this.ListBannerWeights.UseCompatibleStateImageBehavior = false; - this.ListBannerWeights.View = System.Windows.Forms.View.Details; - this.ListBannerWeights.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.ListBannerWeights_MouseDoubleClick); + resources.ApplyResources(this.LblWeight5, "LblWeight5"); + this.LblWeight5.Name = "LblWeight5"; // - // ColCount + // LblWeight4 // - resources.ApplyResources(this.ColCount, "ColCount"); + resources.ApplyResources(this.LblWeight4, "LblWeight4"); + this.LblWeight4.Name = "LblWeight4"; // - // ColWeight + // TxtWeight5 // - resources.ApplyResources(this.ColWeight, "ColWeight"); + resources.ApplyResources(this.TxtWeight5, "TxtWeight5"); + this.TxtWeight5.Name = "TxtWeight5"; // - // MenuCUD + // TxtWeight4 // - this.MenuCUD.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.MenuItemEdit, - this.MenuItemAdd, - this.MenuItemRemove}); - this.MenuCUD.Name = "MenuCUD"; - resources.ApplyResources(this.MenuCUD, "MenuCUD"); + resources.ApplyResources(this.TxtWeight4, "TxtWeight4"); + this.TxtWeight4.Name = "TxtWeight4"; // - // MenuItemAdd + // LnkWeightHelp // - this.MenuItemAdd.Name = "MenuItemAdd"; - resources.ApplyResources(this.MenuItemAdd, "MenuItemAdd"); - this.MenuItemAdd.Click += new System.EventHandler(this.MenuItemAdd_Click); + resources.ApplyResources(this.LnkWeightHelp, "LnkWeightHelp"); + this.LnkWeightHelp.Name = "LnkWeightHelp"; + this.LnkWeightHelp.TabStop = true; + this.LnkWeightHelp.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LnkWeightHelp_LinkClicked); // - // MenuItemRemove + // LnkOpenOldEditor // - this.MenuItemRemove.Name = "MenuItemRemove"; - resources.ApplyResources(this.MenuItemRemove, "MenuItemRemove"); - this.MenuItemRemove.Click += new System.EventHandler(this.MenuItemRemove_Click); + resources.ApplyResources(this.LnkOpenOldEditor, "LnkOpenOldEditor"); + this.LnkOpenOldEditor.Name = "LnkOpenOldEditor"; + this.LnkOpenOldEditor.TabStop = true; + this.LnkOpenOldEditor.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.LnkOpenOldEditor_LinkClicked); // - // MenuItemEdit + // TxtPoolWeight4 // - this.MenuItemEdit.Name = "MenuItemEdit"; - resources.ApplyResources(this.MenuItemEdit, "MenuItemEdit"); - this.MenuItemEdit.Click += new System.EventHandler(this.MenuItemEdit_Click); + resources.ApplyResources(this.TxtPoolWeight4, "TxtPoolWeight4"); + this.TxtPoolWeight4.Name = "TxtPoolWeight4"; + // + // TxtPoolWeight5 + // + resources.ApplyResources(this.TxtPoolWeight5, "TxtPoolWeight5"); + this.TxtPoolWeight5.Name = "TxtPoolWeight5"; + // + // LblPoolWeight4 + // + resources.ApplyResources(this.LblPoolWeight4, "LblPoolWeight4"); + this.LblPoolWeight4.Name = "LblPoolWeight4"; + // + // LblPoolWeight5 + // + resources.ApplyResources(this.LblPoolWeight5, "LblPoolWeight5"); + this.LblPoolWeight5.Name = "LblPoolWeight5"; + // + // ChkRemoveC6FormPool + // + resources.ApplyResources(this.ChkRemoveC6FormPool, "ChkRemoveC6FormPool"); + this.ChkRemoveC6FormPool.Name = "ChkRemoveC6FormPool"; + this.ChkRemoveC6FormPool.UseVisualStyleBackColor = true; + // + // LblOptions + // + resources.ApplyResources(this.LblOptions, "LblOptions"); + this.LblOptions.Name = "LblOptions"; + // + // ChkAutoStripRateUpFromFallback + // + resources.ApplyResources(this.ChkAutoStripRateUpFromFallback, "ChkAutoStripRateUpFromFallback"); + this.ChkAutoStripRateUpFromFallback.Name = "ChkAutoStripRateUpFromFallback"; + this.ChkAutoStripRateUpFromFallback.UseVisualStyleBackColor = true; // // FormGachaBannerEditor2 // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.GrpWeights); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.groupBox1); this.Controls.Add(this.GrpJson); this.Controls.Add(this.GrpPurplePool); this.Controls.Add(this.GrpYellowPool); this.Controls.Add(this.GrpBannerValues); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; this.Name = "FormGachaBannerEditor2"; this.GrpBannerValues.ResumeLayout(false); this.GrpBannerValues.PerformLayout(); @@ -528,9 +536,10 @@ namespace GrasscutterTools.Forms this.GrpYellowPool.ResumeLayout(false); this.GrpJson.ResumeLayout(false); this.GrpJson.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ChartWeights)).EndInit(); - this.GrpWeights.ResumeLayout(false); - this.MenuCUD.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); this.ResumeLayout(false); } @@ -567,22 +576,28 @@ namespace GrasscutterTools.Forms private System.Windows.Forms.Label LblEventChance4; private System.Windows.Forms.Label LblEventChance4Tip; private System.Windows.Forms.NumericUpDown NUDEventChance4; - private System.Windows.Forms.DataVisualization.Charting.Chart ChartWeights; - private System.Windows.Forms.GroupBox GrpWeights; private System.Windows.Forms.DateTimePicker DTPEndTime; private System.Windows.Forms.DateTimePicker DTPBeginTime; - private System.Windows.Forms.ListView ListBannerWeights; private System.Windows.Forms.ListView ListFallbackItems; private System.Windows.Forms.ListView ListUpItems; private System.Windows.Forms.ColumnHeader ColFallbackId; private System.Windows.Forms.ColumnHeader ColFallbackName; private System.Windows.Forms.ColumnHeader ColUpId; private System.Windows.Forms.ColumnHeader ColUpName; - private System.Windows.Forms.ColumnHeader ColCount; - private System.Windows.Forms.ColumnHeader ColWeight; - private System.Windows.Forms.ContextMenuStrip MenuCUD; - private System.Windows.Forms.ToolStripMenuItem MenuItemEdit; - private System.Windows.Forms.ToolStripMenuItem MenuItemAdd; - private System.Windows.Forms.ToolStripMenuItem MenuItemRemove; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox TxtWeight4; + private System.Windows.Forms.TextBox TxtWeight5; + private System.Windows.Forms.Label LblWeight4; + private System.Windows.Forms.Label LblWeight5; + private System.Windows.Forms.LinkLabel LnkWeightHelp; + private System.Windows.Forms.LinkLabel LnkOpenOldEditor; + private System.Windows.Forms.TextBox TxtPoolWeight4; + private System.Windows.Forms.TextBox TxtPoolWeight5; + private System.Windows.Forms.Label LblPoolWeight4; + private System.Windows.Forms.Label LblPoolWeight5; + private System.Windows.Forms.CheckBox ChkRemoveC6FormPool; + private System.Windows.Forms.CheckBox ChkAutoStripRateUpFromFallback; + private System.Windows.Forms.Label LblOptions; } } \ No newline at end of file diff --git a/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.cs b/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.cs index 0d593e2..aae6295 100644 --- a/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.cs +++ b/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.cs @@ -57,6 +57,17 @@ namespace GrasscutterTools.Forms CmbPrefab.Items.AddRange(GameData.GachaBannerPrefabs.Names); } + + private void LnkWeightHelp_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + System.Diagnostics.Process.Start("https://github.com/Grasscutters/Grasscutter/pull/639"); + } + + private void LnkOpenOldEditor_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + new FormGachaBannerEditor().ShowDialog(); + } + #region - 卡池 - private void InitCheckedListBoxs() @@ -159,99 +170,35 @@ namespace GrasscutterTools.Forms #region - 权重 - - Series SeriesW5; - Series SeriesW4; - Series SeriesPW5; - Series SeriesPW4; + struct GachaWeight + { + public int Count; + public int Weight; + + public GachaWeight(int count, int weight) + { + Count = count; + Weight = weight; + } + } private void InitWeights(GachaBanner2 banner) { - var w5 = ListBannerWeights.Groups["GroupWeight5"]; - var w4 = ListBannerWeights.Groups["GroupWeight4"]; - var pw5 = ListBannerWeights.Groups["GroupPoolWeight5"]; - var pw4 = ListBannerWeights.Groups["GroupPoolWeight4"]; - SeriesW5 = ChartWeights.Series["SeriesWeight5"]; - SeriesW5.Color = Color.OrangeRed; - SeriesW5.Points.Clear(); - SeriesW4 = ChartWeights.Series["SeriesWeight4"]; - SeriesW4.Color = Color.Purple; - SeriesW4.Points.Clear(); - SeriesPW5 = ChartWeights.Series["SeriesPoolWeight5"]; - SeriesPW5.Color = Color.Orange; - SeriesPW5.Points.Clear(); - SeriesPW4 = ChartWeights.Series["SeriesPoolWeight4"]; - SeriesPW4.Color = Color.MediumPurple; - SeriesPW4.Points.Clear(); - var t = SelectWeights(banner.Weights5).Select(it => new ListViewItem(it, w5) { ForeColor = SeriesW5.Color }) - .Concat(SelectWeights(banner.Weights4).Select(it => new ListViewItem(it, w4) { ForeColor = SeriesW4.Color })) - .Concat(SelectWeights(banner.PoolBalanceWeights5).Select(it => new ListViewItem(it, pw5) { ForeColor = SeriesPW5.Color })) - .Concat(SelectWeights(banner.PoolBalanceWeights4).Select(it => new ListViewItem(it, pw4) { ForeColor = SeriesPW4.Color })); - ListBannerWeights.BeginUpdate(); - ListBannerWeights.Items.Clear(); - ListBannerWeights.Items.AddRange(t.ToArray()); - ListBannerWeights.EndUpdate(); - UpdateChart(); + TxtWeight5.Text = '[' + string.Join(", ", SelectWeights(banner.Weights5).Select(w => $"[{w.Count}, {w.Weight}]")) + ']'; + TxtWeight4.Text = '[' + string.Join(", ", SelectWeights(banner.Weights4).Select(w => $"[{w.Count}, {w.Weight}]")) + ']'; + TxtPoolWeight5.Text = '[' + string.Join(", ", SelectWeights(banner.PoolBalanceWeights5).Select(w => $"[{w.Count}, {w.Weight}]")) + ']'; + TxtPoolWeight4.Text = '[' + string.Join(", ", SelectWeights(banner.PoolBalanceWeights4).Select(w => $"[{w.Count}, {w.Weight}]")) + ']'; } - private void UpdateChart() - { - // TODO - } - - private IEnumerable SelectWeights(int[,] weights) + private IEnumerable SelectWeights(int[,] weights) { for (int i = 0; i < weights.GetLength(0); i++) - yield return new string[] { weights[i, 0].ToString(), weights[i, 1].ToString() }; + yield return new GachaWeight(weights[i, 0], weights[i, 1]); } - private int[,] GetWeights(ListViewGroup group) + private int[,] GetWeights(string weights) { - var weights = new int[group.Items.Count, 2]; - int i = 0; - foreach (ListViewItem item in group.Items) - { - weights[i, 0] = int.Parse(item.SubItems[0].Text); - weights[i, 1] = int.Parse(item.SubItems[1].Text); - i++; - } - return weights; - } - - private void ListBannerWeights_MouseDoubleClick(object sender, MouseEventArgs e) - { - if (ListBannerWeights.SelectedItems.Count != 1) - return; - MessageBox.Show("TODO"); - } - - private void MenuItemEdit_Click(object sender, EventArgs e) - { - if (ListBannerWeights.SelectedItems.Count != 1) - { - MessageBox.Show("请先选择目标", Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - MessageBox.Show("TODO"); - } - - private void MenuItemAdd_Click(object sender, EventArgs e) - { - if (ListBannerWeights.SelectedItems.Count != 1) - { - MessageBox.Show("请先选择目标", Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - MessageBox.Show("TODO"); - } - - private void MenuItemRemove_Click(object sender, EventArgs e) - { - if (ListBannerWeights.SelectedItems.Count != 1) - { - MessageBox.Show("请先选择目标", Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); - return; - } - MessageBox.Show("TODO"); + return JsonConvert.DeserializeObject(weights); } #endregion @@ -276,6 +223,8 @@ namespace GrasscutterTools.Forms NUDSortId.Value = banner.SortId; NUDEventChance5.Value = banner.EventChance5; NUDEventChance4.Value = banner.EventChance4; + ChkRemoveC6FormPool.Checked = banner.RemoveC6FromPool; + ChkAutoStripRateUpFromFallback.Checked = banner.AutoStripRateUpFromFallback; InitItems(banner); InitWeights(banner); } @@ -310,11 +259,19 @@ namespace GrasscutterTools.Forms PreviewPrefabPath = $"UI_Tab_GachaShowPanel_A{prefabId:000}", TitlePath = $"UI_GACHA_SHOW_PANEL_A{prefabId:000}_TITLE", CostItem = RbCostItem224.Checked ? 224 : 223, - BeginTime = (int)new DateTimeOffset(DTPBeginTime.Value).ToUnixTimeSeconds(), - EndTime = (int)new DateTimeOffset(DTPEndTime.Value).ToUnixTimeSeconds(), + BeginTime = (int)new DateTimeOffset(DTPBeginTime.Value, TimeSpan.Zero).ToUnixTimeSeconds(), + EndTime = (int)new DateTimeOffset(DTPEndTime.Value, TimeSpan.Zero).ToUnixTimeSeconds(), SortId = (int)NUDSortId.Value, EventChance5 = (int)NUDEventChance5.Value, EventChance4 = (int)NUDEventChance4.Value, + + RateUpItems4 = GetCheckedItems(ListUpItems, ListUpItems.Groups["GroupUpA4"]) + .Concat(GetCheckedItems(ListUpItems, ListUpItems.Groups["GroupUpW4"])) + .ToArray(), + RateUpItems5 = GetCheckedItems(ListUpItems, ListUpItems.Groups["GroupUpA5"]) + .Concat(GetCheckedItems(ListUpItems, ListUpItems.Groups["GroupUpW5"])) + .ToArray(), + FallbackItems3 = GetCheckedItems(ListFallbackItems, ListFallbackItems.Groups["GroupA3"]) .Concat(GetCheckedItems(ListFallbackItems, ListFallbackItems.Groups["GroupW3"])) .ToArray(), @@ -323,20 +280,28 @@ namespace GrasscutterTools.Forms FallbackItems5Pool1 = GetCheckedItems(ListFallbackItems, ListFallbackItems.Groups["GroupA5"]).ToArray(), FallbackItems5Pool2 = GetCheckedItems(ListFallbackItems, ListFallbackItems.Groups["GroupW5"]).ToArray(), - Weights4 = GetWeights(ListBannerWeights.Groups["GroupWeight4"]), - Weights5 = GetWeights(ListBannerWeights.Groups["GroupWeight5"]), - PoolBalanceWeights4 = GetWeights(ListBannerWeights.Groups["GroupPoolWeight4"]), - PoolBalanceWeights5 = GetWeights(ListBannerWeights.Groups["GroupPoolWeight5"]), - }; + RemoveC6FromPool = ChkRemoveC6FormPool.Checked, + AutoStripRateUpFromFallback = ChkAutoStripRateUpFromFallback.Checked, + + Weights4 = GetWeights(TxtWeight4.Text), + Weights5 = GetWeights(TxtWeight5.Text), + PoolBalanceWeights4 = GetWeights(TxtPoolWeight4.Text), + PoolBalanceWeights5 = GetWeights(TxtPoolWeight5.Text), + }; return banner; } private void BtnGen_Click(object sender, EventArgs e) { - var banner = ParseBanner(); - if (banner != null) + try { - TxtJson.Text = JsonConvert.SerializeObject(banner, Formatting.Indented); + var banner = ParseBanner(); + if (banner != null) + TxtJson.Text = JsonConvert.SerializeObject(banner, Formatting.Indented); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } } @@ -348,11 +313,11 @@ namespace GrasscutterTools.Forms } catch (Exception ex) { - MessageBox.Show("Json解析失败,错误消息:" + ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(ex.Message, Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); } } #endregion - + } } \ No newline at end of file diff --git a/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.resx b/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.resx index 1f8af00..6ca36f3 100644 --- a/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.resx +++ b/Source/GrasscutterTools/Forms/FormGachaBannerEditor2.resx @@ -117,14 +117,126 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Top, Bottom, Left + + + + True + + + 217, 260 + + + 151, 21 + + + 92 + + + 自动避免UP被基础抽中 + + + ChkAutoStripRateUpFromFallback + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GrpBannerValues + + + 0 + + + True + + + 74, 261 + + + 32, 17 + + + 91 + + + 选项 + + + LblOptions + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GrpBannerValues + + + 1 + + + True + + + 112, 260 + + + 99, 21 + + + 90 + + + 避免命座溢出 + + + ChkRemoveC6FormPool + + + System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GrpBannerValues + + + 2 + + + True + + + 6, 309 + + + 104, 17 + + + 20 + + + 打开旧版本编辑器 + + + LnkOpenOldEditor + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + GrpBannerValues + + + 3 + 302, 173 110, 23 - 7 @@ -138,7 +250,7 @@ GrpBannerValues - 0 + 4 112, 173 @@ -159,7 +271,7 @@ GrpBannerValues - 1 + 5 112, 115 @@ -180,12 +292,11 @@ GrpBannerValues - 2 + 6 True - NoControl @@ -211,7 +322,7 @@ GrpBannerValues - 3 + 7 True @@ -238,7 +349,7 @@ GrpBannerValues - 4 + 8 302, 231 @@ -259,7 +370,7 @@ GrpBannerValues - 5 + 9 112, 231 @@ -280,7 +391,7 @@ GrpBannerValues - 6 + 10 True @@ -307,7 +418,7 @@ GrpBannerValues - 7 + 11 True @@ -337,7 +448,7 @@ GrpBannerValues - 8 + 12 True @@ -364,7 +475,7 @@ GrpBannerValues - 9 + 13 True @@ -391,7 +502,7 @@ GrpBannerValues - 10 + 14 112, 26 @@ -412,7 +523,7 @@ GrpBannerValues - 11 + 15 112, 202 @@ -433,7 +544,7 @@ GrpBannerValues - 12 + 16 True @@ -460,7 +571,7 @@ GrpBannerValues - 13 + 17 True @@ -487,7 +598,7 @@ GrpBannerValues - 14 + 18 True @@ -514,7 +625,7 @@ GrpBannerValues - 15 + 19 True @@ -541,7 +652,7 @@ GrpBannerValues - 16 + 20 112, 55 @@ -562,7 +673,7 @@ GrpBannerValues - 17 + 21 True @@ -589,7 +700,7 @@ GrpBannerValues - 18 + 22 常驻池 @@ -619,7 +730,7 @@ GrpBannerValues - 19 + 23 True @@ -646,7 +757,7 @@ GrpBannerValues - 20 + 24 True @@ -673,7 +784,7 @@ GrpBannerValues - 21 + 25 True @@ -700,7 +811,7 @@ GrpBannerValues - 22 + 26 True @@ -727,7 +838,7 @@ GrpBannerValues - 23 + 27 True @@ -754,7 +865,7 @@ GrpBannerValues - 24 + 28 True @@ -781,16 +892,16 @@ GrpBannerValues - 25 + 29 12, 12 - 440, 268 + 440, 329 - 44 + 0 卡池参数 @@ -913,7 +1024,7 @@ 210, 305 - 50 + 5 基础池 @@ -1016,7 +1127,7 @@ 210, 230 - 49 + 4 UP池 @@ -1046,7 +1157,7 @@ 75, 23 - 53 + 0 生成Json @@ -1079,7 +1190,7 @@ 288, 487 - 0 + 2 TxtJson @@ -1103,7 +1214,7 @@ 75, 23 - 52 + 1 解析Json @@ -1127,7 +1238,7 @@ 300, 541 - 51 + 6 Json @@ -1144,154 +1255,285 @@ 2 - - 162, 22 + + Bottom, Left - - 272, 239 + + True - - 91 + + 402, 0 - - Weights + + 32, 17 - - ChartWeights + + 2 - - System.Windows.Forms.DataVisualization.Charting.Chart, System.Windows.Forms.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 + + 帮助 - - GrpWeights + + LnkWeightHelp - - 1 + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Top, Bottom, Left + + groupBox1 - - 次数 - - - 权重 - - - 17, 17 - - - 112, 22 - - - 编辑点 - - - 112, 22 - - - 添加点 - - - 112, 22 - - - 移除点 - - - 113, 70 - - - MenuCUD - - - System.Windows.Forms.ContextMenuStrip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh - ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAAAo15pif5p2D6YeNBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFsaWdubWVu - dAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAMR3JvdXBXZWlnaHQ1Cw== - - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh - ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAAAo05pif5p2D6YeNBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFsaWdubWVu - dAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAMR3JvdXBXZWlnaHQ0Cw== - - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh - ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAABA15pif5bmz6KGh5p2D6YeNBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFs - aWdubWVudAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAQR3JvdXBQb29sV2VpZ2h0NQs= - - - - - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w - LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACJTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5MaXN0Vmlld0dyb3VwBAAAAAZIZWFkZXIPSGVhZGVyQWxpZ25tZW50A1Rh - ZwROYW1lAQQCAShTeXN0ZW0uV2luZG93cy5Gb3Jtcy5Ib3Jpem9udGFsQWxpZ25tZW50AgAAAAIAAAAG - AwAAABA05pif5bmz6KGh5p2D6YeNBfz///8oU3lzdGVtLldpbmRvd3MuRm9ybXMuSG9yaXpvbnRhbEFs - aWdubWVudAEAAAAHdmFsdWVfXwAIAgAAAAAAAAAKBgUAAAAQR3JvdXBQb29sV2VpZ2h0NAs= - - - - 6, 22 - - - 150, 239 - - - 92 - - - ListBannerWeights - - - System.Windows.Forms.ListView, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - GrpWeights - - + 0 - - 12, 286 + + 112, 58 - - 440, 267 + + 300, 23 - - 93 + + 2 - - 卡池权重 + + TxtWeight4 - - GrpWeights + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + + groupBox1 + + + 1 + + + 112, 29 + + + 300, 23 + + + 1 + + + TxtWeight5 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 2 + + + True + + + 55, 61 + + + 51, 17 + + + 1 + + + 4星权重 + + + LblWeight4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 3 + + + True + + + 55, 32 + + + 51, 17 + + + 0 + + + 5星权重 + + + LblWeight5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox1 + + + 4 + + + 12, 347 + + + 440, 100 + + + 1 + + + 卡池权重与保底机制 + + + groupBox1 + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + $this - + 1 + + Bottom, Left + + + 112, 58 + + + 300, 23 + + + 2 + + + TxtPoolWeight4 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 0 + + + 112, 29 + + + 300, 23 + + + 1 + + + TxtPoolWeight5 + + + System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 1 + + + True + + + NoControl + + + 43, 61 + + + 63, 17 + + + 5 + + + 4星池权重 + + + LblPoolWeight4 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 2 + + + True + + + NoControl + + + 43, 32 + + + 63, 17 + + + 4 + + + 5星池权重 + + + LblPoolWeight5 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + groupBox2 + + + 3 + + + 12, 453 + + + 440, 100 + + + 3 + + + 角色和武器平衡机制(仅混合池有效) + + + groupBox2 + + + System.Windows.Forms.GroupBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + True @@ -1307,6 +1549,9 @@ 3, 4, 3, 4 + + 1000, 600 + CenterScreen @@ -1337,36 +1582,6 @@ System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ColCount - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ColWeight - - - System.Windows.Forms.ColumnHeader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MenuItemAdd - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MenuItemRemove - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - MenuItemEdit - - - System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - FormGachaBannerEditor2