feat: icon colors, no faction for base, full base
release-tag / release-image (push) Successful in 14s

This commit is contained in:
2024-08-06 19:24:12 +02:00
parent 11dbcef970
commit 67c525a65f
2 changed files with 54 additions and 32 deletions
+34 -19
View File
@@ -360,16 +360,24 @@ def create_effect_row(effects: list[Effect], type: str, height: int, width: int)
if len(effect_with_icons) > 0: if len(effect_with_icons) > 0:
icon_y_pos = icon_y_pos - 15 icon_y_pos = icon_y_pos - 15
group.append( group.append(
dw.Text( dw.Group(
"ou", [
font_size=14, dw.Text(
x=width / 2, "ou",
y=text_y_pos-19, font_size=14,
text_anchor="middle", x=width / 2,
fill="black", y=text_y_pos-19,
font_family="Helvetica", text_anchor="middle",
font_style="italic", fill="black",
font_family="Helvetica",
font_style="italic",
),
],
**{
"v-bind:class": f"{{used:used_effects_indexes.length > 0}}"
}
) )
) )
text_y_pos = text_y_pos + 7 text_y_pos = text_y_pos + 7
elif len (effect_with_text) > 1: elif len (effect_with_text) > 1:
@@ -409,16 +417,23 @@ def create_effect_row(effects: list[Effect], type: str, height: int, width: int)
) )
if is_mutex and i!=0: if is_mutex and i!=0:
group.append( group.append(
dw.Text( dw.Group(
"ou", [
# x=(width/2) - ((len(effect_with_icons) - 1) * icon_radius * 1.5) + icon_radius + 10, dw.Text(
x=(width/2) - ((len(effect_with_icons) - 1) * icon_radius * 1.5) + icon_radius + 10 + ((i-1) * icon_radius * 3), "ou",
y=icon_y_pos + 3, # x=(width/2) - ((len(effect_with_icons) - 1) * icon_radius * 1.5) + icon_radius + 10,
text_anchor="middle", x=(width/2) - ((len(effect_with_icons) - 1) * icon_radius * 1.5) + icon_radius + 10 + ((i-1) * icon_radius * 3),
fill="black", y=icon_y_pos + 3,
font_size=12, text_anchor="middle",
font_family="Helvetica", fill="black",
), font_size=12,
font_family="Helvetica",
),
],
**{
"v-bind:class": f"{{used:used_effects_indexes.length > 0}}"
}
)
) )
return group return group
+20 -13
View File
@@ -41,7 +41,7 @@ cost_right_offset = 38
background_colors = { background_colors = {
"blue": "lightblue", "blue": "lightblue",
"red": "lightcoral", "red": "lightcoral",
"yellow": "rgb(206, 182, 167)", "yellow": "rgb(250, 229, 136)",
"green": "lightgreen", "green": "lightgreen",
"base": "lightgrey", "base": "lightgrey",
} }
@@ -56,12 +56,16 @@ gradient_colors = {
icon_colors = { icon_colors = {
"yellow": ["#ff9935", "#ffe744"], "yellow": ["#ff9935", "#ffe744"],
"blue": ["#ff9935", "#ffe744"], "blue": ["#3399ff", "#aa44ff"],
"red": ["#ff9935", "#ffe744"], "red": ["#ff99ff", "#ffe744"],
"green": ["#ff9935", "#ffe744"], "green": ["#009935", "#35dd35"],
"base": ["#ff9935", "#ffe744"], "base": ["#8899aa", "#aa9988"],
} }
fullscreen_card_ids = [
56, 57, 58, 59
]
shadowFilter = dw.Filter(id="drop-shadow") shadowFilter = dw.Filter(id="drop-shadow")
shadowFilter.append(dw.FilterItem("feDropShadow", dx=1, dy=1, stdDeviation=0)) shadowFilter.append(dw.FilterItem("feDropShadow", dx=1, dy=1, stdDeviation=0))
@@ -195,13 +199,14 @@ for card_data in cards:
) )
d.append(title) d.append(title)
# Draw faction icon # Draw faction icon if not a base card
d.append( if card_data['faction'] != 'base':
dw.Group( d.append(
children=[faction_icon], dw.Group(
transform=f"translate({border_width_x + 23 + 1},{border_width_y - border_upper_offset + 20 + 4 + 1})", children=[faction_icon],
transform=f"translate({border_width_x + 23 + 1},{border_width_y - border_upper_offset + 20 + 4 + 1})",
)
) )
)
# Draw card cost # Draw card cost
if card_data.get("cost") is not None: if card_data.get("cost") is not None:
d.append( d.append(
@@ -213,12 +218,13 @@ for card_data in cards:
# Draw image # Draw image
d.append(dw.Rectangle(x=1, y=65, width=x_width - 2, height=200)) d.append(dw.Rectangle(x=1, y=65, width=x_width - 2, height=200))
image_height = 200 if card_data['id'] not in fullscreen_card_ids else y_height - 65 - border_width_y
d.append( d.append(
dw.Image( dw.Image(
x=border_width_x, x=border_width_x,
y=65, y=65,
width=x_width - (border_width_x * 2), width=x_width - (border_width_x * 2),
height=200, height=image_height,
path=card_skin_data["image_path"], path=card_skin_data["image_path"],
preserveAspectRatio="xMidYMid slice", preserveAspectRatio="xMidYMid slice",
) )
@@ -237,11 +243,12 @@ for card_data in cards:
# Draw effects # Draw effects
effects = card_data.get("effects") effects = card_data.get("effects")
if effects is not None: if effects is not None:
effects_height = 265 if card_data['id'] not in fullscreen_card_ids else 220
effects = create_effects(effects=effects, height=135, width=x_internal_width) effects = create_effects(effects=effects, height=135, width=x_internal_width)
d.append( d.append(
dw.Group( dw.Group(
effects, effects,
transform=f"translate({border_width_x},{265})", transform=f"translate({border_width_x},{effects_height})",
) )
) )