[Game] Playmats

Took 19 seconds

Took 1 minute
This commit is contained in:
Lukas Brübach 2026-08-09 21:01:30 +02:00
parent 74a454552a
commit 92c8f1a1a1
29 changed files with 967 additions and 12 deletions

View file

@ -250,6 +250,23 @@ void PlayerLogic::setDeck(const DeckList &_deck)
emit deckChanged();
}
void PlayerLogic::setPlaymatFromProperties(const ServerInfo_PlayerProperties &props)
{
if (props.has_playmat_card_name() && !props.playmat_card_name().empty()) {
remotePlaymatCard = {QString::fromStdString(props.playmat_card_name()),
QString::fromStdString(props.playmat_card_provider_id())};
remotePlaymatParams = {
qBound(0.0, props.playmat_margin_pct_l(), 0.95), qBound(0.0, props.playmat_margin_pct_r(), 0.95),
qBound(0.0, props.playmat_vertical_offset(), 1.0), qBound(0.1, props.playmat_zoom(), 4.0)};
hasRemotePlaymat = true;
} else {
remotePlaymatCard = CardRef{};
remotePlaymatParams = PlaymatParams{};
hasRemotePlaymat = false;
}
emit playmatChanged();
}
CounterState *PlayerLogic::addCounter(const ServerInfo_Counter &counter)
{
return addCounter(counter.id(), QString::fromStdString(counter.name()),