Skip to content

Commit

Permalink
storyinfoauto char-char
Browse files Browse the repository at this point in the history
  • Loading branch information
sctop committed Mar 22, 2024
1 parent f9937a5 commit 7065eee
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
11 changes: 11 additions & 0 deletions data_model/actual_data/_story/story_part_auto.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ def load(self):

self._bg_to_char[bg_id] = char_id

# char to char
for (char_id, data) in self.data["char_to_char"].items():
char1 = self.data_all.character[char_id]

for char2_id in data:
char2 = self.data_all.character[char2_id]

char1.register(char2)
char2.register(char1)

def to_json(self):
return {
"all": self.data_all.to_json(),
Expand All @@ -120,6 +130,7 @@ def to_json(self):
"bg_to_track": self._bg_to_track.to_json(),
"char_to_track": self._char_to_track.to_json(),
"char_to_bg": self.data["char_to_bg"],
"char_to_char": self.data["char_to_char"],
"special": {
"flag": self.data_special["flag"],
"track": None if self.data_special["track"] is None else self.data_special["track"].to_json_basic()
Expand Down
4 changes: 3 additions & 1 deletion data_model/loader/manager_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def __getitem__(self, item) -> LangStringModel:
# 降级到 LangStringModel 进行处置
if temp["zh_cn_cn"] == temp["zh_cn_jp"] == temp["zh_cn_tw"]:
# 如果三者全部都一样,那不就是单语言?
temp["zh_cn"] = temp["zh_cn_cn"]
if temp["zh_cn_cn"] != "":

temp["zh_cn"] = temp["zh_cn_cn"]
m = LangStringModel()
m.load(temp)
else:
Expand Down

0 comments on commit 7065eee

Please sign in to comment.