Skip to content

Commit

Permalink
Added english maps #2128
Browse files Browse the repository at this point in the history
  • Loading branch information
symsym-1629 authored and BastLast committed Oct 18, 2023
1 parent 80fd78a commit 4946d70
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/commands/player/MapCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import MapLocation from "../../core/database/game/models/MapLocation";
* @param player player
* @param destMap
* @param inReport
* @param {("fr"|"en")} language - Language to use in the response
*/
async function getMapToShowInfo(player: Player, destMap: MapLocation, inReport: boolean): Promise<{
async function getMapToShowInfo(player: Player, destMap: MapLocation, inReport: boolean, language: string): Promise<{
name: string,
forced: boolean
}> {
Expand All @@ -33,20 +34,20 @@ async function getMapToShowInfo(player: Player, destMap: MapLocation, inReport:

if (inReport) {
return {
name: destMap.forcedImage ?? `${destMap.id}_`,
name: destMap.forcedImage ?? `${language}_${destMap.id}_`,
forced: Boolean(destMap.forcedImage)
};
}

if (destMap.id < depMap.id) {
return {
name: `${destMap.id}_${depMap.id}_`,
name: `${language}_${destMap.id}_${depMap.id}_`,
forced: false
};
}

return {
name: `${depMap.id}_${destMap.id}_`,
name: `${language}_${depMap.id}_${destMap.id}_`,
forced: false
};

Expand All @@ -65,7 +66,7 @@ async function executeCommand(interaction: CommandInteraction, language: string,

const inReport = await player.isInEvent();
const destMap = await player.getDestination();
const mapToShowInfo = await getMapToShowInfo(player, destMap, inReport);
const mapToShowInfo = await getMapToShowInfo(player, destMap, inReport, language);
if (mapToShowInfo.forced) {
mapEmbed.setImage(
format(BotConstants.FORCED_MAPS_URL, { name: mapToShowInfo.name })
Expand Down

0 comments on commit 4946d70

Please sign in to comment.