tristan-wip #2
@ -50,7 +50,7 @@ const optionsOpen = ref(false);
|
|||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
games.value = await fetchGames();
|
games.value = await fetchGames();
|
||||||
tags.value = [...new Set(games.value.flatMap(game => game.Genres))];
|
tags.value = [...new Set(games.value.flatMap(game => game.Genres.split(",")))];
|
||||||
selectedTag.value = tags.value[0];
|
selectedTag.value = tags.value[0];
|
||||||
selectedGame.value = store.filteredGames[0];
|
selectedGame.value = store.filteredGames[0];
|
||||||
});
|
});
|
||||||
|
|||||||
@ -45,7 +45,7 @@ export async function fetchGames(): Promise<Game[]> {
|
|||||||
|
|
||||||
// TODO games should be loaded from and started from the wails/go code
|
// TODO games should be loaded from and started from the wails/go code
|
||||||
const games = await LoadGames();
|
const games = await LoadGames();
|
||||||
for (const game in games) {
|
for (const game of games) {
|
||||||
console.log(game)
|
console.log(game)
|
||||||
}
|
}
|
||||||
return games;
|
return games;
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
}),
|
}),
|
||||||
getters: {
|
getters: {
|
||||||
filteredGames(state): Game[] {
|
filteredGames(state): Game[] {
|
||||||
return state.games.filter(game => game.Genres.includes(state.selectedTag ?? ''));
|
return state.games.filter(game => game.Genres.split(",").includes(state.selectedTag ?? ''));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|||||||
@ -105,7 +105,8 @@ func GetConjureGameInfo() []models.Game {
|
|||||||
|
|
||||||
fmt.Println("Contents of metadata.txt:")
|
fmt.Println("Contents of metadata.txt:")
|
||||||
metadata, err := io.ReadAll(rc)
|
metadata, err := io.ReadAll(rc)
|
||||||
parseGameInfo(metadata)
|
game := parseGameInfo(metadata)
|
||||||
|
games = append(games, game)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user