first commit, long overdue
deez
This commit is contained in:
commit
54b9012a47
79 changed files with 2516 additions and 0 deletions
99
01 - Menus/01 - Main Menu/main_menu.gd
Normal file
99
01 - Menus/01 - Main Menu/main_menu.gd
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
extends Node2D
|
||||
|
||||
var menu_item
|
||||
var conf_mm
|
||||
var conf_cat
|
||||
var item_names = []
|
||||
var item_proper_names = []
|
||||
var categories
|
||||
var pixel_x
|
||||
var pixel_y
|
||||
var ui_scale = 1
|
||||
|
||||
func _enter_tree() -> void:
|
||||
conf_mm = ConfigFile.new()
|
||||
conf_mm.load("res://02 - Configurations/campaign/main_menu.ini")
|
||||
conf_cat = ConfigFile.new()
|
||||
conf_cat.load("res://02 - Configurations/campaign/categories.ini")
|
||||
print("main_menu:_enter_tree:1 " + str(conf_mm.get_sections()))
|
||||
categories = []
|
||||
pixel_x = get_viewport_rect().size[0]
|
||||
pixel_y = get_viewport_rect().size[1]
|
||||
if pixel_x + pixel_y > 2900:
|
||||
ui_scale = 1
|
||||
else:
|
||||
ui_scale = 0.7
|
||||
print("main_menu:_enter_tree:2 " + str(pixel_x) + " " + str(pixel_y))
|
||||
for i in conf_mm.get_sections():
|
||||
categories = categories + [i]
|
||||
|
||||
for i in categories:
|
||||
#print(i)
|
||||
var button = OptionButton.new()
|
||||
button.text = conf_mm.get_value(i,"name")
|
||||
button.name = i
|
||||
button.custom_minimum_size = Vector2(320,64)
|
||||
button.connect("item_selected",self.item_selected.bind(button))
|
||||
button.allow_reselect = true
|
||||
print("main_menu:_enter_tree:3 " + str(conf_mm.get_sections()))
|
||||
for j in conf_mm.get_value(button.name,"items",[]):
|
||||
item_names = item_names + [j]
|
||||
item_proper_names = item_proper_names + [conf_cat.get_value(j,"name","")]
|
||||
print("main_menu:_enter_tree:3 ")
|
||||
button.add_item(conf_cat.get_value(j,"name",""))
|
||||
%container.add_child(button)
|
||||
set_menu_items()
|
||||
|
||||
func item_selected(k,tab):
|
||||
print("main_menu:select_category:1 " + str(tab.get_item_text(k)))
|
||||
menu_item = load("res://01 - Menus/02 - Selector/selector.tscn").instantiate()
|
||||
print("main_menu:select_category:2 " + str(item_names))
|
||||
menu_item.category = item_names[item_proper_names.find(tab.get_item_text(k))]
|
||||
add_child(menu_item)
|
||||
menu_item.set_menu_items(pixel_x,pixel_y,ui_scale)
|
||||
|
||||
func remove_tabs(tab):
|
||||
remove_child.call_deferred(tab)
|
||||
|
||||
func _on_exit_button_up() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
func set_menu_items():
|
||||
print("main_menu:set_menu_items:1 " + str(pixel_x) + " " + str(pixel_y))
|
||||
%scroll.size.y = pixel_y - (256 * ui_scale)
|
||||
%scroll.position.y = 128 * ui_scale
|
||||
%campaign_manager.position.y = pixel_y - 192 * ui_scale
|
||||
%exit.position.y = pixel_y - 96 * ui_scale
|
||||
%ui_main_menu.size.y = pixel_y
|
||||
%ui_background.size.y = pixel_y
|
||||
%ui_background.size.x = pixel_x
|
||||
if pixel_x < pixel_y: #mobile
|
||||
%ui_main_menu.size.x = pixel_x
|
||||
for i in [%scroll,%exit,%campaign_manager]:
|
||||
i.scale = Vector2(ui_scale,ui_scale)
|
||||
i.size.x = pixel_x/ui_scale - 128
|
||||
i.position.x = 64*ui_scale
|
||||
else:
|
||||
%ui_main_menu.size.x = 512.0 * ui_scale
|
||||
for i in [%scroll,%exit,%campaign_manager]:
|
||||
i.scale = Vector2(ui_scale,ui_scale)
|
||||
i.size.x = 448
|
||||
i.position.x = 32 * ui_scale
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if pixel_x != get_viewport_rect().size[0] or pixel_y != get_viewport_rect().size[1]:
|
||||
pixel_x = get_viewport_rect().size[0]
|
||||
pixel_y = get_viewport_rect().size[1]
|
||||
if pixel_x + pixel_y > 3000:
|
||||
ui_scale = 1
|
||||
else:
|
||||
ui_scale = 0.7
|
||||
if menu_item:
|
||||
menu_item.set_menu_items(pixel_x,pixel_y,ui_scale)
|
||||
set_menu_items()
|
||||
|
||||
|
||||
func _on_campaign_manager_button_up() -> void:
|
||||
var cm = load("res://01 - Menus/05 - Campaign Manager/campaign_manager.tscn").instantiate()
|
||||
add_child(cm)
|
||||
1
01 - Menus/01 - Main Menu/main_menu.gd.uid
Normal file
1
01 - Menus/01 - Main Menu/main_menu.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://ciorv2qbkgxpl
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
extends Node2D
|
||||
|
||||
var menu_item
|
||||
var conf_mm
|
||||
var conf_cat
|
||||
var item_names = []
|
||||
var item_proper_names = []
|
||||
var categories
|
||||
var pixel_x
|
||||
var pixel_y
|
||||
var ui_scale = 1
|
||||
|
||||
func _enter_tree() -> void:
|
||||
conf_mm = ConfigFile.new()
|
||||
conf_mm.load("res://02 - Configurations/campaign/main_menu.ini")
|
||||
conf_cat = ConfigFile.new()
|
||||
conf_cat.load("res://02 - Configurations/campaign/categories.ini")
|
||||
print("main_menu:_enter_tree:1 " + str(conf_mm.get_sections()))
|
||||
categories = []
|
||||
pixel_x = get_viewport_rect().size[0]
|
||||
pixel_y = get_viewport_rect().size[1]
|
||||
if pixel_x + pixel_y > 2900:
|
||||
ui_scale = 1
|
||||
else:
|
||||
ui_scale = 0.7
|
||||
print("main_menu:_enter_tree:2 " + str(pixel_x) + " " + str(pixel_y))
|
||||
for i in conf_mm.get_sections():
|
||||
categories = categories + [i]
|
||||
|
||||
for i in categories:
|
||||
#print(i)
|
||||
var button = OptionButton.new()
|
||||
button.text = conf_mm.get_value(i,"name")
|
||||
button.name = i
|
||||
button.custom_minimum_size = Vector2(320,64)
|
||||
button.connect("item_selected",self.item_selected.bind(button))
|
||||
button.allow_reselect = true
|
||||
print("main_menu:_enter_tree:3 " + str(conf_mm.get_sections()))
|
||||
for j in conf_mm.get_value(button.name,"items",[]):
|
||||
item_names = item_names + [j]
|
||||
item_proper_names = item_proper_names + [conf_cat.get_value(j,"name","")]
|
||||
print("main_menu:_enter_tree:3 ")
|
||||
button.add_item(conf_cat.get_value(j,"name",""))
|
||||
%container.add_child(button)
|
||||
set_menu_items()
|
||||
|
||||
func item_selected(k,tab):
|
||||
print("main_menu:select_category:1 " + str(tab.get_item_text(k)))
|
||||
menu_item = load("res://01 - Menus/02 - Selector/selector.tscn").instantiate()
|
||||
print("main_menu:select_category:2 " + str(item_names))
|
||||
menu_item.category = item_names[item_proper_names.find(tab.get_item_text(k))]
|
||||
add_child(menu_item)
|
||||
remove_child.call_deferred(tab)
|
||||
|
||||
func remove_tabs(tab):
|
||||
remove_child.call_deferred(tab)
|
||||
|
||||
func _on_exit_button_up() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
func set_menu_items():
|
||||
print("main_menu:set_menu_items:1 " + str(pixel_x) + " " + str(pixel_y))
|
||||
%scroll.size.y = pixel_y - (400 * ui_scale)
|
||||
%scroll.position.y = 128 * ui_scale
|
||||
%campaign_manager.position.y = pixel_y - 192 * ui_scale
|
||||
%exit.position.y = pixel_y - 96 * ui_scale
|
||||
%ui_main_menu.size.y = pixel_y
|
||||
%ui_background.size.y = pixel_y
|
||||
%ui_background.size.x = pixel_x
|
||||
if pixel_x < pixel_y: #mobile
|
||||
%ui_main_menu.size.x = pixel_x
|
||||
for i in [%scroll,%exit,%campaign_manager]:
|
||||
i.scale = Vector2(ui_scale,ui_scale)
|
||||
i.size.x = (pixel_x)/ui_scale -128
|
||||
i.position.x = 64
|
||||
else:
|
||||
%ui_main_menu.size.x = 512.0 * ui_scale
|
||||
for i in [%scroll,%exit,%campaign_manager]:
|
||||
i.scale = Vector2(ui_scale,ui_scale)
|
||||
i.size.x = 448
|
||||
i.position.x = 32 * ui_scale
|
||||
|
||||
|
||||
func _process(_delta: float) -> void:
|
||||
if pixel_x != get_viewport_rect().size[0] or pixel_y != get_viewport_rect().size[1]:
|
||||
pixel_x = get_viewport_rect().size[0]
|
||||
pixel_y = get_viewport_rect().size[1]
|
||||
if pixel_x + pixel_y > 3000:
|
||||
ui_scale = 1
|
||||
else:
|
||||
ui_scale = 0.7
|
||||
if menu_item:
|
||||
menu_item.set_menu_items(pixel_x,pixel_y,ui_scale)
|
||||
set_menu_items()
|
||||
|
||||
|
||||
func _on_campaign_manager_button_up() -> void:
|
||||
var cm = load("res://01 - Menus/05 - Campaign Manager/campaign_manager.tscn").instantiate()
|
||||
add_child(cm)
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://4isse2tc5gjs
|
||||
50
01 - Menus/01 - Main Menu/main_menu.tscn
Normal file
50
01 - Menus/01 - Main Menu/main_menu.tscn
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://c1qk762funu8g"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ciorv2qbkgxpl" path="res://01 - Menus/01 - Main Menu/main_menu.gd" id="1_6vrvy"]
|
||||
|
||||
[node name="main_menu" type="Node2D"]
|
||||
script = ExtResource("1_6vrvy")
|
||||
|
||||
[node name="ui_main_menu" type="ColorRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_right = 512.0
|
||||
offset_bottom = 1440.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 1)
|
||||
|
||||
[node name="ui_background" type="ColorRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_right = 2564.0
|
||||
offset_bottom = 1440.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 0.78431374)
|
||||
|
||||
[node name="exit" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 1280.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 1344.0
|
||||
text = "Exit"
|
||||
|
||||
[node name="campaign_manager" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 1184.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 1248.0
|
||||
text = "Campaign Manager"
|
||||
|
||||
[node name="scroll" type="ScrollContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 32.0
|
||||
offset_top = 192.0
|
||||
offset_right = 480.0
|
||||
offset_bottom = 1152.0
|
||||
|
||||
[node name="container" type="VBoxContainer" parent="scroll"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[connection signal="button_up" from="exit" to="." method="_on_exit_button_up"]
|
||||
[connection signal="button_up" from="campaign_manager" to="." method="_on_campaign_manager_button_up"]
|
||||
152
01 - Menus/02 - Selector/selector.gd
Normal file
152
01 - Menus/02 - Selector/selector.gd
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
extends Node2D
|
||||
|
||||
var category
|
||||
var item
|
||||
|
||||
var item_filter = ""
|
||||
var config
|
||||
var ini
|
||||
var sheet
|
||||
var sort = "alphabetically"
|
||||
|
||||
func _enter_tree() -> void:
|
||||
ini = "res://02 - Configurations/" + category + ".ini"
|
||||
%new_item_name.visible = false
|
||||
%delete.visible = false
|
||||
%item_name.visible = false
|
||||
%save.visible = false
|
||||
%new_item.text = "New " + category
|
||||
%filter.placeholder_text = "Filter " + category
|
||||
%new_item_name.placeholder_text = "Set " + category + " name"
|
||||
%save.text = "Save " + category
|
||||
#print(category)
|
||||
list_items()
|
||||
|
||||
func _on_close_button_up() -> void:
|
||||
queue_free()
|
||||
|
||||
func list_items() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load(ini)
|
||||
print(ini)
|
||||
var k = config.get_sections()
|
||||
if sort == "alphabetically":
|
||||
k.sort()
|
||||
#print(str(k))
|
||||
var i = 0
|
||||
%list.item_count = k.size()
|
||||
#print(str(%list.item_count))
|
||||
for j in k:
|
||||
if item_filter == "":
|
||||
%list.set_item_text(i,str(j))
|
||||
i = i+1
|
||||
elif item_filter.to_lower() in j.to_lower():
|
||||
%list.set_item_text(i,str(j))
|
||||
i = i+1
|
||||
#print(j)
|
||||
else:
|
||||
%list.item_count = %list.item_count -1
|
||||
#print(str(%list.item_count))
|
||||
|
||||
|
||||
func refresh_view():
|
||||
%item_name.text = item
|
||||
if item != "":
|
||||
config = ConfigFile.new()
|
||||
config.load(ini)
|
||||
%save.visible = false
|
||||
|
||||
|
||||
func _on_list_item_selected(index: int) -> void:
|
||||
item = %list.get_item_text(index)
|
||||
#print(%list.get_item_text(index))
|
||||
%delete.text = "Delete " + %list.get_item_text(index)
|
||||
%delete.visible = true
|
||||
%item_name.visible = true
|
||||
if sheet:
|
||||
remove_child(sheet)
|
||||
sheet = load("res://01 - Menus/03 - Sheets/item.tscn").instantiate()
|
||||
sheet.item = item
|
||||
sheet.category = category
|
||||
sheet.position.x = 512
|
||||
sheet.position.y = 256
|
||||
add_child(sheet)
|
||||
refresh_view()
|
||||
|
||||
|
||||
func _on_filter_text_changed(new_text: String) -> void:
|
||||
item_filter = new_text
|
||||
#print(str(%list.get_selected_items()))
|
||||
list_items()
|
||||
if %list.item_count == 1:
|
||||
%list.select(0)
|
||||
else:
|
||||
%list.select(0)
|
||||
%list.deselect(0)
|
||||
|
||||
|
||||
func _on_new_item_button_up() -> void:
|
||||
%new_item_name.visible = true
|
||||
%new_item_name.grab_focus()
|
||||
|
||||
|
||||
func _on_new_item_name_text_submitted(new_text: String) -> void:
|
||||
config = ConfigFile.new()
|
||||
item = new_text
|
||||
config.load(ini)
|
||||
config.set_value(item,"type",category)
|
||||
config.save(ini)
|
||||
%new_item_name.text = ""
|
||||
%new_item_name.visible = false
|
||||
# sheet.save()
|
||||
refresh_view()
|
||||
list_items()
|
||||
|
||||
|
||||
func _on_new_item_name_editing_toggled(toggled_on: bool) -> void:
|
||||
if !toggled_on:
|
||||
%new_item_name.text = ""
|
||||
%new_item_name.visible = false
|
||||
|
||||
|
||||
func _on_delete_button_up() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load(ini)
|
||||
config.erase_section(item)
|
||||
config.save(ini)
|
||||
list_items()
|
||||
item = ""
|
||||
%delete.visible = false
|
||||
%item_name.visible = false
|
||||
remove_child(sheet)
|
||||
refresh_view()
|
||||
|
||||
|
||||
func _on_save_button_up() -> void:
|
||||
sheet.save()
|
||||
%save.visible = false
|
||||
|
||||
func show_save():
|
||||
%save.visible = true
|
||||
|
||||
func set_menu_items(pixel_x,pixel_y,ui_scale):
|
||||
%ui_background.size.y = pixel_y
|
||||
%close.position.y = pixel_y - 96 * ui_scale
|
||||
%new_item.position.y = pixel_y - 192 * ui_scale
|
||||
%new_item_name.position.y = pixel_y - 192 * ui_scale
|
||||
%delete.position.y = pixel_y - 286 * ui_scale
|
||||
%filter.position.y = pixel_y - 384 * ui_scale
|
||||
%list.position = (Vector2(128,128)) * ui_scale
|
||||
%list.size.y = pixel_y/ui_scale - 620
|
||||
if pixel_x < pixel_y: #mobile
|
||||
%ui_background.size.x = pixel_x
|
||||
for i in [%close,%new_item,%filter,%delete,%save,%new_item_name,%list]:
|
||||
i.scale = Vector2(ui_scale,ui_scale)
|
||||
i.size.x = pixel_x/ui_scale - 128
|
||||
i.position.x = 64 * ui_scale
|
||||
else:
|
||||
%ui_background.size.x = 512.0 * ui_scale
|
||||
for i in [%close,%new_item,%filter,%delete,%save,%new_item_name,%list]:
|
||||
i.scale = Vector2(ui_scale,ui_scale)
|
||||
i.size.x = 448
|
||||
i.position.x = 32 * ui_scale
|
||||
1
01 - Menus/02 - Selector/selector.gd.uid
Normal file
1
01 - Menus/02 - Selector/selector.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c7qgo02sbv7wl
|
||||
96
01 - Menus/02 - Selector/selector.tscn
Normal file
96
01 - Menus/02 - Selector/selector.tscn
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://cefrjogovj4ql"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c7qgo02sbv7wl" path="res://01 - Menus/02 - Selector/selector.gd" id="1_03gsk"]
|
||||
|
||||
[node name="selector" type="Node2D"]
|
||||
script = ExtResource("1_03gsk")
|
||||
|
||||
[node name="background" type="Node2D" parent="."]
|
||||
|
||||
[node name="ui_background" type="ColorRect" parent="background"]
|
||||
unique_name_in_owner = true
|
||||
offset_right = 512.0
|
||||
offset_bottom = 1440.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 1)
|
||||
|
||||
[node name="close" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 1280.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 1344.0
|
||||
text = "Close"
|
||||
|
||||
[node name="new_item" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 1184.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 1248.0
|
||||
text = "New Item
|
||||
"
|
||||
|
||||
[node name="new_item_name" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 40.0
|
||||
offset_top = 1184.0
|
||||
offset_right = 490.0
|
||||
offset_bottom = 1248.0
|
||||
placeholder_text = "Set Item Name"
|
||||
|
||||
[node name="filter" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 992.0
|
||||
offset_right = 432.0
|
||||
offset_bottom = 1056.0
|
||||
placeholder_text = "Filter Items"
|
||||
|
||||
[node name="list" type="ItemList" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
offset_left = 64.0
|
||||
offset_top = 100.0
|
||||
offset_right = 448.0
|
||||
offset_bottom = 832.0
|
||||
allow_reselect = true
|
||||
item_count = 2
|
||||
item_0/text = "Item A"
|
||||
item_1/text = "Item B"
|
||||
|
||||
[node name="delete" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 1088.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 1152.0
|
||||
text = "Delete Item"
|
||||
|
||||
[node name="save" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 896.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 960.0
|
||||
text = "Save Item"
|
||||
|
||||
[node name="item_name" type="Label" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 1280.0
|
||||
offset_top = 96.0
|
||||
offset_right = 1920.0
|
||||
offset_bottom = 170.0
|
||||
theme_override_font_sizes/font_size = 50
|
||||
text = "Item Name"
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HTTPRequest" type="HTTPRequest" parent="."]
|
||||
|
||||
[connection signal="button_up" from="close" to="." method="_on_close_button_up"]
|
||||
[connection signal="button_up" from="new_item" to="." method="_on_new_item_button_up"]
|
||||
[connection signal="editing_toggled" from="new_item_name" to="." method="_on_new_item_name_editing_toggled"]
|
||||
[connection signal="text_submitted" from="new_item_name" to="." method="_on_new_item_name_text_submitted"]
|
||||
[connection signal="text_changed" from="filter" to="." method="_on_filter_text_changed"]
|
||||
[connection signal="item_selected" from="list" to="." method="_on_list_item_selected"]
|
||||
[connection signal="button_up" from="delete" to="." method="_on_delete_button_up"]
|
||||
[connection signal="button_up" from="save" to="." method="_on_save_button_up"]
|
||||
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
|
||||
5
01 - Menus/04 - Modules/modules_.gd
Normal file
5
01 - Menus/04 - Modules/modules_.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends Control
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. characters
|
||||
var module # e.g. trait
|
||||
1
01 - Menus/04 - Modules/modules_.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cj7dq6bxffndm
|
||||
12
01 - Menus/04 - Modules/modules_.tscn
Normal file
12
01 - Menus/04 - Modules/modules_.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bf5jf67m66141"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cj7dq6bxffndm" path="res://01 - Menus/04 - Modules/modules_.gd" id="1_xh6yg"]
|
||||
|
||||
[node name="modules_" 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_xh6yg")
|
||||
5
01 - Menus/04 - Modules/modules_character.gd
Normal file
5
01 - Menus/04 - Modules/modules_character.gd
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
extends Control
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. characters
|
||||
var module # e.g. trait
|
||||
1
01 - Menus/04 - Modules/modules_character.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_character.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://b0g20c0f26vke
|
||||
8
01 - Menus/04 - Modules/modules_character.tscn
Normal file
8
01 - Menus/04 - Modules/modules_character.tscn
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://ifmshoyijckd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b0g20c0f26vke" path="res://01 - Menus/04 - Modules/modules_character.gd" id="1_ooaol"]
|
||||
|
||||
[node name="character" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_ooaol")
|
||||
171
01 - Menus/04 - Modules/modules_list.gd
Normal file
171
01 - Menus/04 - Modules/modules_list.gd
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
extends Control
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. characters
|
||||
var module # e.g. trait
|
||||
var items = [] # e.g. ["Undergrounder","Tough"]
|
||||
|
||||
var ini
|
||||
|
||||
var config
|
||||
var item_filter = ""
|
||||
var suggestions
|
||||
var suggestion = ""
|
||||
var overview
|
||||
var rec_helper = []
|
||||
var selected = ""
|
||||
var items_list:Array = []
|
||||
|
||||
func _enter_tree() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
rec_helper = config.get_value(category,"modules_list",[])
|
||||
items = []
|
||||
#print(str(category))
|
||||
#print(str(module))
|
||||
#print(str(items))
|
||||
custom_minimum_size.y = 512
|
||||
%filter.placeholder_text = "Filter " + module
|
||||
%new_item.text = "Add " + module
|
||||
%new_item_name.visible = false
|
||||
%suggestions_background.visible = false
|
||||
%new_item_suggestions.visible = false
|
||||
ini = "res://02 - Configurations/" + category + ".ini"
|
||||
list_items()
|
||||
|
||||
func list_items():
|
||||
config = ConfigFile.new()
|
||||
config.load(ini)
|
||||
print("modules_list:list_items:1 " + category)
|
||||
items = []
|
||||
%list.item_count = 0
|
||||
for i in rec_helper:
|
||||
print("")
|
||||
rec(i,category,item)
|
||||
#print(str(%list.item_count))
|
||||
pass
|
||||
|
||||
|
||||
func rec(i,conf,k):
|
||||
var conff = "res://02 - Configurations/" + conf + ".ini"
|
||||
config = ConfigFile.new()
|
||||
config.load(conff)
|
||||
print("modules_list:rec:1 conff = " + conff)
|
||||
print("modules_list:rec:2 sections = " + str(config.get_section_keys(k)))
|
||||
print("modules_list:rec:3 k = " + str(k))
|
||||
print("modules_list:rec:4 i = " + str(i))
|
||||
if config.get_section_keys(k).has(i):
|
||||
var m = config.get_value(k,i)
|
||||
print("modules_list:rec:5 " + (k) + " has " + str(m) + " as " + str(i))
|
||||
if module == i:
|
||||
print("modules_list:rec:6 " + str(items))
|
||||
for b in config.get_value(k,i,[]):
|
||||
print("modules_list:rec:10 " + str(b) + str(items))
|
||||
if not items.has(b) and b != "":
|
||||
items = items + [b]
|
||||
print("modules_list:rec:11 adding " + b + " to list")
|
||||
if item_filter == "":
|
||||
%list.add_item(str(b))
|
||||
%list.set_item_tooltip(%list.item_count - 1, k)
|
||||
if conf != category:
|
||||
%list.set_item_custom_bg_color(%list.item_count - 1,"black")
|
||||
elif item_filter.to_lower() in b.to_lower():
|
||||
%list.add_item(str(b))
|
||||
else:
|
||||
%list.item_count = %list.item_count -1
|
||||
print("modules_list:rec:12 " + i + " " + str(category))
|
||||
if i != category:
|
||||
print("modules_list:rec:7 " + str(rec_helper.slice(rec_helper.find(i),-1)))
|
||||
print("modules_list:rec:8 " + str(m))
|
||||
for o in rec_helper.slice(rec_helper.find(i),rec_helper.size()):
|
||||
print(str(o))
|
||||
for j in m:
|
||||
print("modules_list:rec:9 rec " + o + " - " + i + " - " + j)
|
||||
rec(o,i,j)
|
||||
|
||||
func _on_filter_text_changed(new_text: String) -> void:
|
||||
item_filter = new_text
|
||||
list_items()
|
||||
|
||||
func _on_new_item_button_up() -> void:
|
||||
%new_item_name.visible = true
|
||||
%suggestions_background.visible = true
|
||||
%new_item_suggestions.visible = true
|
||||
%new_item_name.grab_focus()
|
||||
list_suggestions()
|
||||
|
||||
|
||||
func _on_new_item_name_editing_toggled(toggled_on: bool) -> void:
|
||||
if !toggled_on:
|
||||
%new_item_name.text = ""
|
||||
%new_item_name.visible = false
|
||||
%suggestions_background.visible = false
|
||||
await get_tree().create_timer(0.001).timeout
|
||||
%new_item_suggestions.visible = false
|
||||
|
||||
|
||||
func list_suggestions():
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/" + module + ".ini")
|
||||
var i = 0
|
||||
suggestions = config.get_sections()
|
||||
#print(str(suggestions))
|
||||
%new_item_suggestions.item_count = suggestions.size()
|
||||
#print(str(%new_item_suggestions.item_count))
|
||||
for j in suggestions:
|
||||
if suggestion == "":
|
||||
%new_item_suggestions.set_item_text(i,str(j))
|
||||
i = i+1
|
||||
elif suggestion.to_lower() in j.to_lower():
|
||||
%new_item_suggestions.set_item_text(i,str(j))
|
||||
i = i+1
|
||||
#print(j)
|
||||
else:
|
||||
%new_item_suggestions.item_count = %new_item_suggestions.item_count -1
|
||||
#print(str(%list.item_count))
|
||||
pass
|
||||
|
||||
func _on_new_item_name_text_changed(new_text: String) -> void:
|
||||
suggestion = new_text
|
||||
list_suggestions()
|
||||
|
||||
|
||||
func _on_new_item_suggestions_item_selected(index: int) -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load(ini)
|
||||
if not items.has(%new_item_suggestions.get_item_text(index)):
|
||||
print(str(items))
|
||||
var i = config.get_value(item,module,[]) + [%new_item_suggestions.get_item_text(index)]
|
||||
print(str(i))
|
||||
config.set_value(item,module,i)
|
||||
config.save(ini)
|
||||
list_items()
|
||||
|
||||
|
||||
func _on_list_item_selected(index: int) -> void:
|
||||
if overview:
|
||||
remove_child(overview)
|
||||
print(module)
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
var submodule = config.get_value(module,"module","")
|
||||
overview = load("res://01 - Menus/04 - Modules/modules_" + submodule + ".tscn").instantiate()
|
||||
overview.position.x = 448
|
||||
overview.scale.x = 0.8
|
||||
overview.scale.y = 0.8
|
||||
overview.category = module
|
||||
overview.item = %list.get_item_text(index)
|
||||
overview.mouse_filter = 2
|
||||
selected = %list.get_item_text(index)
|
||||
add_child(overview)
|
||||
|
||||
|
||||
func _on_delete_button_up() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load(ini)
|
||||
print(str(items))
|
||||
var j = config.get_value(category,item,[])
|
||||
j.remove_at(config.get_value(category,item,[]).find(selected))
|
||||
config.set_value(item,module,j)
|
||||
config.save(ini)
|
||||
list_items()
|
||||
1
01 - Menus/04 - Modules/modules_list.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_list.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bswsmlukpn7x4
|
||||
88
01 - Menus/04 - Modules/modules_list.tscn
Normal file
88
01 - Menus/04 - Modules/modules_list.tscn
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://uo4yu1gwxcec"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bswsmlukpn7x4" path="res://01 - Menus/04 - Modules/modules_list.gd" id="1_15vp0"]
|
||||
|
||||
[node name="list" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_15vp0")
|
||||
|
||||
[node name="background" type="ColorRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_right = 448.0
|
||||
offset_bottom = 1024.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 1)
|
||||
|
||||
[node name="suggestions_background" type="ColorRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 0
|
||||
offset_left = -64.0
|
||||
offset_top = 192.0
|
||||
offset_right = 512.0
|
||||
offset_bottom = 872.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 1)
|
||||
|
||||
[node name="list" type="ItemList" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 0
|
||||
offset_left = 32.0
|
||||
offset_top = 32.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 672.0
|
||||
|
||||
[node name="filter" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 64.0
|
||||
offset_top = 896.0
|
||||
offset_right = 384.0
|
||||
offset_bottom = 960.0
|
||||
placeholder_text = "Filter item"
|
||||
|
||||
[node name="new_item" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 64.0
|
||||
offset_top = 800.0
|
||||
offset_right = 384.0
|
||||
offset_bottom = 864.0
|
||||
text = "Add item"
|
||||
|
||||
[node name="new_item_name" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 0
|
||||
offset_top = 208.0
|
||||
offset_right = 448.0
|
||||
offset_bottom = 272.0
|
||||
placeholder_text = "Set Item Name"
|
||||
|
||||
[node name="new_item_suggestions" type="ItemList" parent="."]
|
||||
unique_name_in_owner = true
|
||||
z_index = 1
|
||||
layout_mode = 0
|
||||
offset_left = -48.0
|
||||
offset_top = 272.0
|
||||
offset_right = 496.0
|
||||
offset_bottom = 856.0
|
||||
allow_reselect = true
|
||||
|
||||
[node name="delete" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 64.0
|
||||
offset_top = 704.0
|
||||
offset_right = 384.0
|
||||
offset_bottom = 768.0
|
||||
text = "Delete"
|
||||
|
||||
[connection signal="item_selected" from="list" to="." method="_on_list_item_selected"]
|
||||
[connection signal="text_changed" from="filter" to="." method="_on_filter_text_changed"]
|
||||
[connection signal="button_up" from="new_item" to="." method="_on_new_item_button_up"]
|
||||
[connection signal="editing_toggled" from="new_item_name" to="." method="_on_new_item_name_editing_toggled"]
|
||||
[connection signal="text_changed" from="new_item_name" to="." method="_on_new_item_name_text_changed"]
|
||||
[connection signal="item_selected" from="new_item_suggestions" to="." method="_on_new_item_suggestions_item_selected"]
|
||||
[connection signal="button_up" from="delete" to="." method="_on_delete_button_up"]
|
||||
6
01 - Menus/04 - Modules/modules_location.gd
Normal file
6
01 - Menus/04 - Modules/modules_location.gd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
extends Control
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. characters
|
||||
var module # e.g. trait
|
||||
var items = [] # e.g. ["Undergrounder","Tough"]
|
||||
1
01 - Menus/04 - Modules/modules_location.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_location.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c50oko0aci1t8
|
||||
12
01 - Menus/04 - Modules/modules_location.tscn
Normal file
12
01 - Menus/04 - Modules/modules_location.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://cynrv7v87br4g"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c50oko0aci1t8" path="res://01 - Menus/04 - Modules/modules_location.gd" id="1_08287"]
|
||||
|
||||
[node name="modules_location" 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_08287")
|
||||
7
01 - Menus/04 - Modules/modules_modifier.gd
Normal file
7
01 - Menus/04 - Modules/modules_modifier.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
extends Control
|
||||
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. character
|
||||
var module # e.g. trait
|
||||
var items # e.g. ["Undergrounder","Tough"]
|
||||
1
01 - Menus/04 - Modules/modules_modifier.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_modifier.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bsni2icpr5xpg
|
||||
12
01 - Menus/04 - Modules/modules_modifier.tscn
Normal file
12
01 - Menus/04 - Modules/modules_modifier.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://beaslpqen8eqr"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsni2icpr5xpg" path="res://01 - Menus/04 - Modules/modifier.gd" id="1_7leb1"]
|
||||
|
||||
[node name="modifier" 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_7leb1")
|
||||
123
01 - Menus/04 - Modules/modules_skill.gd
Normal file
123
01 - Menus/04 - Modules/modules_skill.gd
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
extends Control
|
||||
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. character
|
||||
var module # e.g. trait
|
||||
var items # e.g. ["Undergrounder","Tough"]
|
||||
|
||||
var cost:Array = [0,0,0,0]
|
||||
var difficulty:int = 0
|
||||
var action:String = ""
|
||||
var success:String = ""
|
||||
var failure:String = ""
|
||||
var duration:int = 0
|
||||
var ends_on:int = 0
|
||||
var target:Array = []
|
||||
var stat:Array = []
|
||||
var challenge:String = ""
|
||||
|
||||
var config = ConfigFile.new()
|
||||
var item_filter = ""
|
||||
var targets1 = ""
|
||||
|
||||
func _enter_tree() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/" + category + ".ini")
|
||||
#print(str(config.get_value(item,"cost")))
|
||||
cost = config.get_value(item,"cost",[0,0,0,0])
|
||||
difficulty = config.get_value(item,"difficulty",0)
|
||||
action = config.get_value(item,"action","")
|
||||
success = config.get_value(item,"success","")
|
||||
failure = config.get_value(item,"failure","")
|
||||
duration = config.get_value(item,"duration",0)
|
||||
ends_on = config.get_value(item,"ends_on",0)
|
||||
target = config.get_value(item,"target",[""])
|
||||
stat = config.get_value(item,"stat",[""])
|
||||
var j = 0
|
||||
for i in %cost.get_children():
|
||||
i.text = str(cost[j])
|
||||
j = j + 1
|
||||
%difficulty.text = str(difficulty)
|
||||
%action.text = action
|
||||
%success.text = success
|
||||
%failure.text = failure
|
||||
%duration.text = str(duration)
|
||||
%ends_on.select(ends_on)
|
||||
%target.item_count = 0
|
||||
for i in target:
|
||||
%target.add_item(i)
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/stat.ini")
|
||||
for i in stat:
|
||||
%stat.add_item(i)
|
||||
|
||||
func _on_body_text_changed(new_text: String) -> void:
|
||||
cost[0] = int(new_text)
|
||||
print(str(cost))
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_communication_text_changed(new_text: String) -> void:
|
||||
cost[1] = int(new_text)
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_mind_text_changed(new_text: String) -> void:
|
||||
cost[2] = int(new_text)
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_soul_text_changed(new_text: String) -> void:
|
||||
cost[3] = int(new_text)
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
func save():
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/" + category + ".ini")
|
||||
config.set_value(item,"cost",cost)
|
||||
config.set_value(item,"difficulty",difficulty)
|
||||
config.set_value(item,"action",action)
|
||||
config.set_value(item,"success",success)
|
||||
config.set_value(item,"failure",failure)
|
||||
config.set_value(item,"duration",duration)
|
||||
config.set_value(item,"ends_on",ends_on)
|
||||
config.set_value(item,"target",target)
|
||||
config.set_value(item,"stat",stat)
|
||||
config.save("res://02 - Configurations/" + category + ".ini")
|
||||
%http.request("https://ttrpg.marty.tf/hi2/",["Content-Type: application/json"],HTTPClient.METHOD_PUT,"hi2")
|
||||
|
||||
|
||||
func _on_difficulty_text_changed(new_text: String) -> void:
|
||||
difficulty = int(new_text)
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_action_text_changed() -> void:
|
||||
action = %action.text
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_success_text_changed() -> void:
|
||||
success = %success.text
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_failure_text_changed() -> void:
|
||||
failure = %failure.text
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_duration_text_changed(new_text) -> void:
|
||||
duration = int(new_text)
|
||||
print(str(duration))
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_ends_on_item_selected(index: int) -> void:
|
||||
ends_on = index
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
|
||||
func _on_http_request_completed(result: int, response_code: int, headers: PackedStringArray, body: PackedByteArray) -> void:
|
||||
print(str(response_code))
|
||||
1
01 - Menus/04 - Modules/modules_skill.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_skill.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cy7cil87c8jlm
|
||||
177
01 - Menus/04 - Modules/modules_skill.tscn
Normal file
177
01 - Menus/04 - Modules/modules_skill.tscn
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://wvtkpsevhva0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cy7cil87c8jlm" path="res://01 - Menus/04 - Modules/modules_skill.gd" id="1_5eik8"]
|
||||
|
||||
[node name="skill" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_5eik8")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
visible = false
|
||||
layout_mode = 0
|
||||
offset_right = 1408.0
|
||||
offset_bottom = 1280.0
|
||||
|
||||
[node name="cost" type="Node2D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="body" type="LineEdit" parent="cost"]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 64.0
|
||||
offset_top = 64.0
|
||||
offset_right = 206.0
|
||||
offset_bottom = 128.0
|
||||
theme_override_colors/font_color = Color(0.8509804, 0.29411766, 0.29411766, 1)
|
||||
placeholder_text = "body"
|
||||
|
||||
[node name="communication" type="LineEdit" parent="cost"]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 256.0
|
||||
offset_top = 64.0
|
||||
offset_right = 398.0
|
||||
offset_bottom = 128.0
|
||||
placeholder_text = "communication"
|
||||
|
||||
[node name="mind" type="LineEdit" parent="cost"]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 64.0
|
||||
offset_top = 160.0
|
||||
offset_right = 206.0
|
||||
offset_bottom = 224.0
|
||||
placeholder_text = "mind"
|
||||
|
||||
[node name="soul" type="LineEdit" parent="cost"]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 256.0
|
||||
offset_top = 160.0
|
||||
offset_right = 398.0
|
||||
offset_bottom = 224.0
|
||||
placeholder_text = "soul"
|
||||
|
||||
[node name="action" type="TextEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 0
|
||||
offset_left = 64.0
|
||||
offset_top = 320.0
|
||||
offset_right = 960.0
|
||||
offset_bottom = 576.0
|
||||
placeholder_text = "action"
|
||||
wrap_mode = 1
|
||||
scroll_smooth = true
|
||||
caret_blink = true
|
||||
|
||||
[node name="success" type="TextEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 0
|
||||
offset_left = 64.0
|
||||
offset_top = 608.0
|
||||
offset_right = 960.0
|
||||
offset_bottom = 864.0
|
||||
placeholder_text = "success"
|
||||
wrap_mode = 1
|
||||
scroll_smooth = true
|
||||
caret_blink = true
|
||||
|
||||
[node name="failure" type="TextEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 0
|
||||
offset_left = 64.0
|
||||
offset_top = 896.0
|
||||
offset_right = 960.0
|
||||
offset_bottom = 1152.0
|
||||
placeholder_text = "failure"
|
||||
wrap_mode = 1
|
||||
scroll_smooth = true
|
||||
caret_blink = true
|
||||
|
||||
[node name="difficulty" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 576.0
|
||||
offset_top = 64.0
|
||||
offset_right = 718.0
|
||||
offset_bottom = 128.0
|
||||
placeholder_text = "difficulty"
|
||||
|
||||
[node name="duration" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 832.0
|
||||
offset_top = 64.0
|
||||
offset_right = 974.0
|
||||
offset_bottom = 128.0
|
||||
placeholder_text = "duration"
|
||||
|
||||
[node name="ends_on" type="OptionButton" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 1024.0
|
||||
offset_top = 64.0
|
||||
offset_right = 1344.0
|
||||
offset_bottom = 128.0
|
||||
selected = 0
|
||||
item_count = 3
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Ends on Sleep"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Ends on Rest"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="challenge" type="OptionButton" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 512.0
|
||||
offset_top = 160.0
|
||||
offset_right = 1344.0
|
||||
offset_bottom = 224.0
|
||||
selected = 0
|
||||
item_count = 3
|
||||
popup/item_0/id = 0
|
||||
popup/item_1/text = "Throw 1 dice"
|
||||
popup/item_1/id = 1
|
||||
popup/item_2/text = "Throw x dice"
|
||||
popup/item_2/id = 2
|
||||
|
||||
[node name="target" type="ItemList" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 0
|
||||
offset_left = 1024.0
|
||||
offset_top = 896.0
|
||||
offset_right = 1344.0
|
||||
offset_bottom = 1152.0
|
||||
mouse_filter = 2
|
||||
select_mode = 2
|
||||
item_count = 1
|
||||
item_0/text = "target"
|
||||
|
||||
[node name="stat" type="ItemList" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 0
|
||||
offset_left = 1024.0
|
||||
offset_top = 320.0
|
||||
offset_right = 1344.0
|
||||
offset_bottom = 864.0
|
||||
mouse_filter = 2
|
||||
select_mode = 2
|
||||
|
||||
[node name="http" type="HTTPRequest" parent="."]
|
||||
unique_name_in_owner = true
|
||||
use_threads = true
|
||||
|
||||
[connection signal="text_changed" from="cost/body" to="." method="_on_body_text_changed"]
|
||||
[connection signal="text_changed" from="cost/communication" to="." method="_on_communication_text_changed"]
|
||||
[connection signal="text_changed" from="cost/mind" to="." method="_on_mind_text_changed"]
|
||||
[connection signal="text_changed" from="cost/soul" to="." method="_on_soul_text_changed"]
|
||||
[connection signal="text_changed" from="action" to="." method="_on_action_text_changed"]
|
||||
[connection signal="text_changed" from="success" to="." method="_on_success_text_changed"]
|
||||
[connection signal="text_changed" from="failure" to="." method="_on_failure_text_changed"]
|
||||
[connection signal="text_changed" from="difficulty" to="." method="_on_difficulty_text_changed"]
|
||||
[connection signal="text_changed" from="duration" to="." method="_on_duration_text_changed"]
|
||||
[connection signal="item_selected" from="ends_on" to="." method="_on_ends_on_item_selected"]
|
||||
[connection signal="request_completed" from="http" to="." method="_on_http_request_completed"]
|
||||
7
01 - Menus/04 - Modules/modules_stat.gd
Normal file
7
01 - Menus/04 - Modules/modules_stat.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
extends Control
|
||||
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. character
|
||||
var module # e.g. trait
|
||||
var items # e.g. ["Undergrounder","Tough"]
|
||||
1
01 - Menus/04 - Modules/modules_stat.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_stat.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://uych52kioaci
|
||||
12
01 - Menus/04 - Modules/modules_stat.tscn
Normal file
12
01 - Menus/04 - Modules/modules_stat.tscn
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bqswmmgfxstfw"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bsni2icpr5xpg" path="res://01 - Menus/04 - Modules/modifier.gd" id="1_iafih"]
|
||||
|
||||
[node name="stat" 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_iafih")
|
||||
25
01 - Menus/04 - Modules/modules_text.gd
Normal file
25
01 - Menus/04 - Modules/modules_text.gd
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
extends Control
|
||||
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. character
|
||||
var module # e.g. trait
|
||||
var items # e.g. ["Undergrounder","Tough"]
|
||||
|
||||
var config
|
||||
var item_filter = ""
|
||||
|
||||
func _enter_tree() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/" + category + ".ini")
|
||||
%text.text = config.get_value(item,"text", "")
|
||||
|
||||
|
||||
func _on_backstory_text_changed() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/" + category + ".ini")
|
||||
config.set_value(item,"text",%text.text)
|
||||
get_parent().get_parent().show_save()
|
||||
|
||||
func save():
|
||||
config.save("res://02 - Configurations/" + category + ".ini")
|
||||
1
01 - Menus/04 - Modules/modules_text.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_text.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://c7veejgoktxy4
|
||||
19
01 - Menus/04 - Modules/modules_text.tscn
Normal file
19
01 - Menus/04 - Modules/modules_text.tscn
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://blinf0w4bd7xh"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c7veejgoktxy4" path="res://01 - Menus/04 - Modules/text.gd" id="1_ed0wg"]
|
||||
|
||||
[node name="text" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_ed0wg")
|
||||
|
||||
[node name="text" type="TextEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 0
|
||||
offset_top = 320.0
|
||||
offset_right = 576.0
|
||||
offset_bottom = 768.0
|
||||
wrap_mode = 1
|
||||
|
||||
[connection signal="text_changed" from="text" to="." method="_on_backstory_text_changed"]
|
||||
7
01 - Menus/04 - Modules/modules_trait.gd
Normal file
7
01 - Menus/04 - Modules/modules_trait.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
extends Control
|
||||
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. character
|
||||
var module # e.g. trait
|
||||
var items # e.g. ["Undergrounder","Tough"]
|
||||
1
01 - Menus/04 - Modules/modules_trait.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_trait.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://5fupt8jhtnre
|
||||
8
01 - Menus/04 - Modules/modules_trait.tscn
Normal file
8
01 - Menus/04 - Modules/modules_trait.tscn
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://bbtwis5vf5pgj"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://5fupt8jhtnre" path="res://01 - Menus/04 - Modules/trait.gd" id="1_elj4r"]
|
||||
|
||||
[node name="trait" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_elj4r")
|
||||
7
01 - Menus/04 - Modules/modules_xenoline.gd
Normal file
7
01 - Menus/04 - Modules/modules_xenoline.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
extends Control
|
||||
|
||||
|
||||
var item # e.g. grondir
|
||||
var category # e.g. character
|
||||
var module # e.g. trait
|
||||
var items # e.g. ["Undergrounder","Tough"]
|
||||
1
01 - Menus/04 - Modules/modules_xenoline.gd.uid
Normal file
1
01 - Menus/04 - Modules/modules_xenoline.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cbbigwfdfc2l4
|
||||
8
01 - Menus/04 - Modules/modules_xenoline.tscn
Normal file
8
01 - Menus/04 - Modules/modules_xenoline.tscn
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://cn53vjwt1k4wq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cbbigwfdfc2l4" path="res://01 - Menus/04 - Modules/xenoline.gd" id="1_bofh8"]
|
||||
|
||||
[node name="xenoline" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_bofh8")
|
||||
40
01 - Menus/05 - Campaign Manager/campaign_manager.gd
Normal file
40
01 - Menus/05 - Campaign Manager/campaign_manager.gd
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
extends Node2D
|
||||
|
||||
var config
|
||||
var items:Array
|
||||
var module
|
||||
var modules_list
|
||||
var name_
|
||||
var name_self
|
||||
|
||||
|
||||
func _enter_tree() -> void:
|
||||
%scroll.visible = false
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
|
||||
|
||||
func _on_close_button_up() -> void:
|
||||
queue_free()
|
||||
|
||||
|
||||
func _on_items_button_up() -> void:
|
||||
%scroll.visible = true
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
items = config.get_sections()
|
||||
for j in %container.get_children():
|
||||
%container.remove_child(j)
|
||||
for i in items + [""]:
|
||||
var item = load("res://01 - Menus/05 - Campaign Manager/item_helper.tscn").instantiate()
|
||||
item.item = i
|
||||
%container.add_child(item)
|
||||
|
||||
|
||||
|
||||
func _on_save_button_up() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
for i in items.size() + 1:
|
||||
%container.get_child(i).save()
|
||||
_on_items_button_up()
|
||||
1
01 - Menus/05 - Campaign Manager/campaign_manager.gd.uid
Normal file
1
01 - Menus/05 - Campaign Manager/campaign_manager.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cn6njcwxgyat2
|
||||
55
01 - Menus/05 - Campaign Manager/campaign_manager.tscn
Normal file
55
01 - Menus/05 - Campaign Manager/campaign_manager.tscn
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://c6cqrvu2ifno6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cn6njcwxgyat2" path="res://01 - Menus/05 - Campaign Manager/campaign_manager.gd" id="1_wb8ha"]
|
||||
|
||||
[node name="campaign_manager" type="Node2D"]
|
||||
script = ExtResource("1_wb8ha")
|
||||
|
||||
[node name="ui_background" type="ColorRect" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_right = 512.0
|
||||
offset_bottom = 1440.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 1)
|
||||
|
||||
[node name="close" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 1280.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 1344.0
|
||||
text = "Close"
|
||||
|
||||
[node name="items" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 320.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 384.0
|
||||
text = "items"
|
||||
|
||||
[node name="save" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
offset_left = 96.0
|
||||
offset_top = 1184.0
|
||||
offset_right = 416.0
|
||||
offset_bottom = 1248.0
|
||||
text = "Save"
|
||||
|
||||
[node name="scroll" type="ScrollContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
offset_left = 576.0
|
||||
offset_top = 64.0
|
||||
offset_right = 2496.0
|
||||
offset_bottom = 1408.0
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="container" type="VBoxContainer" parent="scroll"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[connection signal="button_up" from="close" to="." method="_on_close_button_up"]
|
||||
[connection signal="button_up" from="items" to="." method="_on_items_button_up"]
|
||||
[connection signal="button_up" from="save" to="." method="_on_save_button_up"]
|
||||
117
01 - Menus/05 - Campaign Manager/item_helper.gd
Normal file
117
01 - Menus/05 - Campaign Manager/item_helper.gd
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
extends Control
|
||||
|
||||
var item
|
||||
var config
|
||||
var name_
|
||||
var name_self
|
||||
var module
|
||||
var modules_list
|
||||
var main_menu_entry = ""
|
||||
|
||||
func _enter_tree() -> void:
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
name_ = config.get_value(item,"name","")
|
||||
name_self = config.get_value(item,"name_self","")
|
||||
modules_list = config.get_value(item,"modules_list",[])
|
||||
%item.text = item
|
||||
%name.text = name_
|
||||
%name_self.text = name_self
|
||||
%add_new_select.visible = false
|
||||
%module.add_item("")
|
||||
%module.add_item(%item.text)
|
||||
print("item_helper:_enter_tree: item_helper for " + item)
|
||||
var modules:Array = [""]
|
||||
var select_module = 0
|
||||
for i in config.get_sections():
|
||||
print("item_helper:_enter_tree:i populating %add_new_select with " + i)
|
||||
%add_new_select.add_item(i)
|
||||
var k = config.get_value(i,"module","")
|
||||
if k == %item.text: # select item 1 when module has same name as item
|
||||
print("item_helper:_enter_tree: selecting " + k)
|
||||
select_module = 1
|
||||
elif k != "": # proceed only if module is set
|
||||
if not modules.has(k): # don't duplicate entries
|
||||
print("item_helper:_enter_tree:2 " + str(k) + " into " + str(modules))
|
||||
modules = modules + [config.get_value(i,"module","")]
|
||||
%module.add_item(k)
|
||||
|
||||
if k == config.get_value(item,"module",""):
|
||||
print("item_helper:_enter_tree:3 selecting " + k + " for " + str(i))
|
||||
select_module = modules.find(k) + 1
|
||||
%module.select(select_module)
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/main_menu.ini")
|
||||
var h = 1
|
||||
for i in config.get_sections():
|
||||
%categories.add_item(config.get_value(i,"name",""))
|
||||
%categories.set_item_tooltip(%categories.item_count - 1,i)
|
||||
if config.get_value(i,"items",[]).has(item):
|
||||
%categories.select(h)
|
||||
h = h + 1
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
var j:float = modules_list.size()
|
||||
if j != 0:
|
||||
%modules_list.max_columns = j
|
||||
%modules_list.fixed_column_width = %modules_list.size.x/(1.1*j) - (j *8)
|
||||
for i in modules_list:
|
||||
print("item_helper:_enter_tree:1 " + i)
|
||||
%modules_list.add_item(i)
|
||||
|
||||
func save():
|
||||
if %item.text != "":
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/categories.ini")
|
||||
item = %item.text
|
||||
config.set_value(item,"name",%name.text)
|
||||
config.set_value(item,"name_self",%name_self.text)
|
||||
config.set_value(item,"module",%module.text)
|
||||
var j = []
|
||||
for i in %modules_list.item_count:
|
||||
j = j + [%modules_list.get_item_text(i)]
|
||||
config.set_value(item,"modules_list",j)
|
||||
print("item_helper:save:1 saving " + item)
|
||||
config.save("res://02 - Configurations/campaign/categories.ini")
|
||||
|
||||
|
||||
config = ConfigFile.new()
|
||||
config.load("res://02 - Configurations/campaign/main_menu.ini")
|
||||
if not config.get_value(main_menu_entry,"items",[]).has(item) and main_menu_entry != "":
|
||||
print("item_helper:save:2 " + item + " not in " + str(config.get_value(main_menu_entry,"items",[])))
|
||||
config.set_value(main_menu_entry,"items",config.get_value(main_menu_entry,"items",[]) + [item])
|
||||
config.save("res://02 - Configurations/campaign/main_menu.ini")
|
||||
|
||||
|
||||
|
||||
func _on_modules_list_item_selected(index: int) -> void:
|
||||
print("item_helper:_on_modules_list_item_selected:2 remove " + %modules_list.get_item_text(index))
|
||||
%modules_list.remove_item(index)
|
||||
|
||||
|
||||
func _on_add_new_item_selected(index: int) -> void:
|
||||
%modules_list.add_item(%add_new_select.get_item_text(index))
|
||||
var j:float = %modules_list.item_count
|
||||
%modules_list.max_columns = j
|
||||
%modules_list.fixed_column_width = %modules_list.size.x/(1.1*j) - (j *8)
|
||||
%add_new_select.visible = false
|
||||
|
||||
func _on_module_item_selected(index: int) -> void:
|
||||
module = %module.get_item_text(index)
|
||||
|
||||
|
||||
func _on_add_new_button_up() -> void:
|
||||
print("item_helper:_on_add_new_button_up:1 Add new")
|
||||
%add_new_select.visible = true
|
||||
|
||||
func _on_add_new_select_focus_exited() -> void:
|
||||
%add_new_select.visible = false
|
||||
|
||||
|
||||
func _on_item_text_changed(new_text: String) -> void:
|
||||
%module.set_item_text(1,new_text)
|
||||
|
||||
|
||||
func _on_categories_item_selected(index: int) -> void:
|
||||
main_menu_entry = %categories.get_item_tooltip(index)
|
||||
print("item_helper:_on_categories_item_selected:1 " + str(main_menu_entry))
|
||||
1
01 - Menus/05 - Campaign Manager/item_helper.gd.uid
Normal file
1
01 - Menus/05 - Campaign Manager/item_helper.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://nft8qh8eyyn4
|
||||
131
01 - Menus/05 - Campaign Manager/item_helper.tscn
Normal file
131
01 - Menus/05 - Campaign Manager/item_helper.tscn
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://chky5yb5bj7gy"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://nft8qh8eyyn4" path="res://01 - Menus/05 - Campaign Manager/item_helper.gd" id="1_yac37"]
|
||||
|
||||
[node name="item_helper" type="Control"]
|
||||
custom_minimum_size = Vector2(0, 320)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 2112.0
|
||||
offset_bottom = 192.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_yac37")
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
layout_mode = 0
|
||||
offset_right = 1920.0
|
||||
offset_bottom = 320.0
|
||||
color = Color(0.047058824, 0.07058824, 0.09803922, 1)
|
||||
|
||||
[node name="item" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.030303031
|
||||
anchor_top = 0.2
|
||||
anchor_right = 0.030303031
|
||||
anchor_bottom = 0.2
|
||||
offset_right = 256.0
|
||||
offset_bottom = 64.0
|
||||
placeholder_text = "technical name"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="name_self" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.18200001
|
||||
anchor_top = 0.2
|
||||
anchor_right = 0.18200001
|
||||
anchor_bottom = 0.2
|
||||
offset_left = -0.3840332
|
||||
offset_right = 255.61597
|
||||
offset_bottom = 64.0
|
||||
placeholder_text = "singular name"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="name" type="LineEdit" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.333
|
||||
anchor_top = 0.2
|
||||
anchor_right = 0.333
|
||||
anchor_bottom = 0.2
|
||||
offset_left = 0.7039795
|
||||
offset_right = 256.70398
|
||||
offset_bottom = 64.0
|
||||
placeholder_text = "multiple name"
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="modules_list" type="ItemList" parent="."]
|
||||
unique_name_in_owner = true
|
||||
clip_contents = false
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.030000001
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.030000001
|
||||
anchor_bottom = 0.5
|
||||
offset_left = 0.6399994
|
||||
offset_right = 1472.64
|
||||
offset_bottom = 128.0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="add_new_select" type="OptionButton" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.54545456
|
||||
anchor_top = 0.6
|
||||
anchor_right = 0.54545456
|
||||
anchor_bottom = 0.6
|
||||
offset_right = 512.0
|
||||
offset_bottom = 64.0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="module" type="OptionButton" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.4848485
|
||||
anchor_top = 0.2
|
||||
anchor_right = 0.4848485
|
||||
anchor_bottom = 0.2
|
||||
offset_right = 256.0
|
||||
offset_bottom = 64.0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="add_new" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 1600.0
|
||||
offset_top = 192.0
|
||||
offset_right = 1856.0
|
||||
offset_bottom = 256.0
|
||||
text = "Add list"
|
||||
|
||||
[node name="categories" type="OptionButton" parent="."]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_left = 0.63600004
|
||||
anchor_top = 0.2
|
||||
anchor_right = 0.63600004
|
||||
anchor_bottom = 0.2
|
||||
offset_left = 0.76794434
|
||||
offset_right = 256.76794
|
||||
offset_bottom = 64.0
|
||||
item_count = 1
|
||||
popup/item_0/id = 0
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[connection signal="text_changed" from="item" to="." method="_on_item_text_changed"]
|
||||
[connection signal="item_selected" from="modules_list" to="." method="_on_modules_list_item_selected"]
|
||||
[connection signal="focus_exited" from="add_new_select" to="." method="_on_add_new_select_focus_exited"]
|
||||
[connection signal="item_selected" from="add_new_select" to="." method="_on_add_new_item_selected"]
|
||||
[connection signal="item_selected" from="module" to="." method="_on_module_item_selected"]
|
||||
[connection signal="button_up" from="add_new" to="." method="_on_add_new_button_up"]
|
||||
[connection signal="item_selected" from="categories" to="." method="_on_categories_item_selected"]
|
||||
1
01 - Menus/06 - World Map/world_map.gd
Normal file
1
01 - Menus/06 - World Map/world_map.gd
Normal file
|
|
@ -0,0 +1 @@
|
|||
extends Node2D
|
||||
1
01 - Menus/06 - World Map/world_map.gd.uid
Normal file
1
01 - Menus/06 - World Map/world_map.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://chr13mihhdey2
|
||||
6
01 - Menus/06 - World Map/world_map.tscn
Normal file
6
01 - Menus/06 - World Map/world_map.tscn
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://y3yq0k83jf6o"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://chr13mihhdey2" path="res://01 - Menus/06 - World Map/world_map.gd" id="1_oilm1"]
|
||||
|
||||
[node name="world_map" type="Node2D"]
|
||||
script = ExtResource("1_oilm1")
|
||||
Loading…
Add table
Add a link
Reference in a new issue