Rework item descriptions, fix item rescue menu
This commit is contained in:
@@ -67,11 +67,10 @@ public partial class AugmentableItemsMenu : Control
|
||||
_augmentingItem = augmentingItem;
|
||||
|
||||
var inventory = _player.Inventory.Items;
|
||||
var validSelectableItems = inventory.Except(inventory.OfType<IEquipableItem>().Where(x => x.Glued)).ToList();
|
||||
ItemSlots.ForEach(x => x.SetEmpty());
|
||||
var slotIndex = 0;
|
||||
|
||||
foreach (var item in validSelectableItems)
|
||||
foreach (var item in inventory)
|
||||
{
|
||||
if (item is IAugmentableItem augmentable && augmentable.Augment == null)
|
||||
ItemSlots[slotIndex++].SetItemToSlot(item);
|
||||
|
||||
@@ -19,10 +19,18 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
|
||||
[Node] public Label ItemName { get; set; }
|
||||
|
||||
[Node] public Label ItemType { get; set; }
|
||||
|
||||
[Node] public Label ItemParameter { get; set; }
|
||||
|
||||
[Node] public Label ItemFlavor { get; set; }
|
||||
|
||||
[Node] public Label ItemStats { get; set; }
|
||||
|
||||
[Node] public Label ItemAugment { get; set; }
|
||||
|
||||
[Node] public TextureRect ItemAugmentTexture { get; set; }
|
||||
|
||||
[Node] public ActionPanel ActionPanel { get; set; }
|
||||
|
||||
[Node] public VBoxContainer Inventory { get; set; }
|
||||
@@ -63,19 +71,13 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void EquipmentChanged(IEquipableItem obj)
|
||||
{
|
||||
AttackChanged(0);
|
||||
DefenseChanged(0);
|
||||
}
|
||||
|
||||
private void AttackChanged(int obj) => PlayerATKLabel.Text = $"{_player.AttackComponent.CurrentAttack.Value:D2}/{_player.AttackComponent.MaximumAttack.Value:D2}+{_player.EquipmentComponent.BonusAttack}";
|
||||
|
||||
private void DefenseChanged(int obj) => PlayerDEFLabel.Text = $"{_player.DefenseComponent.CurrentDefense.Value:D2}/{_player.DefenseComponent.MaximumDefense.Value:D2}+{_player.EquipmentComponent.BonusDefense}";
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
var validSelectableItems = _player.Inventory.Items.Except(_player.Inventory.Items.OfType<IEquipableItem>().Where(x => x.Glued)).ToList();
|
||||
var validSelectableItems = _player.Inventory.Items.ToList();
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.MoveUp) && _currentlySelected != null && _currentlySelected.Item.Value != validSelectableItems.First())
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
@@ -114,7 +116,15 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
{
|
||||
_currentlySelected = selectedItem;
|
||||
ItemName.Text = selectedItem.Item.Value.ItemName;
|
||||
ItemFlavor.Text = selectedItem.Item.Value.Description;
|
||||
ItemType.Text = SetItemTypeName(selectedItem.Item.Value);
|
||||
ItemParameter.Text = GetItemParameterText(selectedItem.Item.Value);
|
||||
ItemParameter.Visible = !string.IsNullOrEmpty(ItemParameter.Text);
|
||||
ItemFlavor.Text = selectedItem.Item.Value.FlavorText;
|
||||
ItemFlavor.Visible = !string.IsNullOrEmpty(ItemFlavor.Text);
|
||||
ItemStats.Text = selectedItem.Item.Value.StatDescription;
|
||||
ItemStats.Visible = !string.IsNullOrEmpty(ItemStats.Text);
|
||||
ItemAugmentTexture.Texture = null;
|
||||
ItemAugment.Text = GetAugmentText(selectedItem.Item.Value);
|
||||
}
|
||||
|
||||
private void ResetInventoryState()
|
||||
@@ -126,15 +136,13 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
for (var i = 0; i < inventory.Count; i++)
|
||||
ItemSlots[i].SetItemToSlot(inventory[i]);
|
||||
|
||||
var validSelectableItems = inventory.Except(inventory.OfType<IEquipableItem>().Where(x => x.Glued)).ToList();
|
||||
|
||||
if (_currentlySelected != null && !validSelectableItems.Contains(_currentlySelected.Item.Value))
|
||||
if (_currentlySelected != null && !inventory.Contains(_currentlySelected.Item.Value))
|
||||
_currentlySelected = null;
|
||||
|
||||
if (_currentlySelected == null && validSelectableItems.Count > 0)
|
||||
_currentlySelected = ItemSlots.FirstOrDefault(x => x.Item.Value == validSelectableItems.First());
|
||||
if (_currentlySelected == null && inventory.Count > 0)
|
||||
_currentlySelected = ItemSlots.FirstOrDefault(x => x.Item.Value == inventory.First());
|
||||
|
||||
if (validSelectableItems.Count > 0)
|
||||
if (inventory.Count > 0)
|
||||
_currentlySelected.FocusItem();
|
||||
ActionPanel.Hide();
|
||||
}
|
||||
@@ -142,8 +150,12 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
private void ClearDescriptionBox()
|
||||
{
|
||||
ItemName.Text = string.Empty;
|
||||
ItemFlavor.Text = string.Empty;
|
||||
ItemType.Text = string.Empty;
|
||||
ItemParameter.Text = string.Empty;
|
||||
ItemStats.Text = string.Empty;
|
||||
ItemFlavor.Text = string.Empty;
|
||||
ItemAugment.Text = string.Empty;
|
||||
ItemAugmentTexture.Texture = null;
|
||||
}
|
||||
|
||||
private void ActionPanel_ActionPanelClosing()
|
||||
@@ -166,4 +178,52 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
AugmentMenu.Hide();
|
||||
ResetInventoryState();
|
||||
}
|
||||
|
||||
private void EquipmentChanged(IEquipableItem obj)
|
||||
{
|
||||
AttackChanged(0);
|
||||
DefenseChanged(0);
|
||||
}
|
||||
|
||||
private static string GetItemParameterText(IBaseInventoryItem item)
|
||||
{
|
||||
if (item is Weapon potentiallyProjectile && (potentiallyProjectile.WeaponTag == WeaponTag.KineticProjectile || potentiallyProjectile.WeaponTag == WeaponTag.ElementalProjectile))
|
||||
return string.Empty;
|
||||
|
||||
return item switch
|
||||
{
|
||||
Weapon weapon => $"ATK: {(weapon.ItemTag == ItemTag.MysteryItem ? "???" : weapon.BonusAttack)}",
|
||||
Armor armor => $"DEF: {(armor.ItemTag == ItemTag.MysteryItem ? "???" : armor.BonusDefense)}",
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
private string GetAugmentText(IBaseInventoryItem item)
|
||||
{
|
||||
if (item is IAugmentableItem augmentable && augmentable.Augment != null)
|
||||
{
|
||||
ItemAugmentTexture.Texture = augmentable.Augment.AugmentTexture;
|
||||
return $"{augmentable.Augment.AugmentName}{System.Environment.NewLine}{augmentable.Augment.AugmentDescription}";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private static string SetItemTypeName(IBaseInventoryItem item)
|
||||
{
|
||||
return item switch
|
||||
{
|
||||
Weapon => "Weapon",
|
||||
Armor => "Armor",
|
||||
Accessory => "Mask",
|
||||
Ammo => "Ammo",
|
||||
BoxItem => "Box",
|
||||
ConsumableItem => "Restorative",
|
||||
EffectItem => "Spell",
|
||||
Jewel => "Jewel",
|
||||
Plastique => "Explosive",
|
||||
ThrowableItem => "Dice",
|
||||
_ => "Unknown item type.",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,17 +67,21 @@ unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_unikd")
|
||||
|
||||
[node name="TitlePanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
custom_minimum_size = Vector2(400, 100)
|
||||
layout_mode = 1
|
||||
offset_right = 400.0
|
||||
offset_bottom = 100.0
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="InventoryTitlePanel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/TitlePanelContainer"]
|
||||
[node name="TitlePanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(400, 100)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="InventoryTitlePanel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cq2sk")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/TitlePanelContainer/InventoryTitlePanel"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer/InventoryTitlePanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -89,13 +93,13 @@ theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/TitlePanelContainer/InventoryTitlePanel/MarginContainer"]
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer/InventoryTitlePanel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="InventoryLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/TitlePanelContainer/InventoryTitlePanel/MarginContainer/ReferenceRect"]
|
||||
[node name="InventoryLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer/InventoryTitlePanel/MarginContainer/ReferenceRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
@@ -114,22 +118,15 @@ label_settings = SubResource("LabelSettings_ejvue")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="StatsPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
[node name="StatsPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(400, 100)
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_top = 0.121
|
||||
anchor_right = 0.28
|
||||
anchor_bottom = 0.218
|
||||
offset_top = 0.369995
|
||||
offset_right = -0.399994
|
||||
offset_bottom = 0.459991
|
||||
layout_mode = 2
|
||||
|
||||
[node name="StatsPanel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer"]
|
||||
[node name="StatsPanel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cq2sk")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -141,13 +138,13 @@ theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer"]
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -159,24 +156,24 @@ theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 20
|
||||
|
||||
[node name="StatsContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer"]
|
||||
[node name="StatsContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ATKName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer"]
|
||||
[node name="ATKName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("3_unikd")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "ATK:"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="PlayerATKLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer"]
|
||||
[node name="PlayerATKLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("3_unikd")
|
||||
@@ -184,17 +181,17 @@ theme_override_font_sizes/font_size = 25
|
||||
text = "15/15"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer"]
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DEFName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer2"]
|
||||
[node name="DEFName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer2"]
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("3_unikd")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "DEF:"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="PlayerDEFLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer2"]
|
||||
[node name="PlayerDEFLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatsContainer/HBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("3_unikd")
|
||||
@@ -202,98 +199,131 @@ theme_override_font_sizes/font_size = 25
|
||||
text = "15/15"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="StatusEffectContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer"]
|
||||
[node name="StatusEffectContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatusEffectContainer"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatusEffectContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="StatusName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatusEffectContainer/HBoxContainer"]
|
||||
[node name="StatusName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatusEffectContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Status:"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
|
||||
[node name="StatusLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatusEffectContainer/HBoxContainer"]
|
||||
[node name="StatusLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/StatsPanelContainer/StatsPanel/MarginContainer/ReferenceRect/MarginContainer/HBoxContainer/StatusEffectContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Rust"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
|
||||
[node name="ActionPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 2
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -200.0
|
||||
offset_right = 200.0
|
||||
grow_vertical = 0
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_aiji3")
|
||||
|
||||
[node name="ActionPanel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ActionPanelContainer" instance=ExtResource("3_7co7g")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
[node name="ItemDescriptionPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(550, 330)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemDescriptionPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
custom_minimum_size = Vector2(500, 500)
|
||||
layout_mode = 1
|
||||
anchors_preset = 4
|
||||
anchor_top = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_top = -250.0
|
||||
offset_right = 500.0
|
||||
offset_bottom = 250.0
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ItemDescriptionBox" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer"]
|
||||
[node name="ItemDescriptionBox" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cq2sk")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 5
|
||||
theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer/MarginContainer"]
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer"]
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer"]
|
||||
custom_minimum_size = Vector2(500, 500)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_top = 20
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 20
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer/MarginContainer2"]
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2"]
|
||||
custom_minimum_size = Vector2(500, 500)
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 50
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="ItemName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
[node name="ItemName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Text"
|
||||
theme_override_fonts/font = ExtResource("6_ldqki")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "Cross Sword"
|
||||
|
||||
[node name="ItemType" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Weapon"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
|
||||
[node name="ItemFlavor" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
[node name="ItemParameterBox" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="ItemParameter" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer/ItemParameterBox"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 150)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
text = "ATK: 8"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
|
||||
[node name="ItemStats" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
text = "Text Stats"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ItemFlavor" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 10)
|
||||
layout_mode = 2
|
||||
text = "More Text"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ItemStats" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemAugmentTexture" type="TextureRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ItemAugment" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 10)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
text = "Augment:"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ActionPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_aiji3")
|
||||
|
||||
[node name="ActionPanel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer" instance=ExtResource("3_7co7g")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Text Stats"
|
||||
label_settings = ExtResource("7_we8a6")
|
||||
|
||||
[node name="InventoryList" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
custom_minimum_size = Vector2(800, 100)
|
||||
|
||||
@@ -4,12 +4,11 @@ using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Zennysoft.Game.Implementation;
|
||||
using Zennysoft.Game.Ma;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class ItemRescueMenu : Control
|
||||
public partial class ItemRescueMenu : Control, IInventoryMenu
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
@@ -21,86 +20,42 @@ public partial class ItemRescueMenu : Control
|
||||
|
||||
[Node] public Label ItemName { get; set; }
|
||||
|
||||
[Node] public Label ItemType { get; set; }
|
||||
|
||||
[Node] public Label ItemParameter { get; set; }
|
||||
|
||||
[Node] public Label ItemFlavor { get; set; }
|
||||
|
||||
[Node] public Label ItemStats { get; set; }
|
||||
|
||||
[Node] public Label ItemAugment { get; set; }
|
||||
|
||||
[Node] public TextureRect ItemAugmentTexture { get; set; }
|
||||
|
||||
[Node] public Control ActionPanel { get; set; }
|
||||
|
||||
[Node] public VBoxContainer Inventory { get; set; }
|
||||
|
||||
[Node] public Button InteractButton { get; set; }
|
||||
|
||||
[Node] public Button DropButton { get; set; }
|
||||
|
||||
[Node] public Control ActionPanel { get; set; }
|
||||
|
||||
private List<IItemSlot> ItemSlots;
|
||||
|
||||
private List<Label> ItemCountLabels;
|
||||
|
||||
private IItemSlot _currentlySelected;
|
||||
|
||||
public event Action MenuClosing;
|
||||
|
||||
#region ItemSlots
|
||||
[Node] public IItemSlot ItemSlot01 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot02 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot03 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot04 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot05 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot06 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot07 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot08 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot09 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot10 { get; set; }
|
||||
|
||||
[Node] public Label ItemCount01 { get; set; }
|
||||
[Node] public Label ItemCount02 { get; set; }
|
||||
[Node] public Label ItemCount03 { get; set; }
|
||||
[Node] public Label ItemCount04 { get; set; }
|
||||
[Node] public Label ItemCount05 { get; set; }
|
||||
[Node] public Label ItemCount06 { get; set; }
|
||||
[Node] public Label ItemCount07 { get; set; }
|
||||
[Node] public Label ItemCount08 { get; set; }
|
||||
[Node] public Label ItemCount09 { get; set; }
|
||||
[Node] public Label ItemCount10 { get; set; }
|
||||
#endregion
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
ItemSlots = [ItemSlot01, ItemSlot02, ItemSlot03, ItemSlot04, ItemSlot05, ItemSlot06, ItemSlot07, ItemSlot08, ItemSlot09, ItemSlot10];
|
||||
ItemCountLabels = [ItemCount01, ItemCount02, ItemCount03, ItemCount04, ItemCount05, ItemCount06, ItemCount07, ItemCount08, ItemCount09, ItemCount10];
|
||||
foreach (var slot in ItemSlots)
|
||||
{
|
||||
slot.ItemSelected += Slot_FocusEntered;
|
||||
slot.ItemPressed += Slot_ItemPressed;
|
||||
}
|
||||
ItemSlots = [.. Inventory.GetChildren().OfType<IItemSlot>()];
|
||||
ItemSlots.ForEach(x => x.ItemPressed += ItemPressed);
|
||||
ItemSlots.ForEach(x => x.ItemSelected += ItemSelected);
|
||||
VisibilityChanged += ResetInventoryState;
|
||||
InteractButton.Pressed += InteractButton_Pressed;
|
||||
DropButton.Pressed += DropButton_Pressed;
|
||||
_currentlySelected = ItemSlot01;
|
||||
VisibilityChanged += ItemRescueMenu_VisibilityChanged;
|
||||
}
|
||||
|
||||
private void ItemRescueMenu_VisibilityChanged()
|
||||
{
|
||||
ResetInventoryState();
|
||||
_currentlySelected = ItemSlot01;
|
||||
_currentlySelected.GrabFocus();
|
||||
}
|
||||
|
||||
private void InteractButton_Pressed()
|
||||
{
|
||||
if (_currentlySelected != null)
|
||||
{
|
||||
_player.Inventory.PickUpItem(_currentlySelected.Item.Value);
|
||||
_game.RescuedItems.Items.Remove(_currentlySelected.Item.Value);
|
||||
CloseActionMenu();
|
||||
ResetInventoryState();
|
||||
}
|
||||
}
|
||||
|
||||
private void DropButton_Pressed()
|
||||
{
|
||||
_game.RescuedItems.Items.Remove(_currentlySelected.Item.Value);
|
||||
ResetInventoryState();
|
||||
ClearDescriptionBox();
|
||||
Hide();
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
@@ -111,101 +66,143 @@ public partial class ItemRescueMenu : Control
|
||||
if (Input.IsActionJustPressed(GameInputs.Inventory))
|
||||
GetViewport().SetInputAsHandled();
|
||||
|
||||
var validSelectableItems = _game.RescuedItems.Items;
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.MoveUp) && _currentlySelected != null && _currentlySelected.Item.Value != validSelectableItems.First())
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
if (Input.IsActionJustPressed(GameInputs.MoveDown) && _currentlySelected != null && _currentlySelected.Item.Value != validSelectableItems.Last())
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
if (ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.Interact))
|
||||
{
|
||||
CloseActionMenu();
|
||||
ActionPanel_ActionPanelClosing();
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
GetViewport().SetInputAsHandled();
|
||||
}
|
||||
else if (Input.IsActionJustPressed(GameInputs.Interact))
|
||||
{
|
||||
Hide();
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
GetViewport().SetInputAsHandled();
|
||||
MenuClosing.Invoke();
|
||||
GetViewport().SetInputAsHandled();
|
||||
}
|
||||
if (!ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.MoveUp))
|
||||
{
|
||||
if (ItemSlots.Any() && ItemSlots.First(x => x.Visible) != _currentlySelected)
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
}
|
||||
if (!ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.MoveDown))
|
||||
{
|
||||
if (ItemSlots.Any() && ItemSlots.Last(x => x.Visible) != _currentlySelected)
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
}
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.MoveDown) && ActionPanel.Visible && InteractButton.HasFocus())
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
if (Input.IsActionJustPressed(GameInputs.MoveUp) && ActionPanel.Visible && DropButton.HasFocus())
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
}
|
||||
|
||||
private void Slot_ItemPressed(IItemSlot slot)
|
||||
private void ItemPressed(IItemSlot selectedItem)
|
||||
{
|
||||
var item = slot.Item.Value;
|
||||
|
||||
InteractButton.Disabled = false;
|
||||
DropButton.Disabled = false;
|
||||
InteractButton.FocusMode = FocusModeEnum.All;
|
||||
DropButton.FocusMode = FocusModeEnum.All;
|
||||
ActionPanel.Show();
|
||||
InteractButton.GrabFocus();
|
||||
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
|
||||
}
|
||||
|
||||
private void ItemSelected(IItemSlot selectedItem)
|
||||
{
|
||||
_currentlySelected = selectedItem;
|
||||
ItemName.Text = selectedItem.Item.Value.ItemName;
|
||||
ItemType.Text = SetItemTypeName(selectedItem.Item.Value);
|
||||
ItemParameter.Text = GetItemParameterText(selectedItem.Item.Value);
|
||||
ItemParameter.Visible = !string.IsNullOrEmpty(ItemParameter.Text);
|
||||
ItemFlavor.Text = selectedItem.Item.Value.FlavorText;
|
||||
ItemFlavor.Visible = !string.IsNullOrEmpty(ItemFlavor.Text);
|
||||
ItemStats.Text = selectedItem.Item.Value.StatDescription;
|
||||
ItemStats.Visible = !string.IsNullOrEmpty(ItemStats.Text);
|
||||
ItemAugmentTexture.Texture = null;
|
||||
ItemAugment.Text = GetAugmentText(selectedItem.Item.Value);
|
||||
}
|
||||
|
||||
private void ResetInventoryState()
|
||||
{
|
||||
//foreach (var item in ItemSlots)
|
||||
//{
|
||||
// item.Hide();
|
||||
// item.Disabled = true;
|
||||
// item.FocusMode = FocusModeEnum.None;
|
||||
// ItemFlavor.Text = string.Empty;
|
||||
// ItemName.Text = string.Empty;
|
||||
// ItemStats.Text = string.Empty;
|
||||
//}
|
||||
var inventory = _game.RescuedItems.Items;
|
||||
ItemSlots.ForEach(x => x.SetEmpty());
|
||||
ClearDescriptionBox();
|
||||
|
||||
//foreach (var item in ItemCountLabels)
|
||||
// item.Text = string.Empty;
|
||||
for (var i = 0; i < inventory.Count; i++)
|
||||
ItemSlots[i].SetItemToSlot(inventory[i]);
|
||||
|
||||
//for (var i = 0; i < _game.RescuedItems.Items.Count; i++)
|
||||
//{
|
||||
// var item = _game.RescuedItems.Items[i];
|
||||
// ItemSlots[i].Item.OnNext(item);
|
||||
// ItemSlots[i].FocusMode = FocusModeEnum.All;
|
||||
// ItemSlots[i].Disabled = false;
|
||||
// ItemSlots[i].Show();
|
||||
// if (item is IStackable stackable)
|
||||
// ItemCountLabels[i].Text = $"x{stackable.Count.Value:D2}";
|
||||
//}
|
||||
if (_currentlySelected != null && !inventory.Contains(_currentlySelected.Item.Value))
|
||||
_currentlySelected = null;
|
||||
|
||||
//if (_player.Inventory.AtCapacity())
|
||||
//{
|
||||
// foreach (var item in ItemSlots)
|
||||
// {
|
||||
// item.Disabled = true;
|
||||
// item.FocusMode = FocusModeEnum.None;
|
||||
// }
|
||||
//}
|
||||
//else if (_currentlySelected != null)
|
||||
// _currentlySelected.GrabFocus();
|
||||
//else
|
||||
// _currentlySelected = ItemSlots.First();
|
||||
if (_currentlySelected == null && inventory.Count > 0)
|
||||
_currentlySelected = ItemSlots.FirstOrDefault(x => x.Item.Value == inventory.First());
|
||||
|
||||
if (inventory.Count > 0)
|
||||
_currentlySelected.FocusItem();
|
||||
}
|
||||
|
||||
private void Slot_FocusEntered(IItemSlot slot)
|
||||
private void ClearDescriptionBox()
|
||||
{
|
||||
if (_currentlySelected.Item.Value == null)
|
||||
return;
|
||||
_currentlySelected = slot;
|
||||
var item = slot.Item.Value;
|
||||
ItemName.Text = item.ItemName;
|
||||
ItemFlavor.Text = item.Description;
|
||||
ItemName.Text = string.Empty;
|
||||
ItemType.Text = string.Empty;
|
||||
ItemParameter.Text = string.Empty;
|
||||
ItemStats.Text = string.Empty;
|
||||
ItemFlavor.Text = string.Empty;
|
||||
ItemAugment.Text = string.Empty;
|
||||
ItemAugmentTexture.Texture = null;
|
||||
}
|
||||
|
||||
private void CloseActionMenu()
|
||||
private void ActionPanel_ActionPanelClosing()
|
||||
{
|
||||
_currentlySelected.GrabFocus();
|
||||
ActionPanel.Hide();
|
||||
if (_currentlySelected != null && !_game.RescuedItems.Items.Contains(_currentlySelected.Item.Value))
|
||||
_currentlySelected = null;
|
||||
ResetInventoryState();
|
||||
}
|
||||
|
||||
private void InteractButton_Pressed()
|
||||
{
|
||||
if (_currentlySelected != null)
|
||||
{
|
||||
_player.Inventory.PickUpItem(_currentlySelected.Item.Value);
|
||||
_game.RescuedItems.Items.Remove(_currentlySelected.Item.Value);
|
||||
ResetInventoryState();
|
||||
ActionPanel_ActionPanelClosing();
|
||||
}
|
||||
}
|
||||
|
||||
private void DropButton_Pressed()
|
||||
{
|
||||
_game.RescuedItems.Items.Remove(_currentlySelected.Item.Value);
|
||||
ResetInventoryState();
|
||||
ActionPanel_ActionPanelClosing();
|
||||
}
|
||||
|
||||
private static string GetItemParameterText(IBaseInventoryItem item)
|
||||
{
|
||||
if (item is Weapon potentiallyProjectile && (potentiallyProjectile.WeaponTag == WeaponTag.KineticProjectile || potentiallyProjectile.WeaponTag == WeaponTag.ElementalProjectile))
|
||||
return string.Empty;
|
||||
|
||||
return item switch
|
||||
{
|
||||
Weapon weapon => $"ATK: {(weapon.ItemTag == ItemTag.MysteryItem ? "???" : weapon.BonusAttack)}",
|
||||
Armor armor => $"DEF: {(armor.ItemTag == ItemTag.MysteryItem ? "???" : armor.BonusDefense)}",
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
|
||||
private string GetAugmentText(IBaseInventoryItem item)
|
||||
{
|
||||
if (item is IAugmentableItem augmentable && augmentable.Augment != null)
|
||||
{
|
||||
ItemAugmentTexture.Texture = augmentable.Augment.AugmentTexture;
|
||||
return $"{augmentable.Augment.AugmentName}{System.Environment.NewLine}{augmentable.Augment.AugmentDescription}";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
private static string SetItemTypeName(IBaseInventoryItem item)
|
||||
{
|
||||
return item switch
|
||||
{
|
||||
Weapon => "Weapon",
|
||||
Armor => "Armor",
|
||||
Accessory => "Mask",
|
||||
Ammo => "Ammo",
|
||||
BoxItem => "Box",
|
||||
ConsumableItem => "Restorative",
|
||||
EffectItem => "Spell",
|
||||
Jewel => "Jewel",
|
||||
Plastique => "Explosive",
|
||||
ThrowableItem => "Dice",
|
||||
_ => "Unknown item type.",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,44 +1,86 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://dwa7o6hkkwjg1"]
|
||||
[gd_scene load_steps=16 format=3 uid="uid://dwa7o6hkkwjg1"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cterndmplud2b" path="res://src/ui/inventory_menu/ItemRescueMenu.cs" id="1_qqblc"]
|
||||
[ext_resource type="FontFile" uid="uid://beh6d5lo5ihq0" path="res://src/ui/fonts/georgiai.ttf" id="2_0lwmo"]
|
||||
[ext_resource type="StyleBox" uid="uid://bxuy4tnftibfq" path="res://src/options/SelectedOptionsBox.tres" id="3_5237l"]
|
||||
[ext_resource type="StyleBox" uid="uid://bl15q835s4ene" path="res://src/options/UnselectedOptionsBox.tres" id="4_twupc"]
|
||||
[ext_resource type="PackedScene" uid="uid://c005nd0m2eim" path="res://src/ui/inventory_menu/ItemSlot.tscn" id="5_wq0q0"]
|
||||
[ext_resource type="FontFile" uid="uid://0syyay37admf" path="res://src/ui/fonts/georgiab.ttf" id="6_nl1cv"]
|
||||
[ext_resource type="LabelSettings" uid="uid://b6f8ggy3ulonb" path="res://src/ui/label_settings/GeorgiaItalic.tres" id="7_1xig5"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_cq2sk"]
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_prb8u"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_qqblc"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_0lwmo"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5237l"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_twupc"]
|
||||
bg_color = Color(0, 0, 0, 0.745098)
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_ejvue"]
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_wq0q0"]
|
||||
line_spacing = 1.0
|
||||
font = ExtResource("2_0lwmo")
|
||||
font = ExtResource("6_nl1cv")
|
||||
font_size = 50
|
||||
outline_size = 3
|
||||
outline_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_nl1cv"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g7ag1"]
|
||||
bg_color = Color(0, 0, 0, 0.745098)
|
||||
|
||||
[node name="ItemRescueMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1xig5"]
|
||||
bg_color = Color(0, 0, 0, 0.745098)
|
||||
|
||||
[node name="ItemRescueMenu" type="PanelContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_prb8u")
|
||||
script = ExtResource("1_qqblc")
|
||||
|
||||
[node name="InventoryTitlePanel" type="Panel" parent="."]
|
||||
layout_mode = 1
|
||||
offset_left = 38.0
|
||||
offset_top = 40.0
|
||||
offset_right = 431.0
|
||||
offset_bottom = 157.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cq2sk")
|
||||
[node name="Panel" type="Panel" parent="."]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_qqblc")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="InventoryTitlePanel"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel"]
|
||||
layout_mode = 0
|
||||
offset_right = 1480.0
|
||||
offset_bottom = 1080.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 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="PanelContainer" type="PanelContainer" parent="Panel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_0lwmo")
|
||||
|
||||
[node name="MenuPanel" type="Panel" parent="Panel/MarginContainer/PanelContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_5237l")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="TitlePanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(400, 100)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="InventoryTitlePanel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_twupc")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer/InventoryTitlePanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -50,43 +92,145 @@ theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="InventoryTitlePanel/MarginContainer"]
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer/InventoryTitlePanel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="InventoryLabel" type="Label" parent="InventoryTitlePanel/MarginContainer/ReferenceRect"]
|
||||
[node name="InventoryLabel" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/TitlePanelContainer/InventoryTitlePanel/MarginContainer/ReferenceRect"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -148.0
|
||||
offset_top = -28.5
|
||||
offset_right = 148.0
|
||||
offset_bottom = 28.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_font_sizes/font_size = 15
|
||||
text = "STORAGE"
|
||||
label_settings = SubResource("LabelSettings_ejvue")
|
||||
label_settings = SubResource("LabelSettings_wq0q0")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ActionPanel" type="Panel" parent="."]
|
||||
[node name="ItemDescriptionPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer"]
|
||||
custom_minimum_size = Vector2(550, 330)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemDescriptionBox" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_twupc")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 5
|
||||
theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer"]
|
||||
custom_minimum_size = Vector2(500, 500)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_top = 20
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 20
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2"]
|
||||
custom_minimum_size = Vector2(500, 500)
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 15
|
||||
|
||||
[node name="ItemName" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
text = "Cross Sword"
|
||||
|
||||
[node name="ItemType" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Weapon"
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
|
||||
[node name="ItemParameterBox" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
|
||||
[node name="ItemParameter" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer/ItemParameterBox"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
text = "ATK: 8"
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
|
||||
[node name="ItemStats" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
text = "Text Stats"
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ItemFlavor" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 10)
|
||||
layout_mode = 2
|
||||
text = "More Text"
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemAugmentTexture" type="TextureRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 0
|
||||
expand_mode = 1
|
||||
|
||||
[node name="ItemAugment" type="Label" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ItemDescriptionPanelContainer/MarginContainer2/VBoxContainer/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 10)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
text = "Augment:"
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ActionPanelContainer" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_styles/panel = SubResource("StyleBoxEmpty_nl1cv")
|
||||
|
||||
[node name="ActionPanel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.107
|
||||
anchor_top = 0.86
|
||||
anchor_right = 0.199
|
||||
anchor_bottom = 0.915
|
||||
offset_left = -164.44
|
||||
offset_top = -35.8
|
||||
offset_right = -159.08
|
||||
offset_bottom = 70.8
|
||||
grow_vertical = 0
|
||||
custom_minimum_size = Vector2(200, 200)
|
||||
layout_mode = 2
|
||||
focus_mode = 2
|
||||
mouse_filter = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_g7ag1")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="ActionPanel"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer/ActionPanel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -98,25 +242,24 @@ theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="ActionPanel/MarginContainer"]
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer/ActionPanel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="ActionPanel/MarginContainer"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer/ActionPanel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ActionPanel/MarginContainer/MarginContainer"]
|
||||
process_mode = 2
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer/ActionPanel/MarginContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="InteractButton" type="Button" parent="ActionPanel/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
[node name="InteractButton" type="Button" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer/ActionPanel/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
@@ -139,7 +282,7 @@ theme_override_styles/normal = ExtResource("4_twupc")
|
||||
text = "Take"
|
||||
alignment = 0
|
||||
|
||||
[node name="DropButton" type="Button" parent="ActionPanel/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
[node name="DropButton" type="Button" parent="Panel/MarginContainer/PanelContainer/MenuPanel/VBoxContainer/ActionPanelContainer/ActionPanel/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
@@ -162,273 +305,113 @@ theme_override_styles/normal = ExtResource("4_twupc")
|
||||
text = "Destroy"
|
||||
alignment = 0
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 40.0
|
||||
offset_bottom = 40.0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
[node name="InventoryList" type="PanelContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel"]
|
||||
custom_minimum_size = Vector2(800, 100)
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -188.0
|
||||
offset_top = -275.0
|
||||
offset_right = 188.0
|
||||
offset_bottom = 275.0
|
||||
offset_left = -120.0
|
||||
offset_top = -515.0
|
||||
offset_right = 680.0
|
||||
offset_bottom = 510.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="InventoryList" type="Panel" parent="PanelContainer"]
|
||||
[node name="Panel" type="Panel" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cq2sk")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_1xig5")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="PanelContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 125
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 15
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/MarginContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="ItemSlot01" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot02" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot03" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot04" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot05" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot06" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot07" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot08" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot09" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ItemSlot10" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer" instance=ExtResource("5_wq0q0")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 10
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="ItemCount01" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount02" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount03" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount04" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount05" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount06" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount07" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount08" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount09" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemCount10" type="Label" parent="PanelContainer/MarginContainer/MarginContainer/HBoxContainer/VBoxContainer2"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
theme_override_fonts/font = ExtResource("6_nl1cv")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ItemDescriptionBox" type="Panel" parent="."]
|
||||
layout_mode = 2
|
||||
offset_left = 37.0
|
||||
offset_top = 242.0
|
||||
offset_right = 717.0
|
||||
offset_bottom = 838.0
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cq2sk")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="ItemDescriptionBox"]
|
||||
[node name="MarginContainer" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 10
|
||||
theme_override_constants/margin_top = 10
|
||||
theme_override_constants/margin_right = 10
|
||||
theme_override_constants/margin_bottom = 10
|
||||
theme_override_constants/margin_left = 5
|
||||
theme_override_constants/margin_top = 5
|
||||
theme_override_constants/margin_right = 5
|
||||
theme_override_constants/margin_bottom = 5
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="ItemDescriptionBox/MarginContainer"]
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer"]
|
||||
layout_mode = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
border_width = 2.0
|
||||
editor_only = false
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="ItemDescriptionBox/MarginContainer"]
|
||||
[node name="MarginContainer2" type="MarginContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 15
|
||||
offset_right = 800.0
|
||||
offset_bottom = 1050.0
|
||||
theme_override_constants/margin_left = 25
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 15
|
||||
theme_override_constants/margin_right = 25
|
||||
theme_override_constants/margin_bottom = 15
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="ItemDescriptionBox/MarginContainer/MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 50
|
||||
|
||||
[node name="ItemName" type="Label" parent="ItemDescriptionBox/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
[node name="Inventory" type="VBoxContainer" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
size_flags_vertical = 0
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="ItemFlavor" type="Label" parent="ItemDescriptionBox/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 150)
|
||||
[node name="ItemSlot" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
vertical_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="ItemStats" type="Label" parent="ItemDescriptionBox/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
[node name="ItemSlot2" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot3" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot4" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot5" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot6" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot7" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot8" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot9" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot10" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot11" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot12" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot13" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot14" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot15" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot16" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot17" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot18" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot19" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ItemSlot20" parent="Panel/MarginContainer/PanelContainer/MenuPanel/InventoryList/Panel/MarginContainer2/Inventory" instance=ExtResource("5_wq0q0")]
|
||||
layout_mode = 2
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
|
||||
@@ -57,7 +57,6 @@ public partial class ItemSlot : Control, IItemSlot
|
||||
{
|
||||
SetItemEquipmentStatus(_player.EquipmentComponent.IsItemEquipped(equipableItem));
|
||||
ItemName.Disabled = equipableItem.Glued;
|
||||
ItemName.FocusMode = equipableItem.Glued ? FocusModeEnum.None : FocusModeEnum.All;
|
||||
}
|
||||
|
||||
if (item is IAugmentableItem augmentableItem)
|
||||
|
||||
Reference in New Issue
Block a user