mirror of
https://github.com/jie65535/GrasscutterCommandGenerator.git
synced 2025-10-21 19:53:29 +08:00
Update Tools page
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
32
Source/GrasscutterTools/Game/Dungeon/DungeonItem.cs
Normal file
32
Source/GrasscutterTools/Game/Dungeon/DungeonItem.cs
Normal 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; }
|
||||
}
|
||||
}
|
@@ -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
|
||||
: "???";
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user