Skip to content

ClassicRemasteredTemplate

src.templates.normal.ClassicRemasteredTemplate

Bases: VectorTransformMod, VectorTemplate

Based on iDerp's Classic Remastered template, modified to work with Proxyshop, colored pinlines added for land generation. PT box added for creatures. Does not support Nyx or Companion layers.

Source code in src\templates\normal.py
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
class ClassicRemasteredTemplate(VectorTransformMod, VectorTemplate):
    """
    Based on iDerp's Classic Remastered template, modified to work with Proxyshop, colored pinlines added for
    land generation. PT box added for creatures. Does not support Nyx or Companion layers.
    """
    frame_suffix = 'Classic'
    template_suffix = 'Remastered'

    # Static properties
    is_vehicle = False
    is_name_shifted = False
    twins_group = None

    """
    * Frame Details
    """

    @auto_prop_cached
    def color_limit(self) -> int:
        """Supports 2 and 3 color limit setting."""
        return int(CFG.get_setting("FRAME", "Max.Colors", "3", is_bool=False)) + 1

    @auto_prop_cached
    def gold_pt(self) -> bool:
        """Returns True if PT for multicolored cards should be gold."""
        return bool(CFG.get_setting("FRAME", "Gold.PT", False))

    """
    * Bool
    """

    @auto_prop_cached
    def has_pinlines(self):
        """bool: Allow pinlines for Land and Artifact cards."""
        return bool(self.is_land or self.is_artifact)

    """
    * Colors
    """

    @auto_prop_cached
    def pinlines_colors(self) -> Union[list[int], list[dict]]:
        """Union[list[int], list[dict]]: Allow pinlines on Land and Artifact cards."""
        if self.has_pinlines:
            if len(self.identity) >= self.color_limit:
                if len(self.identity) == 2:
                    # Color limit 1
                    return psd.get_pinline_gradient(LAYERS.GOLD)
                # Color limit exceeded
                return psd.get_pinline_gradient(self.pinlines)
            # Color limit in range
            return psd.get_pinline_gradient(self.identity)
        return []

    @auto_prop_cached
    def pt_colors(self) -> str:
        """str: Single layer name, use last color for hybrid cards."""
        if not self.gold_pt and 0 < len(self.background_colors) < self.color_limit:
            return self.background_colors[-1]
        return self.twins

    @auto_prop_cached
    def textbox_colors(self) -> list[str]:
        """list[str]: Only blend textbox colors for hybrid and land cards."""
        if self.is_land:
            # Within color limit
            if 1 < len(self.identity) < self.color_limit:
                return [f'{n} {LAYERS.LAND}' for n in self.identity]
            # 1 Color limit
            if len(self.identity) == 2:
                return [f'{LAYERS.GOLD} {LAYERS.LAND}']
            # Plain land background
            if self.pinlines == LAYERS.LAND:
                return [LAYERS.LAND]
            # All other land backgrounds
            return [f"{self.pinlines} {LAYERS.LAND}"]
        # Hybrid cards
        if self.is_hybrid:
            # Within color limit
            if 1 < len(self.identity) < self.color_limit:
                return list(self.identity)
            # 1 Color limit
            if len(self.identity) == 2:
                return [LAYERS.GOLD]
            return [self.pinlines]
        # Just one layer
        return [self.background]

    @auto_prop_cached
    def background_colors(self) -> list[str]:
        """list[str]: Supports blended colors on non-Land, non-Artifact cards."""
        if 1 < len(self.identity) < self.color_limit and not self.has_pinlines:
            return list(self.identity)
        if len(self.identity) == 2 and not self.has_pinlines:
            return [LAYERS.GOLD]
        return [self.background]

    @auto_prop_cached
    def crown_colors(self) -> list[str]:
        """list[str]: Use the same colors as background."""
        return self.background_colors

    """
    * Groups
    """

    @auto_prop_cached
    def pinlines_group(self) -> LayerSet:
        """LayerSet: Pinlines and textbox combined."""
        return psd.getLayerSet(LAYERS.PINLINES_TEXTBOX)

    @auto_prop_cached
    def pinlines_groups(self) -> list[LayerSet]:
        """list[LayerSet]: Return empty if no pinlines colors provided."""
        if not self.pinlines_colors:
            return []

        # Two main pinlines groups
        groups: list[LayerSet] = [
            psd.getLayerSet("Pinlines Top", self.pinlines_group),
            psd.getLayerSet("Pinlines Bottom", self.pinlines_group)
        ]

        # Add the crown pinlines if needed
        if self.is_legendary:
            groups.append(psd.getLayerSet(LAYERS.PINLINES, LAYERS.LEGENDARY_CROWN))
        return groups

    @auto_prop_cached
    def textbox_group(self) -> LayerSet:
        """LayerSet: Must apply correct layer effects."""
        group = psd.getLayerSet(LAYERS.TEXTBOX, self.pinlines_group)
        psd.copy_layer_fx(
            psd.getLayer("EFFECTS LAND" if self.pinlines_colors else "EFFECTS", group),
            group)
        return group

    """
    * Masks
    """

    @auto_prop_cached
    def mask_layers(self) -> list[ArtLayer]:
        """list[ArtLayer]: A list of layers containing masks based on how many color splits."""
        if 1 < len(self.identity) < self.color_limit:
            return [psd.getLayer(n, self.mask_group) for n in CON.masks[len(self.identity)]]
        return []

    """
    * Shapes
    """

    @auto_prop_cached
    def pinlines_shape(self) -> Optional[LayerSet]:
        """Pinlines are only provided for Land and Artifact cards."""
        if not self.pinlines_groups:
            return
        return psd.getLayer(
            LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
            [self.pinlines_groups[0], LAYERS.SHAPE]
        )

    @auto_prop_cached
    def enabled_shapes(self) -> list[Union[ArtLayer, LayerSet, None]]:
        """No need for Twins or Border shape."""
        return [self.pinlines_shape, self.textbox_shape]

    """
    * References
    """

    @auto_prop_cached
    def pt_reference(self) -> Optional[ArtLayer]:
        """Support alternate reference for flipside PT."""
        return psd.getLayer(
            f'{LAYERS.PT_REFERENCE} Flip' if (
                    self.is_transform and self.is_front and self.is_flipside_creature
            ) else LAYERS.PT_REFERENCE, self.text_group)

    @auto_prop_cached
    def textbox_reference(self) -> Optional[ArtLayer]:
        """Use smaller Textbox Reference if Pinlines are added."""
        return psd.get_reference_layer(
            f"{LAYERS.TEXTBOX_REFERENCE} {LAYERS.PINLINES}"
            if self.pinlines_colors else LAYERS.TEXTBOX_REFERENCE,
            self.text_group)

    """
    * Hooks
    """

    def hook_large_mana(self) -> None:
        """Adjust mana cost position for large symbols."""
        if not self.is_legendary:
            self.text_layer_mana.translate(0, -10)

    """
    * Methods
    """

    def enable_hollow_crown(self, **kwargs) -> None:
        """No hollow crown."""
        pass

    """
    * Transform Methods
    """

    def enable_transform_layers(self) -> None:
        """No Transform layers."""
        pass

    def text_layers_transform_back(self) -> None:
        """No back-side text changes."""
        pass

