Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace hackerFeaturesEnabled with featureSet #432

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def draw(self, context):
def upgrade_changed_props():
"""Set scene properties after a scene loads, used for migrating old properties"""
SM64_Properties.upgrade_changed_props()
OOT_Properties.upgrade_changed_props()
MK64_Properties.upgrade_changed_props()
SM64_ObjectProperties.upgrade_changed_props()
OOT_ObjectProperties.upgrade_changed_props()
Expand Down
16 changes: 15 additions & 1 deletion fast64_internal/oot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
oot_operator_unregister,
)


feature_set_enum = (
("default", "Default", "Default"),
("hacker_oot", "HackerOoT", "Hacker OoT"),
)


oot_versions_items = [
("Custom", "Custom", "Custom"),
("gc-jp", "gc-jp", "gc-jp"),
Expand All @@ -77,7 +84,7 @@ class OOT_Properties(bpy.types.PropertyGroup):
"""Global OOT Scene Properties found under scene.fast64.oot"""

version: bpy.props.IntProperty(name="OOT_Properties Version", default=0)
hackerFeaturesEnabled: bpy.props.BoolProperty(name="Enable HackerOOT Features")
feature_set: bpy.props.EnumProperty(name="Feature Set", default="decomp", items=feature_set_enum)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
feature_set: bpy.props.EnumProperty(name="Feature Set", default="decomp", items=feature_set_enum)
feature_set: bpy.props.EnumProperty(name="Feature Set", default="default", items=feature_set_enum)

headerTabAffectsVisibility: bpy.props.BoolProperty(
default=False, name="Header Sets Actor Visibility", update=setAllActorsVisibility
)
Expand Down Expand Up @@ -111,6 +118,13 @@ def get_extracted_path(self):
default=False,
)

def upgrade_changed_props():
if "hackerFeaturesEnabled" in bpy.context.scene.fast64.oot:
bpy.context.scene.fast64.oot.feature_set = (
"hacker_oot" if bpy.context.scene.fast64.oot["hackerFeaturesEnabled"] else "decomp"
)
del bpy.context.scene.fast64.oot["hackerFeaturesEnabled"]


oot_classes = (OOT_Properties,)

Expand Down
3 changes: 2 additions & 1 deletion fast64_internal/oot/cutscene/exporter/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def getNewCutsceneExport(csName: str, motionOnly: bool):
# this allows us to change the exporter's variables to get what we need
return CutsceneExport(
getCutsceneObjects(csName),
bpy.context.scene.fast64.oot.hackerFeaturesEnabled or bpy.context.scene.fast64.oot.useDecompFeatures,
(bpy.context.scene.fast64.oot.feature_set == "hacker_oot")
or (bpy.context.scene.fast64.oot.feature_set == "decomp" and bpy.context.scene.fast64.oot.useDecompFeatures),
motionOnly,
)
4 changes: 2 additions & 2 deletions fast64_internal/oot/file_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def draw(self, context):
prop_split(col, context.scene.fast64.oot, "oot_version_custom", "Custom Version")

col.prop(context.scene.fast64.oot, "headerTabAffectsVisibility")
col.prop(context.scene.fast64.oot, "hackerFeaturesEnabled")
col.prop(context.scene.fast64.oot, "feature_set")

if not context.scene.fast64.oot.hackerFeaturesEnabled:
if context.scene.fast64.oot.feature_set == "decomp":
col.prop(context.scene.fast64.oot, "useDecompFeatures")
col.prop(context.scene.fast64.oot, "exportMotionOnly")

Expand Down
2 changes: 1 addition & 1 deletion fast64_internal/oot/scene/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def execute(self, context):
option = settings.option

bootOptions = context.scene.fast64.oot.bootupSceneOptions
hackerFeaturesEnabled = context.scene.fast64.oot.hackerFeaturesEnabled
hackerFeaturesEnabled = context.scene.fast64.oot.feature_set == "hacker_oot"

if settings.customExport:
isCustomExport = True
Expand Down
2 changes: 1 addition & 1 deletion fast64_internal/oot/scene/panels.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def draw(self, context):
self.drawSceneSearchOp(exportBox, settings.option, "Export")
settings.draw_props(exportBox)

if context.scene.fast64.oot.hackerFeaturesEnabled:
if context.scene.fast64.oot.feature_set == "hacker_oot":
hackerOoTBox = exportBox.box().column()
hackerOoTBox.label(text="HackerOoT Options")

Expand Down
Loading