Compare commits
No commits in common. "c181c4f70b50059535c487d2ea6e5ab73ad11637" and "67143708bcc07304aa82129895dcd72ad398e8c8" have entirely different histories.
c181c4f70b
...
67143708bc
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 72 KiB |
@ -1,35 +0,0 @@
|
|||||||
[remap]
|
|
||||||
|
|
||||||
importer="texture"
|
|
||||||
type="StreamTexture"
|
|
||||||
path="res://.import/DiceInputBold.png-dc499cd822102d68e5e44449ce5835a3.stex"
|
|
||||||
metadata={
|
|
||||||
"vram_texture": false
|
|
||||||
}
|
|
||||||
|
|
||||||
[deps]
|
|
||||||
|
|
||||||
source_file="res://Assets/DiceInputBold.png"
|
|
||||||
dest_files=[ "res://.import/DiceInputBold.png-dc499cd822102d68e5e44449ce5835a3.stex" ]
|
|
||||||
|
|
||||||
[params]
|
|
||||||
|
|
||||||
compress/mode=0
|
|
||||||
compress/lossy_quality=0.7
|
|
||||||
compress/hdr_mode=0
|
|
||||||
compress/bptc_ldr=0
|
|
||||||
compress/normal_map=0
|
|
||||||
flags/repeat=0
|
|
||||||
flags/filter=true
|
|
||||||
flags/mipmaps=false
|
|
||||||
flags/anisotropic=false
|
|
||||||
flags/srgb=2
|
|
||||||
process/fix_alpha_border=true
|
|
||||||
process/premult_alpha=false
|
|
||||||
process/HDR_as_SRGB=false
|
|
||||||
process/invert_color=false
|
|
||||||
process/normal_map_invert_y=false
|
|
||||||
stream=false
|
|
||||||
size_limit=0
|
|
||||||
detect_3d=true
|
|
||||||
svg/scale=1.0
|
|
@ -1,5 +1,4 @@
|
|||||||
extends Node
|
extends Node
|
||||||
class_name Card
|
|
||||||
|
|
||||||
signal return_dice(dice_number)
|
signal return_dice(dice_number)
|
||||||
signal do_movement(movement_range)
|
signal do_movement(movement_range)
|
||||||
@ -7,7 +6,7 @@ signal do_damage(damage, damage_range)
|
|||||||
signal do_effect(effect, effect_range)
|
signal do_effect(effect, effect_range)
|
||||||
signal card_removed(card_self)
|
signal card_removed(card_self)
|
||||||
|
|
||||||
export (Resource) var card_info = preload("res://Assets/CardDB/Default.tres")
|
export (Resource) var card_info
|
||||||
|
|
||||||
var input_dice = []
|
var input_dice = []
|
||||||
var addition_dice_amount = card_info.addition_amount
|
var addition_dice_amount = card_info.addition_amount
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
tool
|
|
||||||
extends Control
|
|
||||||
|
|
||||||
const TYPE_COLORS = [
|
|
||||||
Color("#db4758"), # DAMAGE
|
|
||||||
Color("#3cc361"), # UTILITY
|
|
||||||
Color("#bcb64f"), # SPECIAL
|
|
||||||
Color("#bc5ec6"), # EFFECT
|
|
||||||
Color("#a4a4a4"), # MOVEMENT
|
|
||||||
]
|
|
||||||
|
|
||||||
const input_dice_view = preload("res://UI/InputDiceView.tscn")
|
|
||||||
var input_dice_views = []
|
|
||||||
|
|
||||||
var card : Card = Card.new() setget update_cardview
|
|
||||||
|
|
||||||
|
|
||||||
func _ready():
|
|
||||||
update_cardview()
|
|
||||||
|
|
||||||
|
|
||||||
func update_cardview(new_card = null):
|
|
||||||
|
|
||||||
# allow the update card function to work with and without setget
|
|
||||||
if 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)
|
|
||||||
card_style.set_bg_color(TYPE_COLORS[card.card_info.type])
|
|
||||||
$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
|
|
||||||
|
|
||||||
# add the correct number of input dice views
|
|
||||||
for i in card.card_info.number_of_dice:
|
|
||||||
add_input_dice_view()
|
|
||||||
|
|
||||||
# set the extra info
|
|
||||||
var extra_text = ""
|
|
||||||
if card.card_info.addition_dice == true:
|
|
||||||
# set the dice to have the remaining addition
|
|
||||||
extra_text = str(card.addition_dice_amount)
|
|
||||||
|
|
||||||
else:
|
|
||||||
# set the dice to have a list of accepted dice
|
|
||||||
for dice in card.card_info.accepted_dice:
|
|
||||||
extra_text += str(dice) + ", "
|
|
||||||
extra_text = extra_text.trim_suffix(", ")
|
|
||||||
|
|
||||||
for i in input_dice_views:
|
|
||||||
i.set_extra_info(extra_text)
|
|
||||||
|
|
||||||
# set bold dice if addition dice
|
|
||||||
for i in input_dice_views:
|
|
||||||
i.bold = true
|
|
||||||
|
|
||||||
|
|
||||||
# add an input_dice_view to the array (for easy management)
|
|
||||||
# and to the autogrid
|
|
||||||
func add_input_dice_view():
|
|
||||||
var dice_view = input_dice_view.instance()
|
|
||||||
input_dice_views.append(dice_view)
|
|
||||||
$"%AutoGrid".add_child(dice_view)
|
|
@ -1,10 +1,11 @@
|
|||||||
[gd_scene load_steps=8 format=2]
|
[gd_scene load_steps=10 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://UI/CardView.gd" type="Script" id=1]
|
[ext_resource path="res://Assets/Metropolis-font/Metropolis-Medium.ttf" type="DynamicFontData" id=2]
|
||||||
[ext_resource path="res://Assets/Metropolis-font/Metropolis-Bold.ttf" type="DynamicFontData" id=4]
|
[ext_resource path="res://Assets/Metropolis-font/Metropolis-Bold.ttf" type="DynamicFontData" id=4]
|
||||||
|
[ext_resource path="res://Assets/DiceInput.png" type="Texture" id=5]
|
||||||
[ext_resource path="res://AutoGridContainer - Full Version/AutoGridContainer.tscn" type="PackedScene" id=6]
|
[ext_resource path="res://AutoGridContainer - Full Version/AutoGridContainer.tscn" type="PackedScene" id=6]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id=6]
|
[sub_resource type="StyleBoxFlat" id=8]
|
||||||
bg_color = Color( 0.858824, 0.278431, 0.345098, 1 )
|
bg_color = Color( 0.858824, 0.278431, 0.345098, 1 )
|
||||||
corner_radius_top_left = 20
|
corner_radius_top_left = 20
|
||||||
corner_radius_top_right = 20
|
corner_radius_top_right = 20
|
||||||
@ -19,6 +20,11 @@ size = 30
|
|||||||
use_filter = true
|
use_filter = true
|
||||||
font_data = SubResource( 4 )
|
font_data = SubResource( 4 )
|
||||||
|
|
||||||
|
[sub_resource type="DynamicFont" id=7]
|
||||||
|
size = 64
|
||||||
|
use_filter = true
|
||||||
|
font_data = ExtResource( 2 )
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=5]
|
[sub_resource type="DynamicFont" id=5]
|
||||||
size = 20
|
size = 20
|
||||||
use_filter = true
|
use_filter = true
|
||||||
@ -27,16 +33,13 @@ font_data = ExtResource( 4 )
|
|||||||
[node name="CardView" type="Control"]
|
[node name="CardView" type="Control"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
margin_right = -965.0
|
|
||||||
margin_bottom = -325.0
|
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
script = ExtResource( 1 )
|
|
||||||
|
|
||||||
[node name="Background" type="PanelContainer" parent="."]
|
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
custom_styles/panel = SubResource( 6 )
|
custom_styles/panel = SubResource( 8 )
|
||||||
|
|
||||||
[node name="VBox" type="VBoxContainer" parent="."]
|
[node name="VBox" type="VBoxContainer" parent="."]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
@ -47,7 +50,7 @@ margin_right = -10.0
|
|||||||
margin_bottom = -10.0
|
margin_bottom = -10.0
|
||||||
|
|
||||||
[node name="Name" type="Label" parent="VBox"]
|
[node name="Name" type="Label" parent="VBox"]
|
||||||
margin_right = 295.0
|
margin_right = 1260.0
|
||||||
margin_bottom = 31.0
|
margin_bottom = 31.0
|
||||||
custom_fonts/font = SubResource( 2 )
|
custom_fonts/font = SubResource( 2 )
|
||||||
text = "Default"
|
text = "Default"
|
||||||
@ -55,15 +58,36 @@ align = 1
|
|||||||
autowrap = true
|
autowrap = true
|
||||||
|
|
||||||
[node name="AutoGrid" parent="VBox" instance=ExtResource( 6 )]
|
[node name="AutoGrid" parent="VBox" instance=ExtResource( 6 )]
|
||||||
unique_name_in_owner = true
|
|
||||||
margin_top = 35.0
|
margin_top = 35.0
|
||||||
margin_right = 295.0
|
margin_right = 1260.0
|
||||||
margin_bottom = 281.0
|
margin_bottom = 606.0
|
||||||
|
|
||||||
|
[node name="InputDice0" type="TextureRect" parent="VBox/AutoGrid"]
|
||||||
|
margin_left = 42.0
|
||||||
|
margin_top = 5.0
|
||||||
|
margin_right = 192.0
|
||||||
|
margin_bottom = 155.0
|
||||||
|
rect_min_size = Vector2( 75, 75 )
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
texture = ExtResource( 5 )
|
||||||
|
expand = true
|
||||||
|
stretch_mode = 6
|
||||||
|
|
||||||
|
[node name="Number" type="Label" parent="VBox/AutoGrid/InputDice0"]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||||
|
custom_fonts/font = SubResource( 7 )
|
||||||
|
align = 1
|
||||||
|
valign = 1
|
||||||
|
|
||||||
[node name="Description" type="Label" parent="VBox"]
|
[node name="Description" type="Label" parent="VBox"]
|
||||||
margin_top = 285.0
|
margin_top = 610.0
|
||||||
margin_right = 295.0
|
margin_right = 1260.0
|
||||||
margin_bottom = 375.0
|
margin_bottom = 700.0
|
||||||
rect_min_size = Vector2( 0, 90 )
|
rect_min_size = Vector2( 0, 90 )
|
||||||
custom_fonts/font = SubResource( 5 )
|
custom_fonts/font = SubResource( 5 )
|
||||||
text = "Default Description"
|
text = "Default Description"
|
||||||
|
@ -1,25 +1,9 @@
|
|||||||
tool
|
tool
|
||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
export var bold : bool setget set_bold
|
|
||||||
|
|
||||||
|
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
|
|
||||||
# update the pivot offset to make sure the object's animations
|
# update the pivot offset to make sure the object's animations
|
||||||
# are always centered
|
# are always centered
|
||||||
$Sprite.rect_pivot_offset = rect_size/2
|
$Sprite.rect_pivot_offset = rect_size/2
|
||||||
$Particles2D.position = rect_size/2
|
$Particles2D.position = rect_size/2
|
||||||
|
|
||||||
|
|
||||||
func set_extra_info(text : String):
|
|
||||||
$"%ExtraInfo".text = text
|
|
||||||
|
|
||||||
|
|
||||||
func set_bold(is_bold : bool = true):
|
|
||||||
if is_bold:
|
|
||||||
$Sprite.texture = load("res://Assets/DiceInputBold.png")
|
|
||||||
else:
|
|
||||||
$Sprite.texture = load("res://Assets/DiceInput.png")
|
|
||||||
|
|
||||||
bold = is_bold
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[gd_scene load_steps=10 format=2]
|
[gd_scene load_steps=10 format=2]
|
||||||
|
|
||||||
[ext_resource path="res://Assets/Metropolis-font/Metropolis-SemiBold.ttf" type="DynamicFontData" id=1]
|
[ext_resource path="res://Assets/Metropolis-font/Metropolis-Medium.ttf" type="DynamicFontData" id=1]
|
||||||
[ext_resource path="res://Assets/DiceInput.png" type="Texture" id=2]
|
[ext_resource path="res://Assets/DiceInput.png" type="Texture" id=2]
|
||||||
[ext_resource path="res://UI/InputDiceView.gd" type="Script" id=3]
|
[ext_resource path="res://UI/InputDiceView.gd" type="Script" id=3]
|
||||||
|
|
||||||
@ -114,9 +114,6 @@ tracks/2/keys = {
|
|||||||
[node name="InputDiceView" type="Control"]
|
[node name="InputDiceView" type="Control"]
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
rect_min_size = Vector2( 75, 75 )
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
size_flags_vertical = 3
|
|
||||||
script = ExtResource( 3 )
|
script = ExtResource( 3 )
|
||||||
|
|
||||||
[node name="Particles2D" type="Particles2D" parent="."]
|
[node name="Particles2D" type="Particles2D" parent="."]
|
||||||
@ -130,18 +127,7 @@ speed_scale = 2.0
|
|||||||
process_material = SubResource( 12 )
|
process_material = SubResource( 12 )
|
||||||
texture = ExtResource( 2 )
|
texture = ExtResource( 2 )
|
||||||
|
|
||||||
[node name="Sprite" type="TextureRect" parent="."]
|
|
||||||
anchor_right = 1.0
|
|
||||||
anchor_bottom = 1.0
|
|
||||||
rect_pivot_offset = Vector2( 640, 360 )
|
|
||||||
size_flags_horizontal = 3
|
|
||||||
size_flags_vertical = 3
|
|
||||||
texture = ExtResource( 2 )
|
|
||||||
expand = true
|
|
||||||
stretch_mode = 6
|
|
||||||
|
|
||||||
[node name="ExtraInfo" type="Label" parent="."]
|
[node name="ExtraInfo" type="Label" parent="."]
|
||||||
unique_name_in_owner = true
|
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
@ -151,6 +137,17 @@ custom_fonts/font = SubResource( 7 )
|
|||||||
align = 1
|
align = 1
|
||||||
valign = 1
|
valign = 1
|
||||||
|
|
||||||
|
[node name="Sprite" type="TextureRect" parent="."]
|
||||||
|
anchor_right = 1.0
|
||||||
|
anchor_bottom = 1.0
|
||||||
|
rect_min_size = Vector2( 75, 75 )
|
||||||
|
rect_pivot_offset = Vector2( 640, 360 )
|
||||||
|
size_flags_horizontal = 3
|
||||||
|
size_flags_vertical = 3
|
||||||
|
texture = ExtResource( 2 )
|
||||||
|
expand = true
|
||||||
|
stretch_mode = 6
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
anims/Disappear = SubResource( 8 )
|
anims/Disappear = SubResource( 8 )
|
||||||
anims/RESET = SubResource( 9 )
|
anims/RESET = SubResource( 9 )
|
||||||
|
@ -9,11 +9,6 @@
|
|||||||
config_version=4
|
config_version=4
|
||||||
|
|
||||||
_global_script_classes=[ {
|
_global_script_classes=[ {
|
||||||
"base": "Node",
|
|
||||||
"class": "Card",
|
|
||||||
"language": "GDScript",
|
|
||||||
"path": "res://UI/Card.gd"
|
|
||||||
}, {
|
|
||||||
"base": "Resource",
|
"base": "Resource",
|
||||||
"class": "CardResource",
|
"class": "CardResource",
|
||||||
"language": "GDScript",
|
"language": "GDScript",
|
||||||
@ -25,7 +20,6 @@ _global_script_classes=[ {
|
|||||||
"path": "res://Characters/Character.gd"
|
"path": "res://Characters/Character.gd"
|
||||||
} ]
|
} ]
|
||||||
_global_script_class_icons={
|
_global_script_class_icons={
|
||||||
"Card": "",
|
|
||||||
"CardResource": "",
|
"CardResource": "",
|
||||||
"Character": ""
|
"Character": ""
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user