Attributes

twins_group = None

  • Frame Details

Functions

background_colors() -> list[str]

list[str]: Supports blended colors on non-Land, non-Artifact cards.

Source code in src\templates\normal.py
733
734
735
736
737
738
739
740
@auto_prop_cached
def background_colors(self) -> list[str]:
    """list[str]: Supports blended colors on non-Land, non-Artifact cards."""
    if 1 < len(self.identity) < self.color_limit and not self.has_pinlines:
        return list(self.identity)
    if len(self.identity) == 2 and not self.has_pinlines:
        return [LAYERS.GOLD]
    return [self.background]

color_limit() -> int

Supports 2 and 3 color limit setting.

Source code in src\templates\normal.py
662
663
664
665
@auto_prop_cached
def color_limit(self) -> int:
    """Supports 2 and 3 color limit setting."""
    return int(CFG.get_setting("FRAME", "Max.Colors", "3", is_bool=False)) + 1

crown_colors() -> list[str]

list[str]: Use the same colors as background.

Source code in src\templates\normal.py
742
743
744
745
@auto_prop_cached
def crown_colors(self) -> list[str]:
    """list[str]: Use the same colors as background."""
    return self.background_colors

enable_hollow_crown(**kwargs) -> None

No hollow crown.

Source code in src\templates\normal.py
845
846
847
def enable_hollow_crown(self, **kwargs) -> None:
    """No hollow crown."""
    pass

