mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-06-07 22:59:14 +08:00
Update All Gadgets
Update Spawn filter
This commit is contained in:
parent
dcbd946407
commit
738a755353
@ -17,10 +17,20 @@
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Game.Data.Excels
|
||||
{
|
||||
[ResourceType("GadgetExcelConfigData.json")]
|
||||
internal class GadgetData
|
||||
internal class GadgetData : GameResource
|
||||
{
|
||||
[JsonProperty("type")]
|
||||
public string Type { get; set; }
|
||||
|
||||
[JsonProperty("jsonName")]
|
||||
public string JsonName { get; set; }
|
||||
|
||||
[JsonProperty("interactNameTextMapHash")]
|
||||
public long InteractNameTextMapHash { get; set; }
|
||||
}
|
||||
}
|
33
Source/GrasscutterTools/Game/Data/Excels/GatherData.cs
Normal file
33
Source/GrasscutterTools/Game/Data/Excels/GatherData.cs
Normal file
@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Game.Data.Excels
|
||||
{
|
||||
[ResourceType("GatherExcelConfigData.json")]
|
||||
internal class GatherData
|
||||
{
|
||||
[JsonProperty("gadgetId")]
|
||||
public int GadgetId { get; set; }
|
||||
|
||||
[JsonProperty("itemId")]
|
||||
public int ItemId { get; set; }
|
||||
}
|
||||
}
|
@ -17,10 +17,14 @@
|
||||
*
|
||||
**/
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace GrasscutterTools.Game.Data.Excels
|
||||
{
|
||||
[ResourceType("HomeWorldFurnitureExcelConfigData.json")]
|
||||
internal class HomeWorldFurnitureData : GameResource
|
||||
{
|
||||
[JsonProperty("furnitureGadgetID")]
|
||||
public int[] FurnitureGadgetId { get; set; }
|
||||
}
|
||||
}
|
@ -30,7 +30,7 @@ namespace GrasscutterTools.Game.Data
|
||||
public long NameTextMapHash { get; set; }
|
||||
|
||||
[JsonProperty("titleTextMapHash")]
|
||||
public string TitleTextMapHash { get; set; }
|
||||
public long TitleTextMapHash { get; set; }
|
||||
|
||||
[JsonProperty("descTextMapHash")]
|
||||
public long DescTextMapHash { get; set; }
|
||||
|
@ -45,6 +45,10 @@ namespace GrasscutterTools.Game.Data
|
||||
|
||||
public Dictionary<int, DungeonData> DungeonData { get; set; }
|
||||
|
||||
public Dictionary<int, GadgetData> GadgetData { get; set; }
|
||||
|
||||
public List<GatherData> GatherData { get; set; }
|
||||
|
||||
public Dictionary<int, HomeWorldFurnitureData> HomeWorldFurnitureData { get; set; }
|
||||
|
||||
public Dictionary<int, MainQuestData> MainQuestData { get; set; }
|
||||
@ -72,11 +76,18 @@ namespace GrasscutterTools.Game.Data
|
||||
{
|
||||
var type = property.PropertyType;
|
||||
if (!type.IsGenericType) continue;
|
||||
var gameResourceType = type.GetGenericArguments()[1];
|
||||
var attributes = (ResourceTypeAttribute[])gameResourceType.GetCustomAttributes(typeof(ResourceTypeAttribute), true);
|
||||
if (attributes.Length < 1) continue;
|
||||
var dataFile = Path.Combine(resourcesDirPath, "ExcelBinOutput", attributes[0].Name);
|
||||
var data = LoadDataFile(gameResourceType, dataFile);
|
||||
var genericArguments = type.GetGenericArguments();
|
||||
ResourceTypeAttribute attribute = null;
|
||||
foreach (var it in genericArguments)
|
||||
{
|
||||
var attributes = it.GetCustomAttributes(typeof(ResourceTypeAttribute), true);
|
||||
if (attributes.Length == 0) continue;
|
||||
attribute = (ResourceTypeAttribute)attributes[0];
|
||||
type = it;
|
||||
}
|
||||
if (attribute == null) continue;
|
||||
var dataFile = Path.Combine(resourcesDirPath, "ExcelBinOutput", attribute.Name);
|
||||
var data = LoadDataFile(type, dataFile);
|
||||
property.SetValue(this, data, null);
|
||||
}
|
||||
|
||||
@ -115,6 +126,8 @@ namespace GrasscutterTools.Game.Data
|
||||
var list = (IList)JsonConvert.DeserializeObject(File.ReadAllText(path), typeof(List<>).MakeGenericType(type));
|
||||
if (list == null) return null;
|
||||
|
||||
if (!type.IsSubclassOf(typeof(GameResource))) return list;
|
||||
|
||||
var dicType = typeof(Dictionary<,>).MakeGenericType(typeof(int), type);
|
||||
var dic = (IDictionary)Activator.CreateInstance(dicType);
|
||||
foreach (GameResource gameResource in list)
|
||||
@ -144,17 +157,30 @@ namespace GrasscutterTools.Game.Data
|
||||
Thread.CurrentThread.CurrentUICulture = new CultureInfo(language.Key);
|
||||
GameData.LoadResources();
|
||||
|
||||
#region Achievement
|
||||
|
||||
// Achievement
|
||||
File.WriteAllLines(
|
||||
Path.Combine(dir, "Achievement.txt"),
|
||||
AchievementData.Values.Where(it => it.IsUsed)
|
||||
.Select(it => $"{it.Id}:{TextMapData.GetText(it.TitleTextMapHash.ToString())} - {TextMapData.GetText(it.DescTextMapHash.ToString())}"),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Achievement
|
||||
|
||||
#region Artifact
|
||||
|
||||
// Artifact
|
||||
File.WriteAllLines(
|
||||
Path.Combine(dir, "Artifact.txt"),
|
||||
ReliquaryData.Values.OrderBy(it => it.Id).Select(it => $"{it.Id}:{TextMapData.GetText(it.NameTextMapHash.ToString())}"),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Artifact
|
||||
|
||||
#region Avatar
|
||||
|
||||
// Avatar
|
||||
File.WriteAllLines(
|
||||
Path.Combine(dir, "Avatar.txt"),
|
||||
MaterialData.Values
|
||||
@ -162,11 +188,88 @@ namespace GrasscutterTools.Game.Data
|
||||
.Select(it => $"{it.Id}:{TextMapData.GetText(it.NameTextMapHash.ToString())}"),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Avatar
|
||||
|
||||
#region Dungeon
|
||||
|
||||
// Dungeon
|
||||
File.WriteAllLines(
|
||||
Path.Combine(dir, "Dungeon.txt"),
|
||||
DungeonData.Values.Select(it => $"{it.Id}:{TextMapData.GetText(it.NameTextMapHash.ToString())}"),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Dungeon
|
||||
|
||||
#region Gadget
|
||||
|
||||
// Gadget
|
||||
sb.Clear();
|
||||
var gatherMap = new Dictionary<int, int>(GatherData.Count);
|
||||
foreach (var it in GatherData.Where(it => !gatherMap.ContainsKey(it.GadgetId)))
|
||||
gatherMap.Add(it.GadgetId, it.ItemId);
|
||||
var furnitureMap = new Dictionary<int, long>(HomeWorldFurnitureData.Count);
|
||||
foreach (var it in HomeWorldFurnitureData.Values.Where(it => it.FurnitureGadgetId != null))
|
||||
foreach (var gadgetId in it.FurnitureGadgetId.Where(id => id > 0 && !furnitureMap.ContainsKey(id)))
|
||||
furnitureMap.Add(gadgetId, it.NameTextMapHash);
|
||||
var oldFirst = language.Key.StartsWith("zh");
|
||||
foreach (var gadgetTypes in GadgetData.Values.OrderBy(it => it.Id).GroupBy(it => it.Type))
|
||||
{
|
||||
sb.Append("// ").AppendLine(GadgetType.ToTranslatedString(gadgetTypes.Key, language.Key));
|
||||
foreach (var it in gadgetTypes)
|
||||
{
|
||||
var name = oldFirst ? GameData.Gadgets[it.Id] : ItemMap.EmptyName;
|
||||
|
||||
if (name == ItemMap.EmptyName)
|
||||
{
|
||||
if (!TextMapData.TryGetText(it.NameTextMapHash.ToString(), out name)
|
||||
&& !TextMapData.TryGetText(it.InteractNameTextMapHash.ToString(), out name))
|
||||
{
|
||||
if (gatherMap.TryGetValue(it.Id, out var itemId)
|
||||
&& MaterialData.TryGetValue(itemId, out var item))
|
||||
{
|
||||
name = TextMapData.GetText(item.NameTextMapHash.ToString());
|
||||
}
|
||||
else if (furnitureMap.TryGetValue(it.Id, out var hash))
|
||||
{
|
||||
name = TextMapData.GetText(hash.ToString());
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(it.JsonName))
|
||||
{
|
||||
name = it.JsonName;
|
||||
}
|
||||
else if (!oldFirst)
|
||||
{
|
||||
var temp = GameData.Gadgets[it.Id];
|
||||
if (temp != ItemMap.EmptyName)
|
||||
name = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sb.AppendFormat("{0}:{1}", it.Id, name).AppendLine();
|
||||
}
|
||||
sb.AppendLine();
|
||||
}
|
||||
|
||||
// 旧的数据
|
||||
//var old = GameData.Gadgets.AllIds.Where(it => !GadgetData.ContainsKey(it));
|
||||
//if (old.Any())
|
||||
//{
|
||||
// sb.AppendLine("// Old lines");
|
||||
// foreach (var it in old)
|
||||
// sb.AppendFormat("{0}:{1}", it, GameData.Gadgets[it]).AppendLine();
|
||||
//}
|
||||
|
||||
File.WriteAllText(
|
||||
Path.Combine(dir, "Gadget.txt"),
|
||||
sb.ToString(),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Gadget
|
||||
|
||||
#region Item
|
||||
|
||||
// Item
|
||||
sb.Clear();
|
||||
foreach (var itemTypes in MaterialData.Values.GroupBy(it => it.ItemType))
|
||||
{
|
||||
@ -211,6 +314,11 @@ namespace GrasscutterTools.Game.Data
|
||||
|
||||
File.WriteAllText(Path.Combine(dir, "Item.txt"), sb.ToString(), Encoding.UTF8);
|
||||
|
||||
#endregion Item
|
||||
|
||||
#region Monsters
|
||||
|
||||
// Monsters
|
||||
sb.Clear();
|
||||
foreach (var monsterType in MonsterData.Values.OrderBy(it => it.Id)
|
||||
.GroupBy(it => it.Type)
|
||||
@ -240,6 +348,11 @@ namespace GrasscutterTools.Game.Data
|
||||
sb.ToString(),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Monsters
|
||||
|
||||
#region Quest
|
||||
|
||||
// Quest
|
||||
sb.Clear();
|
||||
foreach (var it in QuestData.Values.OrderBy(it => it.Id))
|
||||
{
|
||||
@ -248,7 +361,7 @@ namespace GrasscutterTools.Game.Data
|
||||
{
|
||||
sb.AppendFormat("{0}:{1} - {2}",
|
||||
it.Id,
|
||||
TextMapData.GetText(MainQuestData[it.MainId].TitleTextMapHash),
|
||||
TextMapData.GetText(MainQuestData[it.MainId].TitleTextMapHash.ToString()),
|
||||
TextMapData.GetText(it.DescTextMapHash.ToString()));
|
||||
}
|
||||
else
|
||||
@ -262,6 +375,11 @@ namespace GrasscutterTools.Game.Data
|
||||
sb.ToString(),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Quest
|
||||
|
||||
#region Scene
|
||||
|
||||
// Scene
|
||||
sb.Clear();
|
||||
foreach (var it in DungeonData.Values)
|
||||
{
|
||||
@ -283,10 +401,17 @@ namespace GrasscutterTools.Game.Data
|
||||
sb.ToString(),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Scene
|
||||
|
||||
#region Weapon
|
||||
|
||||
// Weapon
|
||||
File.WriteAllLines(
|
||||
Path.Combine(dir, "Weapon.txt"),
|
||||
WeaponData.Values.Select(it => $"{it.Id}:{TextMapData.GetText(it.NameTextMapHash.ToString())}"),
|
||||
Encoding.UTF8);
|
||||
|
||||
#endregion Weapon
|
||||
}
|
||||
|
||||
File.WriteAllLines(
|
||||
|
@ -64,6 +64,11 @@ namespace GrasscutterTools.Game
|
||||
/// </summary>
|
||||
public IEnumerable<string> AllLines => Values.SelectMany(it => it.Lines);
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有ID
|
||||
/// </summary>
|
||||
public IEnumerable<int> AllIds => Values.SelectMany(it => it.Ids);
|
||||
|
||||
private string[] lines;
|
||||
public string[] Lines => lines ?? (lines = AllLines.ToArray());
|
||||
|
||||
|
92
Source/GrasscutterTools/Game/Props/GadgetType.cs
Normal file
92
Source/GrasscutterTools/Game/Props/GadgetType.cs
Normal file
@ -0,0 +1,92 @@
|
||||
/**
|
||||
* Grasscutter Tools
|
||||
* Copyright (C) 2023 jie65535
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published
|
||||
* by the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
**/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GrasscutterTools.Game.Props
|
||||
{
|
||||
internal static class GadgetType
|
||||
{
|
||||
private static readonly Dictionary<string, string> TextMapCHS = new Dictionary<string, string>
|
||||
{
|
||||
["Gear"] = "机关装置",
|
||||
["Field"] = "领域",
|
||||
["Bullet"] = "技能/飞弹",
|
||||
["Gadget"] = "Gadget",
|
||||
["AirflowField"] = "气流领域",
|
||||
["SpeedupField"] = "加速领域",
|
||||
["GatherObject"] = "采集物品",
|
||||
["Platform"] = "平台",
|
||||
["AmberWind"] = "风琥珀",
|
||||
["Vehicle"] = "载具",
|
||||
["MonsterEquip"] = "怪物装备",
|
||||
["Equip"] = "装备",
|
||||
["SubEquip"] = "副装备",
|
||||
["FishRod"] = "钓鱼竿",
|
||||
["Grass"] = "草",
|
||||
["Water"] = "水",
|
||||
["Tree"] = "树",
|
||||
["Bush"] = "灌木",
|
||||
["Lightning"] = "闪电",
|
||||
["CustomTile"] = "自定义贴图",
|
||||
["TransPointFirst"] = "传送点1",
|
||||
["TransPointSecond"] = "传送点2",
|
||||
["Chest"] = "宝箱",
|
||||
["GeneralRewardPoint"] = "通用奖励点",
|
||||
["OfferingGadget"] = "祭品Gadget",
|
||||
["Worktop"] = "工作台",
|
||||
["CustomGadget"] = "自定义Gadget",
|
||||
["BlackMud"] = "黑色泥浆",
|
||||
["DeshretObeliskGadget"] = "赤王方尖碑",
|
||||
["JourneyGearOperatorGadget"] = "旅途装备操作Gadget",
|
||||
["QuestGadget"] = "任务Gadget",
|
||||
["RoguelikeOperatorGadget"] = "肉鸽 操作台",
|
||||
["NightCrowGadget"] = "幽邃鸦眼",
|
||||
["MpPlayRewardPoint"] = "多人游戏奖励点",
|
||||
["CurveMoveGadget"] = "曲线移动Gadget",
|
||||
["RewardStatue"] = "地城奖励树",
|
||||
["RewardPoint"] = "循环地城奖励点",
|
||||
["Foundation"] = "底座",
|
||||
["Projector"] = "投影仪",
|
||||
["Screen"] = "屏幕",
|
||||
["CoinCollectLevelGadget"] = "金币收集等级Gadget",
|
||||
["EchoShell"] = "回声海螺",
|
||||
["UgcSpecialGadget"] = "UGC特殊Gadget",
|
||||
["UgcTowerLevelUpGadget"] = "UGC塔升级Gadget",
|
||||
["GatherPoint"] = "采集物挂接点",
|
||||
["MiracleRing"] = "奇迹之环",
|
||||
["EnvAnimal"] = "环境动物",
|
||||
["EnergyBall"] = "能量球",
|
||||
["SealGadget"] = "封印Gadget",
|
||||
["ViewPoint"] = "观景点",
|
||||
["FishPool"] = "钓鱼点",
|
||||
["ElemCrystal"] = "元素水晶",
|
||||
["Deprecated"] = "弃用",
|
||||
["WindSeed"] = "风种子",
|
||||
["UIInteractGadget"] = "界面交互Gadget",
|
||||
["Camera"] = "摄像机",
|
||||
};
|
||||
|
||||
public static string ToTranslatedString(string gadgetType, string language)
|
||||
{
|
||||
if (string.IsNullOrEmpty(gadgetType)) gadgetType = "Deprecated";
|
||||
return language.StartsWith("zh") ? TextMapCHS[gadgetType] : gadgetType;
|
||||
}
|
||||
}
|
||||
}
|
@ -143,6 +143,7 @@
|
||||
<Compile Include="Game\Data\Excels\AchievementData.cs" />
|
||||
<Compile Include="Game\Data\Excels\DungeonData.cs" />
|
||||
<Compile Include="Game\Data\Excels\GadgetData.cs" />
|
||||
<Compile Include="Game\Data\Excels\GatherData.cs" />
|
||||
<Compile Include="Game\Data\Excels\HomeWorldBgmData.cs" />
|
||||
<Compile Include="Game\Data\Excels\HomeWorldFurnitureData.cs" />
|
||||
<Compile Include="Game\Data\Excels\MaterialData.cs" />
|
||||
@ -171,6 +172,7 @@
|
||||
<Compile Include="Game\Mail\Mail.cs" />
|
||||
<Compile Include="Game\Mail\MailItem.cs" />
|
||||
<Compile Include="Game\Player\PlayerData.cs" />
|
||||
<Compile Include="Game\Props\GadgetType.cs" />
|
||||
<Compile Include="Game\Props\ItemUseData.cs" />
|
||||
<Compile Include="Game\Props\MonsterType.cs" />
|
||||
<Compile Include="Game\Props\PlayerProperty.cs" />
|
||||
@ -608,6 +610,7 @@
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Pages\PageSpawn.resx">
|
||||
<DependentUpon>PageSpawn.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Pages\PageSpawn.ru-RU.resx">
|
||||
<DependentUpon>PageSpawn.cs</DependentUpon>
|
||||
@ -765,6 +768,7 @@
|
||||
<Content Include="Resources\zh-tw\Cutscene.txt" />
|
||||
<Content Include="Resources\zh-tw\GachaBennerTitle.txt" />
|
||||
<Content Include="Resources\zh-tw\GachaBennerPrefab.txt" />
|
||||
<None Include="Resources\zh-tw\Gadget.txt" />
|
||||
<Content Include="Resources\zh-tw\Item.txt" />
|
||||
<Content Include="Resources\zh-tw\Monsters.txt" />
|
||||
<Content Include="Resources\zh-tw\PlayerProperty.txt" />
|
||||
|
16
Source/GrasscutterTools/Pages/PageSpawn.Designer.cs
generated
16
Source/GrasscutterTools/Pages/PageSpawn.Designer.cs
generated
@ -90,7 +90,7 @@
|
||||
this.ListEntity = new System.Windows.Forms.ListBox();
|
||||
this.PanelEntityFilterBar = new System.Windows.Forms.Panel();
|
||||
this.TxtEntityFilter = new System.Windows.Forms.TextBox();
|
||||
this.BtnFilterEntity = new System.Windows.Forms.Button();
|
||||
this.CmbFilterEntity = new System.Windows.Forms.ComboBox();
|
||||
this.TPSpawnRecords = new System.Windows.Forms.TabPage();
|
||||
this.ListSpawnLogs = new System.Windows.Forms.ListBox();
|
||||
this.FLPSpawnRecordControls = new System.Windows.Forms.FlowLayoutPanel();
|
||||
@ -707,7 +707,7 @@
|
||||
// PanelEntityFilterBar
|
||||
//
|
||||
this.PanelEntityFilterBar.Controls.Add(this.TxtEntityFilter);
|
||||
this.PanelEntityFilterBar.Controls.Add(this.BtnFilterEntity);
|
||||
this.PanelEntityFilterBar.Controls.Add(this.CmbFilterEntity);
|
||||
resources.ApplyResources(this.PanelEntityFilterBar, "PanelEntityFilterBar");
|
||||
this.PanelEntityFilterBar.Name = "PanelEntityFilterBar";
|
||||
//
|
||||
@ -717,12 +717,12 @@
|
||||
this.TxtEntityFilter.Name = "TxtEntityFilter";
|
||||
this.TxtEntityFilter.TextChanged += new System.EventHandler(this.TxtEntityFilter_TextChanged);
|
||||
//
|
||||
// BtnFilterEntity
|
||||
// CmbFilterEntity
|
||||
//
|
||||
resources.ApplyResources(this.BtnFilterEntity, "BtnFilterEntity");
|
||||
this.BtnFilterEntity.Name = "BtnFilterEntity";
|
||||
this.BtnFilterEntity.UseVisualStyleBackColor = true;
|
||||
this.BtnFilterEntity.Click += new System.EventHandler(this.BtnFilterEntity_Click);
|
||||
this.CmbFilterEntity.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
resources.ApplyResources(this.CmbFilterEntity, "CmbFilterEntity");
|
||||
this.CmbFilterEntity.Name = "CmbFilterEntity";
|
||||
this.CmbFilterEntity.SelectedIndexChanged += new System.EventHandler(this.CmbFilterEntity_SelectedIndexChanged);
|
||||
//
|
||||
// TPSpawnRecords
|
||||
//
|
||||
@ -879,7 +879,7 @@
|
||||
private System.Windows.Forms.ListBox ListEntity;
|
||||
private System.Windows.Forms.Panel PanelEntityFilterBar;
|
||||
private System.Windows.Forms.TextBox TxtEntityFilter;
|
||||
private System.Windows.Forms.Button BtnFilterEntity;
|
||||
private System.Windows.Forms.ComboBox CmbFilterEntity;
|
||||
private System.Windows.Forms.TabPage TPSpawnRecords;
|
||||
private System.Windows.Forms.ListBox ListSpawnLogs;
|
||||
private System.Windows.Forms.FlowLayoutPanel FLPSpawnRecordControls;
|
||||
|
@ -52,43 +52,63 @@ namespace GrasscutterTools.Pages
|
||||
|
||||
#region -- 实体列表 --
|
||||
|
||||
private List<string[]> EntityList;
|
||||
|
||||
/// <summary>
|
||||
/// 初始化实体列表
|
||||
/// </summary>
|
||||
private void InitEntityList()
|
||||
{
|
||||
// 初始化列表类型过滤器
|
||||
MenuSpawnEntityFilter.SuspendLayout();
|
||||
MenuSpawnEntityFilter.Items.Clear();
|
||||
BtnFilterEntity.Text = Resources.All;
|
||||
var types = new List<string>();
|
||||
var entityList = new List<string[]>();
|
||||
|
||||
types.Add(Resources.All);
|
||||
// 默认显示所有
|
||||
SelectedEntityTypeLines = GameData.Monsters.AllLines.Concat(GameData.Gadgets.AllLines).ToArray();
|
||||
var all = new ToolStripMenuItem
|
||||
{
|
||||
Text = Resources.All,
|
||||
Tag = SelectedEntityTypeLines,
|
||||
};
|
||||
all.Click += OnEntityTypeFilterClick;
|
||||
MenuSpawnEntityFilter.Items.Add(all);
|
||||
void AddTypes(ItemMapGroup group)
|
||||
{
|
||||
foreach (var kv in group)
|
||||
{
|
||||
var item = new ToolStripMenuItem
|
||||
{
|
||||
Text = kv.Key,
|
||||
Tag = kv.Value.Lines,
|
||||
};
|
||||
item.Click += OnEntityTypeFilterClick;
|
||||
MenuSpawnEntityFilter.Items.Add(item);
|
||||
}
|
||||
}
|
||||
//MenuSpawnEntityFilter.Items.Add(new ToolStripLabel("Monsters"));
|
||||
AddTypes(GameData.Monsters);
|
||||
MenuSpawnEntityFilter.Items.Add(new ToolStripSeparator());
|
||||
//MenuSpawnEntityFilter.Items.Add(new ToolStripLabel("Gadgets"));
|
||||
AddTypes(GameData.Gadgets);
|
||||
MenuSpawnEntityFilter.ResumeLayout();
|
||||
entityList.Add(SelectedEntityTypeLines);
|
||||
types.AddRange(GameData.Monsters.Select(it => it.Key));
|
||||
entityList.AddRange(GameData.Monsters.Select(it => it.Value.Lines));
|
||||
types.AddRange(GameData.Gadgets.Select(it => it.Key));
|
||||
entityList.AddRange(GameData.Gadgets.Select(it => it.Value.Lines));
|
||||
|
||||
CmbFilterEntity.DataSource = types;
|
||||
EntityList = entityList;
|
||||
|
||||
//// 初始化列表类型过滤器
|
||||
//MenuSpawnEntityFilter.SuspendLayout();
|
||||
//MenuSpawnEntityFilter.Items.Clear();
|
||||
//CmbFilterEntity.Text = Resources.All;
|
||||
//// 默认显示所有
|
||||
//SelectedEntityTypeLines = GameData.Monsters.AllLines.Concat(GameData.Gadgets.AllLines).ToArray();
|
||||
//var all = new ToolStripMenuItem
|
||||
//{
|
||||
// Text = Resources.All,
|
||||
// Tag = SelectedEntityTypeLines,
|
||||
//};
|
||||
//all.Click += OnEntityTypeFilterClick;
|
||||
//MenuSpawnEntityFilter.Items.Add(all);
|
||||
|
||||
//void AddTypes(ItemMapGroup group)
|
||||
//{
|
||||
// foreach (var kv in group)
|
||||
// {
|
||||
// var item = new ToolStripMenuItem
|
||||
// {
|
||||
// Text = kv.Key,
|
||||
// Tag = kv.Value.Lines,
|
||||
// };
|
||||
// item.Click += OnEntityTypeFilterClick;
|
||||
// MenuSpawnEntityFilter.Items.Add(item);
|
||||
// }
|
||||
//}
|
||||
////MenuSpawnEntityFilter.Items.Add(new ToolStripLabel("Monsters"));
|
||||
//AddTypes(GameData.Monsters);
|
||||
//MenuSpawnEntityFilter.Items.Add(new ToolStripSeparator());
|
||||
////MenuSpawnEntityFilter.Items.Add(new ToolStripLabel("Gadgets"));
|
||||
//AddTypes(GameData.Gadgets);
|
||||
//MenuSpawnEntityFilter.ResumeLayout();
|
||||
|
||||
//Console.WriteLine(string.Join("\n", GameData.Gadgets.Keys));
|
||||
|
||||
LoadEntityList();
|
||||
}
|
||||
@ -98,14 +118,26 @@ namespace GrasscutterTools.Pages
|
||||
/// </summary>
|
||||
private string[] SelectedEntityTypeLines;
|
||||
|
||||
///// <summary>
|
||||
///// 实体类型过滤器类型选中时触发
|
||||
///// </summary>
|
||||
//private void OnEntityTypeFilterClick(object sender, EventArgs e)
|
||||
//{
|
||||
// var btn = sender as ToolStripMenuItem;
|
||||
// CmbFilterEntity.Text = btn.Text;
|
||||
// SelectedEntityTypeLines = btn.Tag as string[];
|
||||
// LoadEntityList();
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// 实体类型过滤器类型选中时触发
|
||||
/// 类别选中时触发
|
||||
/// </summary>
|
||||
private void OnEntityTypeFilterClick(object sender, EventArgs e)
|
||||
private void CmbFilterEntity_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
var btn = sender as ToolStripMenuItem;
|
||||
BtnFilterEntity.Text = btn.Text;
|
||||
SelectedEntityTypeLines = btn.Tag as string[];
|
||||
if (CmbFilterEntity.SelectedIndex < 0 || EntityList == null) return;
|
||||
var lines = EntityList[CmbFilterEntity.SelectedIndex];
|
||||
if (SelectedEntityTypeLines == lines) return;
|
||||
SelectedEntityTypeLines = lines;
|
||||
LoadEntityList();
|
||||
}
|
||||
|
||||
@ -130,7 +162,7 @@ namespace GrasscutterTools.Pages
|
||||
/// </summary>
|
||||
private void BtnFilterEntity_Click(object sender, EventArgs e)
|
||||
{
|
||||
MenuSpawnEntityFilter.Show(BtnFilterEntity, 0, BtnFilterEntity.Height);
|
||||
MenuSpawnEntityFilter.Show(CmbFilterEntity, CmbFilterEntity.Width, CmbFilterEntity.Height);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -389,5 +421,6 @@ namespace GrasscutterTools.Pages
|
||||
}
|
||||
|
||||
#endregion -- 攻击注入参数 --
|
||||
|
||||
}
|
||||
}
|
@ -1594,10 +1594,10 @@
|
||||
<value>Top, Left, Right</value>
|
||||
</data>
|
||||
<data name="TxtEntityFilter.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>103, 3</value>
|
||||
<value>153, 3</value>
|
||||
</data>
|
||||
<data name="TxtEntityFilter.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>168, 23</value>
|
||||
<value>118, 23</value>
|
||||
</data>
|
||||
<data name="TxtEntityFilter.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
@ -1614,31 +1614,28 @@
|
||||
<data name=">>TxtEntityFilter.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="BtnFilterEntity.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<data name="CmbFilterEntity.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="BtnFilterEntity.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<data name="CmbFilterEntity.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 2</value>
|
||||
</data>
|
||||
<data name="BtnFilterEntity.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 25</value>
|
||||
<data name="CmbFilterEntity.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>150, 25</value>
|
||||
</data>
|
||||
<data name="BtnFilterEntity.TabIndex" type="System.Int32, mscorlib">
|
||||
<data name="CmbFilterEntity.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="BtnFilterEntity.Text" xml:space="preserve">
|
||||
<value>全部</value>
|
||||
<data name=">>CmbFilterEntity.Name" xml:space="preserve">
|
||||
<value>CmbFilterEntity</value>
|
||||
</data>
|
||||
<data name=">>BtnFilterEntity.Name" xml:space="preserve">
|
||||
<value>BtnFilterEntity</value>
|
||||
<data name=">>CmbFilterEntity.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>BtnFilterEntity.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>BtnFilterEntity.Parent" xml:space="preserve">
|
||||
<data name=">>CmbFilterEntity.Parent" xml:space="preserve">
|
||||
<value>PanelEntityFilterBar</value>
|
||||
</data>
|
||||
<data name=">>BtnFilterEntity.ZOrder" xml:space="preserve">
|
||||
<data name=">>CmbFilterEntity.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="PanelEntityFilterBar.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
|
@ -363,4 +363,7 @@ Improvement suggestions have been submitted, please use caution to send emails t
|
||||
<data name="PageHotKey" xml:space="preserve">
|
||||
<value>HotKey</value>
|
||||
</data>
|
||||
<data name="Gadget" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\en-us\Gadget.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
@ -351,4 +351,7 @@
|
||||
<data name="PageHotKey" xml:space="preserve">
|
||||
<value>Горячая клавиша</value>
|
||||
</data>
|
||||
<data name="Gadget" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\ru-ru\Gadget.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
@ -357,4 +357,7 @@
|
||||
<data name="PageHotKey" xml:space="preserve">
|
||||
<value>快捷鍵</value>
|
||||
</data>
|
||||
<data name="Gadget" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\zh-tw\Gadget.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
|
||||
</data>
|
||||
</root>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user