Compare commits

..

6 Commits

Author SHA1 Message Date
LQ63
5f30b9f739 fix(ui): Tie selection
Added !
2026-01-13 14:40:00 +01:00
LQ63
7829b35211 feat(ui): Tie selection
Added a minimal ui for the tie selection. Tie selection gets sent to the server via websocket and gets response from it.
2026-01-13 14:24:50 +01:00
TeamCity
8482aa8876 ci: bump version to v0.22.0 2026-01-07 21:37:08 +00:00
c6537467f8 feat: Update LobbyComponent to use icons for player removal buttons 2026-01-07 22:34:23 +01:00
TeamCity
3eb505806c ci: bump version to v0.21.0 2026-01-07 21:05:21 +00:00
058d232d2b feat: Implement PlayDogCard functionality in user session and update Vue component 2026-01-07 22:02:21 +01:00
7 changed files with 137 additions and 7 deletions

View File

@@ -150,3 +150,13 @@
### Features ### Features
* Enhance user state management with polling and WebSocket connection handling ([02869ff](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/02869fff8b448cde73369679c9b38bc99fb771ff)) * Enhance user state management with polling and WebSocket connection handling ([02869ff](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/02869fff8b448cde73369679c9b38bc99fb771ff))
## [0.0.0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/compare/0.20.0...0.0.0) (2026-01-07)
### Features
* Implement PlayDogCard functionality in user session and update Vue component ([058d232](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/058d232d2ba00f33b1e658fc8a793dcd59018fa4))
## [0.0.0](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/compare/0.21.0...0.0.0) (2026-01-07)
### Features
* Update LobbyComponent to use icons for player removal buttons ([c653746](https://git.janis-eccarius.de/KnockOutWhist/KnockOutWhist-Frontend/commit/c6537467f87d60aeece18f86f42c839d5437c18b))

View File

@@ -10,6 +10,7 @@ import TurnC from "@/components/ingame/TurnC.vue";
import TrumpC from "@/components/ingame/TrumpC.vue"; import TrumpC from "@/components/ingame/TrumpC.vue";
import {storeToRefs} from "pinia"; import {storeToRefs} from "pinia";
import {ref, toRefs, watch} from "vue"; import {ref, toRefs, watch} from "vue";
import TieC from "@/components/ingame/TieC.vue";
const ig = useIngame() const ig = useIngame()
const { state } = toRefs(ig) const { state } = toRefs(ig)
@@ -45,6 +46,22 @@ watch(
<TrumpC /> <TrumpC />
</div> </div>
</transition> </transition>
<transition
appear
enter-active-class="animate__animated animate__fadeInDown"
leave-active-class="animate__animated animate__fadeOutDown"
>
<div
v-if="state === 'TieBreak'"
class="full-overlay-blur"
style="z-index: 2000;"
>
<TieC />
</div>
</transition>
<div class="fit row wrap justify-center items-center content-start"> <div class="fit row wrap justify-center items-center content-start">
<div class="mt-5 ml-4 self-start col-2"> <div class="mt-5 ml-4 self-start col-2">
<TurnC v-if="(cachedGameInfo as GameInfo)?.playerQueue" :queue="(cachedGameInfo as GameInfo).playerQueue!"/> <TurnC v-if="(cachedGameInfo as GameInfo)?.playerQueue" :queue="(cachedGameInfo as GameInfo).playerQueue!"/>

View File

@@ -25,9 +25,8 @@ function triggerWiggle(index: number) {
function handlePlayCard(index: number | null) { function handlePlayCard(index: number | null) {
if (index === null) return if (index === null) return
wb.sendAndWait("PlayCard", { cardindex: index }).catch((error) => { wb.sendAndWait((<GameInfo>wi.data)?.self?.dogLife ? "PlayDogCard" : "PlayCard", { cardindex: index }).catch((error) => {
triggerWiggle(index) triggerWiggle(index)
$q.notify({ $q.notify({
message: error.message, message: error.message,
color: "negative", color: "negative",
@@ -45,7 +44,13 @@ function onBeforeLeave(el: Element) {
element.style.height = height; element.style.height = height;
} }
function handleSkipDogLife() { function handleSkipDogLife() {
//TODO: Add some animation or feedback for skipping turn wb.sendAndWait("PlayDogCard", { cardindex: 'Skip' }).catch((error) => {
$q.notify({
message: error.message,
color: "negative",
position: "top"
})
})
} }
function getCardImagePath(cardPath: string) { function getCardImagePath(cardPath: string) {

View File

@@ -0,0 +1,98 @@
<script setup lang="ts">
import {useWebSocket} from "@/composables/useWebsocket.ts";
import {useIngame} from "@/composables/useIngame.ts";
import type {GameInfo, LobbyInfo, TieInfo, TrumpInfo} from "@/types/GameTypes.ts";
import {useQuasar} from "quasar";
import { ref } from 'vue';
import { computed } from 'vue'
const wb = useWebSocket()
const wi = useIngame()
const tieInf = computed(() => wi.data as TieInfo)
const tieBlankCard = [
"/images/cards/AS.png"
]
const $q = useQuasar();
function getCardImagePath(cardPath: string) {
if (!cardPath) return ''
if (cardPath.includes('://') || cardPath.startsWith('/')) return cardPath
return `/${cardPath}`
}
function selectTie(tieIndex: number) {
wb.sendAndWait("PickTie", { cardIndex: tieIndex }).then(
$q.notify({
message: "You've successfully picked your tieCard!",
color: "positive",
position: "top"
})
).catch((error) => {
$q.notify({
message: error.message,
color: "negative",
position: "top"
})
})
}
const model = ref(1)
const options = computed(() => {
const list = []
const max = tieInf.value.highestAmount?.valueOf() || 0
for (let i = 1; i <= max; i++) {
list.push(i)
}
return list
})
</script>
<template>
<q-card v-if="tieInf.self?.name === tieInf.currentPlayer?.name" class="player-profile-card" flat bordered>
<q-card-section class="bg-white text-dark text-center q-py-lg">
<div class="text-h3 text-weight-bolder">
{{ tieInf.self?.name || "Loading Player..."}}
</div>
</q-card-section>
<q-card-section class="bg-dark text-dark text-center q-py-lg">
<div class="q-pa-md" style="max-width: 500px">
<div class="q-gutter-md">
<q-select
v-model="model"
:options="options"
label="Select Amount"
filled
bg-color="white"
label-color="primary"
color="primary"
popup-content-class="bg-white text-black"
/>
<q-btn
color="positive"
icon="sports_martial_arts"
@click="selectTie(model)"
class="full-width"
/>
</div>
</div>
</q-card-section>
</q-card>
<q-card
v-else
class="player-profile-card text-center"
flat
bordered
style="min-height: 200px; display: flex; flex-direction: column; justify-content: center;"
>
<q-card-section class="q-pa-lg">
<q-spinner-hourglass color="black" size="3em" class="q-mb-md" />
<div class="text-h5 text-grey-8">
Waiting for {{ tieInf.currentPlayer?.name || 'the other player' }} to select card for the tie...
</div>
</q-card-section>
</q-card>
</template>
<style scoped>
</style>

View File

@@ -103,14 +103,14 @@ const profileIcon = 'person';
<q-btn <q-btn
v-if="player.id !== (<LobbyInfo>ig.data).self.id" v-if="player.id !== (<LobbyInfo>ig.data).self.id"
color="negative" color="negative"
label="Remove" icon="sports_martial_arts"
@click="handleKickPlayer(player)" @click="handleKickPlayer(player)"
class="full-width" class="full-width"
/> />
<q-btn <q-btn
v-else v-else
color="negative" color="negative"
label="Remove (Cannot Kick Self)" icon="sports_martial_arts"
disable disable
class="full-width" class="full-width"
/> />

View File

@@ -33,7 +33,7 @@ ui.requestState().then(() => {
<template> <template>
<div class="lobby-background"> <div class="lobby-background">
<Ingame v-if="state === 'InGame' || state === 'SelectTrump'"/> <Ingame v-if="state === 'InGame' || state === 'SelectTrump' || state === 'TieBreak'"/>
<lobby-component v-if="state === 'Lobby'"/> <lobby-component v-if="state === 'Lobby'"/>
</div> </div>
</template> </template>

View File

@@ -1,3 +1,3 @@
MAJOR=0 MAJOR=0
MINOR=20 MINOR=22
PATCH=0 PATCH=0