fixes merge conflicts
This commit is contained in:
commit
04ae9b856b
21
caching.gd
21
caching.gd
@ -9,12 +9,13 @@ var _emitted_done = 0
|
|||||||
signal fetch_start
|
signal fetch_start
|
||||||
var _emitted_start = 0
|
var _emitted_start = 0
|
||||||
|
|
||||||
|
|
||||||
var _consts = preload("res://data/consts.gd")
|
var _consts = preload("res://data/consts.gd")
|
||||||
|
|
||||||
|
|
||||||
func _all_downloads_done() -> bool:
|
func _all_downloads_done() -> bool:
|
||||||
return _emitted_done == _emitted_start
|
return _emitted_done == _emitted_start
|
||||||
|
|
||||||
|
|
||||||
func _setup_cache_in_mem():
|
func _setup_cache_in_mem():
|
||||||
var file = FileAccess.open("user://bulk.json", FileAccess.READ)
|
var file = FileAccess.open("user://bulk.json", FileAccess.READ)
|
||||||
_bulk_data = JSON.parse_string(file.get_as_text())
|
_bulk_data = JSON.parse_string(file.get_as_text())
|
||||||
@ -34,14 +35,16 @@ func setup() -> Error:
|
|||||||
_setup_cache_in_mem()
|
_setup_cache_in_mem()
|
||||||
return OK
|
return OK
|
||||||
|
|
||||||
|
|
||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
_req_headers = PackedStringArray(["User-Agent: " + _consts.APP_NAME + "/" + _consts.APP_VERSION, "Accept: */*"])
|
_req_headers = PackedStringArray(
|
||||||
|
["User-Agent: " + _consts.APP_NAME + "/" + _consts.APP_VERSION, "Accept: */*"]
|
||||||
|
)
|
||||||
|
|
||||||
fetch_done.connect(_on_end_emit)
|
fetch_done.connect(_on_end_emit)
|
||||||
fetch_start.connect(_on_start_emit)
|
fetch_start.connect(_on_start_emit)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_start_emit() -> void:
|
func _on_start_emit() -> void:
|
||||||
_emitted_start += 1
|
_emitted_start += 1
|
||||||
|
|
||||||
@ -49,6 +52,7 @@ func _on_start_emit() -> void:
|
|||||||
func _on_end_emit() -> void:
|
func _on_end_emit() -> void:
|
||||||
_emitted_done += 1
|
_emitted_done += 1
|
||||||
|
|
||||||
|
|
||||||
func has_emitted_all() -> bool:
|
func has_emitted_all() -> bool:
|
||||||
return _emitted_start == _emitted_done
|
return _emitted_start == _emitted_done
|
||||||
|
|
||||||
@ -63,6 +67,7 @@ func _get_dict_from_file(filepath: String) -> Dictionary:
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
## get_card_data_from_name
|
## get_card_data_from_name
|
||||||
##
|
##
|
||||||
## _name: String [br]
|
## _name: String [br]
|
||||||
@ -123,6 +128,7 @@ func _get_card_data_from_bulk(dict_entry: Dictionary) -> Dictionary:
|
|||||||
|
|
||||||
return dict_entry
|
return dict_entry
|
||||||
|
|
||||||
|
|
||||||
func _fetch_card_img(data: Dictionary) -> Error:
|
func _fetch_card_img(data: Dictionary) -> Error:
|
||||||
fetch_start.emit()
|
fetch_start.emit()
|
||||||
if FileAccess.file_exists("user://card_cache/" + data["id"] + "card.png"):
|
if FileAccess.file_exists("user://card_cache/" + data["id"] + "card.png"):
|
||||||
@ -154,14 +160,13 @@ func _fetch_card_img(data: Dictionary) -> Error:
|
|||||||
|
|
||||||
return OK
|
return OK
|
||||||
|
|
||||||
|
|
||||||
func get_bulk_data(force: bool) -> Error:
|
func get_bulk_data(force: bool) -> Error:
|
||||||
if FileAccess.file_exists("user://bulk.json"):
|
if FileAccess.file_exists("user://bulk.json"):
|
||||||
if force:
|
if force:
|
||||||
DirAccess.remove_absolute("user://bulk.json")
|
DirAccess.remove_absolute("user://bulk.json")
|
||||||
else:
|
else:
|
||||||
return OK
|
return OK
|
||||||
print("downloading ")
|
|
||||||
|
|
||||||
var httpr = HTTPRequest.new()
|
var httpr = HTTPRequest.new()
|
||||||
add_child(httpr)
|
add_child(httpr)
|
||||||
|
|
||||||
@ -181,7 +186,6 @@ func get_bulk_data(force: bool) -> Error:
|
|||||||
push_error(_cache_error("PARSING") + "Failed to parse the Scryfall card results.")
|
push_error(_cache_error("PARSING") + "Failed to parse the Scryfall card results.")
|
||||||
return FAILED
|
return FAILED
|
||||||
|
|
||||||
|
|
||||||
error = httpr.request(card_content["download_uri"], _req_headers)
|
error = httpr.request(card_content["download_uri"], _req_headers)
|
||||||
if error != OK:
|
if error != OK:
|
||||||
push_error(_cache_error("GET_REQUEST") + "An error occurred in the Scryfall request.")
|
push_error(_cache_error("GET_REQUEST") + "An error occurred in the Scryfall request.")
|
||||||
@ -206,7 +210,10 @@ func get_bulk_data(force: bool) -> Error:
|
|||||||
|
|
||||||
return OK
|
return OK
|
||||||
|
|
||||||
|
|
||||||
func _notification(what):
|
func _notification(what):
|
||||||
if what == NOTIFICATION_PREDELETE:
|
if what == NOTIFICATION_PREDELETE:
|
||||||
if !_all_downloads_done():
|
if !_all_downloads_done():
|
||||||
push_error("ERR::MEM::CACHE\nCache being deleted before all threads have finished processing!")
|
push_error(
|
||||||
|
"ERR::MEM::CACHE\nCache being deleted before all threads have finished processing!"
|
||||||
|
)
|
||||||
|
11
card.tscn
11
card.tscn
@ -1,11 +0,0 @@
|
|||||||
[gd_scene load_steps=2 format=3 uid="uid://cah3mvdnom1xg"]
|
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://b3yqd1qu7dyq" path="res://card.gd" id="1_kikvd"]
|
|
||||||
|
|
||||||
[node name="Card" type="TextureRect"]
|
|
||||||
offset_left = 794.0
|
|
||||||
offset_top = 79.0
|
|
||||||
offset_right = 919.0
|
|
||||||
offset_bottom = 254.0
|
|
||||||
mouse_default_cursor_shape = 2
|
|
||||||
script = ExtResource("1_kikvd")
|
|
@ -4,6 +4,7 @@ var _caching = preload("res://caching.gd")
|
|||||||
|
|
||||||
var _decklist
|
var _decklist
|
||||||
|
|
||||||
|
|
||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
_decklist = Dictionary()
|
_decklist = Dictionary()
|
||||||
|
|
||||||
@ -62,7 +63,6 @@ func _do_decklist_cache(_queries: Dictionary) -> void:
|
|||||||
push_error("Failed to find card: " + query)
|
push_error("Failed to find card: " + query)
|
||||||
continue
|
continue
|
||||||
_decklist[entry["id"]] = _queries[query]
|
_decklist[entry["id"]] = _queries[query]
|
||||||
|
|
||||||
cache.fetch_done.connect(_do_free.bind(cache))
|
cache.fetch_done.connect(_do_free.bind(cache))
|
||||||
|
|
||||||
|
|
||||||
|
4
field.gd
4
field.gd
@ -3,7 +3,7 @@ extends TextureRect
|
|||||||
var _screen_size: Vector2
|
var _screen_size: Vector2
|
||||||
var _colors: Array[Color]
|
var _colors: Array[Color]
|
||||||
|
|
||||||
var _card_scene = preload("res://card.tscn")
|
var _card_class = preload("res://scenes/card/card.tscn")
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
@ -11,7 +11,7 @@ func _ready() -> void:
|
|||||||
# TODO: Calculate this field's scale and position based on which no# field this is.
|
# TODO: Calculate this field's scale and position based on which no# field this is.
|
||||||
_screen_size = get_viewport_rect().size
|
_screen_size = get_viewport_rect().size
|
||||||
|
|
||||||
var card = _card_scene.instantiate()
|
var card = _card_class.instantiate()
|
||||||
|
|
||||||
# TODO: Currently working with an already-cached card with a known ID to load this.
|
# TODO: Currently working with an already-cached card with a known ID to load this.
|
||||||
# Later on, the cards should be pulling the IDs directly from the library's list of IDs.
|
# Later on, the cards should be pulling the IDs directly from the library's list of IDs.
|
||||||
|
15
hand.gd
Normal file
15
hand.gd
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
extends StaticBody2D
|
||||||
|
|
||||||
|
var cards: Array[Node] = []
|
||||||
|
|
||||||
|
var _card_class = preload("res://scenes/card/card.tscn")
|
||||||
|
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
pass
|
1
hand.gd.uid
Normal file
1
hand.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://dvu4gdhqjejeo
|
@ -19,6 +19,7 @@ func _init(_decklist: Dictionary) -> void:
|
|||||||
for i in _num:
|
for i in _num:
|
||||||
lib_cards.push_back(card)
|
lib_cards.push_back(card)
|
||||||
|
|
||||||
|
|
||||||
func add_cards(cards: Array, top: bool) -> void:
|
func add_cards(cards: Array, top: bool) -> void:
|
||||||
for card in cards:
|
for card in cards:
|
||||||
add_card(card, top)
|
add_card(card, top)
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
extends Node2D
|
extends Node2D
|
||||||
|
|
||||||
var _card_class = preload("res://card.tscn")
|
var _card_class = preload("res://scenes/card/card.tscn")
|
||||||
|
|
||||||
var field_scene = preload("res://field.tscn")
|
var field_scene = preload("res://field.tscn")
|
||||||
var fields: Array[Node] = []
|
var fields: Array[Node] = []
|
||||||
|
|
||||||
var decks: Array[Dictionary]
|
var decks: Array[Dictionary]
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
# The first field in the array will be the player's own field.
|
# The first field in the array will be the player's own field.
|
||||||
|
13
player.tscn
13
player.tscn
@ -1,12 +1,21 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://cx0vga81xwckh"]
|
[gd_scene load_steps=5 format=3 uid="uid://cx0vga81xwckh"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://w2rqm1u7p7im" path="res://player.gd" id="1_4flbx"]
|
[ext_resource type="Script" uid="uid://w2rqm1u7p7im" path="res://player.gd" id="1_4flbx"]
|
||||||
|
[ext_resource type="Script" uid="uid://dvu4gdhqjejeo" path="res://hand.gd" id="2_i3pqv"]
|
||||||
[ext_resource type="Script" uid="uid://bc51go8t8uvts" path="res://library.gd" id="2_onrkg"]
|
[ext_resource type="Script" uid="uid://bc51go8t8uvts" path="res://library.gd" id="2_onrkg"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_onrkg"]
|
||||||
|
size = Vector2(1920, 200)
|
||||||
|
|
||||||
[node name="Player" type="Node2D"]
|
[node name="Player" type="Node2D"]
|
||||||
script = ExtResource("1_4flbx")
|
script = ExtResource("1_4flbx")
|
||||||
|
|
||||||
[node name="Hand" type="Node2D" parent="."]
|
[node name="Hand" type="StaticBody2D" parent="."]
|
||||||
|
script = ExtResource("2_i3pqv")
|
||||||
|
|
||||||
|
[node name="CollisionArea" type="CollisionShape2D" parent="Hand"]
|
||||||
|
position = Vector2(960, 980)
|
||||||
|
shape = SubResource("RectangleShape2D_onrkg")
|
||||||
|
|
||||||
[node name="Library" type="Node2D" parent="."]
|
[node name="Library" type="Node2D" parent="."]
|
||||||
script = ExtResource("2_onrkg")
|
script = ExtResource("2_onrkg")
|
||||||
|
@ -27,7 +27,7 @@ enabled=PackedStringArray()
|
|||||||
|
|
||||||
[input]
|
[input]
|
||||||
|
|
||||||
default_action={
|
MAIN={
|
||||||
"deadzone": 0.2,
|
"deadzone": 0.2,
|
||||||
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":32,"key_label":0,"unicode":32,"location":0,"echo":false,"script":null)
|
||||||
]
|
]
|
||||||
|
@ -1,80 +1,75 @@
|
|||||||
extends TextureRect
|
extends Node2D
|
||||||
#extends Sprite2D
|
|
||||||
## The card class
|
## The card class
|
||||||
##
|
##
|
||||||
## Represents an instance of a card to be displayed on the tabletop.
|
## Represents an instance of a card to be displayed on the tabletop.
|
||||||
## Contains helper text for the text, the cards ID, and the image path.
|
## Contains helper text for the text, the cards ID, and the image path.
|
||||||
|
|
||||||
enum pivot {
|
# Card information.
|
||||||
ROTATE_0,
|
|
||||||
ROTATE_90,
|
|
||||||
ROTATE_180,
|
|
||||||
ROTATE_270
|
|
||||||
}
|
|
||||||
|
|
||||||
var current_pivot = pivot.ROTATE_0
|
|
||||||
|
|
||||||
var card_id: String
|
var card_id: String
|
||||||
var card_name: String
|
var card_name: String
|
||||||
var card_type: String
|
var card_type: String
|
||||||
var oracle_text: String
|
var oracle_text: String
|
||||||
|
|
||||||
var is_dragging = false
|
# Card properties.
|
||||||
var is_pivot = false
|
var tapped: bool
|
||||||
|
|
||||||
|
# Card input state.
|
||||||
|
var is_focused: bool # Is the card a focus?
|
||||||
|
var is_dragging: bool # Is the card currently being dragged?
|
||||||
|
|
||||||
var delay = 5.0
|
|
||||||
var mouse_offset: Vector2
|
var mouse_offset: Vector2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _pivot() -> int:
|
|
||||||
var deg: int
|
|
||||||
match current_pivot:
|
|
||||||
pivot.ROTATE_0:
|
|
||||||
deg = 0
|
|
||||||
pivot.ROTATE_90:
|
|
||||||
deg = 90
|
|
||||||
pivot.ROTATE_180:
|
|
||||||
deg = 180
|
|
||||||
pivot.ROTATE_270:
|
|
||||||
deg = 270
|
|
||||||
return deg
|
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta: float) -> void:
|
func _physics_process(delta: float) -> void:
|
||||||
if is_dragging == true:
|
if is_focused:
|
||||||
var tween = get_tree().create_tween()
|
# TODO: Export handling keypresses to its own area.
|
||||||
tween.tween_property(self, "position", get_global_mouse_position() - mouse_offset, delay * delta)
|
if Input.is_action_just_pressed("MAIN"):
|
||||||
if is_pivot == true:
|
tapped = not tapped
|
||||||
var tween = get_tree().create_tween()
|
$TweenController.tap(tapped, delta)
|
||||||
tween.tween_property(self, "rotation_degrees", _pivot(), delta * delay)
|
|
||||||
is_pivot = false
|
if is_dragging:
|
||||||
|
$TweenController.move_to(get_global_mouse_position() - mouse_offset, delta)
|
||||||
|
|
||||||
|
|
||||||
func _gui_input(event: InputEvent) -> void:
|
func _on_input_event(viewport: Node, event: InputEvent, shape_idx: int) -> void:
|
||||||
if event is not InputEventMouseButton:
|
if event is not InputEventMouseButton:
|
||||||
return
|
return
|
||||||
|
|
||||||
match event.button_index:
|
match event.button_index:
|
||||||
|
# MOUSE BUTTONS
|
||||||
MOUSE_BUTTON_LEFT:
|
MOUSE_BUTTON_LEFT:
|
||||||
if event.pressed:
|
if event.pressed:
|
||||||
is_dragging = true
|
Input.set_default_cursor_shape(Input.CURSOR_DRAG)
|
||||||
mouse_offset = get_global_mouse_position() - global_position
|
mouse_offset = get_global_mouse_position() - global_position
|
||||||
|
is_dragging = true
|
||||||
else:
|
else:
|
||||||
|
Input.set_default_cursor_shape(Input.CURSOR_POINTING_HAND)
|
||||||
is_dragging = false
|
is_dragging = false
|
||||||
MOUSE_BUTTON_RIGHT:
|
MOUSE_BUTTON_RIGHT:
|
||||||
|
# TODO: Tooltip menu for right-button clicking on cards.
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
func _unhandled_key_input(event: InputEvent) -> void:
|
func _on_mouse_entered() -> void:
|
||||||
if not event.is_action_pressed("default_action"):
|
# Do not care about mouse entering if we're dragging the card.
|
||||||
|
if is_dragging:
|
||||||
return
|
return
|
||||||
if current_pivot == pivot.ROTATE_0:
|
|
||||||
current_pivot = pivot.ROTATE_90
|
Input.set_default_cursor_shape(Input.CURSOR_POINTING_HAND)
|
||||||
is_pivot = true
|
$TweenController.scale(1.05)
|
||||||
else:
|
is_focused = true
|
||||||
current_pivot = pivot.ROTATE_0
|
|
||||||
is_pivot = true
|
|
||||||
set_pivot_offset(size / 2)
|
func _on_mouse_exited() -> void:
|
||||||
|
# Do not care about mouse exiting if we're dragging the card.
|
||||||
|
if is_dragging:
|
||||||
|
return
|
||||||
|
|
||||||
|
Input.set_default_cursor_shape(Input.CURSOR_ARROW)
|
||||||
|
$TweenController.scale(1.0)
|
||||||
|
|
||||||
|
is_focused = false
|
||||||
|
|
||||||
|
|
||||||
func _card_error(error_type: String) -> String:
|
func _card_error(error_type: String) -> String:
|
||||||
return "ERROR::CARD::%s::%s::%s::\n" % [card_id, card_name, error_type]
|
return "ERROR::CARD::%s::%s::%s::\n" % [card_id, card_name, error_type]
|
||||||
@ -92,8 +87,6 @@ func _ready() -> void:
|
|||||||
# Setting that up can be put here later...
|
# Setting that up can be put here later...
|
||||||
push_error("Failed to load card.")
|
push_error("Failed to load card.")
|
||||||
|
|
||||||
set_pivot_offset(size / 2)
|
|
||||||
|
|
||||||
|
|
||||||
func _load_card() -> Error:
|
func _load_card() -> Error:
|
||||||
if _load_data() != OK:
|
if _load_data() != OK:
|
||||||
@ -140,16 +133,12 @@ func _load_image() -> Error:
|
|||||||
push_error("%sCard on-board image failed to load correctly" % _card_error("IMAGE"))
|
push_error("%sCard on-board image failed to load correctly" % _card_error("IMAGE"))
|
||||||
return FAILED
|
return FAILED
|
||||||
|
|
||||||
|
var size = $Area2D/CollisionShape2D.shape.size
|
||||||
# TODO: Get the size from the node or some constant variable.
|
|
||||||
image.resize(int(size.x), int(size.y), Image.INTERPOLATE_LANCZOS)
|
image.resize(int(size.x), int(size.y), Image.INTERPOLATE_LANCZOS)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var image_texture = ImageTexture.new()
|
var image_texture = ImageTexture.new()
|
||||||
image_texture.set_image(image)
|
image_texture.set_image(image)
|
||||||
|
|
||||||
#expand_mode = TextureRect.EXPAND_FIT_WIDTH
|
$Sprite2D.texture = image_texture
|
||||||
texture = image_texture
|
|
||||||
|
|
||||||
return OK
|
return OK
|
24
scenes/card/card.tscn
Normal file
24
scenes/card/card.tscn
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[gd_scene load_steps=4 format=3 uid="uid://cah3mvdnom1xg"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" uid="uid://b3yqd1qu7dyq" path="res://scenes/card/card.gd" id="1_kikvd"]
|
||||||
|
[ext_resource type="Script" uid="uid://bkk0pyypi1id7" path="res://scenes/card/tween.gd" id="2_imta7"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kikvd"]
|
||||||
|
size = Vector2(125, 175)
|
||||||
|
|
||||||
|
[node name="Card" type="Node2D"]
|
||||||
|
script = ExtResource("1_kikvd")
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
|
shape = SubResource("RectangleShape2D_kikvd")
|
||||||
|
|
||||||
|
[node name="TweenController" type="Node2D" parent="."]
|
||||||
|
script = ExtResource("2_imta7")
|
||||||
|
|
||||||
|
[connection signal="input_event" from="Area2D" to="." method="_on_input_event"]
|
||||||
|
[connection signal="mouse_entered" from="Area2D" to="." method="_on_mouse_entered"]
|
||||||
|
[connection signal="mouse_exited" from="Area2D" to="." method="_on_mouse_exited"]
|
0
scenes/card/input.gd
Normal file
0
scenes/card/input.gd
Normal file
1
scenes/card/input.gd.uid
Normal file
1
scenes/card/input.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://dhgk6fhw8oua0
|
22
scenes/card/tween.gd
Normal file
22
scenes/card/tween.gd
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
extends Node
|
||||||
|
|
||||||
|
@export var move_speed = 1.0
|
||||||
|
@export var tap_speed = 5.0
|
||||||
|
@export var scale_speed = 0.1
|
||||||
|
|
||||||
|
|
||||||
|
func move_to(location: Vector2, delta: float) -> void:
|
||||||
|
var tween = create_tween()
|
||||||
|
tween.tween_property(get_parent(), "position", location, delta * move_speed)
|
||||||
|
|
||||||
|
|
||||||
|
func tap(tapped: bool, delta: float) -> void:
|
||||||
|
var tween = create_tween()
|
||||||
|
var rotation = 90 if tapped else 0
|
||||||
|
tween.tween_property(get_parent(), "rotation_degrees", rotation, delta * tap_speed)
|
||||||
|
|
||||||
|
|
||||||
|
func scale(scalar: float) -> void:
|
||||||
|
var tween = create_tween()
|
||||||
|
var new_scale = Vector2.ONE * scalar
|
||||||
|
tween.tween_property(get_parent(), "scale", new_scale, scale_speed)
|
1
scenes/card/tween.gd.uid
Normal file
1
scenes/card/tween.gd.uid
Normal file
@ -0,0 +1 @@
|
|||||||
|
uid://bkk0pyypi1id7
|
@ -90,9 +90,11 @@ var cards = "1 Arcane Signet
|
|||||||
|
|
||||||
1 Clavileño, First of the Blessed"
|
1 Clavileño, First of the Blessed"
|
||||||
|
|
||||||
|
|
||||||
func _bulk_callback(cache) -> void:
|
func _bulk_callback(cache) -> void:
|
||||||
cache.setup()
|
cache.setup()
|
||||||
|
|
||||||
|
|
||||||
# Called when the node enters the scene tree for the first time.
|
# Called when the node enters the scene tree for the first time.
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
var cache = _caching.new()
|
var cache = _caching.new()
|
||||||
@ -107,11 +109,17 @@ func _ready() -> void:
|
|||||||
move_child(player, 0)
|
move_child(player, 0)
|
||||||
|
|
||||||
cache.get_card_data_from_name("1996 World Champion")
|
cache.get_card_data_from_name("1996 World Champion")
|
||||||
|
<<<<<<< HEAD
|
||||||
|
|
||||||
var deck = deck_input.new()
|
var deck = deck_input.new()
|
||||||
add_child(deck)
|
add_child(deck)
|
||||||
deck.add_new_deck(cards, "Blood rites")
|
deck.add_new_deck(cards, "Blood rites")
|
||||||
|
|
||||||
|
=======
|
||||||
|
|
||||||
|
# var deck = deck_input.new(cards)
|
||||||
|
# add_child(deck)
|
||||||
|
>>>>>>> card-rework
|
||||||
|
|
||||||
pass # Replace with function body.
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user