#!/bin/sh
# SPDX-License-Identifier: ACSL
# SPDX-FileCopyrightText: © 2024 Fabien Givors <captnfab@debian-facile.org>
# SPDX-FileCopyrightText: © 2024 Antoine Le Gonidec <vv221@dotslashplay.it>
set -o errexit

###
# Inkulinati
# send your bug reports to bugs@dotslashplay.it
###

script_version=20260331.3

PLAYIT_COMPATIBILITY_LEVEL='2.35'

GAME_ID='inkulinati'
GAME_NAME='Inkulinati'

GAME_ID_DEMO="${GAME_ID}-demo"
GAME_NAME_DEMO="$GAME_NAME (demo)"

ARCHIVE_BASE_0_NAME='setup_inkulinati_1.47.2.0_(64bit)_(71246).exe'
ARCHIVE_BASE_0_MD5='099f8976a9142d736282316f37028f60'
ARCHIVE_BASE_0_TYPE='innosetup'
ARCHIVE_BASE_0_SIZE='3934716'
ARCHIVE_BASE_0_VERSION='1.47.2.0-gog71246'
ARCHIVE_BASE_0_URL='https://www.gog.com/game/inkulinati'

# The free demo is no longer available from gog.com.
ARCHIVE_BASE_DEMO_0_NAME='setup_inkulinati_demo_1.1_(42755).exe'
ARCHIVE_BASE_DEMO_0_MD5='8e081a8cf9e9457757c1a66b72c9a5f0'
ARCHIVE_BASE_DEMO_0_TYPE='innosetup'
ARCHIVE_BASE_DEMO_0_SIZE='1258482'
ARCHIVE_BASE_DEMO_0_VERSION='1.0-gog42755'

UNITY3D_NAME='Inkulinati'

CONTENT_PATH_DEFAULT='.'
# This game includes no Unity3D plugin.

WINE_PERSISTENT_DIRECTORIES='
users/${USER}/AppData/LocalLow/Yaza Games/Inkulinati'

PACKAGES_LIST='
PKG_BIN
PKG_DATA'

PKG_BIN_ARCH='64'
PKG_BIN_DEPENDENCIES_SIBLINGS='
PKG_DATA'
PKG_BIN_DEPENDENCIES_GSTREAMER_PLUGINS='
video/quicktime, variant=(string)iso'

PKG_DATA_ID="${GAME_ID}-data"
PKG_DATA_ID_DEMO="${GAME_ID_DEMO}-data"
PKG_DATA_DESCRIPTION='data'

# Load common functions.

if [ -z "$PLAYIT_LIB2" ]; then
	for playit_lib_dir in \
		"$PWD" \
		"${HOME}/.local/lib/play.it" \
		'/usr/local/lib/play.it' \
		'/usr/lib/play.it'
	do
		playit_lib_path="${playit_lib_dir}/libplayit.sh.2"
		if [ -e "$playit_lib_path" ]; then
			PLAYIT_LIB2="$playit_lib_path"
			break
		fi
	done
fi
if [ -z "$PLAYIT_LIB2" ]; then
	printf '\n\033[1;31mError:\033[0m\n'
	printf 'libplayit.sh.2 not found.\n'
	exit 1
fi
# shellcheck source=libplayit.sh.2
. "$PLAYIT_LIB2"

# Run default initialisation actions.

initialization_default "$@"

# Extract game data.

archive_extraction_default

# Include game data.

content_inclusion_icons 'PKG_DATA'
content_inclusion_default

# Write launchers.

launchers_generation

# Build packages.

packages_generation
print_instructions

# Clean up.

working_directory_cleanup

exit 0