enable_transform_layers() -> None

No Transform layers.

Source code in src\templates\normal.py
853
854
855
def enable_transform_layers(self) -> None:
    """No Transform layers."""
    pass

enabled_shapes() -> list[Union[ArtLayer, LayerSet, None]]

No need for Twins or Border shape.

Source code in src\templates\normal.py
807
808
809
810
@auto_prop_cached
def enabled_shapes(self) -> list[Union[ArtLayer, LayerSet, None]]:
    """No need for Twins or Border shape."""
    return [self.pinlines_shape, self.textbox_shape]

gold_pt() -> bool

Returns True if PT for multicolored cards should be gold.

Source code in src\templates\normal.py
667
668
669
670
@auto_prop_cached
def gold_pt(self) -> bool:
    """Returns True if PT for multicolored cards should be gold."""
    return bool(CFG.get_setting("FRAME", "Gold.PT", False))

has_pinlines()

Source code in src\templates\normal.py
676
677
678
679
@auto_prop_cached
def has_pinlines(self):
    """bool: Allow pinlines for Land and Artifact cards."""
    return bool(self.is_land or self.is_artifact)

hook_large_mana() -> None

Adjust mana cost position for large symbols.

Source code in src\templates\normal.py
836
837
838
839
def hook_large_mana(self) -> None:
    """Adjust mana cost position for large symbols."""
    if not self.is_legendary:
        self.text_layer_mana.translate(0, -10)

mask_layers() -> list[ArtLayer]

list[ArtLayer]: A list of layers containing masks based on how many color splits.

Source code in src\templates\normal.py
786
787
788
789
790
791
@auto_prop_cached
def mask_layers(self) -> list[ArtLayer]:
    """list[ArtLayer]: A list of layers containing masks based on how many color splits."""
    if 1 < len(self.identity) < self.color_limit:
        return [psd.getLayer(n, self.mask_group) for n in CON.masks[len(self.identity)]]
    return []

pinlines_colors() -> Union[list[int], list[dict]]

Union[list[int], list[dict]]: Allow pinlines on Land and Artifact cards.

Source code in src\templates\normal.py
685
686
687
688
689
690
691
692
693
694
695
696
697
@auto_prop_cached
def pinlines_colors(self) -> Union[list[int], list[dict]]:
    """Union[list[int], list[dict]]: Allow pinlines on Land and Artifact cards."""
    if self.has_pinlines:
        if len(self.identity) >= self.color_limit:
            if len(self.identity) == 2:
                # Color limit 1
                return psd.get_pinline_gradient(LAYERS.GOLD)
            # Color limit exceeded
            return psd.get_pinline_gradient(self.pinlines)
        # Color limit in range
        return psd.get_pinline_gradient(self.identity)
    return []

pinlines_group() -> LayerSet

Source code in src\templates\normal.py
751
752
753
754
@auto_prop_cached
def pinlines_group(self) -> LayerSet:
    """LayerSet: Pinlines and textbox combined."""
    return psd.getLayerSet(LAYERS.PINLINES_TEXTBOX)

pinlines_groups() -> list[LayerSet]

list[LayerSet]: Return empty if no pinlines colors provided.

Source code in src\templates\normal.py
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
@auto_prop_cached
def pinlines_groups(self) -> list[LayerSet]:
    """list[LayerSet]: Return empty if no pinlines colors provided."""
    if not self.pinlines_colors:
        return []

    # Two main pinlines groups
    groups: list[LayerSet] = [
        psd.getLayerSet("Pinlines Top", self.pinlines_group),
        psd.getLayerSet("Pinlines Bottom", self.pinlines_group)
    ]

    # Add the crown pinlines if needed
    if self.is_legendary:
        groups.append(psd.getLayerSet(LAYERS.PINLINES, LAYERS.LEGENDARY_CROWN))
    return groups

