Implement ShopEditor

This commit is contained in:
2022-11-01 21:55:05 +08:00
parent 52317d8d5a
commit 302e4e327d
10 changed files with 345 additions and 67 deletions

View File

@@ -72,5 +72,13 @@ namespace GrasscutterTools.Game
public string[] Lines { get; }
public static int ToId(string line) => int.Parse(line.Substring(0, line.IndexOf(':')).Trim());
public static bool TryToId(string line, out int id)
{
id = 0;
var sp = line.IndexOf(':');
if (sp == -1) return false;
return int.TryParse(line.Substring(0, sp).Trim(), out id);
}
}
}

View File

@@ -22,6 +22,12 @@ namespace GrasscutterTools.Game.Shop
{
public struct ItemParamData
{
public ItemParamData(int id, int count)
{
Id = id;
Count = count;
}
[JsonProperty("id")]
public int Id { get; set; }

View File

@@ -30,6 +30,9 @@ namespace GrasscutterTools.Game.Shop
[JsonProperty("goodsItem")]
public ItemParamData GoodsItem { get; set; }
/// <summary>
/// 消耗摩拉
/// </summary>
[JsonProperty("scoin")]
public int SCoin { get; set; }
@@ -55,11 +58,18 @@ namespace GrasscutterTools.Game.Shop
public int MaxLevel { get; set; } = 61;
[JsonProperty("preGoodsIdList")]
public List<int> PreGoodsIdList { get; set; } = new List<int>();
public List<int> PreGoodsIdList { get; set; }
/// <summary>
/// 消耗创世结晶
/// </summary>
[JsonProperty("mcoin")]
public int MCoin { get; set; }
/// <summary>
/// 消耗原石
/// </summary>
[JsonProperty("hcoin")]
public int HCoin { get; set; }