From 9f9548abcf53573bf8be82889855bab1c3ff39e1 Mon Sep 17 00:00:00 2001 From: Sebastian Morr Date: Tue, 27 Oct 2020 13:14:07 +0100 Subject: [PATCH] Cards have images! --- cards/checkout.svg | 135 +++++++++++++ cards/checkout.svg.import | 34 ++++ cards/cherry-pick.svg | 189 ++++++++++++++++++ cards/cherry-pick.svg.import | 34 ++++ cards/commit-auto.svg | 145 ++++++++++++++ cards/commit-auto.svg.import | 34 ++++ cards/merge.svg | 157 +++++++++++++++ cards/merge.svg.import | 34 ++++ cards/pull.svg | 110 +++++++++++ cards/pull.svg.import | 34 ++++ cards/push.svg | 110 +++++++++++ cards/push.svg.import | 34 ++++ cards/rebase-interactive.svg | 161 +++++++++++++++ cards/rebase-interactive.svg.import | 34 ++++ cards/rebase.svg | 294 ++++++++++++++++++++++++++++ cards/rebase.svg.import | 34 ++++ cards/reset-hard.svg | 187 ++++++++++++++++++ cards/reset-hard.svg.import | 34 ++++ scenes/card.gd | 7 + scenes/card.tscn | 25 ++- scenes/cardgame.gd | 1 + scenes/cardgame.tscn | 1 - scenes/cards.tscn | 1 - 23 files changed, 1820 insertions(+), 9 deletions(-) create mode 100644 cards/checkout.svg create mode 100644 cards/checkout.svg.import create mode 100644 cards/cherry-pick.svg create mode 100644 cards/cherry-pick.svg.import create mode 100644 cards/commit-auto.svg create mode 100644 cards/commit-auto.svg.import create mode 100644 cards/merge.svg create mode 100644 cards/merge.svg.import create mode 100644 cards/pull.svg create mode 100644 cards/pull.svg.import create mode 100644 cards/push.svg create mode 100644 cards/push.svg.import create mode 100644 cards/rebase-interactive.svg create mode 100644 cards/rebase-interactive.svg.import create mode 100644 cards/rebase.svg create mode 100644 cards/rebase.svg.import create mode 100644 cards/reset-hard.svg create mode 100644 cards/reset-hard.svg.import diff --git a/cards/checkout.svg b/cards/checkout.svg new file mode 100644 index 0000000..8448572 --- /dev/null +++ b/cards/checkout.svg @@ -0,0 +1,135 @@ + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cards/checkout.svg.import b/cards/checkout.svg.import new file mode 100644 index 0000000..895efd6 --- /dev/null +++ b/cards/checkout.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/checkout.svg-3143aa02cfd5a2acddb95b1a75f60fe5.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/checkout.svg" +dest_files=[ "res://.import/checkout.svg-3143aa02cfd5a2acddb95b1a75f60fe5.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/cherry-pick.svg b/cards/cherry-pick.svg new file mode 100644 index 0000000..b78c23d --- /dev/null +++ b/cards/cherry-pick.svg @@ -0,0 +1,189 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cards/cherry-pick.svg.import b/cards/cherry-pick.svg.import new file mode 100644 index 0000000..3549183 --- /dev/null +++ b/cards/cherry-pick.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/cherry-pick.svg-b916c94f654b5af97f4a3dff68693e53.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/cherry-pick.svg" +dest_files=[ "res://.import/cherry-pick.svg-b916c94f654b5af97f4a3dff68693e53.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/commit-auto.svg b/cards/commit-auto.svg new file mode 100644 index 0000000..b7623ea --- /dev/null +++ b/cards/commit-auto.svg @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/cards/commit-auto.svg.import b/cards/commit-auto.svg.import new file mode 100644 index 0000000..51e7cfd --- /dev/null +++ b/cards/commit-auto.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/commit-auto.svg-3602bf004267ccb8cb830fe4f194c90f.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/commit-auto.svg" +dest_files=[ "res://.import/commit-auto.svg-3602bf004267ccb8cb830fe4f194c90f.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/merge.svg b/cards/merge.svg new file mode 100644 index 0000000..a9b5e8b --- /dev/null +++ b/cards/merge.svg @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/cards/merge.svg.import b/cards/merge.svg.import new file mode 100644 index 0000000..b96f40d --- /dev/null +++ b/cards/merge.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/merge.svg-5ff4b4b93d3f613b5ff54414397df67c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/merge.svg" +dest_files=[ "res://.import/merge.svg-5ff4b4b93d3f613b5ff54414397df67c.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/pull.svg b/cards/pull.svg new file mode 100644 index 0000000..14e48b9 --- /dev/null +++ b/cards/pull.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/cards/pull.svg.import b/cards/pull.svg.import new file mode 100644 index 0000000..15ab40d --- /dev/null +++ b/cards/pull.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/pull.svg-95e22c3c54690b0bb9cd734d753f8b7d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/pull.svg" +dest_files=[ "res://.import/pull.svg-95e22c3c54690b0bb9cd734d753f8b7d.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/push.svg b/cards/push.svg new file mode 100644 index 0000000..d771db2 --- /dev/null +++ b/cards/push.svg @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/cards/push.svg.import b/cards/push.svg.import new file mode 100644 index 0000000..aa6a9ff --- /dev/null +++ b/cards/push.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/push.svg-840b26c5fe96f5b0ec0b58d17f5f6ebf.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/push.svg" +dest_files=[ "res://.import/push.svg-840b26c5fe96f5b0ec0b58d17f5f6ebf.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/rebase-interactive.svg b/cards/rebase-interactive.svg new file mode 100644 index 0000000..e0463b7 --- /dev/null +++ b/cards/rebase-interactive.svg @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/cards/rebase-interactive.svg.import b/cards/rebase-interactive.svg.import new file mode 100644 index 0000000..a65c315 --- /dev/null +++ b/cards/rebase-interactive.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/rebase-interactive.svg-9bd40b291a9d619bf58504a61e1cbcf7.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/rebase-interactive.svg" +dest_files=[ "res://.import/rebase-interactive.svg-9bd40b291a9d619bf58504a61e1cbcf7.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/rebase.svg b/cards/rebase.svg new file mode 100644 index 0000000..e267912 --- /dev/null +++ b/cards/rebase.svg @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cards/rebase.svg.import b/cards/rebase.svg.import new file mode 100644 index 0000000..97241e1 --- /dev/null +++ b/cards/rebase.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/rebase.svg-52003a9e4e854e9c851cf2a6352e6205.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/rebase.svg" +dest_files=[ "res://.import/rebase.svg-52003a9e4e854e9c851cf2a6352e6205.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/cards/reset-hard.svg b/cards/reset-hard.svg new file mode 100644 index 0000000..ac78eb0 --- /dev/null +++ b/cards/reset-hard.svg @@ -0,0 +1,187 @@ + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cards/reset-hard.svg.import b/cards/reset-hard.svg.import new file mode 100644 index 0000000..199bee3 --- /dev/null +++ b/cards/reset-hard.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/reset-hard.svg-babcffb163a4c5606782673185f034cd.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://cards/reset-hard.svg" +dest_files=[ "res://.import/reset-hard.svg-babcffb163a4c5606782673185f034cd.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 +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/scenes/card.gd b/scenes/card.gd index 7e32ce6..7b5acde 100644 --- a/scenes/card.gd +++ b/scenes/card.gd @@ -5,6 +5,7 @@ var dragged = false var drag_offset export var arg_number = 0 +export var id = "" setget set_id export var command = "" setget set_command export var description = "" setget set_description export var energy = 0 setget set_energy @@ -79,6 +80,12 @@ func set_energy(new_energy): energy = new_energy if energy_label: energy_label.text = str(energy) + +func set_id(new_id): + id = new_id + var texture = load("res://cards/%s.svg" % new_id) + if texture: + $Image.texture = texture func move_back(): position = _home_position diff --git a/scenes/card.tscn b/scenes/card.tscn index 9284a2d..00fcf43 100644 --- a/scenes/card.tscn +++ b/scenes/card.tscn @@ -7,7 +7,6 @@ [ext_resource path="res://sounds/swoosh.wav" type="AudioStream" id=5] [ext_resource path="res://sounds/poof.wav" type="AudioStream" id=6] - [sub_resource type="StyleBoxFlat" id=1] bg_color = Color( 0.45098, 0.584314, 0.843137, 1 ) border_color = Color( 0.0627451, 0.141176, 0.176471, 1 ) @@ -66,9 +65,9 @@ shape = SubResource( 2 ) [node name="Label" type="Label" parent="."] margin_left = -89.0 -margin_top = -276.0 +margin_top = -279.0 margin_right = 85.0 -margin_bottom = -185.0 +margin_bottom = -184.0 custom_fonts/font = ExtResource( 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) text = "Name" @@ -79,7 +78,7 @@ __meta__ = { [node name="ColorRect2" type="Panel" parent="."] margin_left = -97.0 -margin_top = -169.0 +margin_top = -166.0 margin_right = 94.0 margin_bottom = -10.0 mouse_filter = 2 @@ -90,9 +89,9 @@ __meta__ = { [node name="Description" type="Label" parent="."] margin_left = -92.0 -margin_top = -164.0 -margin_right = 133.0 -margin_bottom = 23.0 +margin_top = -160.0 +margin_right = 146.0 +margin_bottom = 31.0 rect_scale = Vector2( 0.75, 0.75 ) custom_fonts/font = ExtResource( 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) @@ -132,5 +131,17 @@ volume_db = -6.848 [node name="ReturnSound" type="AudioStreamPlayer" parent="."] stream = ExtResource( 5 ) volume_db = -6.848 + +[node name="Image" type="TextureRect" parent="."] +margin_left = -88.0 +margin_top = -243.735 +margin_right = 85.0 +margin_bottom = -178.735 +mouse_filter = 2 +expand = true +stretch_mode = 6 +__meta__ = { +"_edit_use_anchors_": false +} [connection signal="mouse_entered" from="Area2D" to="." method="_mouse_entered"] [connection signal="mouse_exited" from="Area2D" to="." method="_mouse_exited"] diff --git a/scenes/cardgame.gd b/scenes/cardgame.gd index 1274205..6b5b307 100644 --- a/scenes/cardgame.gd +++ b/scenes/cardgame.gd @@ -35,6 +35,7 @@ func draw_rand_card(): func draw_card(card): var new_card = preload("res://scenes/card.tscn").instance() + new_card.id = card["id"] new_card.command = card["command"] new_card.arg_number = int(card["arg_number"]) new_card.description = card["description"] diff --git a/scenes/cardgame.tscn b/scenes/cardgame.tscn index 7dc69d0..eaed90f 100644 --- a/scenes/cardgame.tscn +++ b/scenes/cardgame.tscn @@ -6,7 +6,6 @@ [ext_resource path="res://scenes/terminal.tscn" type="PackedScene" id=5] [ext_resource path="res://fonts/big.tres" type="DynamicFont" id=6] - [node name="Cardgame" type="Node2D"] script = ExtResource( 4 ) diff --git a/scenes/cards.tscn b/scenes/cards.tscn index 109d7c8..b471bf5 100644 --- a/scenes/cards.tscn +++ b/scenes/cards.tscn @@ -14,7 +14,6 @@ __meta__ = { } [node name="Button" type="Button" parent="."] -visible = false anchor_left = 1.0 anchor_right = 1.0 margin_left = -172.0