--- /usr/portage/eclass/games-mods.eclass 2007-09-15 02:06:19.000000000 +0100 +++ games-mods.eclass 2007-10-09 15:06:03.000000000 +0100 @@ -6,7 +6,8 @@ # GAME - (doom3, quake4 or ut2004, etc), unless ${PN} starts with e.g. "doom3-" # MOD_BINS - Name of the binary to run # MOD_DESC - Description for the mod -# MOD_DIR - Subdirectory name for the mod, if applicable +# MOD_DIR - Subdirectory name for the mod, if applicable +# MOD_MAP - Name of map to load at start, if applicable # MOD_ICON - Custom icon for the mod, instead of the default # MOD_NAME - Creates a command-line wrapper and desktop icon for the mod # MOD_TBZ2 - File to extract within the Makeself archive @@ -17,6 +18,9 @@ [[ -z ${GAME} ]] && GAME=${PN%%-*} +SELECT_MAP="" +[[ -n ${MOD_MAP} ]] && SELECT_MAP=" +map " + # Set our default title, icon, and cli options case "${GAME}" in "doom3") @@ -58,6 +62,7 @@ GAME_EXE="ut2003" DED_EXE="ucc" DED_OPTIONS="" + SELECT_MAP="" ;; "ut2004") GAME_TITLE="UT2004" @@ -66,6 +71,7 @@ GAME_EXE="ut2004" DED_EXE="ucc" DED_OPTIONS="" + SELECT_MAP="" ;; *) eerror "This game is either not supported or you must set the GAME" @@ -229,7 +235,7 @@ if [[ -n "${MOD_DIR}" ]] then games_make_wrapper "${GAME_EXE}-${MOD_BINS}" \ - "${GAME_EXE} ${SELECT_MOD}${MOD_DIR}" "${dir}" "${dir}" + "${GAME_EXE} ${SELECT_MOD}${MOD_DIR}${SELECT_MAP}${MOD_MAP}" "${dir}" "${dir}" make_desktop_entry "${GAME_EXE}-${MOD_BINS}" \ "${GAME_TITLE} - ${MOD_NAME}" "${MOD_ICON}" elif [[ -e "${S}"/bin/"${binary}" ]] @@ -275,7 +281,7 @@ elif [[ -n "${MOD_DIR}" ]] then games_make_wrapper "${GAME_EXE}-${MOD_DIR}" \ - "${GAME_EXE} ${SELECT_MOD}${MOD_DIR}" "${dir}" "${dir}" + "${GAME_EXE} ${SELECT_MOD}${MOD_DIR}${SELECT_MAP}${MOD_MAP}" "${dir}" "${dir}" make_desktop_entry "${GAME_EXE}-${MOD_DIR}" \ "${GAME_TITLE} - ${MOD_NAME}" "${MOD_ICON}" # Since only quake3 has both a binary and a source-based install, @@ -285,7 +291,7 @@ if has_version games-fps/quake3-bin then games_make_wrapper "${GAME_EXE}-bin-${MOD_DIR}" \ - "${GAME_EXE}-bin ${SELECT_MOD}${MOD_DIR}" \ + "${GAME_EXE}-bin ${SELECT_MOD}${MOD_DIR}${SELECT_MAP}${MOD_MAP}" \ "${dir}" "${dir}" fi make_desktop_entry "${GAME_EXE}-bin-${MOD_DIR}" \