x12 windowing system

This commit is contained in:
martyTF 2025-12-09 20:17:57 +01:00
parent e16b468e23
commit e6ab1fb39a
60 changed files with 701 additions and 877 deletions

View file

@ -0,0 +1,21 @@
extends Control
var size_x = 192
var size_y = 164
var text = "button"
var config
# Called when the node enters the scene tree for the first time.
func _enter_tree() -> void:
%button.size = Vector2(size_x,size_y)
%button.text = text
custom_minimum_size = %button.size
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta: float) -> void:
pass
func _on_button_pressed() -> void:
pass # Replace with function body.

View file

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

View file

@ -0,0 +1,23 @@
[gd_scene load_steps=2 format=3 uid="uid://csa8o3aa1jxx5"]
[ext_resource type="Script" uid="uid://c5e5v6ai5yv0w" path="res://01 - Menus/04 - Modules/ini_button.gd" id="1_jc31o"]
[node name="ini_button" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_jc31o")
[node name="button" type="Button" parent="."]
unique_name_in_owner = true
layout_mode = 0
offset_right = 256.0
offset_bottom = 64.0
text = "button"
[connection signal="pressed" from="button" to="." method="_on_button_pressed"]

View file

@ -0,0 +1,10 @@
extends Control
func set_stat_text(text):
%stat.text = text
func set_value(module_type,value):
var module = module_type.new()
module.text = str(value)
%value.add_child(module)

View file

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

View file

@ -0,0 +1,32 @@
[gd_scene load_steps=2 format=3 uid="uid://j2f5hra8e7um"]
[ext_resource type="Script" uid="uid://b5l5ei1tt4wka" path="res://01 - Menus/04 - Modules/module.gd" id="1_rxp26"]
[node name="module" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_rxp26")
[node name="vbox" type="VBoxContainer" parent="."]
unique_name_in_owner = true
layout_mode = 0
offset_right = 760.0
offset_bottom = 51.0
[node name="stat" type="Label" parent="vbox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3
text = "stat"
horizontal_alignment = 1
[node name="value" type="HBoxContainer" parent="vbox"]
unique_name_in_owner = true
layout_mode = 2
size_flags_vertical = 3

View file

@ -1,5 +0,0 @@
extends Control
var item # e.g. grondir
var category # e.g. characters
var module # e.g. trait

View file

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

View file

@ -1,12 +0,0 @@
[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")

View file

@ -1,5 +0,0 @@
extends Control
var item # e.g. grondir
var category # e.g. characters
var module # e.g. trait

View file

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

View file

@ -1,8 +0,0 @@
[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")

View file

@ -32,6 +32,7 @@ func _enter_tree() -> void:
%new_item_suggestions.visible = false
ini = "res://02 - Configurations/" + category + ".ini"
list_items()
set_menu_items()
func list_items():
config = ConfigFile.new()
@ -169,3 +170,21 @@ func _on_delete_button_up() -> void:
config.set_value(item,module,j)
config.save(ini)
list_items()
func set_menu_items():
var ui_scale = 1
var pixel_x = get_viewport_rect().size[0]
var pixel_y = get_viewport_rect().size[1]
if pixel_x + pixel_y < 2900:
ui_scale = 0.7
%background.size.y = pixel_y
if pixel_x < pixel_y: #mobile
self.position = Vector2(0,0)
%background.size.x = pixel_x
for i in [%list]:
i.scale = Vector2(ui_scale,ui_scale)
i.size.x = pixel_x/ui_scale - 128
i.position.x = 64 * ui_scale
else:
self.position = Vector2(1020 * ui_scale,0)
%background.size.x = 256*ui_scale

View file

@ -1,6 +0,0 @@
extends Control
var item # e.g. grondir
var category # e.g. characters
var module # e.g. trait
var items = [] # e.g. ["Undergrounder","Tough"]

View file

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

View file

@ -1,12 +0,0 @@
[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")

View file

@ -1,7 +0,0 @@
extends Control
var item # e.g. grondir
var category # e.g. character
var module # e.g. trait
var items # e.g. ["Undergrounder","Tough"]

View file

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

View file

@ -1,12 +0,0 @@
[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")

View file

@ -1,123 +0,0 @@
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))

View file

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

View file

@ -1,177 +0,0 @@
[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"]

View file

@ -1,7 +0,0 @@
extends Control
var item # e.g. grondir
var category # e.g. character
var module # e.g. trait
var items # e.g. ["Undergrounder","Tough"]

View file

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

View file

@ -1,12 +0,0 @@
[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")

View file

@ -1,25 +0,0 @@
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")

View file

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

View file

@ -1,19 +0,0 @@
[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"]

View file

@ -1,7 +0,0 @@
extends Control
var item # e.g. grondir
var category # e.g. character
var module # e.g. trait
var items # e.g. ["Undergrounder","Tough"]

View file

@ -1 +0,0 @@
uid://5fupt8jhtnre

View file

@ -1,8 +0,0 @@
[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")

View file

@ -1,7 +0,0 @@
extends Control
var item # e.g. grondir
var category # e.g. character
var module # e.g. trait
var items # e.g. ["Undergrounder","Tough"]

View file

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

View file

@ -1,8 +0,0 @@
[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")