mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-17 09:25:06 +01:00
and misc bug fixes
This commit is contained in:
@@ -56,22 +56,23 @@ public class ResourceLoader {
|
||||
public static void loadAll() {
|
||||
Grasscutter.getLogger().info(translate("messages.status.resources.loading"));
|
||||
|
||||
// Load ability lists
|
||||
loadAbilityEmbryos();
|
||||
loadOpenConfig();
|
||||
loadAbilityModifiers();
|
||||
// Load resources
|
||||
loadResources();
|
||||
// Process into depots
|
||||
GameDepot.load();
|
||||
// Load spawn data and quests
|
||||
loadSpawnData();
|
||||
loadQuests();
|
||||
// Load scene points - must be done AFTER resources are loaded
|
||||
loadScenePoints();
|
||||
// Load default home layout
|
||||
loadHomeworldDefaultSaveData();
|
||||
loadNpcBornData();
|
||||
// Load ability lists
|
||||
loadAbilityEmbryos();
|
||||
loadOpenConfig();
|
||||
loadAbilityModifiers();
|
||||
// Load resources
|
||||
loadResources();
|
||||
// Process into depots
|
||||
GameDepot.load();
|
||||
// Load spawn data and quests
|
||||
loadSpawnData();
|
||||
loadQuests();
|
||||
loadScriptSceneData();
|
||||
// Load scene points - must be done AFTER resources are loaded
|
||||
loadScenePoints();
|
||||
// Load default home layout
|
||||
loadHomeworldDefaultSaveData();
|
||||
loadNpcBornData();
|
||||
|
||||
Grasscutter.getLogger().info(translate("messages.status.resources.finish"));
|
||||
}
|
||||
@@ -420,10 +421,32 @@ public class ResourceLoader {
|
||||
Grasscutter.getLogger().debug("Loaded " + GameData.getMainQuestDataMap().size() + " MainQuestDatas.");
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private static void loadHomeworldDefaultSaveData() {
|
||||
var folder = Files.list(Path.of(RESOURCE("BinOutput/HomeworldDefaultSave"))).toList();
|
||||
var pattern = Pattern.compile("scene(.*)_home_config.json");
|
||||
public static void loadScriptSceneData() {
|
||||
File folder = new File(RESOURCE("ScriptSceneData/"));
|
||||
|
||||
if (!folder.exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (File file : folder.listFiles()) {
|
||||
ScriptSceneData sceneData;
|
||||
try (FileReader fileReader = new FileReader(file)) {
|
||||
sceneData = Grasscutter.getGsonFactory().fromJson(fileReader, ScriptSceneData.class);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
continue;
|
||||
}
|
||||
|
||||
GameData.getScriptSceneDataMap().put(file.getName(), sceneData);
|
||||
}
|
||||
|
||||
Grasscutter.getLogger().debug("Loaded " + GameData.getScriptSceneDataMap().size() + " ScriptSceneDatas.");
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
private static void loadHomeworldDefaultSaveData(){
|
||||
var folder = Files.list(Path.of(RESOURCE("BinOutput/HomeworldDefaultSave"))).toList();
|
||||
var pattern = Pattern.compile("scene(.*)_home_config.json");
|
||||
|
||||
for (var file : folder) {
|
||||
var matcher = pattern.matcher(file.getFileName().toString());
|
||||
|
||||
@@ -1,35 +1,41 @@
|
||||
package emu.grasscutter.data.binout;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
import emu.grasscutter.game.quest.enums.QuestType;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class MainQuestData {
|
||||
private int id;
|
||||
private int ICLLDPJFIMA;
|
||||
private int series;
|
||||
private QuestType type;
|
||||
|
||||
|
||||
private long titleTextMapHash;
|
||||
private int[] suggestTrackMainQuestList;
|
||||
private int[] rewardIdList;
|
||||
|
||||
|
||||
private SubQuestData[] subQuests;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
private List<TalkData> talks;
|
||||
private long[] preloadLuaList;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getSeries() {
|
||||
return series;
|
||||
}
|
||||
|
||||
|
||||
public QuestType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public long getTitleTextMapHash() {
|
||||
return titleTextMapHash;
|
||||
}
|
||||
|
||||
|
||||
public int[] getSuggestTrackMainQuestList() {
|
||||
return suggestTrackMainQuestList;
|
||||
}
|
||||
@@ -37,14 +43,28 @@ public class MainQuestData {
|
||||
public int[] getRewardIdList() {
|
||||
return rewardIdList;
|
||||
}
|
||||
|
||||
|
||||
public SubQuestData[] getSubQuests() {
|
||||
return subQuests;
|
||||
}
|
||||
public List<TalkData> getTalks() {
|
||||
return talks;
|
||||
}
|
||||
|
||||
public void onLoad() {
|
||||
this.talks = talks.stream().filter(Objects::nonNull).toList();
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SubQuestData {
|
||||
private int subId;
|
||||
private int order;
|
||||
}
|
||||
|
||||
|
||||
@Data @Entity
|
||||
public static class TalkData {
|
||||
private int id;
|
||||
private String heroTalk;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,10 +36,14 @@ public class QuestData extends GameResource {
|
||||
private List<QuestExecParam> beginExec;
|
||||
private List<QuestExecParam> finishExec;
|
||||
private List<QuestExecParam> failExec;
|
||||
private Guide guide;
|
||||
|
||||
//ResourceLoader not happy if you remove getId() ~~
|
||||
public int getId() {
|
||||
return subId;
|
||||
}
|
||||
//Added getSubId() for clarity
|
||||
public int getSubId() {return subId;}
|
||||
|
||||
public int getMainId() {
|
||||
return mainId;
|
||||
@@ -62,7 +66,7 @@ public class QuestData extends GameResource {
|
||||
}
|
||||
|
||||
public LogicType getAcceptCondComb() {
|
||||
return acceptCondComb;
|
||||
return acceptCondComb == null ? LogicType.LOGIC_NONE : acceptCondComb;
|
||||
}
|
||||
|
||||
public List<QuestCondition> getAcceptCond() {
|
||||
@@ -70,7 +74,7 @@ public class QuestData extends GameResource {
|
||||
}
|
||||
|
||||
public LogicType getFinishCondComb() {
|
||||
return finishCondComb;
|
||||
return finishCondComb == null ? LogicType.LOGIC_NONE : finishCondComb;
|
||||
}
|
||||
|
||||
public List<QuestCondition> getFinishCond() {
|
||||
@@ -78,7 +82,7 @@ public class QuestData extends GameResource {
|
||||
}
|
||||
|
||||
public LogicType getFailCondComb() {
|
||||
return failCondComb;
|
||||
return failCondComb == null ? LogicType.LOGIC_NONE : failCondComb;
|
||||
}
|
||||
|
||||
public List<QuestCondition> getFailCond() {
|
||||
@@ -118,4 +122,11 @@ public class QuestData extends GameResource {
|
||||
private String count;
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class Guide {
|
||||
private String type;
|
||||
private List<String> param;
|
||||
private int guideScene;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user