-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(wip): initial work on item/inventory/equipment
- Loading branch information
Showing
31 changed files
with
2,396 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gd_resource type="Item" load_steps=2 format=3 uid="uid://cmuoe6r8lr7g"] | ||
|
||
[ext_resource type="ItemSettings" uid="uid://bcdwpcf5776td" path="res://demos/item_test_ui/items/test_item_settings.tres" id="1_xmfv7"] | ||
|
||
[resource] | ||
item_settings = ExtResource("1_xmfv7") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gd_resource type="Item" load_steps=2 format=3 uid="uid://d27wbmd1lsxtp"] | ||
|
||
[ext_resource type="ItemSettings" uid="uid://bcdwpcf5776td" path="res://demos/item_test_ui/items/test_item_settings.tres" id="1_n6u0y"] | ||
|
||
[resource] | ||
item_settings = ExtResource("1_n6u0y") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[gd_resource type="ItemSettings" format=3 uid="uid://bcdwpcf5776td"] | ||
|
||
[resource] | ||
decrease_quantity_on_use = true | ||
is_stackable = true | ||
max_quantity = 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
extends Control | ||
|
||
|
||
func _ready() -> void: | ||
print(ItemManager.get_items()) | ||
print(EquipmentManager.get_slots()) | ||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://c7kl1lpd5o5ps"] | ||
|
||
[ext_resource type="Script" path="res://demos/item_test_ui/main.gd" id="1_poj3d"] | ||
|
||
[node name="Main" 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_poj3d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[gd_resource type="TagDictionary" format=3 uid="uid://dh8udsjb5navh"] | ||
|
||
[resource] | ||
tags = PackedStringArray("enemy.ai.idle", "enemy.ai.roam", "enemy.ai.roam.end", "enemy.ai.roam.start", "enemy.ai.roam.idle", "enemy.ai.combat.chasing", "enemy.ai.combat.low_health", "enemy.ai.combat.panic", "enemy.factions", "enemy.factions.000", "enemy.factions.001", "enemy.factions.002") | ||
tags = PackedStringArray("enemy.ai.idle", "enemy.ai.roam", "enemy.ai.roam.end", "enemy.ai.roam.start", "enemy.ai.roam.idle", "enemy.ai.combat.chasing", "enemy.ai.combat.low_health", "enemy.ai.combat.panic", "enemy.factions", "enemy.factions.enemies", "enemy.factions.neutrals", "enemy.factions.friends") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include "ggs_item_main_scene.h" | ||
|
||
#include <godot_cpp/classes/button.hpp> | ||
#include <godot_cpp/classes/label.hpp> | ||
#include <godot_cpp/classes/v_box_container.hpp> | ||
#include <godot_cpp/classes/panel.hpp> | ||
|
||
using namespace ggs; | ||
using namespace ggs::editor_plugin; | ||
|
||
void ItemMainScene::_handle_tab_pressed(int tab_id) | ||
{ | ||
} | ||
|
||
void ItemMainScene::_bind_methods() | ||
{ | ||
} | ||
|
||
void ItemMainScene::_ready() | ||
{ | ||
Button *equipment_button = memnew(Button); | ||
Button *items_button = memnew(Button); | ||
VBoxContainer *tab_buttons = memnew(VBoxContainer); | ||
VBoxContainer *tabs_container = memnew(VBoxContainer); | ||
Panel *tabs_panel = memnew(Panel); | ||
Panel *items_panel = memnew(Panel); | ||
Panel *equipment_panel = memnew(Panel); | ||
|
||
equipment_button->set_text(tr("Equipment")); | ||
items_button->set_text(tr("Items")); | ||
|
||
tab_buttons->set_name("GGS_ITEMS_TabButtons"); | ||
|
||
tab_buttons->add_child(equipment_button); | ||
tab_buttons->add_child(items_button); | ||
|
||
tabs_container->add_child(equipment_panel); | ||
tabs_container->add_child(items_panel); | ||
tabs_container->set_anchors_and_offsets_preset(PRESET_FULL_RECT); | ||
|
||
tabs_panel->add_child(tabs_container); | ||
|
||
add_child(tab_buttons); | ||
add_child(tabs_panel); | ||
|
||
set_anchors_and_offsets_preset(PRESET_FULL_RECT); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#ifndef GGS_ITEM_MAIN_SCENE_H | ||
#define GGS_ITEM_MAIN_SCENE_H | ||
|
||
#include <godot_cpp/classes/h_box_container.hpp> | ||
|
||
using namespace godot; | ||
|
||
namespace ggs::editor_plugin | ||
{ | ||
class ItemMainScene : public HBoxContainer | ||
{ | ||
GDCLASS(ItemMainScene, HBoxContainer); | ||
/// @brief Handles the tab button being pressed. | ||
/// @param tab_id The tab id of the button that was pressed. | ||
void _handle_tab_pressed(int tab_id); | ||
|
||
protected: | ||
/// @brief Bind methods to Godot. | ||
static void _bind_methods(); | ||
/// @brief Called when the node enters the scene tree for the first time. | ||
public: | ||
void _ready() override; | ||
}; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.