Completely refractor the project so the code isn't so terrible #7
@ -26,13 +26,13 @@ func update_cardview(new_card = null):
|
||||
card = new_card
|
||||
|
||||
# change the color of the panel to match the appropriate type
|
||||
var card_style = $Background.get('custom_styles/panel').duplicate(true)
|
||||
var card_style = $"%Background".get('custom_styles/panel').duplicate(true)
|
||||
card_style.set_bg_color(TYPE_COLORS[card.card_info.type])
|
||||
$Background.set('custom_styles/panel', card_style)
|
||||
$"%Background".set('custom_styles/panel', card_style)
|
||||
|
||||
# change the name and description
|
||||
$VBox/Name.text = card.card_info.name
|
||||
$VBox/Description.text = card.card_info.description
|
||||
$"%Name".text = card.card_info.name
|
||||
$"%Description".text = card.card_info.description
|
||||
|
||||
# add the correct number of input dice views
|
||||
for i in card.card_info.number_of_dice:
|
||||
|
@ -34,6 +34,7 @@ size_flags_vertical = 3
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Background" type="PanelContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
custom_styles/panel = SubResource( 6 )
|
||||
@ -47,6 +48,7 @@ margin_right = -10.0
|
||||
margin_bottom = -10.0
|
||||
|
||||
[node name="Name" type="Label" parent="VBox"]
|
||||
unique_name_in_owner = true
|
||||
margin_right = 295.0
|
||||
margin_bottom = 31.0
|
||||
custom_fonts/font = SubResource( 2 )
|
||||
@ -61,6 +63,7 @@ margin_right = 295.0
|
||||
margin_bottom = 281.0
|
||||
|
||||
[node name="Description" type="Label" parent="VBox"]
|
||||
unique_name_in_owner = true
|
||||
margin_top = 285.0
|
||||
margin_right = 295.0
|
||||
margin_bottom = 375.0
|
||||
|
Loading…
Reference in New Issue
Block a user