Add item spawn menu
Fix game over bug Start adding more implementation for jewels
This commit is contained in:
@@ -18,6 +18,8 @@ public partial class InGameUI : Control, IInGameUI
|
||||
|
||||
[Node] public IInventoryMenu InventoryMenu { get; set; } = default!;
|
||||
|
||||
[Node] public ItemRescueMenu ItemRescueMenu { get; set; } = default!;
|
||||
|
||||
[Node] public IPlayerInfoUI PlayerInfoUI { get; set; } = default!;
|
||||
|
||||
[Node] public InventoryMessageUI InventoryMessageUI { get; set; } = default!;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://b1muxus5qdbeu"]
|
||||
[gd_scene load_steps=12 format=3 uid="uid://b1muxus5qdbeu"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dlq2mkhl4pe7a" path="res://src/ui/in_game_ui/InGameUI.cs" id="1_sc13i"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"]
|
||||
@@ -9,6 +9,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://8f3dk16nj0dn" path="res://src/menu/DebugMenu.tscn" id="7_llomk"]
|
||||
[ext_resource type="Texture2D" uid="uid://bj4p4qxb1mj3q" path="res://src/ui/player_ui/Assets/panel rough draft.png" id="7_ur8ag"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3e6hbctay1us" path="res://src/ui/inventory_menu/InventoryMenu2.tscn" id="9_ur8ag"]
|
||||
[ext_resource type="PackedScene" uid="uid://dwa7o6hkkwjg1" path="res://src/ui/inventory_menu/ItemRescueMenu.tscn" id="10_higkc"]
|
||||
|
||||
[sub_resource type="StyleBoxLine" id="StyleBoxLine_ur8ag"]
|
||||
color = Color(0.792157, 0.698039, 0.643137, 1)
|
||||
@@ -147,3 +148,8 @@ size_flags_vertical = 3
|
||||
[node name="InventoryMenu" parent="." instance=ExtResource("9_ur8ag")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
|
||||
[node name="ItemRescueMenu" parent="." instance=ExtResource("10_higkc")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
|
||||
@@ -1,333 +0,0 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class InventoryMenu : Control, IInventoryMenu
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Node] public VBoxContainer ItemsPage { get; set; }
|
||||
|
||||
[Node] public Label ATKValue { get; set; }
|
||||
[Node] public Label ATKBonusLabel { get; set; }
|
||||
[Node] public Label DEFValue { get; set; }
|
||||
[Node] public Label DEFBonusLabel { get; set; }
|
||||
|
||||
[Node] public Button UseButton { get; set; }
|
||||
[Node] public Button ThrowButton { get; set; }
|
||||
[Node] public Button DropButton { get; set; }
|
||||
|
||||
[Node] public Label ItemDescriptionTitle { get; set; }
|
||||
[Node] public Label UseItemPrompt { get; set; }
|
||||
[Node] public Label ItemEffectLabel { get; set; }
|
||||
|
||||
[Node] public ItemSlot ItemSlot1 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot2 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot3 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot4 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot5 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot6 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot7 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot8 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot9 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot10 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot11 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot12 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot13 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot14 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot15 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot16 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot17 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot18 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot19 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot20 { get; set; }
|
||||
|
||||
[Dependency] private IPlayer _player => this.DependOn<IPlayer>();
|
||||
[Dependency] private IGame _game => this.DependOn<IGame>();
|
||||
[Dependency] private IGameRepo _gameRepo => this.DependOn<IGameRepo>();
|
||||
|
||||
private List<IItemSlot> ItemSlots;
|
||||
|
||||
private string ITEM_SLOT_SCENE = "res://src/ui/inventory_menu/ItemSlot.tscn";
|
||||
|
||||
private IItemSlot _currentlySelectedItem = null;
|
||||
private bool _enableMenuSound = false;
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
ItemSlots = [ItemSlot1, ItemSlot2, ItemSlot3, ItemSlot4, ItemSlot5, ItemSlot6, ItemSlot7, ItemSlot8, ItemSlot9, ItemSlot10, ItemSlot11, ItemSlot12, ItemSlot13, ItemSlot14, ItemSlot15, ItemSlot16, ItemSlot17, ItemSlot18, ItemSlot19, ItemSlot20];
|
||||
_currentlySelectedItem = ItemSlot1;
|
||||
foreach (var item in ItemSlots)
|
||||
{
|
||||
item.ItemPressed += Item_Pressed;
|
||||
}
|
||||
|
||||
_player.AttackComponent.CurrentAttack.Sync += Attack_Sync;
|
||||
_player.AttackComponent.MaximumAttack.Sync += Attack_Sync;
|
||||
_player.DefenseComponent.CurrentDefense.Sync += Defense_Sync;
|
||||
_player.DefenseComponent.MaximumDefense.Sync += Defense_Sync;
|
||||
_player.EquipmentComponent.EquipmentChanged += EquipmentComponent_EquipmentChanged;
|
||||
_player.Inventory.InventoryChanged += Inventory_InventoryChanged;
|
||||
|
||||
UseButton.Pressed += UseButtonPressed;
|
||||
ThrowButton.Pressed += ThrowButtonPressed;
|
||||
DropButton.Pressed += DropButtonPressed;
|
||||
|
||||
UseButton.FocusEntered += ActionButtonFocusChanged;
|
||||
ThrowButton.FocusEntered += ActionButtonFocusChanged;
|
||||
DropButton.FocusEntered += ActionButtonFocusChanged;
|
||||
|
||||
VisibilityChanged += InventoryMenu_VisibilityChanged;
|
||||
SetProcessUnhandledInput(false);
|
||||
}
|
||||
|
||||
private void ActionButtonFocusChanged()
|
||||
{
|
||||
if (!_enableMenuSound)
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if ((!Input.IsActionJustPressed(GameInputs.UiUp) && Input.IsActionPressed(GameInputs.UiUp)) || (!Input.IsActionJustPressed(GameInputs.UiDown) && Input.IsActionPressed(GameInputs.UiDown)))
|
||||
AcceptEvent();
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.UiCancel) && (UseItemPrompt.Visible))
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
AcceptEvent();
|
||||
HideUserActionPrompt();
|
||||
}
|
||||
else if (Input.IsActionJustPressed(GameInputs.UiCancel))
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
AcceptEvent();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.InventorySort))
|
||||
{
|
||||
var isChanged = _player.Inventory.Sort(_player.EquipmentComponent.EquippedWeapon.Value, _player.EquipmentComponent.EquippedArmor.Value, _player.EquipmentComponent.EquippedAccessory.Value, _player.EquipmentComponent.EquippedAmmo.Value);
|
||||
if (!isChanged)
|
||||
return;
|
||||
|
||||
SfxDatabase.Instance.Play(SoundEffect.SortInventory);
|
||||
Inventory_InventoryChanged();
|
||||
Item_ItemExitFocus(_currentlySelectedItem);
|
||||
_currentlySelectedItem = ItemSlot1;
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private void InventoryMenu_VisibilityChanged()
|
||||
{
|
||||
if (Visible)
|
||||
{
|
||||
SetProcessUnhandledInput(true);
|
||||
SfxDatabase.Instance.Play(SoundEffect.OpenInventory);
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
_enableMenuSound = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetProcessUnhandledInput(false);
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
_enableMenuSound = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Item_ItemExitFocus(IItemSlot itemSlot)
|
||||
{
|
||||
ItemDescriptionTitle.Text = string.Empty;
|
||||
ItemEffectLabel.Text = string.Empty;
|
||||
}
|
||||
|
||||
private void Item_FocusEntered(IItemSlot itemSlot)
|
||||
{
|
||||
if (itemSlot.Item.Value == null)
|
||||
return;
|
||||
|
||||
if (_enableMenuSound)
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
|
||||
ItemDescriptionTitle.Text = $"{itemSlot.Item.Value.ItemName}";
|
||||
ItemEffectLabel.Text = $"{itemSlot.Item.Value.Description}";
|
||||
_currentlySelectedItem = itemSlot;
|
||||
AcceptEvent();
|
||||
}
|
||||
|
||||
private void Item_Pressed(IItemSlot item) => DisplayUserActionPrompt(item.Item.Value);
|
||||
|
||||
private async void Inventory_InventoryChanged()
|
||||
{
|
||||
foreach (var slot in ItemSlots)
|
||||
{
|
||||
slot.Visible = false;
|
||||
}
|
||||
|
||||
var itemsToDisplay = _player.Inventory.Items;
|
||||
for (var i = 0; i < itemsToDisplay.Count; i++)
|
||||
{
|
||||
ItemSlots[i].Item.OnNext(itemsToDisplay[i]);
|
||||
ItemSlots[i].Visible = true;
|
||||
}
|
||||
|
||||
if (!_player.Inventory.Items.Contains(_currentlySelectedItem.Item.Value))
|
||||
{
|
||||
_currentlySelectedItem.Item.OnNext(null);
|
||||
var elementToSelect = Mathf.Max(0, ItemSlots.IndexOf(_currentlySelectedItem) - 1);
|
||||
_currentlySelectedItem = ItemSlots.ElementAt(elementToSelect);
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private void Attack_Sync(int obj) => ATKValue.Text = $"{_player.AttackComponent.CurrentAttack.Value}/{_player.AttackComponent.MaximumAttack.Value}";
|
||||
private void Defense_Sync(int obj) => DEFValue.Text = $"{_player.DefenseComponent.CurrentDefense.Value}/{_player.DefenseComponent.MaximumDefense.Value}";
|
||||
|
||||
private void EquipmentComponent_EquipmentChanged(EquipableItem equipableItem)
|
||||
{
|
||||
ATKBonusLabel.Text = $"{_player.EquipmentComponent.BonusAttack:+0;-#;\\.\\.\\.}";
|
||||
DEFBonusLabel.Text = $"{_player.EquipmentComponent.BonusDefense:+0;-#;\\.\\.\\.}";
|
||||
}
|
||||
|
||||
private async void UseButtonPressed()
|
||||
{
|
||||
UseButton.Disabled = true;
|
||||
if (_currentlySelectedItem.Item.Value is EquipableItem equipable)
|
||||
await EquipOrUnequipItem(equipable);
|
||||
else if (_currentlySelectedItem.Item.Value is Plastique plastique)
|
||||
SetItem();
|
||||
else if (_currentlySelectedItem.Item.Value is Jewel jewel)
|
||||
AugmentEquipment(jewel);
|
||||
else
|
||||
await _game.UseItem(_currentlySelectedItem.Item.Value);
|
||||
UseButton.Disabled = false;
|
||||
|
||||
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
await ToSignal(GetTree().CreateTimer(1f), "timeout");
|
||||
}
|
||||
|
||||
private async void SetItem()
|
||||
{
|
||||
_game.SetItem(_currentlySelectedItem.Item.Value);
|
||||
_player.Inventory.Remove(_currentlySelectedItem.Item.Value);
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
private async void ThrowButtonPressed()
|
||||
{
|
||||
_game.ThrowItem(_currentlySelectedItem.Item.Value);
|
||||
_player.Inventory.Remove(_currentlySelectedItem.Item.Value);
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
private async void DropButtonPressed()
|
||||
{
|
||||
_game.DropItem(_currentlySelectedItem.Item.Value);
|
||||
_player.Inventory.Remove(_currentlySelectedItem.Item.Value);
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
private void AugmentEquipment(Jewel jewel)
|
||||
{
|
||||
DisplayUserActionPrompt(jewel);
|
||||
foreach (var item in ItemSlots)
|
||||
{
|
||||
item.Disabled = item.Item.Value is not Weapon && item.Item.Value is not Armor && item.Item.Value is not Accessory;
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayUserActionPrompt(InventoryItem item)
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
|
||||
ItemDescriptionTitle.Hide();
|
||||
ItemEffectLabel.Hide();
|
||||
UseItemPrompt.Show();
|
||||
UseButton.Show();
|
||||
ThrowButton.Show();
|
||||
DropButton.Show();
|
||||
|
||||
if (item is EquipableItem equipable)
|
||||
{
|
||||
var isItemEquipped = _player.EquipmentComponent.IsItemEquipped(equipable);
|
||||
UseButton.Text = isItemEquipped ? "Unequip" : "Equip";
|
||||
UseButton.Disabled = equipable.Glued;
|
||||
ThrowButton.Disabled = isItemEquipped;
|
||||
ThrowButton.FocusMode = isItemEquipped ? FocusModeEnum.None : FocusModeEnum.All;
|
||||
DropButton.Disabled = isItemEquipped;
|
||||
DropButton.FocusMode = isItemEquipped ? FocusModeEnum.None : FocusModeEnum.All;
|
||||
|
||||
UseButton.GrabFocus();
|
||||
|
||||
if (!_player.CanEquipState && isItemEquipped)
|
||||
UseButton.Disabled = true;
|
||||
}
|
||||
else if (item is Plastique plastique)
|
||||
{
|
||||
UseButton.Text = "Set";
|
||||
}
|
||||
else
|
||||
{
|
||||
UseButton.Text = "Use";
|
||||
}
|
||||
_enableMenuSound = false;
|
||||
}
|
||||
|
||||
private void HideUserActionPrompt()
|
||||
{
|
||||
UseItemPrompt.Hide();
|
||||
UseButton.Hide();
|
||||
ThrowButton.Hide();
|
||||
DropButton.Hide();
|
||||
UseButton.ReleaseFocus();
|
||||
ThrowButton.ReleaseFocus();
|
||||
DropButton.ReleaseFocus();
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
_enableMenuSound = true;
|
||||
}
|
||||
|
||||
private async Task EquipOrUnequipItem(EquipableItem equipable)
|
||||
{
|
||||
if (_player.EquipmentComponent.IsItemEquipped(equipable))
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.Unequip);
|
||||
ItemEffectLabel.Text = $"{equipable.GetType().Name} unequipped.";
|
||||
_player.Unequip(equipable);
|
||||
}
|
||||
else
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.Equip);
|
||||
var itemSlot = _currentlySelectedItem;
|
||||
ItemEffectLabel.Text = $"{equipable.GetType().Name} equipped.";
|
||||
_player.Equip(equipable);
|
||||
_currentlySelectedItem = itemSlot;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ShowInventoryInfo()
|
||||
{
|
||||
ItemDescriptionTitle.Show();
|
||||
ItemEffectLabel.Show();
|
||||
}
|
||||
|
||||
private enum InventoryPageNumber
|
||||
{
|
||||
FirstPage,
|
||||
SecondPage
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://bi1xopts68paw
|
||||
@@ -1,6 +1,5 @@
|
||||
[gd_scene load_steps=21 format=3 uid="uid://dlj8qdg1c5048"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://cbxw70qa7gifp"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bi1xopts68paw" path="res://src/ui/inventory_menu/InventoryMenu.cs" id="1_b6rkr"]
|
||||
[ext_resource type="PackedScene" uid="uid://c005nd0m2eim" path="res://src/ui/inventory_menu/ItemSlot.tscn" id="4_aiji3"]
|
||||
[ext_resource type="LabelSettings" uid="uid://wc363u5t1yi2" path="res://src/ui/label_settings/HeadingFont.tres" id="4_l0byb"]
|
||||
[ext_resource type="LabelSettings" uid="uid://cuuo43x72xcsc" path="res://src/ui/label_settings/MainTextBold.tres" id="7_vyrxm"]
|
||||
@@ -8,6 +7,345 @@
|
||||
[ext_resource type="Theme" uid="uid://daxuhpmyxwxck" path="res://src/ui/inventory_menu/InventoryDialogueSelectionStyle.tres" id="8_khyvo"]
|
||||
[ext_resource type="LabelSettings" uid="uid://bgnwcs434ppkf" path="res://src/ui/label_settings/EbrimaText.tres" id="8_ldqki"]
|
||||
|
||||
[sub_resource type="CSharpScript" id="CSharpScript_xwkpe"]
|
||||
script/source = "using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
using Godot;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Zennysoft.Ma.Adapter;
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class InventoryMenu : Control, IInventoryMenu
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Node] public VBoxContainer ItemsPage { get; set; }
|
||||
|
||||
[Node] public Label ATKValue { get; set; }
|
||||
[Node] public Label ATKBonusLabel { get; set; }
|
||||
[Node] public Label DEFValue { get; set; }
|
||||
[Node] public Label DEFBonusLabel { get; set; }
|
||||
|
||||
[Node] public Button UseButton { get; set; }
|
||||
[Node] public Button ThrowButton { get; set; }
|
||||
[Node] public Button DropButton { get; set; }
|
||||
|
||||
[Node] public Label ItemDescriptionTitle { get; set; }
|
||||
[Node] public Label UseItemPrompt { get; set; }
|
||||
[Node] public Label ItemEffectLabel { get; set; }
|
||||
|
||||
[Node] public ItemSlot ItemSlot1 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot2 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot3 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot4 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot5 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot6 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot7 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot8 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot9 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot10 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot11 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot12 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot13 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot14 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot15 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot16 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot17 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot18 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot19 { get; set; }
|
||||
[Node] public ItemSlot ItemSlot20 { get; set; }
|
||||
|
||||
[Dependency] private IPlayer _player => this.DependOn<IPlayer>();
|
||||
[Dependency] private IGame _game => this.DependOn<IGame>();
|
||||
[Dependency] private IGameRepo _gameRepo => this.DependOn<IGameRepo>();
|
||||
|
||||
private List<IItemSlot> ItemSlots;
|
||||
|
||||
private string ITEM_SLOT_SCENE = \"res://src/ui/inventory_menu/ItemSlot.tscn\";
|
||||
|
||||
private IItemSlot _currentlySelectedItem = null;
|
||||
private bool _enableMenuSound = false;
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
ItemSlots = [ItemSlot1, ItemSlot2, ItemSlot3, ItemSlot4, ItemSlot5, ItemSlot6, ItemSlot7, ItemSlot8, ItemSlot9, ItemSlot10, ItemSlot11, ItemSlot12, ItemSlot13, ItemSlot14, ItemSlot15, ItemSlot16, ItemSlot17, ItemSlot18, ItemSlot19, ItemSlot20];
|
||||
_currentlySelectedItem = ItemSlot1;
|
||||
foreach (var item in ItemSlots)
|
||||
{
|
||||
item.ItemPressed += Item_Pressed;
|
||||
}
|
||||
|
||||
_player.AttackComponent.CurrentAttack.Sync += Attack_Sync;
|
||||
_player.AttackComponent.MaximumAttack.Sync += Attack_Sync;
|
||||
_player.DefenseComponent.CurrentDefense.Sync += Defense_Sync;
|
||||
_player.DefenseComponent.MaximumDefense.Sync += Defense_Sync;
|
||||
_player.EquipmentComponent.EquipmentChanged += EquipmentComponent_EquipmentChanged;
|
||||
_player.Inventory.InventoryChanged += Inventory_InventoryChanged;
|
||||
|
||||
UseButton.Pressed += UseButtonPressed;
|
||||
ThrowButton.Pressed += ThrowButtonPressed;
|
||||
DropButton.Pressed += DropButtonPressed;
|
||||
|
||||
UseButton.FocusEntered += ActionButtonFocusChanged;
|
||||
ThrowButton.FocusEntered += ActionButtonFocusChanged;
|
||||
DropButton.FocusEntered += ActionButtonFocusChanged;
|
||||
|
||||
VisibilityChanged += InventoryMenu_VisibilityChanged;
|
||||
SetProcessUnhandledInput(false);
|
||||
}
|
||||
|
||||
private void ActionButtonFocusChanged()
|
||||
{
|
||||
if (!_enableMenuSound)
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
if (!Visible)
|
||||
return;
|
||||
|
||||
if ((!Input.IsActionJustPressed(GameInputs.UiUp) && Input.IsActionPressed(GameInputs.UiUp)) || (!Input.IsActionJustPressed(GameInputs.UiDown) && Input.IsActionPressed(GameInputs.UiDown)))
|
||||
AcceptEvent();
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.UiCancel) && (UseItemPrompt.Visible))
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
AcceptEvent();
|
||||
HideUserActionPrompt();
|
||||
}
|
||||
else if (Input.IsActionJustPressed(GameInputs.UiCancel))
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
AcceptEvent();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.InventorySort))
|
||||
{
|
||||
var isChanged = _player.Inventory.Sort(_player.EquipmentComponent.EquippedWeapon.Value, _player.EquipmentComponent.EquippedArmor.Value, _player.EquipmentComponent.EquippedAccessory.Value, _player.EquipmentComponent.EquippedAmmo.Value);
|
||||
if (!isChanged)
|
||||
return;
|
||||
|
||||
SfxDatabase.Instance.Play(SoundEffect.SortInventory);
|
||||
Inventory_InventoryChanged();
|
||||
Item_ItemExitFocus(_currentlySelectedItem);
|
||||
_currentlySelectedItem = ItemSlot1;
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private void InventoryMenu_VisibilityChanged()
|
||||
{
|
||||
if (Visible)
|
||||
{
|
||||
SetProcessUnhandledInput(true);
|
||||
SfxDatabase.Instance.Play(SoundEffect.OpenInventory);
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
_enableMenuSound = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetProcessUnhandledInput(false);
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
_enableMenuSound = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void Item_ItemExitFocus(IItemSlot itemSlot)
|
||||
{
|
||||
ItemDescriptionTitle.Text = string.Empty;
|
||||
ItemEffectLabel.Text = string.Empty;
|
||||
}
|
||||
|
||||
private void Item_FocusEntered(IItemSlot itemSlot)
|
||||
{
|
||||
if (itemSlot.Item.Value == null)
|
||||
return;
|
||||
|
||||
if (_enableMenuSound)
|
||||
SfxDatabase.Instance.Play(SoundEffect.MoveUI);
|
||||
|
||||
ItemDescriptionTitle.Text = $\"{itemSlot.Item.Value.ItemName}\";
|
||||
ItemEffectLabel.Text = $\"{itemSlot.Item.Value.Description}\";
|
||||
_currentlySelectedItem = itemSlot;
|
||||
AcceptEvent();
|
||||
}
|
||||
|
||||
private void Item_Pressed(IItemSlot item) => DisplayUserActionPrompt(item.Item.Value);
|
||||
|
||||
private async void Inventory_InventoryChanged()
|
||||
{
|
||||
foreach (var slot in ItemSlots)
|
||||
{
|
||||
slot.Visible = false;
|
||||
}
|
||||
|
||||
var itemsToDisplay = _player.Inventory.Items;
|
||||
for (var i = 0; i < itemsToDisplay.Count; i++)
|
||||
{
|
||||
ItemSlots[i].Item.OnNext(itemsToDisplay[i]);
|
||||
ItemSlots[i].Visible = true;
|
||||
}
|
||||
|
||||
if (!_player.Inventory.Items.Contains(_currentlySelectedItem.Item.Value))
|
||||
{
|
||||
_currentlySelectedItem.Item.OnNext(null);
|
||||
var elementToSelect = Mathf.Max(0, ItemSlots.IndexOf(_currentlySelectedItem) - 1);
|
||||
_currentlySelectedItem = ItemSlots.ElementAt(elementToSelect);
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
}
|
||||
}
|
||||
|
||||
private void Attack_Sync(int obj) => ATKValue.Text = $\"{_player.AttackComponent.CurrentAttack.Value}/{_player.AttackComponent.MaximumAttack.Value}\";
|
||||
private void Defense_Sync(int obj) => DEFValue.Text = $\"{_player.DefenseComponent.CurrentDefense.Value}/{_player.DefenseComponent.MaximumDefense.Value}\";
|
||||
|
||||
private void EquipmentComponent_EquipmentChanged(EquipableItem equipableItem)
|
||||
{
|
||||
ATKBonusLabel.Text = $\"{_player.EquipmentComponent.BonusAttack:+0;-#;\\\\.\\\\.\\\\.}\";
|
||||
DEFBonusLabel.Text = $\"{_player.EquipmentComponent.BonusDefense:+0;-#;\\\\.\\\\.\\\\.}\";
|
||||
}
|
||||
|
||||
private async void UseButtonPressed()
|
||||
{
|
||||
UseButton.Disabled = true;
|
||||
if (_currentlySelectedItem.Item.Value is EquipableItem equipable)
|
||||
await EquipOrUnequipItem(equipable);
|
||||
else if (_currentlySelectedItem.Item.Value is Plastique plastique)
|
||||
SetItem();
|
||||
else if (_currentlySelectedItem.Item.Value is Jewel jewel)
|
||||
AugmentEquipment(jewel);
|
||||
else
|
||||
await _game.UseItem(_currentlySelectedItem.Item.Value);
|
||||
UseButton.Disabled = false;
|
||||
|
||||
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
await ToSignal(GetTree().CreateTimer(1f), \"timeout\");
|
||||
}
|
||||
|
||||
private async void SetItem()
|
||||
{
|
||||
_game.SetItem(_currentlySelectedItem.Item.Value);
|
||||
_player.Inventory.Remove(_currentlySelectedItem.Item.Value);
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
private async void ThrowButtonPressed()
|
||||
{
|
||||
_game.ThrowItem(_currentlySelectedItem.Item.Value);
|
||||
_player.Inventory.Remove(_currentlySelectedItem.Item.Value);
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
private async void DropButtonPressed()
|
||||
{
|
||||
_game.DropItem(_currentlySelectedItem.Item.Value);
|
||||
_player.Inventory.Remove(_currentlySelectedItem.Item.Value);
|
||||
HideUserActionPrompt();
|
||||
await ShowInventoryInfo();
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
|
||||
private void AugmentEquipment(Jewel jewel)
|
||||
{
|
||||
DisplayUserActionPrompt(jewel);
|
||||
foreach (var item in ItemSlots)
|
||||
{
|
||||
item.Disabled = item.Item.Value is not Weapon && item.Item.Value is not Armor && item.Item.Value is not Accessory;
|
||||
}
|
||||
}
|
||||
|
||||
private void DisplayUserActionPrompt(InventoryItem item)
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.SelectUI);
|
||||
ItemDescriptionTitle.Hide();
|
||||
ItemEffectLabel.Hide();
|
||||
UseItemPrompt.Show();
|
||||
UseButton.Show();
|
||||
ThrowButton.Show();
|
||||
DropButton.Show();
|
||||
|
||||
if (item is EquipableItem equipable)
|
||||
{
|
||||
var isItemEquipped = _player.EquipmentComponent.IsItemEquipped(equipable);
|
||||
UseButton.Text = isItemEquipped ? \"Unequip\" : \"Equip\";
|
||||
UseButton.Disabled = equipable.Glued;
|
||||
ThrowButton.Disabled = isItemEquipped;
|
||||
ThrowButton.FocusMode = isItemEquipped ? FocusModeEnum.None : FocusModeEnum.All;
|
||||
DropButton.Disabled = isItemEquipped;
|
||||
DropButton.FocusMode = isItemEquipped ? FocusModeEnum.None : FocusModeEnum.All;
|
||||
|
||||
UseButton.GrabFocus();
|
||||
|
||||
if (!_player.CanEquipState && isItemEquipped)
|
||||
UseButton.Disabled = true;
|
||||
}
|
||||
else if (item is Plastique plastique)
|
||||
{
|
||||
UseButton.Text = \"Set\";
|
||||
}
|
||||
else
|
||||
{
|
||||
UseButton.Text = \"Use\";
|
||||
}
|
||||
_enableMenuSound = false;
|
||||
}
|
||||
|
||||
private void HideUserActionPrompt()
|
||||
{
|
||||
UseItemPrompt.Hide();
|
||||
UseButton.Hide();
|
||||
ThrowButton.Hide();
|
||||
DropButton.Hide();
|
||||
UseButton.ReleaseFocus();
|
||||
ThrowButton.ReleaseFocus();
|
||||
DropButton.ReleaseFocus();
|
||||
_currentlySelectedItem.GrabFocus();
|
||||
_enableMenuSound = true;
|
||||
}
|
||||
|
||||
private async Task EquipOrUnequipItem(EquipableItem equipable)
|
||||
{
|
||||
if (_player.EquipmentComponent.IsItemEquipped(equipable))
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.Unequip);
|
||||
ItemEffectLabel.Text = $\"{equipable.GetType().Name} unequipped.\";
|
||||
_player.Unequip(equipable);
|
||||
}
|
||||
else
|
||||
{
|
||||
SfxDatabase.Instance.Play(SoundEffect.Equip);
|
||||
var itemSlot = _currentlySelectedItem;
|
||||
ItemEffectLabel.Text = $\"{equipable.GetType().Name} equipped.\";
|
||||
_player.Equip(equipable);
|
||||
_currentlySelectedItem = itemSlot;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ShowInventoryInfo()
|
||||
{
|
||||
ItemDescriptionTitle.Show();
|
||||
ItemEffectLabel.Show();
|
||||
}
|
||||
|
||||
private enum InventoryPageNumber
|
||||
{
|
||||
FirstPage,
|
||||
SecondPage
|
||||
}
|
||||
}
|
||||
"
|
||||
|
||||
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_unikd"]
|
||||
blend_mode = 4
|
||||
|
||||
@@ -47,7 +385,7 @@ grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
mouse_filter = 2
|
||||
script = ExtResource("1_b6rkr")
|
||||
script = SubResource("CSharpScript_xwkpe")
|
||||
|
||||
[node name="BG" type="ColorRect" parent="."]
|
||||
material = SubResource("CanvasItemMaterial_unikd")
|
||||
|
||||
@@ -38,6 +38,10 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
|
||||
private IItemSlot _currentlySelected;
|
||||
|
||||
private bool _augmentMode = false;
|
||||
|
||||
private Jewel _augmentingJewel;
|
||||
|
||||
#region ItemSlots
|
||||
[Node] public IItemSlot ItemSlot01 { get; set; }
|
||||
[Node] public IItemSlot ItemSlot02 { get; set; }
|
||||
@@ -91,7 +95,7 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
slot.ItemSelected += Slot_FocusEntered;
|
||||
slot.ItemPressed += Slot_ItemPressed;
|
||||
}
|
||||
VisibilityChanged += InventoryMenu_VisibilityChanged;
|
||||
VisibilityChanged += ResetInventoryState;
|
||||
InteractButton.Pressed += InteractButton_Pressed;
|
||||
ThrowButton.Pressed += ThrowButton_Pressed;
|
||||
DropButton.Pressed += DropButton_Pressed;
|
||||
@@ -103,7 +107,12 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
if (_currentlySelected != null)
|
||||
{
|
||||
var item = _currentlySelected.Item.Value;
|
||||
if (item is EquipableItem equipable)
|
||||
if (_augmentMode)
|
||||
{
|
||||
//_player.AugmentItem(_augmentingJewel, item as EquipableItem);
|
||||
ResetInventoryState();
|
||||
}
|
||||
else if (item is EquipableItem equipable)
|
||||
{
|
||||
if (_player.EquipmentComponent.IsItemEquipped(equipable))
|
||||
_player.Unequip(equipable);
|
||||
@@ -116,6 +125,11 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
}
|
||||
else if (item is Plastique plastique)
|
||||
_game.SetItem(plastique);
|
||||
else if (item is Jewel jewel)
|
||||
{
|
||||
_augmentMode = true;
|
||||
AugmentMode(jewel);
|
||||
}
|
||||
else
|
||||
_game.UseItem(_currentlySelected.Item.Value);
|
||||
|
||||
@@ -148,6 +162,7 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
if (ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.Interact))
|
||||
{
|
||||
CloseActionMenu();
|
||||
_augmentMode = false;
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
GetViewport().SetInputAsHandled();
|
||||
}
|
||||
@@ -175,7 +190,7 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
{
|
||||
_player.Inventory.Sort(_player.EquipmentComponent.EquippedWeapon.Value, _player.EquipmentComponent.EquippedArmor.Value, _player.EquipmentComponent.EquippedAccessory.Value, _player.EquipmentComponent.EquippedAmmo.Value);
|
||||
SfxDatabase.Instance.Play(SoundEffect.SortInventory);
|
||||
InventoryMenu_VisibilityChanged();
|
||||
ResetInventoryState();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,7 +205,14 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
ThrowButton.FocusMode = FocusModeEnum.All;
|
||||
DropButton.FocusMode = FocusModeEnum.All;
|
||||
|
||||
if (item is EquipableItem equipable)
|
||||
if (_augmentMode)
|
||||
{
|
||||
InteractButton.Text = "Augment";
|
||||
ThrowButton.Disabled = true;
|
||||
DropButton.Disabled = true;
|
||||
InteractButton.GrabFocus();
|
||||
}
|
||||
else if (item is EquipableItem equipable)
|
||||
{
|
||||
var itemIsEquipped = _player.EquipmentComponent.IsItemEquipped(equipable);
|
||||
InteractButton.Text = itemIsEquipped ? "Unequip" : "Equip";
|
||||
@@ -212,6 +234,11 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
InteractButton.FocusMode = FocusModeEnum.None;
|
||||
ThrowButton.GrabFocus();
|
||||
}
|
||||
else if (item is Jewel jewel)
|
||||
{
|
||||
InteractButton.Text = "Augment";
|
||||
InteractButton.GrabFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
InteractButton.Text = "Use";
|
||||
@@ -221,19 +248,31 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
ActionPanel.Show();
|
||||
}
|
||||
|
||||
private void InventoryMenu_VisibilityChanged()
|
||||
private void ResetInventoryState()
|
||||
{
|
||||
_augmentMode = false;
|
||||
|
||||
foreach (var item in ItemSlots)
|
||||
{
|
||||
item.Hide();
|
||||
item.Disabled = true;
|
||||
item.FocusMode = FocusModeEnum.None;
|
||||
}
|
||||
|
||||
foreach (var item in ItemCountLabels)
|
||||
item.Text = string.Empty;
|
||||
|
||||
ItemName.Text = string.Empty;
|
||||
ItemFlavor.Text = string.Empty;
|
||||
ItemStats.Text = string.Empty;
|
||||
|
||||
|
||||
for (var i = 0; i < _player.Inventory.Items.Count; i++)
|
||||
{
|
||||
var item = _player.Inventory.Items[i];
|
||||
ItemSlots[i].Item.OnNext(item);
|
||||
ItemSlots[i].FocusMode = FocusModeEnum.All;
|
||||
ItemSlots[i].Disabled = false;
|
||||
ItemSlots[i].Show();
|
||||
ItemSlots[i].SetItemEquipmentStatus(_player.EquipmentComponent.IsItemEquipped(item));
|
||||
if (item is IStackable stackable)
|
||||
@@ -256,6 +295,25 @@ public partial class InventoryMenu2 : Control, IInventoryMenu
|
||||
ItemFlavor.Text = item.Description;
|
||||
}
|
||||
|
||||
private void AugmentMode(Jewel jewel)
|
||||
{
|
||||
_augmentingJewel = jewel;
|
||||
|
||||
foreach (var item in ItemSlots)
|
||||
{
|
||||
item.Disabled = true;
|
||||
item.FocusMode = FocusModeEnum.None;
|
||||
if (item.Item.Value is EquipableItem equipable && equipable.Augment == null)
|
||||
{
|
||||
item.Disabled = false;
|
||||
item.FocusMode = FocusModeEnum.All;
|
||||
}
|
||||
}
|
||||
|
||||
var itemToSelect = ItemSlots.First(x => !x.Disabled);
|
||||
itemToSelect.GrabFocus();
|
||||
}
|
||||
|
||||
private void CloseActionMenu()
|
||||
{
|
||||
_currentlySelected.GrabFocus();
|
||||
|
||||
@@ -22,6 +22,7 @@ outline_color = Color(0, 0, 0, 1)
|
||||
bg_color = Color(0, 0, 0, 0.745098)
|
||||
|
||||
[node name="InventoryMenu2" type="Control"]
|
||||
process_mode = 2
|
||||
visible = false
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
|
||||
203
Zennysoft.Game.Ma/src/ui/inventory_menu/ItemRescueMenu.cs
Normal file
203
Zennysoft.Game.Ma/src/ui/inventory_menu/ItemRescueMenu.cs
Normal file
@@ -0,0 +1,203 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.Introspection;
|
||||
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 override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Dependency] private IPlayer _player => this.DependOn<IPlayer>();
|
||||
|
||||
[Dependency] private IGame _game => this.DependOn<IGame>();
|
||||
|
||||
[Dependency] private IGameRepo _gameRepo => this.DependOn<IGameRepo>();
|
||||
|
||||
[Node] public Label ItemName { get; set; }
|
||||
|
||||
[Node] public Label ItemFlavor { get; set; }
|
||||
|
||||
[Node] public Label ItemStats { 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;
|
||||
}
|
||||
VisibilityChanged += ResetInventoryState;
|
||||
InteractButton.Pressed += InteractButton_Pressed;
|
||||
DropButton.Pressed += DropButton_Pressed;
|
||||
_currentlySelected = ItemSlot01;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (!Visible)
|
||||
return;
|
||||
|
||||
if (Input.IsActionJustPressed(GameInputs.Inventory))
|
||||
GetViewport().SetInputAsHandled();
|
||||
|
||||
if (ActionPanel.Visible && Input.IsActionJustPressed(GameInputs.Interact))
|
||||
{
|
||||
CloseActionMenu();
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
GetViewport().SetInputAsHandled();
|
||||
}
|
||||
else if (Input.IsActionJustPressed(GameInputs.Interact))
|
||||
{
|
||||
Hide();
|
||||
SfxDatabase.Instance.Play(SoundEffect.CancelUI);
|
||||
GetViewport().SetInputAsHandled();
|
||||
MenuClosing.Invoke();
|
||||
}
|
||||
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)
|
||||
{
|
||||
var item = slot.Item.Value;
|
||||
|
||||
InteractButton.Disabled = false;
|
||||
DropButton.Disabled = false;
|
||||
InteractButton.FocusMode = FocusModeEnum.All;
|
||||
DropButton.FocusMode = FocusModeEnum.All;
|
||||
ActionPanel.Show();
|
||||
InteractButton.GrabFocus();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
foreach (var item in ItemCountLabels)
|
||||
item.Text = string.Empty;
|
||||
|
||||
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 (_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();
|
||||
}
|
||||
|
||||
private void Slot_FocusEntered(IItemSlot slot)
|
||||
{
|
||||
if (_currentlySelected.Item.Value == null)
|
||||
return;
|
||||
_currentlySelected = slot;
|
||||
var item = slot.Item.Value;
|
||||
ItemName.Text = item.ItemName;
|
||||
ItemFlavor.Text = item.Description;
|
||||
}
|
||||
|
||||
private void CloseActionMenu()
|
||||
{
|
||||
_currentlySelected.GrabFocus();
|
||||
ActionPanel.Hide();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://cterndmplud2b
|
||||
434
Zennysoft.Game.Ma/src/ui/inventory_menu/ItemRescueMenu.tscn
Normal file
434
Zennysoft.Game.Ma/src/ui/inventory_menu/ItemRescueMenu.tscn
Normal file
@@ -0,0 +1,434 @@
|
||||
[gd_scene load_steps=11 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"]
|
||||
bg_color = Color(0, 0, 0, 0.745098)
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_ejvue"]
|
||||
line_spacing = 1.0
|
||||
font = ExtResource("2_0lwmo")
|
||||
font_size = 50
|
||||
outline_size = 3
|
||||
outline_color = Color(0, 0, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g7ag1"]
|
||||
bg_color = Color(0, 0, 0, 0.745098)
|
||||
|
||||
[node name="ItemRescueMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
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="MarginContainer" type="MarginContainer" parent="InventoryTitlePanel"]
|
||||
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
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="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"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_font_sizes/font_size = 15
|
||||
text = "STORAGE"
|
||||
label_settings = SubResource("LabelSettings_ejvue")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ActionPanel" type="Panel" parent="."]
|
||||
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
|
||||
focus_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_g7ag1")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="ActionPanel"]
|
||||
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 = 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="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"]
|
||||
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
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="InteractButton" type="Button" parent="ActionPanel/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_top = NodePath(".")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
focus_neighbor_bottom = NodePath("../DropButton")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
theme_override_styles/focus = ExtResource("3_5237l")
|
||||
theme_override_styles/disabled_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/disabled = ExtResource("4_twupc")
|
||||
theme_override_styles/hover_pressed_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/hover_pressed = ExtResource("4_twupc")
|
||||
theme_override_styles/hover_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/hover = ExtResource("4_twupc")
|
||||
theme_override_styles/pressed_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/pressed = ExtResource("4_twupc")
|
||||
theme_override_styles/normal_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/normal = ExtResource("4_twupc")
|
||||
text = "Take"
|
||||
alignment = 0
|
||||
|
||||
[node name="DropButton" type="Button" parent="ActionPanel/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 0
|
||||
focus_neighbor_left = NodePath(".")
|
||||
focus_neighbor_top = NodePath("../InteractButton")
|
||||
focus_neighbor_right = NodePath(".")
|
||||
focus_neighbor_bottom = NodePath(".")
|
||||
theme_override_font_sizes/font_size = 25
|
||||
theme_override_styles/focus = ExtResource("3_5237l")
|
||||
theme_override_styles/disabled_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/disabled = ExtResource("4_twupc")
|
||||
theme_override_styles/hover_pressed_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/hover_pressed = ExtResource("4_twupc")
|
||||
theme_override_styles/hover_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/hover = ExtResource("4_twupc")
|
||||
theme_override_styles/pressed_mirrored = ExtResource("4_twupc")
|
||||
theme_override_styles/pressed = ExtResource("4_twupc")
|
||||
theme_override_styles/normal_mirrored = ExtResource("4_twupc")
|
||||
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="."]
|
||||
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
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="InventoryList" type="Panel" parent="PanelContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_cq2sk")
|
||||
|
||||
[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"]
|
||||
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
|
||||
|
||||
[node name="ReferenceRect" type="ReferenceRect" parent="ItemDescriptionBox/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"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 15
|
||||
theme_override_constants/margin_top = 15
|
||||
theme_override_constants/margin_right = 15
|
||||
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"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
|
||||
[node name="ItemFlavor" type="Label" parent="ItemDescriptionBox/MarginContainer/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(500, 150)
|
||||
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
|
||||
layout_mode = 2
|
||||
label_settings = ExtResource("7_1xig5")
|
||||
Reference in New Issue
Block a user