Skip to content

Commit

Permalink
Fix scrolling
Browse files Browse the repository at this point in the history
  • Loading branch information
amazliah committed Dec 7, 2023
1 parent 70192f8 commit 7883a77
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 28 deletions.
40 changes: 14 additions & 26 deletions scenes/main_menu.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ grow_vertical = 2
flat = true

[node name="ItemsTab" type="Control" parent="UI/TabContainer"]
visible = false
layout_mode = 2
mouse_filter = 2
script = ExtResource("9_hdxf0")
Expand All @@ -1090,53 +1089,42 @@ offset_left = 25.0
offset_top = 25.0
offset_right = 695.0
offset_bottom = 1135.0
mouse_filter = 2
follow_focus = true
horizontal_scroll_mode = 0
vertical_scroll_mode = 3

[node name="MarginContainer" type="MarginContainer" parent="UI/TabContainer/ItemsTab/ScrollContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
mouse_filter = 2
theme_override_constants/margin_left = 25
theme_override_constants/margin_top = 25
theme_override_constants/margin_right = 25
theme_override_constants/margin_bottom = 25

[node name="Control" type="Control" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer"]
[node name="ItemsContainer" type="VBoxContainer" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer"]
layout_mode = 2
mouse_filter = 2

[node name="ItemsContainer" type="VBoxContainer" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2

[node name="MyItemsLabel" type="Label" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer"]
[node name="MyItemsLabel" type="Label" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer"]
layout_mode = 2
theme = ExtResource("2_bv25m")
theme_override_font_sizes/font_size = 32
text = "YOUR ITEMS"
horizontal_alignment = 1

[node name="MyItemsContainer" type="HBoxContainer" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer"]
[node name="MyItemsContainer" type="HBoxContainer" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer"]
layout_mode = 2
mouse_filter = 2
theme_override_constants/separation = 4
alignment = 1

[node name="HeadSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer"]
[node name="HeadSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer"]
custom_minimum_size = Vector2(150, 220)
layout_mode = 2
theme = ExtResource("2_bv25m")
theme_override_styles/panel = SubResource("StyleBoxFlat_di1xv")

[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer/HeadSlot"]
[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer/HeadSlot"]
self_modulate = Color(0.67451, 0.67451, 0.67451, 0.666667)
layout_mode = 1
anchors_preset = 8
Expand All @@ -1154,13 +1142,13 @@ texture = ExtResource("40_whfkm")
expand_mode = 1
stretch_mode = 5

[node name="RightHandSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer"]
[node name="RightHandSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer"]
custom_minimum_size = Vector2(150, 220)
layout_mode = 2
theme = ExtResource("2_bv25m")
theme_override_styles/panel = SubResource("StyleBoxFlat_di1xv")

[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer/RightHandSlot"]
[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer/RightHandSlot"]
self_modulate = Color(0.67451, 0.67451, 0.67451, 0.666667)
layout_mode = 1
anchors_preset = 8
Expand All @@ -1178,13 +1166,13 @@ texture = ExtResource("41_3d1vt")
expand_mode = 1
stretch_mode = 5

[node name="LeftHandSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer"]
[node name="LeftHandSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer"]
custom_minimum_size = Vector2(150, 220)
layout_mode = 2
theme = ExtResource("2_bv25m")
theme_override_styles/panel = SubResource("StyleBoxFlat_di1xv")

[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer/LeftHandSlot"]
[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer/LeftHandSlot"]
self_modulate = Color(0.67451, 0.67451, 0.67451, 0.666667)
layout_mode = 1
anchors_preset = 8
Expand All @@ -1202,13 +1190,13 @@ texture = ExtResource("42_a6hvk")
expand_mode = 1
stretch_mode = 5

[node name="BootsSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer"]
[node name="BootsSlot" type="Panel" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer"]
custom_minimum_size = Vector2(150, 220)
layout_mode = 2
theme = ExtResource("2_bv25m")
theme_override_styles/panel = SubResource("StyleBoxFlat_di1xv")

[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer/BootsSlot"]
[node name="TextureRect" type="TextureRect" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer/BootsSlot"]
self_modulate = Color(0.67451, 0.67451, 0.67451, 0.666667)
layout_mode = 1
anchors_preset = 8
Expand All @@ -1226,14 +1214,14 @@ texture = ExtResource("43_jq1uo")
expand_mode = 1
stretch_mode = 5

[node name="CollectionLabel" type="Label" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer"]
[node name="CollectionLabel" type="Label" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer"]
layout_mode = 2
theme = ExtResource("2_bv25m")
theme_override_font_sizes/font_size = 32
text = "COLLECTION"
horizontal_alignment = 1

[node name="OwnedItemsGridContainer" type="GridContainer" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/Control/ItemsContainer"]
[node name="OwnedItemsGridContainer" type="GridContainer" parent="UI/TabContainer/ItemsTab/ScrollContainer/MarginContainer/ItemsContainer"]
layout_mode = 2
mouse_filter = 2
columns = 4
Expand Down
4 changes: 2 additions & 2 deletions scripts/UI/items_tab_ui.gd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends Control

@onready var _my_items_container: HBoxContainer = $ScrollContainer/MarginContainer/Control/ItemsContainer/MyItemsContainer
@onready var _owned_items_grid: GridContainer = $ScrollContainer/MarginContainer/Control/ItemsContainer/OwnedItemsGridContainer
@onready var _my_items_container: HBoxContainer = $ScrollContainer/MarginContainer/ItemsContainer/MyItemsContainer
@onready var _owned_items_grid: GridContainer = $ScrollContainer/MarginContainer/ItemsContainer/OwnedItemsGridContainer
@onready var _item_details_popup: ItemDetailsPopup = $ItemDetailsPopup

@export var _item_view_prefab: PackedScene
Expand Down

0 comments on commit 7883a77

Please sign in to comment.