removed editor granted weapon abilities and prepared granting abilites through an inventory

This commit is contained in:
2026-04-18 15:44:59 +02:00
parent 9e57641a75
commit 9464fc7caa
13 changed files with 310 additions and 53 deletions

View File

@@ -0,0 +1,10 @@
using Godot;
[GlobalClass, Icon("res://assets/ui/IconGodotNode/control/icon_crate.png")]
public partial class Inventory : Control
{
public PlayerController? Player { get; set; }
public override void _Ready()
{
}
}

View File

@@ -0,0 +1 @@
uid://7yil0fiftvaf

View File

@@ -0,0 +1,166 @@
[gd_scene format=3 uid="uid://oq1jjvjs4qga"]
[ext_resource type="Script" uid="uid://vu5kh5amnta" path="res://menus/scenes/overlaid_menus/inventory_wrapper.gd" id="1_yst23"]
[ext_resource type="Script" uid="uid://1nf36h0gms3q" path="res://addons/maaacks_game_template/base/scripts/capture_focus.gd" id="2_ijoei"]
[ext_resource type="Script" uid="uid://7yil0fiftvaf" path="res://menus/scenes/overlaid_menus/Inventory.cs" id="2_sb1gh"]
[node name="InventoryWrapper" type="Control" unique_id=1853168495]
process_mode = 3
top_level = true
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_yst23")
pauses_game = true
[node name="Inventory" type="MarginContainer" parent="." unique_id=1581374847]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 9
anchor_bottom = 1.0
offset_right = 1920.0
grow_vertical = 2
theme_override_constants/margin_left = 256
theme_override_constants/margin_top = 32
theme_override_constants/margin_right = 256
theme_override_constants/margin_bottom = 32
script = ExtResource("2_sb1gh")
[node name="MenuPanelContainer" type="PanelContainer" parent="Inventory" unique_id=494302799]
unique_name_in_owner = true
process_mode = 3
layout_mode = 2
[node name="MarginContainer" type="MarginContainer" parent="Inventory/MenuPanelContainer" unique_id=890844332]
layout_mode = 2
theme_override_constants/margin_left = 128
theme_override_constants/margin_top = 16
theme_override_constants/margin_right = 128
theme_override_constants/margin_bottom = 16
[node name="BoxContainer" type="BoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer" unique_id=1551508149]
layout_mode = 2
vertical = true
[node name="TitleMargin" type="MarginContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer" unique_id=1278279788]
layout_mode = 2
[node name="TitleLabel" type="Label" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/TitleMargin" unique_id=1966063657]
layout_mode = 2
theme_override_font_sizes/font_size = 24
text = "Inventory"
horizontal_alignment = 1
[node name="PlayerSectionMargin" type="MarginContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer" unique_id=461792371]
layout_mode = 2
theme_override_constants/margin_top = 16
theme_override_constants/margin_bottom = 16
[node name="PlayerSection" type="BoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin" unique_id=469432036]
custom_minimum_size = Vector2(128, 0)
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 16
vertical = true
[node name="PlayerSectionLabel" type="Label" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection" unique_id=1100827847]
layout_mode = 2
text = "Player"
[node name="PlayerUtilsContainer" type="HBoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection" unique_id=993608648]
layout_mode = 2
size_flags_horizontal = 4
theme_override_constants/separation = 8
[node name="PlayerInvicibleToggle" type="CheckButton" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerUtilsContainer" unique_id=960956060]
unique_name_in_owner = true
layout_mode = 2
text = "Invincible"
script = ExtResource("2_ijoei")
[node name="KillPlayerButton" type="Button" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerUtilsContainer" unique_id=472828424]
layout_mode = 2
text = "Kill in 1s"
[node name="PlayerStatsContainer" type="VBoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection" unique_id=201095522]
layout_mode = 2
size_flags_horizontal = 4
theme_override_constants/separation = 8
[node name="PlayerHealth" type="HBoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer" unique_id=823599662]
layout_mode = 2
size_flags_horizontal = 4
theme_override_constants/separation = 8
[node name="Label" type="Label" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer/PlayerHealth" unique_id=159028563]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
text = "Player base health"
[node name="PlayerHealthSpinBox" type="SpinBox" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer/PlayerHealth" unique_id=211258886]
unique_name_in_owner = true
layout_mode = 2
min_value = 1.0
max_value = 1000.0
value = 1.0
rounded = true
allow_greater = true
[node name="PlayerDamage" type="HBoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer" unique_id=560862269]
layout_mode = 2
size_flags_horizontal = 4
[node name="Label" type="Label" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer/PlayerDamage" unique_id=16098677]
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
text = "Player damage"
[node name="PlayerDamageSpinBox" type="SpinBox" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer/PlayerDamage" unique_id=223936754]
unique_name_in_owner = true
layout_mode = 2
min_value = 1.0
max_value = 1000.0
value = 1.0
rounded = true
allow_greater = true
[node name="LevelSelectionMargin" type="MarginContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer" unique_id=517648431]
layout_mode = 2
theme_override_constants/margin_top = 16
theme_override_constants/margin_bottom = 16
[node name="LevelSelectionSection" type="BoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin" unique_id=2038380087]
custom_minimum_size = Vector2(128, 0)
layout_mode = 2
size_flags_vertical = 3
theme_override_constants/separation = 16
vertical = true
[node name="LevelSelectionLabel" type="Label" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin/LevelSelectionSection" unique_id=950442689]
layout_mode = 2
text = "Levels"
[node name="LevelSelectionContainer" type="HBoxContainer" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin/LevelSelectionSection" unique_id=1674253271]
layout_mode = 2
size_flags_horizontal = 4
theme_override_constants/separation = 8
[node name="RestartCurrentButton" type="Button" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin/LevelSelectionSection/LevelSelectionContainer" unique_id=1059727667]
layout_mode = 2
text = "Restart current
"
[node name="SelectLevel" type="Button" parent="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin/LevelSelectionSection/LevelSelectionContainer" unique_id=2015444126]
layout_mode = 2
text = "Select level
"
[connection signal="toggled" from="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerUtilsContainer/PlayerInvicibleToggle" to="." method="_on_player_invicible_toggled"]
[connection signal="pressed" from="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerUtilsContainer/KillPlayerButton" to="." method="_on_kill_player_button_pressed"]
[connection signal="value_changed" from="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer/PlayerHealth/PlayerHealthSpinBox" to="." method="_on_player_health_changed"]
[connection signal="value_changed" from="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/PlayerSectionMargin/PlayerSection/PlayerStatsContainer/PlayerDamage/PlayerDamageSpinBox" to="." method="_on_player_damage_changed"]
[connection signal="pressed" from="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin/LevelSelectionSection/LevelSelectionContainer/RestartCurrentButton" to="." method="_on_restart_current_level_pressed"]
[connection signal="pressed" from="Inventory/MenuPanelContainer/MarginContainer/BoxContainer/LevelSelectionMargin/LevelSelectionSection/LevelSelectionContainer/SelectLevel" to="." method="_on_select_level_pressed"]

View File

@@ -0,0 +1,14 @@
@tool
@icon("res://assets/ui/IconGodotNode/control/icon_crate_02.png")
class_name InventoryWrapper
extends OverlaidMenu
@export var player: PlayerController
@onready var inventory: Control = %Inventory
func _ready() -> void:
inventory.Player = player
func _on_close_button_pressed() -> void:
close()

View File

@@ -0,0 +1 @@
uid://vu5kh5amnta