#!/usr/bin/env bash
#Author: PortWINE
#lgc_api.exe
#lgc.exe
#Rating=5
export PW_COMMENT_DB="Lesta Game Centers"
################################################
export PW_VULKAN_USE=1                       #dxvk, vkd3d or 0 for OpenGL
export LAUNCH_PARAMETERS=""            # Additional launch options
export PW_WINDOWS_VER=10                        # Set windows version 10, 7 or XP
export WINEDLLOVERRIDES=""
export PW_DLL_INSTALL="lucida"     # Install DLL in port prefix (used winetricks)
export PW_USE_D3D_EXTRAS="1"
export PW_USE_EAC_AND_BE="0"
export PW_PREFIX_NAME="LGC"
export PW_USE_SHADER_CACHE="0"

add_in_start_portwine () {
    if [[ -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/${USER}/AppData/Roaming/Wargaming.net/WorldOfTanks/preferences.xml" ]] ; then
        sed -i 's%<igbHardwareAccelerationEnabled> true </igbHardwareAccelerationEnabled>%<igbHardwareAccelerationEnabled> false </igbHardwareAccelerationEnabled>%' "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}/drive_c/users/${USER}/AppData/Roaming/Wargaming.net/WorldOfTanks/preferences.xml"
    fi
    if [[ "${PW_VULKAN_USE}" == "0" || "${PW_VULKAN_USE}" == "3" ]] ; then
        export LAUNCH_PARAMETERS="--disable-gpu"
    fi
}
