Skip to content

Commit

Permalink
Update scene dungeon names
Browse files Browse the repository at this point in the history
  • Loading branch information
jie65535 committed Aug 24, 2023
1 parent f48c9b4 commit c2ff37f
Show file tree
Hide file tree
Showing 6 changed files with 3,097 additions and 3,083 deletions.
6 changes: 5 additions & 1 deletion Source/GrasscutterTools/Game/Data/Excels/DungeonData.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
namespace GrasscutterTools.Game.Data.Excels
using Newtonsoft.Json;

namespace GrasscutterTools.Game.Data.Excels
{
[ResourceType("DungeonExcelConfigData.json")]
internal class DungeonData : GameResource
{
[JsonProperty("sceneId")]
public int SceneId { get; set; }
}
}
14 changes: 12 additions & 2 deletions Source/GrasscutterTools/Game/Data/GameResources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,20 @@ public void ConvertResources(string projectResourcesDir)


sb.Clear();
foreach (var it in DungeonData.Values)
{
var scene = SceneData[it.SceneId];
scene.NameTextMapHash = it.NameTextMapHash;
}
foreach (var it in SceneData.Values.OrderBy(it => it.Id))
{
var name = GameData.Scenes[it.Id];
sb.AppendLine($"{it.Id}:{(name == ItemMap.EmptyName ? it.ScriptData : name)}");
if (it.NameTextMapHash == 0 || !TextMapData.TryGetText(it.NameTextMapHash.ToString(), out var name))
{
name = GameData.Scenes[it.Id];
if (name == ItemMap.EmptyName)
name = it.ScriptData;
}
sb.AppendLine($"{it.Id}:{name}");
}
File.WriteAllText(
Path.Combine(dir, "Scene.txt"),
Expand Down
Loading

0 comments on commit c2ff37f

Please sign in to comment.