first commit, long overdue
deez
This commit is contained in:
commit
54b9012a47
79 changed files with 2516 additions and 0 deletions
74
01 - Menus/03 - Sheets/item.gd
Normal file
74
01 - Menus/03 - Sheets/item.gd
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
extends Node2D
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. character
|
||||
|
||||
var module
|
||||
var module_type
|
||||
var active_module
|
||||
|
||||
var module_self:String
|
||||
var modules_list:Array
|
||||
var modules_text:Array
|
||||
var modules_skill:Array
|
||||
|
||||
var config
|
||||
|
||||
func _enter_tree() -> void:
|
||||
print("item:_enter_tree:1 " + category)
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
module_self = config.get_value(category,"module","")
|
||||
var modules_all = [module_self]
|
||||
for i in config.get_section_keys(category):
|
||||
print("item:_enter_tree:2 " + i)
|
||||
if i.contains("modules_"):
|
||||
modules_all = modules_all + config.get_value(category,i,[])
|
||||
print("item:_enter_tree:3 " + str(modules_all))
|
||||
var j = 0
|
||||
for i in modules_all:
|
||||
var button = Button.new()
|
||||
button.tooltip_text = i
|
||||
if i == category:
|
||||
button.text = config.get_value(i,"name_self","")
|
||||
else:
|
||||
button.text = config.get_value(i,"name","")
|
||||
button.size.x = 192
|
||||
button.size.y = 64
|
||||
button.connect("button_up",spawn_module.bind(button.get_tooltip_text()))
|
||||
%container.add_child(button)
|
||||
j = j + 1
|
||||
spawn_module(category)
|
||||
|
||||
func spawn_module(text):
|
||||
print("item:spawn_module:1 " + text)
|
||||
remove_child(module)
|
||||
active_module = text
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
for i in config.get_section_keys(category):
|
||||
print("item:spawn_module:2 " + i)
|
||||
if i == "module" and category == text:
|
||||
print("item:spawn_module:3 " + text)
|
||||
module = load("res://01 - Menus/04 - Modules/modules_" + config.get_value(text,i,"") + ".tscn").instantiate()
|
||||
module.item = item
|
||||
module.category = category
|
||||
module.module = active_module
|
||||
module.position.x = 384
|
||||
add_child.call_deferred(module)
|
||||
elif i.contains("modules_"):
|
||||
print("item:spawn_module:4 is array" )
|
||||
if config.get_value(category,i,[]).has(text):
|
||||
print("item:spawn_module:5 " + i)
|
||||
module = load("res://01 - Menus/04 - Modules/" + i + ".tscn").instantiate()
|
||||
module.item = item
|
||||
module.category = category
|
||||
module.module = active_module
|
||||
module.position.x = 384
|
||||
add_child.call_deferred(module)
|
||||
|
||||
func show_save():
|
||||
pass
|
||||
|
||||
func save():
|
||||
module.save()
|
||||
1
01 - Menus/03 - Sheets/item.gd.uid
Normal file
1
01 - Menus/03 - Sheets/item.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://d1ixiojxt27x7
|
||||
25
01 - Menus/03 - Sheets/item.tscn
Normal file
25
01 - Menus/03 - Sheets/item.tscn
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://cl4squ3cegosj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d1ixiojxt27x7" path="res://01 - Menus/03 - Sheets/item.gd" id="1_sscaq"]
|
||||
|
||||
[node name="item" type="Node2D"]
|
||||
script = ExtResource("1_sscaq")
|
||||
|
||||
[node name="tabs" type="ColorRect" parent="."]
|
||||
offset_top = -256.0
|
||||
offset_right = 384.0
|
||||
offset_bottom = 1184.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 1)
|
||||
|
||||
[node name="scroll" type="ScrollContainer" parent="."]
|
||||
clip_contents = false
|
||||
offset_left = 64.0
|
||||
offset_top = 64.0
|
||||
offset_right = 320.0
|
||||
offset_bottom = 960.0
|
||||
|
||||
[node name="container" type="VBoxContainer" parent="scroll"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
Loading…
Add table
Add a link
Reference in a new issue