import unreal


def load(path):
    asset = unreal.EditorAssetLibrary.load_asset(path)
    if not asset:
        raise RuntimeError(f"Could not load {path}")
    return asset


def main():
    game_mode_bp = load("/Game/Agrarian/Blueprints/Characters/BP_AgrarianGameMode")
    game_mode_cdo = unreal.get_default_object(game_mode_bp.generated_class())
    hud_class = unreal.load_class(None, "/Script/AgrarianGame.AgrarianDebugHUD")
    if not hud_class:
        raise RuntimeError("Could not load /Script/AgrarianGame.AgrarianDebugHUD")

    game_mode_cdo.set_editor_property("hud_class", hud_class)
    unreal.EditorAssetLibrary.save_loaded_asset(game_mode_bp)

    unreal.log("Agrarian interaction prompt setup complete.")


main()
