mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-10-21 19:53:29 +08:00
Add Drop.json Path Setting
Update Drop.json Editor UI
This commit is contained in:
@@ -50,7 +50,10 @@ namespace GrasscutterTools.Game.Drop
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{ItemId} x{MinCount}~x{MaxCount} [{MinWeight}~{MaxWeight}]";
|
||||
if (MinCount != MaxCount)
|
||||
return $"{ItemId}:{GameData.Items[ItemId]} | x[{MinCount}~{MaxCount}] w[{MinWeight}~{MaxWeight}]";
|
||||
else
|
||||
return $"{ItemId}:{GameData.Items[ItemId]} | x{MinCount} w[{MinWeight}~{MaxWeight}]";
|
||||
}
|
||||
}
|
||||
}
|
@@ -27,7 +27,7 @@ namespace GrasscutterTools.Game
|
||||
{
|
||||
var lines = idNamePairs.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var capacity = lines.Length;
|
||||
//IdMap = new Dictionary<int, string>(capacity);
|
||||
IdMap = new Dictionary<int, string>(capacity);
|
||||
//NameMap = new Dictionary<string, int>(capacity);
|
||||
var IdList = new List<int>(capacity);
|
||||
var NameList = new List<string>(capacity);
|
||||
@@ -41,7 +41,7 @@ namespace GrasscutterTools.Game
|
||||
var name = line.Substring(si + 1).Trim();
|
||||
if (!string.IsNullOrEmpty(name) && name != "null")
|
||||
{
|
||||
//IdMap[id] = name;
|
||||
IdMap[id] = name;
|
||||
//NameMap[name] = id;
|
||||
IdList.Add(id);
|
||||
NameList.Add(name);
|
||||
@@ -55,14 +55,12 @@ namespace GrasscutterTools.Game
|
||||
Lines = lineList.ToArray();
|
||||
}
|
||||
|
||||
//Dictionary<int, string> IdMap;
|
||||
//Dictionary<string, int> NameMap;
|
||||
//List<int> IdList;
|
||||
//List<string> NameList;
|
||||
private readonly Dictionary<int, string> IdMap;
|
||||
//private readonly Dictionary<string, int> NameMap;
|
||||
|
||||
public int Count => Ids.Length;
|
||||
|
||||
//public string this[int id] => IdMap[id];
|
||||
public string this[int id] => IdMap.TryGetValue(id, out string name) ? name : "???";
|
||||
|
||||
//public int this[string name] => NameMap[name];
|
||||
|
||||
|
Reference in New Issue
Block a user