#!/usr/bin/env bash

. common

CONFIG=autoconf.h
echo "/* This config is generated by scripts/configure */" >$CONFIG

FEATURES=(aimbot esp test);

declare -A features
for feature in "${FEATURES[@]}"
do
    features[\"$feature\"]=0
done

enabled=$($DIALOG --backtitle "Configure cathook" --checklist "Select features you want to enable" 20 78 4 \
    aimbot "Enable Aimbot" ON \
    esp "Enable ESP" ON \
    test "Test" OFF \
    3>&2 2>&1 1>&3)

for feature in $enabled
do
    features[$feature]="1"
done

for feature in ${FEATURES[@]}
do
    echo "#define CONFIG_FEATURE_$feature ${features[\"$feature\"]}">>$CONFIG
done

! $DIALOG --backtitle "Configure cathook" --yesno "Use Xoverlay to draw visuals outside TF2's window (can be buggy and is NOT compatible with Steam overlay!)" 10 40 3>&2 2>&1 1>&3
echo "#define CONFIG_ENABLE_XOVERLAY $?" >>$CONFIG