#!/bin/bash

response=$(zenity --question \
  --title="Clip Studio Paint Wine Warning" \
  --width=400 \
  --height=200 \
  --text=$'⚠️Warning⚠️ Before running Clip Studio Paint, you must follow this instruction:\n\nAdd the application in winecfg at:\n\n  /opt/CELSYS/CLIP-STUDIO-1.5/CLIP-STUDIO-PAINT/CLIPStudioPaint.exe\n\nThen set Wine Windows Version: to Windows 8.1\nPlease open winecfg and set the Windows version first.' \
  --ok-label="Go to winecfg" \
  --extra-button="Run Clip Studio Paint")

zenity_exit_status=$?

# Handle responses
if [ "$zenity_exit_status" -eq 0 ]; then
    # User clicked "Go to winecfg"
    winecfg
elif [ "$response" = "Run Clip Studio Paint" ]; then
    # User clicked the extra button
    /usr/bin/clip-studio-paint
else
    # User closed the dialog or pressed Esc
    echo "Dialog closed or cancelled."
fi
