mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 19:13:25 -08:00
Limited deck views (view top/bottom N cards, scry, surveil) made it ambiguous which card was the top or bottom of the library. Label the card itself with a small in-view marker instead of placing text above or below the whole zone, which became ambiguous once the grid used several columns or the window was resized. The marker stays on the part of its card that the column leaves visible: for a top view, the right end of the exposed strip of the first card; for a bottom view, the bottom-left corner of the last, fully visible card. The view logic now answers whether it is a limited library-end view and which edge it shows. The graphics zone draws and positions a marker on the first or last displayed card, and re-translates its tooltip with the rest of the zone view. Co-authored-by: Lukas Brübach <44814898+BruebachL@users.noreply.github.com>
This commit is contained in:
parent
80986266b9
commit
d9cd308a2e
6 changed files with 243 additions and 2 deletions
|
|
@ -7,6 +7,7 @@
|
|||
#include <QtGlobal>
|
||||
#include <libcockatrice/interfaces/interface_interface_settings_provider.h>
|
||||
#include <libcockatrice/settings/interface_settings.h>
|
||||
#include <libcockatrice/utility/zone_names.h>
|
||||
|
||||
class PlayerLogic;
|
||||
class QObject;
|
||||
|
|
@ -36,6 +37,11 @@ bool ZoneViewZoneLogic::getCloseEmptyCardView() const
|
|||
return interfaceSettings ? interfaceSettings->getCloseEmptyCardView() : true;
|
||||
}
|
||||
|
||||
bool ZoneViewZoneLogic::isLibraryEdgeView() const
|
||||
{
|
||||
return origZone != nullptr && numberCards > 0 && origZone->getName() == ZoneNames::DECK;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if inserting a card at the given position requires an actual new card to be created and added to the view.
|
||||
* Also does any cardId updates that would be required if a card is inserted in that position.
|
||||
|
|
|
|||
|
|
@ -82,6 +82,27 @@ public:
|
|||
return isReversed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Whether this view is a limited look at one end of a library.
|
||||
*
|
||||
* Only scry/surveil-style views of the top or bottom cards of a deck
|
||||
* qualify. Full-zone views, revealed-card views and views of other zones
|
||||
* do not, because their first and last cards have no library edge meaning.
|
||||
*/
|
||||
[[nodiscard]] bool isLibraryEdgeView() const;
|
||||
|
||||
/** @brief Whether the first card in the view is the top card of the library. */
|
||||
[[nodiscard]] bool showsTopOfLibrary() const
|
||||
{
|
||||
return isLibraryEdgeView() && !isReversed;
|
||||
}
|
||||
|
||||
/** @brief Whether the last card in the view is the bottom card of the library. */
|
||||
[[nodiscard]] bool showsBottomOfLibrary() const
|
||||
{
|
||||
return isLibraryEdgeView() && isReversed;
|
||||
}
|
||||
|
||||
CardZoneLogic *getOriginalZone() const
|
||||
{
|
||||
return origZone;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue