Skip to content

Commit

Permalink
Merge pull request #309 from Teicsoft/goon-changes
Browse files Browse the repository at this point in the history
Some aestehtics, some balance, and combo glossary now sorts for combos in deck and highlights
  • Loading branch information
soma-code authored Feb 24, 2024
2 parents e7adaed + 489c4c9 commit dbd7f5d
Show file tree
Hide file tree
Showing 14 changed files with 235 additions and 24 deletions.
Binary file added assets/ui/9patchBorder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/ui/9patchBorder.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://b6l772dpx2bgq"
path="res://.godot/imported/9patchBorder.png-1c16dd6c3e7ce6ab4efb216c068ff4d4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/ui/9patchBorder.png"
dest_files=["res://.godot/imported/9patchBorder.png-1c16dd6c3e7ce6ab4efb216c068ff4d4.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
1 change: 1 addition & 0 deletions data/decks/deck_Player3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<card card_id="card_JudoThrow"/>
<card card_id="card_FullBlock"/>
<card card_id="card_FullBlock"/>
<card card_id="card_FullBlock"/>
</cards>
</deck>
1 change: 1 addition & 0 deletions data/decks/deck_Player4.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<card card_id="card_Trip"/>
<card card_id="card_ComeCloser"/>
<card card_id="card_ComeCloser"/>
<card card_id="card_ComeCloser"/>
<card card_id="card_Showoff"/>
<card card_id="card_Showoff"/>
<card card_id="card_reckless"/>
Expand Down
11 changes: 6 additions & 5 deletions data/decks/deck_Player6.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
<cards>
<card card_id="card_Spartackle"/> <!--card_id: string-->
<card card_id="card_Spartackle"/>
<card card_id="card_Lariat"/>
<card card_id="card_Lariat"/>
<card card_id="card_gladius"/>
<card card_id="card_Throw"/>
<card card_id="card_Lariat"/>
<card card_id="card_Lariat"/>
<card card_id="card_gladius"/>
<card card_id="card_gladius"/>
<card card_id="card_Throw"/>
<card card_id="card_kick"/>
<card card_id="card_kick"/>
<card card_id="card_kick"/>
<card card_id="card_ComeCloser"/>
<card card_id="card_ComeCloser"/>
<card card_id="card_DramaticTattooReveal"/>
<card card_id="card_DramaticTattooReveal"/>
<card card_id="card_FullBlock"/>
<card card_id="card_FullBlock"/>
</cards>
</deck>
2 changes: 1 addition & 1 deletion data/decks/deck_player2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<card card_id="card_punch"/>
<card card_id="card_kick"/>
<card card_id="card_kick"/>
<card card_id="card_kick"/>
<card card_id="card_gladius"/>
<card card_id="card_gladius"/>
<card card_id="card_Throw"/>
<card card_id="card_Throw"/>
<card card_id="card_Lariat"/>
<card card_id="card_Lariat"/>
<card card_id="card_LowerBlock"/>
<card card_id="card_UpperBlock"/>
Expand Down
38 changes: 29 additions & 9 deletions scenes/glossary/ComboGlossary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@

public partial class ComboGlossary : Control
{
private List<Combo> AllCombos;
private Node _vBoxContainer;

public override void _Ready()
{
Node VBoxContainer = GetNode<Node>("ScrollContainer/VBoxContainer");
_vBoxContainer = GetNode<Node>("ScrollContainer/VBoxContainer");
}

public void Initialize(Deck<CardSleeve> deck, List<Combo> allCombos)
{
List<Node> combosNotInDeck = new();

AllCombos = ComboXmlParser.ParseAllCombos();
foreach (Combo combo in AllCombos)
foreach (Combo combo in allCombos)
{
bool inDeck = true;
Node packedScene = ResourceLoader.Load<PackedScene>("res://scenes/glossary/combo_glossary_item.tscn").Instantiate();
packedScene.GetNode<Label>("VBoxContainer/ContentMargin/VBoxContainer/ComboNameMargin/ComboName").Text = combo.Name;

Expand All @@ -41,24 +46,39 @@ public override void _Ready()
int i = 0;
List<string> _blockCards = CardPrototypes.cardPrototypeDict.Where(kvp => kvp.Value.CardType == "Block").Select(kvp => kvp.Value.Id).ToList();

foreach (Card card in combo.CardList)
foreach (Card comboCard in combo.CardList)
{
Label label = new Godot.Label();

if (_blockCards.Contains(card.Id))
if (comboCard.Id == "card_FullBlock")
{
label.Text = (i+1).ToString() + ": " + "Any Block Card";
}
else
{
label.Text = (i+1).ToString() + ": " + CardPrototypes.cardPrototypeDict[card.Id].CardName;
label.Text = (i+1).ToString() + ": " + CardPrototypes.cardPrototypeDict[comboCard.Id].CardName;
}

if ((deck.Cards.Any(deckCard => (deckCard.Card.Id == comboCard.Id) || (_blockCards.Contains(deckCard.Card.Id) && "card_FullBlock" == comboCard.Id) ) == false) && inDeck)
{
combosNotInDeck.Add(packedScene);
inDeck = false;
}

cardList.AddChild(label);
i++;
}

VBoxContainer.AddChild(packedScene);

if (inDeck)
{
packedScene.GetNode<TextureRect>("VBoxContainer/ContentMargin/VBoxContainer/ComboNameMargin/ComboName/ThumbsUp").Show();
_vBoxContainer.AddChild(packedScene);
}
}

foreach (Node comboNotInDeck in combosNotInDeck)
{
_vBoxContainer.AddChild(comboNotInDeck);
}
}

Expand Down
9 changes: 9 additions & 0 deletions scenes/glossary/card_glossary.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_58lte")

[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.745098)

[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 1
anchors_preset = 15
Expand Down
30 changes: 29 additions & 1 deletion scenes/glossary/card_glossary_item.tscn
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[gd_scene load_steps=6 format=3 uid="uid://517fbrq52blj"]
[gd_scene load_steps=7 format=3 uid="uid://517fbrq52blj"]

[ext_resource type="Texture2D" uid="uid://bqelqsritcoiy" path="res://assets/images/Cards/CardArt/dropkick.png" id="1_7qbpl"]
[ext_resource type="Theme" uid="uid://hajaa20bfn8q" path="res://styles/Bigtext.tres" id="2_vx2rf"]
[ext_resource type="Theme" uid="uid://b4367d11n6l8i" path="res://styles/Nimbus.tres" id="3_snjjf"]
[ext_resource type="Theme" uid="uid://bi7ohn58wto5o" path="res://scripts/customresource/roman_font.tres" id="4_rk27n"]
[ext_resource type="Texture2D" uid="uid://b6l772dpx2bgq" path="res://assets/ui/9patchBorder.png" id="5_ple64"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_udkd7"]
bg_color = Color(0.0431373, 0.0431373, 0.0431373, 0.815686)
Expand All @@ -22,6 +23,8 @@ theme_override_styles/panel = SubResource("StyleBoxFlat_udkd7")
[node name="ColorRect" type="ColorRect" parent="."]
visible = false
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
color = Color(0, 0, 0, 0.482353)

[node name="VBoxContainer" type="VBoxContainer" parent="."]
Expand All @@ -44,6 +47,23 @@ size_flags_horizontal = 4
texture = ExtResource("1_7qbpl")
expand_mode = 5

[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer/ImageMargin/CardImage"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -8.0
offset_top = -8.0
offset_right = 8.0
offset_bottom = 7.75
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("5_ple64")
patch_margin_left = 24
patch_margin_top = 24
patch_margin_right = 24
patch_margin_bottom = 24

[node name="ContentMargin" type="MarginContainer" parent="VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 10
Expand Down Expand Up @@ -429,3 +449,11 @@ theme = ExtResource("4_rk27n")
theme_override_font_sizes/font_size = 20
text = "Deal 3 damage. Grounds an enemy"
autowrap_mode = 2

[node name="NinePatchRect" type="NinePatchRect" parent="."]
layout_mode = 2
texture = ExtResource("5_ple64")
patch_margin_left = 24
patch_margin_top = 24
patch_margin_right = 24
patch_margin_bottom = 24
9 changes: 9 additions & 0 deletions scenes/glossary/combo_glossary.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_htb0h")

[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.745098)

[node name="ScrollContainer" type="ScrollContainer" parent="."]
layout_mode = 1
anchors_preset = 15
Expand Down
40 changes: 39 additions & 1 deletion scenes/glossary/combo_glossary_item.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://h3gjvvvksjfo"]
[gd_scene load_steps=7 format=3 uid="uid://h3gjvvvksjfo"]

[ext_resource type="Theme" uid="uid://hajaa20bfn8q" path="res://styles/Bigtext.tres" id="1_jfqnu"]
[ext_resource type="Theme" uid="uid://b4367d11n6l8i" path="res://styles/Nimbus.tres" id="2_866jv"]
[ext_resource type="Theme" uid="uid://bi7ohn58wto5o" path="res://scripts/customresource/roman_font.tres" id="3_tngxl"]
[ext_resource type="Texture2D" uid="uid://diq0l8bgyca73" path="res://assets/sprites/Emperor_Thumbs/Emperor_Thumb_Up.png" id="3_yi1ca"]
[ext_resource type="Texture2D" uid="uid://b6l772dpx2bgq" path="res://assets/ui/9patchBorder.png" id="4_0jqwi"]

[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0kler"]
bg_color = Color(0.0431373, 0.0431373, 0.0431373, 0.815686)
Expand Down Expand Up @@ -46,6 +48,34 @@ theme_override_font_sizes/font_size = 50
text = "Combo Name"
horizontal_alignment = 1

[node name="NinePatchRect" type="NinePatchRect" parent="VBoxContainer/ContentMargin/VBoxContainer/ComboNameMargin/ComboName"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -17.0
offset_bottom = 17.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("4_0jqwi")
patch_margin_left = 24
patch_margin_top = 24
patch_margin_right = 24
patch_margin_bottom = 24

[node name="ThumbsUp" type="TextureRect" parent="VBoxContainer/ContentMargin/VBoxContainer/ComboNameMargin/ComboName"]
visible = false
layout_mode = 2
offset_left = 478.0
offset_top = -33.0
offset_right = 590.0
offset_bottom = 79.0
rotation = -0.596903
scale = Vector2(0.8, 0.8)
size_flags_horizontal = 8
texture = ExtResource("3_yi1ca")
stretch_mode = 4

[node name="StatsGridItemMargin" type="MarginContainer" parent="VBoxContainer/ContentMargin/VBoxContainer"]
layout_mode = 2
size_flags_horizontal = 4
Expand Down Expand Up @@ -305,3 +335,11 @@ theme = ExtResource("3_tngxl")
theme_override_font_sizes/font_size = 20
text = "Deal 3 damage. Grounds an enemy"
autowrap_mode = 2

[node name="NinePatchRect" type="NinePatchRect" parent="."]
layout_mode = 2
texture = ExtResource("4_0jqwi")
patch_margin_left = 24
patch_margin_top = 24
patch_margin_right = 24
patch_margin_bottom = 24
Loading

0 comments on commit dbd7f5d

Please sign in to comment.