pinlines_shape() -> Optional[LayerSet]

Pinlines are only provided for Land and Artifact cards.

Source code in src\templates\normal.py
797
798
799
800
801
802
803
804
805
@auto_prop_cached
def pinlines_shape(self) -> Optional[LayerSet]:
    """Pinlines are only provided for Land and Artifact cards."""
    if not self.pinlines_groups:
        return
    return psd.getLayer(
        LAYERS.TRANSFORM_FRONT if self.is_transform and self.is_front else LAYERS.NORMAL,
        [self.pinlines_groups[0], LAYERS.SHAPE]
    )

pt_colors() -> str

Source code in src\templates\normal.py
699
700
701
702
703
704
@auto_prop_cached
def pt_colors(self) -> str:
    """str: Single layer name, use last color for hybrid cards."""
    if not self.gold_pt and 0 < len(self.background_colors) < self.color_limit:
        return self.background_colors[-1]
    return self.twins

pt_reference() -> Optional[ArtLayer]

Support alternate reference for flipside PT.

Source code in src\templates\normal.py
816
817
818
819
820
821
822
@auto_prop_cached
def pt_reference(self) -> Optional[ArtLayer]:
    """Support alternate reference for flipside PT."""
    return psd.getLayer(
        f'{LAYERS.PT_REFERENCE} Flip' if (
                self.is_transform and self.is_front and self.is_flipside_creature
        ) else LAYERS.PT_REFERENCE, self.text_group)

text_layers_transform_back() -> None

No back-side text changes.

Source code in src\templates\normal.py
857
858
859
def text_layers_transform_back(self) -> None:
    """No back-side text changes."""
    pass

textbox_colors() -> list[str]

list[str]: Only blend textbox colors for hybrid and land cards.

Source code in src\templates\normal.py
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
@auto_prop_cached
def textbox_colors(self) -> list[str]:
    """list[str]: Only blend textbox colors for hybrid and land cards."""
    if self.is_land:
        # Within color limit
        if 1 < len(self.identity) < self.color_limit:
            return [f'{n} {LAYERS.LAND}' for n in self.identity]
        # 1 Color limit
        if len(self.identity) == 2:
            return [f'{LAYERS.GOLD} {LAYERS.LAND}']
        # Plain land background
        if self.pinlines == LAYERS.LAND:
            return [LAYERS.LAND]
        # All other land backgrounds
        return [f"{self.pinlines} {LAYERS.LAND}"]
    # Hybrid cards
    if self.is_hybrid:
        # Within color limit
        if 1 < len(self.identity) < self.color_limit:
            return list(self.identity)
        # 1 Color limit
        if len(self.identity) == 2:
            return [LAYERS.GOLD]
        return [self.pinlines]
    # Just one layer
    return [self.background]

textbox_group() -> LayerSet

Source code in src\templates\normal.py
773
774
775
776
777
778
779
780
@auto_prop_cached
def textbox_group(self) -> LayerSet:
    """LayerSet: Must apply correct layer effects."""
    group = psd.getLayerSet(LAYERS.TEXTBOX, self.pinlines_group)
    psd.copy_layer_fx(
        psd.getLayer("EFFECTS LAND" if self.pinlines_colors else "EFFECTS", group),
        group)
    return group

textbox_reference() -> Optional[ArtLayer]

Use smaller Textbox Reference if Pinlines are added.

Source code in src\templates\normal.py
824
825
826
827
828
829
830
@auto_prop_cached
def textbox_reference(self) -> Optional[ArtLayer]:
    """Use smaller Textbox Reference if Pinlines are added."""
    return psd.get_reference_layer(
        f"{LAYERS.TEXTBOX_REFERENCE} {LAYERS.PINLINES}"
        if self.pinlines_colors else LAYERS.TEXTBOX_REFERENCE,
        self.text_group)