diff --git a/client/documentation/admin-dashboard/games.md b/client/documentation/admin-dashboard/games.md index b87783e..73caf79 100644 --- a/client/documentation/admin-dashboard/games.md +++ b/client/documentation/admin-dashboard/games.md @@ -24,8 +24,8 @@ Pages for games can be added and edited at the row 'Game' of the GAME_DEV sectio **Event:** Optional field for the event at which the game was created. Links the game to an event. Foreign key field for an event. -**Itch Game Embed ID:** Optional field for the game's game embed. This ID allows the web version of a game to be played inside the site. This value can be acquired in two ways, either by the developer or through looking in the page source. A developer can get the value by going to the distribution tab of their game and going to the embed game section this will bring up a full embed for the game and the only part needed is the 8 digit number after "https://html-classic.itch.zone/html/". By looking through the page source that link can also be found either in a div or an iframe on the page depending on if the game has been played. **This value is not attainable if there is no web version of the game. hosted on itch.** +**Itch Game Playable ID:** Optional field for the game's game embed. This ID allows the web version of a game to be played inside the site. This value can be acquired in two ways, either by the developer or through looking in the page source. A developer can get the value by going to the distribution tab of their game and going to the embed game section this will bring up a full embed for the game and the only part needed is the 8 digit number after "https://html-classic.itch.zone/html/". By looking through the page source that link can also be found either in a div or an iframe on the page depending on if the game has been played. **This value is not attainable if there is no web version of the game. hosted on itch.** -**Itch Game Width:** Required field for the game's game embed. This value is gotten in a similar way to the Itch Game Embed, however for the developer it's the number after "width=" and in the page source is found after "data-width=". +**Itch Game Width:** This field is required if the playable field ID is non null. This value is gotten in a similar way to the Itch Game Embed, however for the developer it's the number after "width=" and in the page source is found after "data-width=". -**Itch Game Height:** Required field for the game's game embed. This value is gotten in a similar way to the Itch Game Embed, however for the developer it's the number after "height=" and in the page source is found after "data-height=". \ No newline at end of file +**Itch Game Height:** This field is required if the playable field ID is non null. This value is gotten in a similar way to the Itch Game Embed, however for the developer it's the number after "height=" and in the page source is found after "data-height=". \ No newline at end of file diff --git a/client/src/hooks/useGames.ts b/client/src/hooks/useGames.ts index ddc4d83..758e9c7 100644 --- a/client/src/hooks/useGames.ts +++ b/client/src/hooks/useGames.ts @@ -24,7 +24,7 @@ type ApiGame = { itchEmbedID: string; thumbnail: string | null; event: number | null; - itchGameEmbedID: string; + itchGamePlayableID: string; itchGameWidth: number; itchGameHeight: number; contributors: Contributor[]; diff --git a/client/src/pages/games/[id].tsx b/client/src/pages/games/[id].tsx index fb956ff..69dd1c8 100644 --- a/client/src/pages/games/[id].tsx +++ b/client/src/pages/games/[id].tsx @@ -57,7 +57,7 @@ export default function IndividualGamePage() { const gameTitle = game.name; const gameCover = game.gameCover; const gameDescription = game.description.split("\n"); - const gameEmbedID = game.itchGameEmbedID; + const gamePlayableID = game.itchGamePlayableID; const gameWidth = game.itchGameWidth; const gameHeight = game.itchGameHeight; const eventID = game.event; @@ -94,10 +94,11 @@ export default function IndividualGamePage() {
- {gameEmbedID ? ( + {/* only render game embed if ID, width, and height are all provided (...and are non-zero). */} + {gamePlayableID && gameWidth && gameHeight ? (