Skip to content

CardViewer

Divided by Zer0 edited this page Mar 9, 2022 · 2 revisions

CardViewer

Extends: PanelContainer

Description

The Card Viewer is a basic class which is responsible for displaying all cards available in the game, either for preview, or for deckbuilding

It is meant to be extended.

Property Descriptions

filter_button_properties

export var filter_button_properties: Array = ["Type"]

Set a property name defined in the cards. The deckbuilder will provide one button per distinct property of that name it discovers in your card base. This buttons can be toggled on/off for quick filtering

Only supports string properties. No tags or integers. Also, all cards Should have some value in this property. It is suggested this functionality is only used on properties with few distinct values.

Also, if more than 8 distrinct properties are found, this functionality will be skipped.

generation_keys

export var generation_keys: Array = []

Set a property name defined in the cards. The deckbuilder will provide one button per distinct property of that name it discovers in your card base. This buttons can be toggled on/off for quick filtering

Only supports string properties. No tags or integers. Also, all cards Should have some value in this property. It is suggested this functionality is only used on properties with few distinct values.

Also, if more than 8 distrinct properties are found, this functionality will be skipped. If a value in a card property is in this list, the Deckbuilder will call its value_generation method to attempt to generate the value according to the game's design. Make sure that the values specified will never match normal values for that property.

replacements

export var replacements: Dictionary = {}

Set a property name defined in the cards. The deckbuilder will provide one button per distinct property of that name it discovers in your card base. This buttons can be toggled on/off for quick filtering

Only supports string properties. No tags or integers. Also, all cards Should have some value in this property. It is suggested this functionality is only used on properties with few distinct values.

Also, if more than 8 distrinct properties are found, this functionality will be skipped. If a value in a card property is in this list, the Deckbuilder will call its value_generation method to attempt to generate the value according to the game's design. Make sure that the values specified will never match normal values for that property. See CardConfig.REPLACEMENTS. This allows for extra replacements in the card Viewer, if needed.

info_panel_scene

export var info_panel_scene = "[PackedScene:19410]"

Set a property name defined in the cards. The deckbuilder will provide one button per distinct property of that name it discovers in your card base. This buttons can be toggled on/off for quick filtering

Only supports string properties. No tags or integers. Also, all cards Should have some value in this property. It is suggested this functionality is only used on properties with few distinct values.

Also, if more than 8 distrinct properties are found, this functionality will be skipped. If a value in a card property is in this list, the Deckbuilder will call its value_generation method to attempt to generate the value according to the game's design. Make sure that the values specified will never match normal values for that property. See CardConfig.REPLACEMENTS. This allows for extra replacements in the card Viewer, if needed. The custom scene which displays the card when its name is hovered.

list_card_object_scene

export var list_card_object_scene = "[PackedScene:19396]"

Set a property name defined in the cards. The deckbuilder will provide one button per distinct property of that name it discovers in your card base. This buttons can be toggled on/off for quick filtering

Only supports string properties. No tags or integers. Also, all cards Should have some value in this property. It is suggested this functionality is only used on properties with few distinct values.

Also, if more than 8 distrinct properties are found, this functionality will be skipped. If a value in a card property is in this list, the Deckbuilder will call its value_generation method to attempt to generate the value according to the game's design. Make sure that the values specified will never match normal values for that property. See CardConfig.REPLACEMENTS. This allows for extra replacements in the card Viewer, if needed. The custom scene which displays the card when its name is hovered. We use this variable, so that the scene can be overriden with a custom one

grid_card_object_scene

export var grid_card_object_scene = "[PackedScene:19400]"

Set a property name defined in the cards. The deckbuilder will provide one button per distinct property of that name it discovers in your card base. This buttons can be toggled on/off for quick filtering

Only supports string properties. No tags or integers. Also, all cards Should have some value in this property. It is suggested this functionality is only used on properties with few distinct values.

Also, if more than 8 distrinct properties are found, this functionality will be skipped. If a value in a card property is in this list, the Deckbuilder will call its value_generation method to attempt to generate the value according to the game's design. Make sure that the values specified will never match normal values for that property. See CardConfig.REPLACEMENTS. This allows for extra replacements in the card Viewer, if needed. The custom scene which displays the card when its name is hovered. We use this variable, so that the scene can be overriden with a custom one We use this variable, so that the scene can be overriden with a custom one

custom_rich_text_effects

export var custom_rich_text_effects: Array = []

Set a property name defined in the cards. The deckbuilder will provide one button per distinct property of that name it discovers in your card base. This buttons can be toggled on/off for quick filtering

Only supports string properties. No tags or integers. Also, all cards Should have some value in this property. It is suggested this functionality is only used on properties with few distinct values.

Also, if more than 8 distrinct properties are found, this functionality will be skipped. If a value in a card property is in this list, the Deckbuilder will call its value_generation method to attempt to generate the value according to the game's design. Make sure that the values specified will never match normal values for that property. See CardConfig.REPLACEMENTS. This allows for extra replacements in the card Viewer, if needed. The custom scene which displays the card when its name is hovered. We use this variable, so that the scene can be overriden with a custom one We use this variable, so that the scene can be overriden with a custom one These are passed to the rich_text_labels used in the card list To use as part of the card info.

Method Descriptions

prepate_filter_buttons

func prepate_filter_buttons() -> void

Prepares the filter buttons based on the unique values in cards.

populate_available_cards

func populate_available_cards() -> void

Populates the list of available cards, with all defined cards in the game

prepare_card_grid

func prepare_card_grid(is_staggered: bool = false) -> var

Slowly loads all cards in to the grid We use a delay function between each card, to avoid freezing the game while instancing all the nodes

generate_value

func generate_value(property: String, card_properties: Dictionary)

Extend this class and call this function, when your game has a value field Which is suposed to be autogenerated in some fashion. warning-ignore:unused_argument warning-ignore:unused_argument