diff --git a/fast64_internal/oot/exporter/decomp_edit/__init__.py b/fast64_internal/oot/exporter/decomp_edit/__init__.py index 4f0693f..95af7f7 100644 --- a/fast64_internal/oot/exporter/decomp_edit/__init__.py +++ b/fast64_internal/oot/exporter/decomp_edit/__init__.py @@ -48,6 +48,7 @@ class Files: # TODO: find a better name exportInfo.exportPath, exportInfo.name, scene.mainHeader.infos.drawConfig, + scene.mainHeader.infos.title_card_name, ) @staticmethod diff --git a/fast64_internal/oot/exporter/decomp_edit/scene_table.py b/fast64_internal/oot/exporter/decomp_edit/scene_table.py index 8ae9668..ccdf43d 100644 --- a/fast64_internal/oot/exporter/decomp_edit/scene_table.py +++ b/fast64_internal/oot/exporter/decomp_edit/scene_table.py @@ -54,11 +54,10 @@ class SceneTableEntry: raise PluginError("ERROR: This line is not a scene table entry!") @staticmethod - def from_scene(scene_name: str, draw_config: str): - # TODO: Implement title cards + def from_scene(scene_name: str, draw_config: str, title_card_name: str): return SceneTableEntry( scene_name if scene_name.endswith("_scene") else f"{scene_name}_scene", - "none", + title_card_name if title_card_name.strip() else "none", get_scene_enum_from_name(scene_name), draw_config, "0", @@ -264,13 +263,13 @@ class SceneTableUtility: raise PluginError(f"ERROR: Scene name {scene_name} not found in scene table.") @staticmethod - def edit_scene_table(export_path: str, export_name: str, draw_config: str): + def edit_scene_table(export_path: str, export_name: str, draw_config: str, title_card_name: str): """Update the scene table entry of the selected scene""" path = os.path.join(export_path, "include/tables/scene_table.h") scene_table = SceneTable.new(path) export_enum = get_scene_enum_from_name(export_name) - scene_table.update(SceneTableEntry.from_scene(export_name, draw_config), export_enum) + scene_table.update(SceneTableEntry.from_scene(export_name, draw_config, title_card_name), export_enum) # write the file with the final data writeFile(path, scene_table.to_c()) diff --git a/fast64_internal/oot/exporter/scene/general.py b/fast64_internal/oot/exporter/scene/general.py index 988eb79..493589e 100644 --- a/fast64_internal/oot/exporter/scene/general.py +++ b/fast64_internal/oot/exporter/scene/general.py @@ -157,6 +157,7 @@ class SceneInfos: drawConfig: str appendNullEntrance: bool useDummyRoomList: bool + title_card_name: str ### Skybox And Sound ### @@ -185,6 +186,7 @@ class SceneInfos: Utility.getPropValue(props.sceneTableEntry, "drawConfig"), props.appendNullEntrance, sceneObj.fast64.oot.scene.write_dummy_room_list, + Utility.getPropValue(props, "title_card_name"), Utility.getPropValue(props, "skyboxID"), Utility.getPropValue(props, "skyboxCloudiness"), Utility.getPropValue(props, "musicSeq"), diff --git a/fast64_internal/oot/scene/properties.py b/fast64_internal/oot/scene/properties.py index 1f2414d..b530e3b 100644 --- a/fast64_internal/oot/scene/properties.py +++ b/fast64_internal/oot/scene/properties.py @@ -309,6 +309,10 @@ class OOTSceneHeaderProperty(PropertyGroup): default=False, ) + title_card_name: StringProperty( + name="Title Card", default="none", description="Segment name of the title card to use" + ) + def draw_props(self, layout: UILayout, dropdownLabel: str, headerIndex: int, objName: str): from .operators import OOT_SearchMusicSeqEnumOperator # temp circular import fix @@ -338,6 +342,9 @@ class OOTSceneHeaderProperty(PropertyGroup): drawEnumWithCustom(general, self, "naviCup", "Navi Hints", "") if headerIndex is None or headerIndex == 0: self.sceneTableEntry.draw_props(general) + prop_split(general, self, "title_card_name", "Title Card") + if bpy.context.scene.ootSceneExportSettings.customExport: + general.label(text="Custom Export Path enabled, title card will be ignored.", icon="INFO") general.prop(self, "appendNullEntrance") skyboxAndSound = layout.column()