diff --git a/Globals/StageProducer.cs b/Globals/StageProducer.cs index 4e019c18..da88c937 100644 --- a/Globals/StageProducer.cs +++ b/Globals/StageProducer.cs @@ -141,6 +141,11 @@ public void PreloadScene(int nextRoomIdx) }); break; case Stages.Shop: + _loadTask = Task.Run(() => + { + _preloadStage = GD.Load(ShopScene.LoadPath).Instantiate(); + }); + break; case Stages.Event: case Stages.Chest: _loadTask = Task.Run(() => diff --git a/Globals/Translations/Translations.csv b/Globals/Translations/Translations.csv index 120aa74c..70febe64 100644 --- a/Globals/Translations/Translations.csv +++ b/Globals/Translations/Translations.csv @@ -30,6 +30,10 @@ CHEST_ROOM_REWARDS,Reward Selection!,奖励! CHEST_ROOM_SKIP,Skip,跳过 CHEST_ROOM_ACCEPT,Accept,接受 CHEST_ROOM_REROLL,Rerolls: ,重刷: +SHOP_REMOVAL,Remove A Note,"去掉一个音符" +SHOP_CONFIRM,Confirm Purchase,购买已确认 +SHOP_CANCEL,Cancel,取消操作 +REMOVAL_COST,Removal Fee,删除费用 BATTLE_ROOM_BEGIN_BUTTON,"Begin Battle [Enter]","开始战斗 [Enter]" BATTLE_ROOM_PERFECT,Perfect,精准 BATTLE_ROOM_GOOD,Good,良好 diff --git a/Scenes/ChestScene/ChestScene.cs b/Scenes/ChestScene/ChestScene.cs index 4451d014..8d32acbf 100644 --- a/Scenes/ChestScene/ChestScene.cs +++ b/Scenes/ChestScene/ChestScene.cs @@ -33,7 +33,6 @@ public override void _Process(double delta) private void GetLoot() { - GetNode("%Audio").ProcessMode = ProcessModeEnum.Always; ChestButton.Disabled = true; RewardSelect.CreateSelection(this, _player.Stats, 3, Stages.Chest).Selected += EndBattle; } diff --git a/Scenes/ChestScene/ChestScene.tscn b/Scenes/ChestScene/ChestScene.tscn index 92374ac3..bd88dc49 100644 --- a/Scenes/ChestScene/ChestScene.tscn +++ b/Scenes/ChestScene/ChestScene.tscn @@ -24,7 +24,7 @@ ChestButton = NodePath("CenterContainer/VBoxContainer/ChestButton") PlayerMarker = NodePath("PlayerMarker") [node name="Audio" type="AudioStreamPlayer" parent="."] -unique_name_in_owner = true +process_mode = 3 stream = ExtResource("2_x78jo") autoplay = true diff --git a/Scenes/Puppets/Scripts/PlayerStats.cs b/Scenes/Puppets/Scripts/PlayerStats.cs index b42d979a..602cb0ac 100644 --- a/Scenes/Puppets/Scripts/PlayerStats.cs +++ b/Scenes/Puppets/Scripts/PlayerStats.cs @@ -55,4 +55,9 @@ public void AddNote(Note nSelection) CurNotes = CurNotes.Append(nSelection).ToArray(); } + + public void RemoveNote(Note nSelection) + { + CurNotes = CurNotes.Where(n => n != nSelection).ToArray(); + } } diff --git a/Scenes/ShopScene/Scripts/ShopItem.cs b/Scenes/ShopScene/Scripts/ShopItem.cs new file mode 100644 index 00000000..db396ee6 --- /dev/null +++ b/Scenes/ShopScene/Scripts/ShopItem.cs @@ -0,0 +1,21 @@ +using System; +using Godot; + +public partial class ShopItem : VBoxContainer +{ + public static readonly string LoadPath = "res://Scenes/ShopScene/ShopItem.tscn"; + + [Export] + public DisplayButton DisplayButton; + + [Export] + public Label Cost; + public int Price; + + public void Display(int cost, Texture2D texture, string name, bool focusHandling = false) + { + DisplayButton.Display(texture, name, focusHandling); + Price = cost; + Cost.Text = cost.ToString(); + } +} diff --git a/Scenes/ShopScene/Scripts/ShopItem.cs.uid b/Scenes/ShopScene/Scripts/ShopItem.cs.uid new file mode 100644 index 00000000..ad3cf9c5 --- /dev/null +++ b/Scenes/ShopScene/Scripts/ShopItem.cs.uid @@ -0,0 +1 @@ +uid://doajq3v7wwje5 diff --git a/Scenes/ShopScene/Scripts/ShopScene.cs b/Scenes/ShopScene/Scripts/ShopScene.cs new file mode 100644 index 00000000..612d7aa2 --- /dev/null +++ b/Scenes/ShopScene/Scripts/ShopScene.cs @@ -0,0 +1,293 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using FunkEngine; +using Godot; + +public partial class ShopScene : Control +{ + public static readonly string LoadPath = "res://Scenes/ShopScene/ShopScene.tscn"; + + [Export] + private Label _moneyLabel; + + [Export] + private Button _exitButton; + + [Export] + private Button _removalButton; + + [Export] + private GridContainer _noteGrid; + + [Export] + private GridContainer _relicGrid; + + [Export] + private CenterContainer _confirmationPopup; + + [Export] + private Button _confirmationButton; + + [Export] + private Button _denyButton; + + [Export] + private Label _descriptionLabel; + + [Export] + private Control _removalPanel; + + [Export] + private GridContainer _possessionGrid; + + [Export] + private Button _removalAcceptButton; + + [Export] + private Button _cancelRemoveButton; + + [Export] + private Label _removalCostLabel; + + private ButtonGroup _bGroup; + + private readonly int[] _priceByRarity = [100, 90, 80, 70, 60, 50, 9]; + const int NoteCost = 45; + + public override void _Ready() + { + _bGroup = new ButtonGroup(); + Initialize(); + _confirmationButton.Pressed += TryPurchase; + _denyButton.Pressed += CloseConfirmationPopup; + _removalButton.Pressed += OpenRemovalPane; + _removalAcceptButton.Pressed += RemoveNote; + _cancelRemoveButton.Pressed += CloseRemovalPane; + } + + private void Initialize() + { + UpdateMoneyLabel(); + GenerateShopItems(); + PopulatePossessedNotes(); + } + + public override void _Input(InputEvent @event) + { + if (@event.IsActionPressed("ui_cancel")) + { + if (_confirmationPopup.Visible) + { + CloseConfirmationPopup(); + GetViewport().SetInputAsHandled(); + } + else if (_removalPanel.Visible) + { + CloseRemovalPane(); + GetViewport().SetInputAsHandled(); + } + } + } + + private void UpdateMoneyLabel() + { + _moneyLabel.Text = StageProducer.PlayerStats.Money.ToString(); + } + + private const int RelicOptions = 3; + private const int NoteOptions = 5; + + private void GenerateShopItems() + { + var relics = Scribe.GetRandomRelics( + RelicOptions, + StageProducer.CurRoom + 10, + StageProducer.PlayerStats.RarityOdds + ); + + var notes = Scribe.GetRandomRewardNotes(NoteOptions, StageProducer.CurRoom + 10); + + foreach (var relic in relics) + { + int price = _priceByRarity[(int)relic.Rarity]; + AddShopItem(_relicGrid, relic, price); + } + + foreach (var note in notes) + { + int price = NoteCost; + AddShopItem(_noteGrid, note, price); + } + } + + private void AddShopItem(GridContainer container, IDisplayable item, int price) + { + if (container == null || item == null) + { + GD.PushError("AddShopItem called with null!"); + return; + } + price = Math.Max(price, 0); //Price can't go negative. + ShopItem newItem = GD.Load(ShopItem.LoadPath).Instantiate(); + newItem.Display(price, item.Texture, item.Name); + newItem.DisplayButton.Pressed += () => SetPurchasable(item, newItem); + newItem.DisplayButton.SetButtonGroup(_bGroup); + newItem.DisplayButton.ToggleMode = true; + newItem.DisplayButton.FocusEntered += () => ChangeDescription(item); + container.AddChild(newItem); + } + + private IDisplayable _currentItem; + private ShopItem _currentUItem; + + private void SetPurchasable(IDisplayable item, ShopItem uItem) + { + if (item == null || uItem == null) + return; + _currentItem = item; + _currentUItem = uItem; + _confirmationButton.Disabled = StageProducer.PlayerStats.Money < _currentUItem.Price; + OpenConfirmationPopup(); + } + + private void TryPurchase() + { + if (StageProducer.PlayerStats.Money < _currentUItem.Price) + return; + + StageProducer.PlayerStats.Money -= _currentUItem.Price; + switch (_currentItem) + { + case Note note: + StageProducer.PlayerStats.AddNote(note); + AddNoteToPossessions(note); + break; + case RelicTemplate relic: + StageProducer.PlayerStats.AddRelic(relic); + break; + } + + CloseConfirmationPopup(); + + GetViewport().GuiGetFocusOwner().FindNextValidFocus().GrabFocus(); //slightly hacky + _currentUItem.Visible = false; + _currentUItem.QueueFree(); + UpdateMoneyLabel(); + + _currentItem = null; + _currentUItem = null; + } + + private Control _lastFocused; + + private void OpenConfirmationPopup() + { + _confirmationPopup.Visible = true; + _lastFocused = GetViewport().GuiGetFocusOwner(); + _denyButton.GrabFocus(); + } + + private void CloseConfirmationPopup() + { + _confirmationPopup.Visible = false; + _lastFocused.GrabFocus(); + _lastFocused = null; + _bGroup.GetPressedButton().SetPressed(false); + } + + private void ChangeDescription(IDisplayable displayable) + { + if (displayable == null) + { + _descriptionLabel.Text = ""; + return; + } + string name = displayable.Name.ToUpper(); + name = name.Replace(" ", ""); + string type = displayable switch + { + Note => "NOTE_", + RelicTemplate => "RELIC_", + _ => "UNKNOWN_", + }; + _descriptionLabel.Text = Tr(type + name + "_NAME") + ": " + Tr(type + name + "_TOOLTIP"); + } + + private const int RemovalCost = 50; + private bool _hasRemoved; + + private void OpenRemovalPane() + { + if (_hasRemoved) + return; + _removalCostLabel.Text = RemovalCost.ToString(); + _removalButton.Disabled = true; + _exitButton.Disabled = true; + _removalPanel.Visible = true; + _removalAcceptButton.Visible = false; + _removalAcceptButton.Disabled = StageProducer.PlayerStats.Money < RemovalCost; + _bGroup.GetPressedButton()?.SetPressed(false); + _noteGrid.Visible = false; + _relicGrid.Visible = false; + _cancelRemoveButton.GrabFocus(); + } + + private void CloseRemovalPane() + { + _removalButton.Disabled = _hasRemoved; + _exitButton.Disabled = false; + _removalPanel.Visible = false; + _removalButton.GrabFocus(); + _toRemove = null; + _selectedRemoveButton = null; + _noteGrid.Visible = true; + _relicGrid.Visible = true; + ChangeDescription(null); + } + + private void PopulatePossessedNotes() + { + foreach (var note in StageProducer.PlayerStats.CurNotes) + { + AddNoteToPossessions(note); + } + } + + private void AddNoteToPossessions(Note note) + { + if (note == null) + return; + DisplayButton disButton = GD.Load(DisplayButton.LoadPath) + .Instantiate(); + disButton.Display(note.Texture, note.Name); + disButton.ToggleMode = true; + disButton.FocusEntered += () => ChangeDescription(note); + disButton.Pressed += () => RemovalSelection(note, disButton); + disButton.ButtonGroup = _bGroup; + _possessionGrid.AddChild(disButton); + } + + private Note _toRemove; + private Button _selectedRemoveButton; + + private void RemovalSelection(Note note, Button button) + { + _toRemove = note; + _selectedRemoveButton = button; + _removalAcceptButton.Visible = true; + button.SetPressed(true); + } + + private void RemoveNote() + { + if (_toRemove == null || _selectedRemoveButton == null) + return; + StageProducer.PlayerStats.Money -= RemovalCost; + _removalButton.Disabled = true; + _hasRemoved = true; + StageProducer.PlayerStats.RemoveNote(_toRemove); + _selectedRemoveButton.QueueFree(); + CloseRemovalPane(); + } +} diff --git a/Scenes/ShopScene/Scripts/ShopScene.cs.uid b/Scenes/ShopScene/Scripts/ShopScene.cs.uid new file mode 100644 index 00000000..f81ceae9 --- /dev/null +++ b/Scenes/ShopScene/Scripts/ShopScene.cs.uid @@ -0,0 +1 @@ +uid://dg0xaieus84ns diff --git a/Scenes/ShopScene/ShopItem.tscn b/Scenes/ShopScene/ShopItem.tscn new file mode 100644 index 00000000..9bbfb294 --- /dev/null +++ b/Scenes/ShopScene/ShopItem.tscn @@ -0,0 +1,47 @@ +[gd_scene load_steps=4 format=3 uid="uid://cln1jkrh6sq35"] + +[ext_resource type="PackedScene" uid="uid://cymo26khpw4m1" path="res://Scenes/UI/DisplayButton.tscn" id="1_f0nq7"] +[ext_resource type="Script" uid="uid://doajq3v7wwje5" path="res://Scenes/ShopScene/Scripts/ShopItem.cs" id="1_ncg4o"] +[ext_resource type="Texture2D" uid="uid://dyt1cvag13aik" path="res://SharedAssets/Money.png" id="3_qkmob"] + +[node name="ShopItem" type="VBoxContainer" node_paths=PackedStringArray("DisplayButton", "Cost")] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_right = -596.0 +offset_bottom = -300.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +script = ExtResource("1_ncg4o") +DisplayButton = NodePath("DisplayButton") +Cost = NodePath("MarginContainer/HBoxContainer/MoneyLabel") + +[node name="DisplayButton" parent="." instance=ExtResource("1_f0nq7")] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 2 +theme_override_constants/margin_right = 2 + +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/HBoxContainer"] +layout_mode = 2 +theme_override_constants/margin_left = 2 + +[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/MarginContainer"] +layout_mode = 2 +size_flags_vertical = 4 +texture = ExtResource("3_qkmob") + +[node name="MoneyLabel" type="Label" parent="MarginContainer/HBoxContainer"] +custom_minimum_size = Vector2(21, 0) +layout_mode = 2 +size_flags_horizontal = 10 +size_flags_vertical = 1 +horizontal_alignment = 2 +vertical_alignment = 1 +clip_text = true diff --git a/Scenes/ShopScene/ShopScene.tscn b/Scenes/ShopScene/ShopScene.tscn new file mode 100644 index 00000000..5a2d6b67 --- /dev/null +++ b/Scenes/ShopScene/ShopScene.tscn @@ -0,0 +1,66 @@ +[gd_scene load_steps=9 format=3 uid="uid://b35sk5syi24et"] + +[ext_resource type="Script" uid="uid://pl57giqyhckb" path="res://Scenes/UI/Scripts/MenuModule.cs" id="2_723s6"] +[ext_resource type="Texture2D" uid="uid://qhwve7fik4do" path="res://SharedAssets/BackGround_Full.png" id="2_dt33i"] +[ext_resource type="AudioStream" uid="uid://b52r6rgf4qsdr" path="res://Scenes/UI/TitleScreen/Assets/TitleSong.ogg" id="3_2rgbi"] +[ext_resource type="Script" uid="uid://cp6t6haqyef7o" path="res://Scenes/AreaBasedBackground.cs" id="3_n34g6"] +[ext_resource type="PackedScene" uid="uid://eus17omen6yk" path="res://Scenes/Puppets/PlayerPuppet.tscn" id="4_jpqhk"] +[ext_resource type="PackedScene" uid="uid://bk0js6ji42xrt" path="res://Scenes/ShopScene/ShopUI.tscn" id="8_2xatg"] +[ext_resource type="Shader" uid="uid://dp36iuuy414k1" path="res://SharedAssets/StarryNight.gdshader" id="11_0afww"] + +[sub_resource type="ShaderMaterial" id="ShaderMaterial_jpqhk"] +shader = ExtResource("11_0afww") +shader_parameter/bg_top_color = Vector4(0.18, 0.08, 0.12, 0) +shader_parameter/bg_bottom_color = Vector4(0.028, 0.008, 0.184, 0) +shader_parameter/gradient_ratio = 1.0 +shader_parameter/time_scale = 1.0 + +[node name="ShopScene" type="Node2D"] + +[node name="UILayer" type="CanvasLayer" parent="." node_paths=PackedStringArray("CurSceneNode")] +script = ExtResource("2_723s6") +CurSceneNode = NodePath("..") + +[node name="Audio" type="AudioStreamPlayer" parent="."] +process_mode = 3 +stream = ExtResource("3_2rgbi") +autoplay = true + +[node name="SubViewportContainer" type="SubViewportContainer" parent="."] +z_index = -2 +offset_top = 178.0 +offset_right = 640.0 +offset_bottom = 358.0 +mouse_filter = 2 + +[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"] +handle_input_locally = false +size = Vector2i(640, 180) +render_target_update_mode = 4 + +[node name="StarShader" type="ColorRect" parent="SubViewportContainer/SubViewport"] +z_index = -1 +material = SubResource("ShaderMaterial_jpqhk") +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +mouse_filter = 2 +color = Color(0, 0, 0, 1) + +[node name="PlayerMarker" type="Marker2D" parent="."] +position = Vector2(579, 126) + +[node name="PlayerPuppet" parent="PlayerMarker" instance=ExtResource("4_jpqhk")] + +[node name="BackGround" type="TextureRect" parent="."] +z_index = -1 +offset_right = 640.0 +offset_bottom = 180.0 +texture = ExtResource("2_dt33i") +script = ExtResource("3_n34g6") + +[node name="ShopUI" parent="." instance=ExtResource("8_2xatg")] +offset_right = 640.0 +offset_bottom = 360.0 diff --git a/Scenes/ShopScene/ShopUI.tscn b/Scenes/ShopScene/ShopUI.tscn new file mode 100644 index 00000000..6a999efe --- /dev/null +++ b/Scenes/ShopScene/ShopUI.tscn @@ -0,0 +1,530 @@ +[gd_scene load_steps=8 format=3 uid="uid://bk0js6ji42xrt"] + +[ext_resource type="Texture2D" uid="uid://djd6iw2g84bba" path="res://Scenes/UI/Assets/UI_CenterFrame.png" id="1_67his"] +[ext_resource type="Script" uid="uid://dg0xaieus84ns" path="res://Scenes/ShopScene/Scripts/ShopScene.cs" id="1_bmt43"] +[ext_resource type="Texture2D" uid="uid://8u3xvcma81d" path="res://Scenes/UI/Assets/UI_CrystalFrame.png" id="2_bmt43"] +[ext_resource type="Texture2D" uid="uid://burj10os057fx" path="res://Scenes/UI/Assets/UI_CrystalFrameInset.png" id="3_r34tc"] +[ext_resource type="Theme" uid="uid://d37e3tpsbxwak" path="res://Scenes/UI/Assets/GeneralTheme.tres" id="4_3vktw"] +[ext_resource type="Script" uid="uid://cahjluc6v7ked" path="res://Scenes/UI/TitleScreen/Scripts/SceneChange.cs" id="5_w0f8r"] +[ext_resource type="Texture2D" uid="uid://dyt1cvag13aik" path="res://SharedAssets/Money.png" id="6_tf865"] + +[node name="ShopUI" type="Control" node_paths=PackedStringArray("_moneyLabel", "_exitButton", "_removalButton", "_noteGrid", "_relicGrid", "_confirmationPopup", "_confirmationButton", "_denyButton", "_descriptionLabel", "_removalPanel", "_possessionGrid", "_removalAcceptButton", "_cancelRemoveButton", "_removalCostLabel")] +z_index = 2 +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("1_bmt43") +_moneyLabel = NodePath("MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer/MoneyLabel") +_exitButton = NodePath("BottomPanel/DescBox/HBoxContainer/OptionsBG/OptionsMargin/OptionsBG/MarginContainer/VBoxContainer/Continue") +_removalButton = NodePath("BottomPanel/DescBox/HBoxContainer/OptionsBG/OptionsMargin/OptionsBG/MarginContainer/VBoxContainer/Removal") +_noteGrid = NodePath("TopPanel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer/NotesBox/CenterContainer/NotesGrid") +_relicGrid = NodePath("TopPanel/MarginContainer/VBoxContainer/RelicSelection/MarginContainer/RelicsBox/CenterContainer/RelicsGrid") +_confirmationPopup = NodePath("ConfirmPurchase") +_confirmationButton = NodePath("ConfirmPurchase/HBoxContainer/Confirm") +_denyButton = NodePath("ConfirmPurchase/HBoxContainer/Deny") +_descriptionLabel = NodePath("BottomPanel/DescBox/HBoxContainer/DescBG/DescMargin/DescBackground/MarginContainer/Description") +_removalPanel = NodePath("Removal") +_possessionGrid = NodePath("Removal/Panel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer/NotesBox/CenterContainer/PossesionGrid") +_removalAcceptButton = NodePath("Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/Accept") +_cancelRemoveButton = NodePath("Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/Cancel") +_removalCostLabel = NodePath("Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/CostPanel/HBoxContainer/MoneyLabel") + +[node name="TopPanel" type="NinePatchRect" parent="."] +layout_mode = 0 +offset_right = 508.0 +offset_bottom = 211.0 +texture = ExtResource("1_67his") +patch_margin_left = 12 +patch_margin_top = 12 +patch_margin_right = 12 +patch_margin_bottom = 12 + +[node name="MarginContainer" type="MarginContainer" parent="TopPanel"] +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="VBoxContainer" type="VBoxContainer" parent="TopPanel/MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 5 + +[node name="NoteSelection" type="NinePatchRect" parent="TopPanel/MarginContainer/VBoxContainer"] +self_modulate = Color(1, 1, 1, 0.75) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource("2_bmt43") +patch_margin_left = 6 +patch_margin_top = 6 +patch_margin_right = 6 +patch_margin_bottom = 7 + +[node name="MarginContainer" type="MarginContainer" parent="TopPanel/MarginContainer/VBoxContainer/NoteSelection"] +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="NotesBox" type="ScrollContainer" parent="TopPanel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer"] +layout_mode = 2 +follow_focus = true + +[node name="CenterContainer" type="CenterContainer" parent="TopPanel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer/NotesBox"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="NotesGrid" type="GridContainer" parent="TopPanel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer/NotesBox/CenterContainer"] +layout_mode = 2 +size_flags_vertical = 4 +theme_override_constants/h_separation = 30 +columns = 6 + +[node name="RelicSelection" type="NinePatchRect" parent="TopPanel/MarginContainer/VBoxContainer"] +self_modulate = Color(1, 1, 1, 0.75) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource("2_bmt43") +patch_margin_left = 6 +patch_margin_top = 6 +patch_margin_right = 6 +patch_margin_bottom = 7 + +[node name="MarginContainer" type="MarginContainer" parent="TopPanel/MarginContainer/VBoxContainer/RelicSelection"] +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="RelicsBox" type="ScrollContainer" parent="TopPanel/MarginContainer/VBoxContainer/RelicSelection/MarginContainer"] +layout_mode = 2 +follow_focus = true + +[node name="CenterContainer" type="CenterContainer" parent="TopPanel/MarginContainer/VBoxContainer/RelicSelection/MarginContainer/RelicsBox"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="RelicsGrid" type="GridContainer" parent="TopPanel/MarginContainer/VBoxContainer/RelicSelection/MarginContainer/RelicsBox/CenterContainer"] +layout_mode = 2 +size_flags_vertical = 4 +theme_override_constants/h_separation = 30 +columns = 6 + +[node name="BottomPanel" type="NinePatchRect" parent="."] +layout_mode = 0 +offset_top = 211.0 +offset_right = 640.0 +offset_bottom = 360.0 +texture = ExtResource("1_67his") +patch_margin_left = 12 +patch_margin_top = 12 +patch_margin_right = 12 +patch_margin_bottom = 12 + +[node name="DescBox" type="MarginContainer" parent="BottomPanel"] +layout_mode = 2 +offset_right = 640.0 +offset_bottom = 149.0 +grow_vertical = 0 +size_flags_vertical = 3 +size_flags_stretch_ratio = 0.4 +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="HBoxContainer" type="HBoxContainer" parent="BottomPanel/DescBox"] +layout_mode = 2 + +[node name="DescBG" type="NinePatchRect" parent="BottomPanel/DescBox/HBoxContainer"] +self_modulate = Color(1, 1, 1, 0.75) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource("2_bmt43") +patch_margin_left = 6 +patch_margin_top = 6 +patch_margin_right = 6 +patch_margin_bottom = 7 + +[node name="DescMargin" type="MarginContainer" parent="BottomPanel/DescBox/HBoxContainer/DescBG"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_top = 4 +theme_override_constants/margin_right = 4 +theme_override_constants/margin_bottom = 4 + +[node name="DescBackground" type="NinePatchRect" parent="BottomPanel/DescBox/HBoxContainer/DescBG/DescMargin"] +layout_mode = 2 +texture = ExtResource("3_r34tc") +patch_margin_left = 7 +patch_margin_top = 7 +patch_margin_right = 7 +patch_margin_bottom = 7 + +[node name="MarginContainer" type="MarginContainer" parent="BottomPanel/DescBox/HBoxContainer/DescBG/DescMargin/DescBackground"] +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 = 7 +theme_override_constants/margin_top = 7 +theme_override_constants/margin_right = 7 + +[node name="Description" type="Label" parent="BottomPanel/DescBox/HBoxContainer/DescBG/DescMargin/DescBackground/MarginContainer"] +layout_mode = 2 +size_flags_vertical = 1 +autowrap_mode = 2 +clip_text = true +text_overrun_behavior = 1 + +[node name="OptionsBG" type="NinePatchRect" parent="BottomPanel/DescBox/HBoxContainer"] +self_modulate = Color(1, 1, 1, 0.75) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 0.39 +texture = ExtResource("2_bmt43") +patch_margin_left = 6 +patch_margin_top = 6 +patch_margin_right = 6 +patch_margin_bottom = 7 + +[node name="OptionsMargin" type="MarginContainer" parent="BottomPanel/DescBox/HBoxContainer/OptionsBG"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +size_flags_horizontal = 3 +theme_override_constants/margin_left = 4 +theme_override_constants/margin_top = 4 +theme_override_constants/margin_right = 4 +theme_override_constants/margin_bottom = 4 + +[node name="OptionsBG" type="NinePatchRect" parent="BottomPanel/DescBox/HBoxContainer/OptionsBG/OptionsMargin"] +layout_mode = 2 +texture = ExtResource("3_r34tc") +patch_margin_left = 7 +patch_margin_top = 7 +patch_margin_right = 7 +patch_margin_bottom = 7 + +[node name="MarginContainer" type="MarginContainer" parent="BottomPanel/DescBox/HBoxContainer/OptionsBG/OptionsMargin/OptionsBG"] +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 = 7 +theme_override_constants/margin_top = 7 +theme_override_constants/margin_right = 7 + +[node name="VBoxContainer" type="VBoxContainer" parent="BottomPanel/DescBox/HBoxContainer/OptionsBG/OptionsMargin/OptionsBG/MarginContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Removal" type="Button" parent="BottomPanel/DescBox/HBoxContainer/OptionsBG/OptionsMargin/OptionsBG/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme = ExtResource("4_3vktw") +text = "SHOP_REMOVAL" + +[node name="Continue" type="Button" parent="BottomPanel/DescBox/HBoxContainer/OptionsBG/OptionsMargin/OptionsBG/MarginContainer/VBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +theme = ExtResource("4_3vktw") +text = "INBETWEEN_CONTINUE" +script = ExtResource("5_w0f8r") +ScenePath = 7 +_startFocused = true + +[node name="MoneyContainer" type="MarginContainer" parent="."] +layout_mode = 1 +anchors_preset = 1 +anchor_left = 1.0 +anchor_right = 1.0 +offset_left = -125.0 +offset_bottom = 29.0 +grow_horizontal = 0 +theme_override_constants/margin_left = -1 +theme_override_constants/margin_top = 5 +theme_override_constants/margin_right = 5 +theme_override_constants/margin_bottom = 0 + +[node name="MoneyFrame" type="NinePatchRect" parent="MoneyContainer"] +layout_mode = 2 +texture = ExtResource("2_bmt43") +patch_margin_left = 7 +patch_margin_top = 7 +patch_margin_right = 7 +patch_margin_bottom = 7 + +[node name="MarginContainer" type="MarginContainer" parent="MoneyContainer/MoneyFrame"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_constants/margin_right = 8 + +[node name="HBoxContainer" type="HBoxContainer" parent="MoneyContainer/MoneyFrame/MarginContainer"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer"] +layout_mode = 2 +theme_override_constants/margin_left = 6 + +[node name="TextureRect" type="TextureRect" parent="MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer/MarginContainer"] +layout_mode = 2 +size_flags_vertical = 4 +texture = ExtResource("6_tf865") + +[node name="MoneyLabel" type="Label" parent="MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer"] +custom_minimum_size = Vector2(91, 0) +layout_mode = 2 +size_flags_horizontal = 10 +size_flags_vertical = 1 +text = "0" +horizontal_alignment = 2 +vertical_alignment = 1 +clip_text = true + +[node name="ConfirmPurchase" type="CenterContainer" parent="."] +visible = false +z_index = 3 +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -105.0 +offset_top = -20.0 +offset_right = 105.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="MouseFilter" type="Control" parent="ConfirmPurchase"] +custom_minimum_size = Vector2(640, 360) +layout_mode = 2 + +[node name="Confirmation" type="NinePatchRect" parent="ConfirmPurchase"] +custom_minimum_size = Vector2(230, 62) +layout_mode = 2 +texture = ExtResource("1_67his") +patch_margin_left = 7 +patch_margin_top = 7 +patch_margin_right = 7 +patch_margin_bottom = 7 + +[node name="HBoxContainer" type="HBoxContainer" parent="ConfirmPurchase"] +layout_mode = 2 +alignment = 1 + +[node name="Confirm" type="Button" parent="ConfirmPurchase/HBoxContainer"] +layout_mode = 2 +focus_neighbor_left = NodePath("../Deny") +focus_neighbor_top = NodePath("../Deny") +focus_neighbor_right = NodePath("../Deny") +focus_neighbor_bottom = NodePath("../Deny") +focus_next = NodePath("../Deny") +focus_previous = NodePath("../Deny") +theme = ExtResource("4_3vktw") +text = "SHOP_CONFIRM" + +[node name="Deny" type="Button" parent="ConfirmPurchase/HBoxContainer"] +layout_mode = 2 +focus_neighbor_left = NodePath("../Confirm") +focus_neighbor_top = NodePath("../Confirm") +focus_neighbor_right = NodePath("../Confirm") +focus_neighbor_bottom = NodePath("../Confirm") +focus_next = NodePath("../Confirm") +focus_previous = NodePath("../Confirm") +theme = ExtResource("4_3vktw") +text = "SHOP_CANCEL" + +[node name="Removal" type="Control" parent="."] +visible = false +layout_mode = 3 +anchors_preset = 0 +offset_right = 640.0 +offset_bottom = 360.0 + +[node name="Panel" type="NinePatchRect" parent="Removal"] +layout_mode = 0 +offset_right = 508.0 +offset_bottom = 211.0 +texture = ExtResource("1_67his") +patch_margin_left = 12 +patch_margin_top = 12 +patch_margin_right = 12 +patch_margin_bottom = 12 + +[node name="MarginContainer" type="MarginContainer" parent="Removal/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 + +[node name="VBoxContainer" type="VBoxContainer" parent="Removal/Panel/MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 5 + +[node name="NoteSelection" type="NinePatchRect" parent="Removal/Panel/MarginContainer/VBoxContainer"] +self_modulate = Color(1, 1, 1, 0.75) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +texture = ExtResource("2_bmt43") +patch_margin_left = 6 +patch_margin_top = 6 +patch_margin_right = 6 +patch_margin_bottom = 7 + +[node name="MarginContainer" type="MarginContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/NoteSelection"] +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="NotesBox" type="ScrollContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer"] +layout_mode = 2 +follow_focus = true + +[node name="CenterContainer" type="CenterContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer/NotesBox"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="PossesionGrid" type="GridContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/NoteSelection/MarginContainer/NotesBox/CenterContainer"] +layout_mode = 2 +size_flags_vertical = 4 +theme_override_constants/h_separation = 30 +columns = 6 + +[node name="Options" type="NinePatchRect" parent="Removal/Panel/MarginContainer/VBoxContainer"] +self_modulate = Color(1, 1, 1, 0.75) +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +size_flags_stretch_ratio = 0.5 +texture = ExtResource("2_bmt43") +patch_margin_left = 6 +patch_margin_top = 6 +patch_margin_right = 6 +patch_margin_bottom = 7 + +[node name="MarginContainer" type="MarginContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/Options"] +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="HBoxContainer" type="HBoxContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer"] +layout_mode = 2 +theme_override_constants/separation = 20 +alignment = 1 + +[node name="CostPanel" type="VBoxContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer"] +layout_mode = 2 +alignment = 1 + +[node name="Label" type="Label" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/CostPanel"] +layout_mode = 2 +text = "REMOVAL_COST" + +[node name="HBoxContainer" type="HBoxContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/CostPanel"] +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/CostPanel/HBoxContainer"] +layout_mode = 2 +theme_override_constants/margin_left = 2 + +[node name="TextureRect" type="TextureRect" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/CostPanel/HBoxContainer/MarginContainer"] +layout_mode = 2 +size_flags_vertical = 4 +texture = ExtResource("6_tf865") + +[node name="MoneyLabel" type="Label" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer/CostPanel/HBoxContainer"] +custom_minimum_size = Vector2(21, 0) +layout_mode = 2 +size_flags_horizontal = 10 +size_flags_vertical = 1 +text = "999" +horizontal_alignment = 2 +vertical_alignment = 1 +clip_text = true + +[node name="Accept" type="Button" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +focus_neighbor_bottom = NodePath("../Cancel") +theme = ExtResource("4_3vktw") +text = "CHEST_ROOM_ACCEPT" + +[node name="Cancel" type="Button" parent="Removal/Panel/MarginContainer/VBoxContainer/Options/MarginContainer/HBoxContainer"] +layout_mode = 2 +size_flags_horizontal = 4 +size_flags_vertical = 4 +focus_neighbor_bottom = NodePath("../Accept") +focus_next = NodePath(".") +theme = ExtResource("4_3vktw") +text = "SHOP_CANCEL" diff --git a/Scenes/UI/DisplayButton.tscn b/Scenes/UI/DisplayButton.tscn index a6c1d0fa..01b83737 100644 --- a/Scenes/UI/DisplayButton.tscn +++ b/Scenes/UI/DisplayButton.tscn @@ -10,4 +10,5 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 theme = ExtResource("1_26ea7") +icon_alignment = 1 script = ExtResource("1_7lpm6") diff --git a/Scenes/UI/Inventory.tscn b/Scenes/UI/Inventory.tscn index 4e031711..7fa6e6ab 100644 --- a/Scenes/UI/Inventory.tscn +++ b/Scenes/UI/Inventory.tscn @@ -16,7 +16,7 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_8rcwd") _relics = NodePath("MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_RELICS/MarginContainer/RelicBox/RelicGrid") -_notes = NodePath("MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/MarginContainer/NotesBox/NotesGrid") +_notes = NodePath("MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/SelectionBG/MarginContainer/NotesBox/NotesGrid") _description = NodePath("MarginContainer/InvenVBox/DescBox/DescMargin/MarginContainer/Description") _tabs = NodePath("MarginContainer/InvenVBox/Tabs") _moneyLabel = NodePath("MoneyContainer/MoneyFrame/MarginContainer/HBoxContainer/MoneyLabel") @@ -73,18 +73,20 @@ patch_margin_top = 6 patch_margin_right = 6 patch_margin_bottom = 7 -[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES"] +[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/SelectionBG"] layout_mode = 2 +offset_right = 620.0 +offset_bottom = 197.0 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="NotesBox" type="ScrollContainer" parent="MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/MarginContainer"] +[node name="NotesBox" type="ScrollContainer" parent="MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/SelectionBG/MarginContainer"] layout_mode = 2 follow_focus = true -[node name="NotesGrid" type="GridContainer" parent="MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/MarginContainer/NotesBox"] +[node name="NotesGrid" type="GridContainer" parent="MarginContainer/InvenVBox/Tabs/INVENTORY_TAB_NOTES/SelectionBG/MarginContainer/NotesBox"] layout_mode = 2 size_flags_vertical = 4 columns = 10