mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-29 17:32:17 -07:00
[Game] Playmats
Took 19 seconds Took 1 minute
This commit is contained in:
parent
74a454552a
commit
92c8f1a1a1
29 changed files with 967 additions and 12 deletions
|
|
@ -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()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue