From 466bb7633b521466a6ea08650a9c89b83066ce8c Mon Sep 17 00:00:00 2001 From: Dylan <78911744+Didiloy@users.noreply.github.com> Date: Wed, 8 Jan 2025 19:21:56 +0100 Subject: [PATCH] Added a new success --- .../src/assets/images/successes/team_player.svg | 15 +++++++++++++++ src/renderer/src/components/TeamList.vue | 9 +++++++++ src/renderer/src/composables/successes.js | 17 +++++++++++++++++ src/renderer/src/views/Team.vue | 2 ++ 4 files changed, 43 insertions(+) create mode 100644 src/renderer/src/assets/images/successes/team_player.svg diff --git a/src/renderer/src/assets/images/successes/team_player.svg b/src/renderer/src/assets/images/successes/team_player.svg new file mode 100644 index 0000000..7c3b709 --- /dev/null +++ b/src/renderer/src/assets/images/successes/team_player.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/src/renderer/src/components/TeamList.vue b/src/renderer/src/components/TeamList.vue index d8e4cc8..d36ee96 100755 --- a/src/renderer/src/components/TeamList.vue +++ b/src/renderer/src/components/TeamList.vue @@ -127,6 +127,12 @@ :title="item.why_playing.description + ''" class="success" /> +
@@ -235,6 +241,7 @@ function filterTeam() { thousand_hours: team.thousand_hours, stinky: team.stinky, why_playing: team.why_playing, + team_player: team.team_player, })); return; } @@ -277,6 +284,7 @@ function getSuccesses() { thousand_hours, stinky, why_playing, + team_player, } = useSuccesses(i18n); calculateSuccesses(team.name, sessions.value); team.relentless = relentless.value; @@ -294,6 +302,7 @@ function getSuccesses() { team.thousand_hours = thousand_hours.value; team.stinky = stinky.value; team.why_playing = why_playing.value; + team.team_player = team_player.value; team.computed_successes = true; }); } diff --git a/src/renderer/src/composables/successes.js b/src/renderer/src/composables/successes.js index 3541d92..1c588e7 100755 --- a/src/renderer/src/composables/successes.js +++ b/src/renderer/src/composables/successes.js @@ -17,6 +17,7 @@ import important_person_logo from "../assets/images/successes/important_person.s import thousand_hours_logo from "../assets/images/successes/thousand_hours.svg"; import stinky_logo from "../assets/images/successes/stinky.svg"; import why_playing_logo from "../assets/images/successes/why_playing.svg"; +import team_player_logo from "../assets/images/successes/team_player.svg"; export function useSuccesses(i18n) { const store = useStore(); @@ -49,6 +50,7 @@ export function useSuccesses(i18n) { let bad_session = new Map(); //relentless let session_number = 0; //young_gamer, gamer, passionnate + let sessions_in_team = 0; //team_player let different_games = new Set(); //curious let bad_session_acc = 0; //depressed //important_person @@ -106,6 +108,11 @@ export function useSuccesses(i18n) { //stinky sessions_of_ten_hours++; } + + //team_player + if (session.teams.length > 1) { + sessions_in_team++; + } } //relentless and why_playing @@ -210,6 +217,15 @@ export function useSuccesses(i18n) { stinky.value.image = stinky_logo; stinky.value.description = i18n.t("Successes.descriptions.stinky"); } + + //team_player + if (sessions_in_team > session_number / 2) { + team_player.value.unlocked = true; + team_player.value.image = team_player_logo; + team_player.value.description = i18n.t( + "Successes.descriptions.team_player", + ); + } } return { @@ -229,5 +245,6 @@ export function useSuccesses(i18n) { thousand_hours, stinky, why_playing, + team_player, }; } diff --git a/src/renderer/src/views/Team.vue b/src/renderer/src/views/Team.vue index 6ac3017..42dd4bf 100755 --- a/src/renderer/src/views/Team.vue +++ b/src/renderer/src/views/Team.vue @@ -262,6 +262,7 @@ onMounted(() => { thousand_hours, stinky, why_playing, + team_player, } = useSuccesses(i18n); calculateSuccesses(useRoute().params.name, sessions_of_team.value, false); let unlocked = []; @@ -280,6 +281,7 @@ onMounted(() => { unlocked.push(thousand_hours.value); unlocked.push(stinky.value); unlocked.push(why_playing.value); + unlocked.push(team_player.value); unlocked_successes.value = unlocked.filter((s) => s.unlocked); selected_success.value = unlocked_successes.value[0]; });