How to use the domdiv.draw.CardPlot.tabSetup function in domdiv

To help you get started, we’ve selected a few domdiv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sumpfork / dominiontabs / domdiv / draw.py View on Github external
nextTabIndex = CardPlot.tabRestart()
        lastCardSet = None
        reset_expansion_tabs = options.expansion_dividers and options.expansion_reset_tabs

        for card in cards:
            # Check if tab needs to be reset to the start
            if reset_expansion_tabs and not card.isExpansion():
                if lastCardSet != card.cardset_tag:
                    # In a new expansion, so reset the tabs to start over
                    nextTabIndex = CardPlot.tabRestart()
                    if options.tab_number > Card.sets[card.cardset_tag]['count']:
                        #  Limit to the number of tabs to the number of dividers in the expansion
                        CardPlot.tabSetup(tabNumber=Card.sets[card.cardset_tag]['count'])
                    elif CardPlot.tabNumber != options.tab_number:
                        # Make sure tabs are set back to the original
                        CardPlot.tabSetup(tabNumber=options.tab_number)
            lastCardSet = card.cardset_tag

            if self.wantCentreTab(card):
                # If we want centred expansion cards, then force this divider to centre
                thisTabIndex = 0
            else:
                thisTabIndex = nextTabIndex

            item = CardPlot(card,
                            rotation=options.spin if options.spin != 0 else options.rotate,
                            tabIndex=thisTabIndex,
                            textTypeFront=options.text_front,
                            textTypeBack=options.text_back,
                            stackHeight=card.getStackHeight(options.thickness)
                            )
            if options.flip and (options.tab_number == 2) and (thisTabIndex != CardPlot.tabStart):
github sumpfork / dominiontabs / domdiv / draw.py View on Github external
elif "centre" in options.tab_side:
            tabSideStart = CardPlot.CENTRE  # centre
        elif "full" == options.tab_side:
            tabSideStart = CardPlot.CENTRE  # full
        else:
            tabSideStart = CardPlot.LEFT  # catch anything else

        cardWidth = options.dominionCardWidth
        cardHeight = options.dominionCardHeight

        # Adjust for Vertical
        if options.orientation == "vertical":
            cardWidth, cardHeight = cardHeight, cardWidth

        # Initialized CardPlot tabs
        CardPlot.tabSetup(tabNumber=options.tab_number,
                          cardWidth=cardWidth,
                          cardHeight=cardHeight,
                          lineType=lineType,
                          tabWidth=options.labelWidth,
                          tabHeight=options.labelHeight,
                          start=tabSideStart,
                          serpentine=options.tab_serpentine,
                          wrapper=options.wrapper)

        # Now go through all the cards and create their plotter information record...
        items = []
        nextTabIndex = CardPlot.tabRestart()
        lastCardSet = None
        reset_expansion_tabs = options.expansion_dividers and options.expansion_reset_tabs

        for card in cards: