mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-12-19 11:01:38 +08:00
Show Items
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
@@ -46,6 +47,9 @@ namespace GrasscutterTools.Forms
|
||||
CmbBannerType.SelectedIndex = 0;
|
||||
InitBannerPrefab();
|
||||
InitCheckedListBoxs();
|
||||
|
||||
|
||||
ShowBanner(new GachaBanner2());
|
||||
}
|
||||
|
||||
private void InitBannerPrefab()
|
||||
@@ -54,40 +58,93 @@ namespace GrasscutterTools.Forms
|
||||
CmbPrefab.Items.AddRange(GameData.GachaBannerPrefabs.Names);
|
||||
}
|
||||
|
||||
|
||||
private void InitCheckedListBoxs()
|
||||
{
|
||||
// TODO
|
||||
var c = new Dictionary<string, string>();
|
||||
ListFallbackItems.BeginUpdate();
|
||||
var a5 = ListFallbackItems.Groups.Add("a5", "5星角色");
|
||||
var a4 = ListFallbackItems.Groups.Add("a4", "4星角色");
|
||||
var a3 = ListFallbackItems.Groups.Add("a3", "3星角色");
|
||||
var w5 = ListFallbackItems.Groups.Add("w5", "5星武器");
|
||||
var w4 = ListFallbackItems.Groups.Add("w4", "4星武器");
|
||||
var w3 = ListFallbackItems.Groups.Add("w3", "3星武器");
|
||||
var avatars = GetAvatarsByColor("yellow")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, a5) { ForeColor = Color.OrangeRed })
|
||||
.Concat(GetAvatarsByColor("purple")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, a4) { ForeColor = Color.Purple }))
|
||||
.Concat(GetAvatarsByColor("blue")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, a3) { ForeColor = Color.Blue }));
|
||||
var weapons = GetWeaponsByColor("yellow")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, w5) { ForeColor = Color.OrangeRed })
|
||||
.Concat(GetWeaponsByColor("purple")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, w4) { ForeColor = Color.Purple }))
|
||||
.Concat(GetWeaponsByColor("blue")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, w3) { ForeColor = Color.Blue }));
|
||||
ListFallbackItems.Items.AddRange(avatars.Concat(weapons).ToArray());
|
||||
|
||||
|
||||
ListUpItems.BeginUpdate();
|
||||
var ua5 = ListUpItems.Groups.Add("ua5", "5星角色");
|
||||
var ua4 = ListUpItems.Groups.Add("ua4", "4星角色");
|
||||
var uw5 = ListUpItems.Groups.Add("uw5", "5星武器");
|
||||
var uw4 = ListUpItems.Groups.Add("uw4", "4星武器");
|
||||
var upAvatars = GetAvatarsByColor("yellow")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, ua5) { ForeColor = Color.OrangeRed })
|
||||
.Concat(GetAvatarsByColor("purple")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, ua4) { ForeColor = Color.Purple }));
|
||||
var upWeapons = GetWeaponsByColor("yellow")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, uw5) { ForeColor = Color.OrangeRed })
|
||||
.Concat(GetWeaponsByColor("purple")
|
||||
.Select(it => new ListViewItem(new string[] { it.Item1.ToString(), it.Item2 }, uw4) { ForeColor = Color.Purple }));
|
||||
ListUpItems.Items.AddRange(upAvatars.Concat(upWeapons).ToArray());
|
||||
|
||||
ListFallbackItems.EndUpdate();
|
||||
ListUpItems.EndUpdate();
|
||||
}
|
||||
|
||||
//private void InitCheckedListBox(CheckedListBox list, string color)
|
||||
//{
|
||||
// var kvs = new List<string>();
|
||||
// for (int i = 0; i < GameData.AvatarColors.Count; i++)
|
||||
// {
|
||||
// if (GameData.AvatarColors.Names[i] == color)
|
||||
// {
|
||||
// var id = GameData.AvatarColors.Ids[i];
|
||||
// var index = Array.IndexOf(GameData.Avatars.Ids, id % 1000 + 10000000);
|
||||
// if (index >= 0)
|
||||
// kvs.Add($"{id}:{GameData.Avatars.Names[index]}");
|
||||
// }
|
||||
// }
|
||||
// for (int i = 0; i < GameData.WeaponColors.Count; i++)
|
||||
// {
|
||||
// if (GameData.WeaponColors.Names[i] == color)
|
||||
// {
|
||||
// var id = GameData.WeaponColors.Ids[i];
|
||||
// var index = Array.IndexOf(GameData.Weapons.Ids, id);
|
||||
// if (index >= 0)
|
||||
// kvs.Add($"{id}:{GameData.Weapons.Names[index]}");
|
||||
// }
|
||||
// }
|
||||
// list.Items.AddRange(kvs.ToArray());
|
||||
//}
|
||||
|
||||
private void InitRateUpItems(GachaBanner2 banner)
|
||||
private IEnumerable<(int, string)> GetAvatarsByColor(string color)
|
||||
{
|
||||
// TODO
|
||||
for (int i = 0; i < GameData.AvatarColors.Count; i++)
|
||||
{
|
||||
if (GameData.AvatarColors.Names[i] == color)
|
||||
{
|
||||
var id = GameData.AvatarColors.Ids[i];
|
||||
var index = Array.IndexOf(GameData.Avatars.Ids, id % 1000 + 10000000);
|
||||
if (index >= 0)
|
||||
yield return (id, GameData.Avatars.Names[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<(int, string)> GetWeaponsByColor(string color)
|
||||
{
|
||||
for (int i = 0; i < GameData.WeaponColors.Count; i++)
|
||||
{
|
||||
if (GameData.WeaponColors.Names[i] == color)
|
||||
{
|
||||
var id = GameData.WeaponColors.Ids[i];
|
||||
var index = Array.IndexOf(GameData.Weapons.Ids, id);
|
||||
if (index >= 0)
|
||||
yield return (id, GameData.Weapons.Names[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void InitItems(GachaBanner2 banner)
|
||||
{
|
||||
var f = banner.FallbackItems3
|
||||
.Concat(banner.FallbackItems4Pool1)
|
||||
.Concat(banner.FallbackItems4Pool2)
|
||||
.Concat(banner.FallbackItems5Pool1)
|
||||
.Concat(banner.FallbackItems5Pool2)
|
||||
.ToArray();
|
||||
foreach (ListViewItem item in ListFallbackItems.Items)
|
||||
item.Checked = Array.IndexOf(f, int.Parse(item.Text)) >= 0;
|
||||
|
||||
var u = banner.RateUpItems4.Concat(banner.RateUpItems5).ToArray();
|
||||
foreach (ListViewItem item in ListUpItems.Items)
|
||||
item.Checked = Array.IndexOf(u, int.Parse(item.Text)) >= 0;
|
||||
}
|
||||
|
||||
#endregion - 初始化 -
|
||||
@@ -107,12 +164,12 @@ namespace GrasscutterTools.Forms
|
||||
CmbPrefab.SelectedIndex = Array.IndexOf(GameData.GachaBannerPrefabs.Ids, prefabId);
|
||||
RbCostItem224.Checked = banner.CostItem == 224;
|
||||
RbCostItem223.Checked = banner.CostItem == 223;
|
||||
NUDBeginTime.Value = banner.BeginTime;
|
||||
NUDEndTime.Value = banner.EndTime;
|
||||
DTPBeginTime.Value = DateTimeOffset.FromUnixTimeSeconds(banner.BeginTime).DateTime;
|
||||
DTPEndTime.Value = DateTimeOffset.FromUnixTimeSeconds(banner.EndTime).DateTime;
|
||||
NUDSortId.Value = banner.SortId;
|
||||
NUDEventChance5.Value = banner.EventChance5;
|
||||
NUDEventChance4.Value = banner.EventChance4;
|
||||
InitRateUpItems(banner);
|
||||
InitItems(banner);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -145,8 +202,8 @@ 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)NUDBeginTime.Value,
|
||||
EndTime = (int)NUDEndTime.Value,
|
||||
BeginTime = (int)new DateTimeOffset(DTPBeginTime.Value).ToUnixTimeSeconds(),
|
||||
EndTime = (int)new DateTimeOffset(DTPEndTime.Value).ToUnixTimeSeconds(),
|
||||
SortId = (int)NUDSortId.Value,
|
||||
EventChance5 = (int)NUDEventChance5.Value,
|
||||
EventChance4 = (int)NUDEventChance4.Value,
|
||||
|
||||
Reference in New Issue
Block a user