mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-05 20:39:59 -08:00
Prevent a ton of local arrow from spamming a user's UI
Co-authored-by: alyssa.syharath@gmail.com
This commit is contained in:
@@ -110,7 +110,7 @@ void PlayerArea::setPlayerZoneId(int _playerZoneId)
|
||||
}
|
||||
|
||||
Player::Player(const ServerInfo_User &info, int _id, bool _local, bool _judge, TabGame *_parent)
|
||||
: QObject(_parent), game(_parent), movingCardsUntil(false), shortcutsActive(false), lastTokenDestroy(true),
|
||||
: QObject(_parent), game(_parent), movingCardsUntil(false), isCreatingArrow(false), shortcutsActive(false), lastTokenDestroy(true),
|
||||
lastTokenTableRow(0), id(_id), active(false), local(_local), judge(_judge), mirrored(false), handVisible(false),
|
||||
conceded(false), zoneId(0), dialogSemaphore(false), deck(nullptr)
|
||||
{
|
||||
@@ -1967,6 +1967,7 @@ void Player::eventRollDie(const Event_RollDie &event)
|
||||
|
||||
void Player::eventCreateArrow(const Event_CreateArrow &event)
|
||||
{
|
||||
isCreatingArrow = false;
|
||||
ArrowItem *arrow = addArrow(event.arrow_info());
|
||||
if (!arrow) {
|
||||
return;
|
||||
@@ -3199,7 +3200,13 @@ void Player::actSetPT()
|
||||
|
||||
void Player::actDrawArrow()
|
||||
{
|
||||
if (isCreatingArrow) {
|
||||
return;
|
||||
}
|
||||
|
||||
isCreatingArrow = true;
|
||||
if (!game->getActiveCard()) {
|
||||
isCreatingArrow = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,6 +254,7 @@ private:
|
||||
QString previousMovingCardsUntilExpr = {};
|
||||
FilterString movingCardsUntilFilter;
|
||||
|
||||
bool isCreatingArrow;
|
||||
bool shortcutsActive;
|
||||
int defaultNumberTopCards = 1;
|
||||
int defaultNumberTopCardsToPlaceBelow = 1;
|
||||
|
||||
Reference in New Issue
Block a user