import bpy
from bpy.types import AddonPreferences
from bpy.props import BoolProperty, StringProperty


class BATPreferences(AddonPreferences):
    bl_idname = "blender_asset_tracer"

    use_env_root: BoolProperty(
        name="Use Environment Variable for Root",
        description="Read the project root from ZIP_ROOT or PROJECT_ROOT environment variables",
        default=False,
    )

    root_default: StringProperty(
        name="Default Root",
        description="Fallback project root when the environment variable is not set",
        default="",
        subtype="DIR_PATH",
    )

    def draw(self, context):
        layout = self.layout
        layout.prop(self, "use_env_root")
        layout.prop(self, "root_default")


