Skip to content

Commit

Permalink
chore: update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
gudzpoz committed Dec 17, 2024
1 parent d84a044 commit ee67d87
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/components/simulator/StoryList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const rawData: (MenuOption & TreeSelectOption)[] = [
generateChapterOption('anniversary6', '六周年周年庆'),
generateChapterOption('anniversary5', '五周年周年庆'),
generateChapterOption('anniversary4', '四周年周年庆'),
generateChapterOption('help', '求救回信'),
generateChapterOption('skin', '皮肤故事'),
];
function filterOptions(
Expand Down
1 change: 1 addition & 0 deletions src/types/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function getUrlType(s: string): typeof MEDIA_TYPES[number] {
export type ChapterType = (
'main' | 'event' | 'colab' | 'bonding' | 'upgrading'
| 'anniversary' | 'anniversary6' | 'anniversary5' | 'anniversary4' | 'skin'
| 'help'
);
export type Story = {
name: string;
Expand Down
2 changes: 1 addition & 1 deletion unpack/gf-data-ch
Submodule gf-data-ch updated 661 files
18 changes: 17 additions & 1 deletion unpack/src/gfunpack/chapters.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def _parse_event_stories(cls, story: EventStoryInfo, mapped_files: set[str]):
all_files = [f'{s.strip().lower()}.txt' for s in scripts if s.strip() != '']
filtered = [f for f in all_files if f not in mapped_files]
if len(filtered) != 0 and len(filtered) != len(all_files):
_warning('potential duplicate story entries: %s (%s)', story.title, filtered)
_warning('potential duplicate story entries: %s (%s != %s)', story.title, filtered, all_files)
mapped_files.update(all_files)
return filtered

Expand All @@ -190,6 +190,8 @@ def _categorize_anniversary(self, directory: str = 'anniversary'):
continue
_, filename = path.split('/')
name = filename.split('.')[0]
if name.startswith('default_'):
name = name[len('default_'):]
if name.isdigit() and int(name) in self.guns:
i = int(name)
name = self.guns[i]['name']
Expand Down Expand Up @@ -342,6 +344,19 @@ def _categorize_upgrading_stories(self):
))
return [v for _, v in sorted(chapters.items(), key=lambda e: e[0])]

def _categorize_help_letters(self):
chapters = self._categorize_anniversary('letters')
for chapter in chapters:
for story in chapter.stories:
files = story.files
files_with_info = []
for file in files:
if isinstance(file, str) and 'default_' in file:
file = (file, '默认')
files_with_info.append(file)
story.files = files_with_info
return chapters

def categorize_stories(self):
all_chapters: dict[str, list[Chapter]] = {}
stories = self._categorize_main_stories()
Expand All @@ -368,6 +383,7 @@ def categorize_stories(self):
all_chapters['anniversary4'] = self._categorize_anniversary('anniversary4')
all_chapters['anniversary5'] = self._categorize_anniversary('anniversary5')
all_chapters['anniversary6'] = self._categorize_anniversary('anniversary6')
all_chapters['help'] = self._categorize_help_letters()
all_chapters['skin'] = self._categorize_skins()
return all_chapters

Expand Down

0 comments on commit ee67d87

Please sign in to comment.