Add quest ids to handbook

This commit is contained in:
Melledy 2022-05-11 12:47:16 -07:00
parent 5d4f245293
commit 7befebe37f

View File

@ -19,6 +19,7 @@ import emu.grasscutter.command.Command;
import emu.grasscutter.command.CommandMap; import emu.grasscutter.command.CommandMap;
import emu.grasscutter.data.GameData; import emu.grasscutter.data.GameData;
import emu.grasscutter.data.ResourceLoader; import emu.grasscutter.data.ResourceLoader;
import emu.grasscutter.data.custom.QuestConfig;
import emu.grasscutter.data.def.AvatarData; import emu.grasscutter.data.def.AvatarData;
import emu.grasscutter.data.def.ItemData; import emu.grasscutter.data.def.ItemData;
import emu.grasscutter.data.def.MonsterData; import emu.grasscutter.data.def.MonsterData;
@ -88,7 +89,7 @@ public final class Tools {
final class ToolsWithLanguageOption { final class ToolsWithLanguageOption {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public static void createGmHandbook(String language) throws Exception { public static void createGmHandbook(String language) throws Exception {
ResourceLoader.loadResources(); ResourceLoader.loadAll();
Map<Long, String> map; Map<Long, String> map;
try (InputStreamReader fileReader = new InputStreamReader(new FileInputStream(Utils.toFilePath(RESOURCE("TextMap/TextMap"+language+".json"))), StandardCharsets.UTF_8)) { try (InputStreamReader fileReader = new InputStreamReader(new FileInputStream(Utils.toFilePath(RESOURCE("TextMap/TextMap"+language+".json"))), StandardCharsets.UTF_8)) {
@ -148,6 +149,15 @@ final class ToolsWithLanguageOption {
writer.println(data.getId() + " : " + data.getScriptData()); writer.println(data.getId() + " : " + data.getScriptData());
} }
writer.println("// Quests");
list = new ArrayList<>(GameData.getQuestConfigs().keySet());
Collections.sort(list);
for (Integer id : list) {
QuestConfig data = GameData.getQuestConfigs().get(id);
writer.println(data.getId() + " : " + map.get(data.getMainQuest().getTitleTextMapHash()));
}
writer.println(); writer.println();
writer.println("// Monsters"); writer.println("// Monsters");