Update Tools page

This commit is contained in:
2023-06-09 22:42:33 +08:00
parent 6706525e77
commit c1b89a2b9a
10 changed files with 219 additions and 5 deletions

View File

@@ -1,4 +1,23 @@
using Newtonsoft.Json;
/**
* 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.CutScene
{

View File

@@ -0,0 +1,32 @@
/**
* 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.Dungeon
{
internal class DungeonItem
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("nameTextMapHash")]
public string NameTextMapHash { get; set; }
}
}

View File

@@ -17,6 +17,7 @@
*
**/
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -31,9 +32,12 @@ namespace GrasscutterTools.Game
{
LoadManualTextMap(Path.Combine(resourcesDirPath, "ExcelBinOutput", "ManualTextMapConfigData.json"));
LoadTextMaps(Path.Combine(resourcesDirPath, "TextMap"));
LoadTextMap(TextMapFilePaths[Array.IndexOf(TextMapFiles, "TextMapCHS")]);
DefaultTextMap = TextMap;
}
public Dictionary<string, string> ManualTextMap;
public Dictionary<string, string> DefaultTextMap;
public Dictionary<string, string> TextMap;
public string[] TextMapFilePaths;
public string[] TextMapFiles;
@@ -81,5 +85,12 @@ namespace GrasscutterTools.Game
}
}
}
public string GetText(string textMapHash)
{
return TextMap.TryGetValue(textMapHash, out var text) ? text
: DefaultTextMap.TryGetValue(textMapHash, out text) ? text
: "???";
}
}
}