Skip to content

UniversesBeyondSagaTemplate

src.templates.saga.UniversesBeyondSagaTemplate

Bases: SagaVectorTemplate

Saga Vector template with Universes Beyond frame treatment.

Source code in src\templates\saga.py
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
class UniversesBeyondSagaTemplate(SagaVectorTemplate):
    """Saga Vector template with Universes Beyond frame treatment."""
    template_suffix = 'Universes Beyond'

    # Color Maps
    pinlines_color_map = {
        **pinlines_color_map.copy(),
        'W': [246, 247, 241],
        'U': [0, 131, 193],
        'B': [44, 40, 33],
        'R': [237, 66, 31],
        'G': [5, 129, 64],
        'Gold': [239, 209, 107],
        'Land': [165, 150, 132],
        'Artifact': [227, 228, 230],
        'Colorless': [227, 228, 230]
    }

    """
    * Colors
    """

    @auto_prop_cached
    def textbox_colors(self) -> list[str]:
        """Not separated by front/back face."""
        if 1 < len(self.identity) < self.color_limit:
            return [n for n in self.identity]
        return [self.pinlines]

    @auto_prop_cached
    def twins_colors(self) -> Optional[str]:
        """Look for 'Beyond' variant texture."""
        return f'{self.twins} Beyond'

    """
    * Groups
    """

    @auto_prop_cached
    def background_group(self) -> LayerSet:
        """Look for 'Beyond' variant group."""
        return psd.getLayerSet(f'{LAYERS.BACKGROUND} Beyond')

    @auto_prop_cached
    def textbox_group(self) -> LayerSet:
        """Look for 'Beyond' variant group. Must be enabled."""
        if group := psd.getLayerSet(f"{LAYERS.TEXTBOX} Beyond"):
            group.visible = True
            return group

    """
    * Transform Frame Layers
    """

    def enable_transform_layers(self):
        super().enable_transform_layers()

        # Switch to darker colors for back side
        if not self.is_front:
            psd.getLayer(LAYERS.BACK, self.textbox_group).visible = True
            psd.getLayer(LAYERS.BACK, self.twins_group).visible = True

Attributes

pinlines_color_map = {None: pinlines_color_map.copy(), 'W': [246, 247, 241], 'U': [0, 131, 193], 'B': [44, 40, 33], 'R': [237, 66, 31], 'G': [5, 129, 64], 'Gold': [239, 209, 107], 'Land': [165, 150, 132], 'Artifact': [227, 228, 230], 'Colorless': [227, 228, 230]}

  • Colors

Functions

background_group() -> LayerSet

Look for 'Beyond' variant group.

Source code in src\templates\saga.py
563
564
565
566
@auto_prop_cached
def background_group(self) -> LayerSet:
    """Look for 'Beyond' variant group."""
    return psd.getLayerSet(f'{LAYERS.BACKGROUND} Beyond')

textbox_colors() -> list[str]

Not separated by front/back face.

Source code in src\templates\saga.py
547
548
549
550
551
552
@auto_prop_cached
def textbox_colors(self) -> list[str]:
    """Not separated by front/back face."""
    if 1 < len(self.identity) < self.color_limit:
        return [n for n in self.identity]
    return [self.pinlines]

textbox_group() -> LayerSet

Look for 'Beyond' variant group. Must be enabled.

Source code in src\templates\saga.py
568
569
570
571
572
573
@auto_prop_cached
def textbox_group(self) -> LayerSet:
    """Look for 'Beyond' variant group. Must be enabled."""
    if group := psd.getLayerSet(f"{LAYERS.TEXTBOX} Beyond"):
        group.visible = True
        return group

twins_colors() -> Optional[str]

Look for 'Beyond' variant texture.

Source code in src\templates\saga.py
554
555
556
557
@auto_prop_cached
def twins_colors(self) -> Optional[str]:
    """Look for 'Beyond' variant texture."""
    return f'{self.twins} Beyond'