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

###
# Cats Hidden in Places expansions:
# - Cats Hidden in Paris - Extra level
# send your bug reports to bugs@dotslashplay.it
###

script_version=20260421.1

PLAYIT_COMPATIBILITY_LEVEL='2.35'

GAME_ID_PARIS='cats-hidden-in-paris'
GAME_NAME_PARIS='Cats Hidden in Paris'

EXPANSION_ID_PARIS='extra-level'
EXPANSION_NAME_PARIS='Extra level'

# Cats Hidden in Paris - Extra level

ARCHIVE_BASE_PARIS_0_NAME='setup_cats_hidden_in_paris_-_extra_level_1.0_gog_dlc_fix6_(69829).exe'
ARCHIVE_BASE_PARIS_0_MD5='d440ba3300af973579e5cef269b94962'
ARCHIVE_BASE_PARIS_0_TYPE='innosetup'
ARCHIVE_BASE_PARIS_0_SIZE='6687'
ARCHIVE_BASE_PARIS_0_VERSION='1.0-gog69829'
ARCHIVE_BASE_PARIS_0_URL='https://www.gog.com/game/cats_hidden_in_paris_extra_level'

CONTENT_PATH_DEFAULT='.'
CONTENT_GAME_MAIN_FILES_PARIS='
goggame-2143975614.info'

PKG_PARENT_ID_PARIS="$GAME_ID_PARIS"

PKG_MAIN_DEPENDENCIES_SIBLINGS='
PKG_PARENT'

# 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_default

# Build packages.

packages_generation
print_instructions

# Clean up.

working_directory_cleanup

exit 0
