loading for grammar should work now

This commit is contained in:
BassS0ul 2024-04-07 13:56:05 -05:00
parent 7f88a823d8
commit 1d00c9c1f1
8 changed files with 110 additions and 45 deletions

View File

@ -16,7 +16,7 @@ dock_5="Inspector,Node,History"
[EditorNode] [EditorNode]
open_scenes=["res://top_toolbar/TopToolbar.tscn", "res://genre_dialog_container.tscn", "res://new_genre.tscn", "res://term_container.tscn"] open_scenes=["res://top_toolbar/TopToolbar.tscn", "res://genre_dialog_container.tscn", "res://term_container.tscn", "res://new_genre.tscn"]
[ScriptEditor] [ScriptEditor]

View File

@ -1,19 +1,19 @@
2a60927148abd1d33b818b535e306557 2a60927148abd1d33b818b535e306557
::res://::1705255721 ::res://::1712510277
Cabin-VariableFont_wdth,wght.ttf::FontFile::6071708341937432371::1691361083::1691361083::1::::<><>:: Cabin-VariableFont_wdth,wght.ttf::FontFile::6071708341937432371::1691364683::1691364683::1::::<><>::
default_env.tres::Environment::-1::1691361083::0::1::::<><>:: default_env.tres::Environment::-1::1691364683::0::1::::<><>::
GenreSettings.gd::GDScript::-1::1699512452::0::1::::<>Node<>:: GenreSettings.gd::GDScript::-1::1699516052::0::1::::<>Node<>::
genre_dialog_container.gd::GDScript::-1::1693701895::0::1::::<>ScrollContainer<>:: genre_dialog_container.gd::GDScript::-1::1693705495::0::1::::<>ScrollContainer<>::
genre_dialog_container.tscn::PackedScene::153944638127573795::1699812762::0::1::::<><>::uid://cl7q0snsncynm<>res://genre_dialog_container.gd genre_dialog_container.tscn::PackedScene::153944638127573795::1706469530::0::1::::<><>::uid://cl7q0snsncynm<>res://genre_dialog_container.gd
icon.png::CompressedTexture2D::6683631437730026850::1691361083::1691361083::1::::<><>:: icon.png::CompressedTexture2D::6683631437730026850::1691364683::1691364683::1::::<><>::
MenuManager.gd::GDScript::-1::1691944901::0::1::::<>Node<>:: MenuManager.gd::GDScript::-1::1707680580::0::1::::<>Node<>::
new_genre.tscn::PackedScene::4691503272014395181::1699812762::0::1::::<><>:: new_genre.tscn::PackedScene::4691503272014395181::1707680580::0::1::::<><>::
README.md::TextFile::-1::1691361083::0::1::::<><>:: README.md::TextFile::-1::1691364683::0::1::::<><>::
term_container.tscn::PackedScene::5611995818604433798::1699817594::0::1::::<><>:: term_container.tscn::PackedScene::5611995818604433798::1706469530::0::1::::<><>::
::res://index_screen/::1691361083 ::res://index_screen/::1691364683
index.tscn::PackedScene::1801527253264693182::1691361083::0::1::::<><>:: index.tscn::PackedScene::1801527253264693182::1691364683::0::1::::<><>::
::res://top_toolbar/::1701632118 ::res://top_toolbar/::1706475281
CharacterMenu.gd::GDScript::-1::1701632118::0::1::::<>Label<>:: CharacterMenu.gd::GDScript::-1::1705288580::0::1::::<>Label<>::
DialogMenu.gd::GDScript::-1::1699817594::0::1::::<>Label<>:: DialogMenu.gd::GDScript::-1::1699821194::0::1::::<>Label<>::
GenreDialogManager.gd::GDScript::-1::1693443126::0::1::::<>OptionButton<>:: GenreDialogManager.gd::GDScript::-1::1693446726::0::1::::<>OptionButton<>::
TopToolbar.tscn::PackedScene::5079673781919012116::1701632118::0::1::::<><>::res://MenuManager.gd<>res://GenreSettings.gd<>res://top_toolbar/DialogMenu.gd<>res://top_toolbar/GenreDialogManager.gd<>uid://cgtpfhy1ler0<>res://top_toolbar/CharacterMenu.gd TopToolbar.tscn::PackedScene::5079673781919012116::1706475281::0::1::::<><>::res://MenuManager.gd<>res://GenreSettings.gd<>res://top_toolbar/DialogMenu.gd<>res://top_toolbar/GenreDialogManager.gd<>uid://cgtpfhy1ler0<>res://top_toolbar/CharacterMenu.gd

View File

@ -1,2 +1,4 @@
res://genre_dialog_container.tscn
res://MenuManager.gd
res://top_toolbar/TopToolbar.tscn res://top_toolbar/TopToolbar.tscn
res://top_toolbar/CharacterMenu.gd res://term_container.tscn

View File

@ -10,7 +10,7 @@ run_reload_scripts=true
[recent_files] [recent_files]
scenes=["res://term_container.tscn", "res://new_genre.tscn", "res://genre_dialog_container.tscn", "res://top_toolbar/TopToolbar.tscn", "res://index_screen/index.tscn", "res://toolset_test_tabbed_merged/tabbed_merged_test_interface.tscn", "res://toolset_test_tabbed_merged/draggable_assets.tscn", "res://toolset_test/drag_and_drop_demo_final.tscn"] scenes=["res://new_genre.tscn", "res://term_container.tscn", "res://genre_dialog_container.tscn", "res://top_toolbar/TopToolbar.tscn", "res://index_screen/index.tscn", "res://toolset_test_tabbed_merged/tabbed_merged_test_interface.tscn", "res://toolset_test_tabbed_merged/draggable_assets.tscn", "res://toolset_test/drag_and_drop_demo_final.tscn"]
scripts=["res://top_toolbar/CharacterMenu.gd", "res://genre_dialog_container.gd", "res://top_toolbar/GenreDialogManager.gd", "res://top_toolbar/DialogMenu.gd", "res://GenreSettings.gd", "res://RadioButtonManager.gd", "res://MenuManager.gd", "res://toolset_test_tabbed_merged/target_container_final.gd", "res://toolset_test_tabbed_merged/toolset_test_tabbed_merged.gd", "res://toolset_test/draggable_final.gd"] scripts=["res://top_toolbar/CharacterMenu.gd", "res://genre_dialog_container.gd", "res://top_toolbar/GenreDialogManager.gd", "res://top_toolbar/DialogMenu.gd", "res://GenreSettings.gd", "res://RadioButtonManager.gd", "res://MenuManager.gd", "res://toolset_test_tabbed_merged/target_container_final.gd", "res://toolset_test_tabbed_merged/toolset_test_tabbed_merged.gd", "res://toolset_test/draggable_final.gd"]
[dialog_bounds] [dialog_bounds]

View File

@ -3,11 +3,11 @@
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 22, "column": 117,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 343,
"row": 29, "row": 84,
"scroll_position": 0.0, "scroll_position": 51.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }
@ -17,12 +17,16 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 32, "column": 0,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 35, "row": 2,
"scroll_position": 2.0, "scroll_position": 0.0,
"selection": false, "selection": true,
"selection_from_column": 0,
"selection_from_line": 2,
"selection_to_column": 43,
"selection_to_line": 2,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }
@ -31,16 +35,12 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 76, "column": 333,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 2044,
"row": 16, "row": 24,
"scroll_position": 3.0, "scroll_position": 0.0,
"selection": true, "selection": false,
"selection_from_column": 1,
"selection_from_line": 15,
"selection_to_column": 76,
"selection_to_line": 16,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }
@ -63,12 +63,16 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 64, "column": 87,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 16, "row": 16,
"scroll_position": 0.0, "scroll_position": 0.0,
"selection": false, "selection": true,
"selection_from_column": 1,
"selection_from_line": 15,
"selection_to_column": 87,
"selection_to_line": 16,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }
@ -77,11 +81,11 @@ state={
state={ state={
"bookmarks": PackedInt32Array(), "bookmarks": PackedInt32Array(),
"breakpoints": PackedInt32Array(), "breakpoints": PackedInt32Array(),
"column": 76, "column": 61,
"folded_lines": Array[int]([]), "folded_lines": Array[int]([]),
"h_scroll_position": 0, "h_scroll_position": 0,
"row": 100, "row": 15,
"scroll_position": 69.0, "scroll_position": 0.0,
"selection": false, "selection": false,
"syntax_highlighter": "GDScript" "syntax_highlighter": "GDScript"
} }

View File

@ -15,15 +15,74 @@ func _process(delta):
func _on_option_button_wizards_item_selected(index): func _on_option_button_wizards_item_selected(index):
var newGenre = load("res://new_genre.tscn")
var toLoad
var data
var parser = XMLParser.new()
match index: match index:
0: 0:
$GenreMenu.show() $GenreMenu.show()
$DialogMenu.hide() $DialogMenu.hide()
$CharacterMenu.hide() $CharacterMenu.hide()
parser.open("user://GenreSettings.xml")
var loaded_name = ""
var name_loaded = false
var loaded_def = false
var def_loaded = false
var loadedBase
var base_loaded = false
while parser.read() != ERR_FILE_EOF:
if parser.get_node_type() == XMLParser.NODE_ELEMENT:
var node_name = parser.get_node_name()
if node_name == "default":
var node_data = parser.get_node_data()
if node_data == "true":
loaded_def = true
else:
loaded_def = false
def_loaded = true
elif node_name == "name":
loaded_name = parser.get_node_data()
if loaded_name != "Fantasy" and loaded_name != "Science Fiction" and loaded_name != "Modern Day":
name_loaded = true
elif node_name == "basedOn":
base_loaded = true
loadedBase = parser.get_node_data()
if def_loaded and name_loaded and base_loaded:
pass
var genreInstance = newGenre.instantiate()
genreInstance.GetChild(0).GetChild(0).Pressed = loaded_def
genreInstance.GetChild(0).GetChild(1).text = loaded_name
if loadedBase == "Modern Day":
genreInstance.getChild(0).GetChild(3).Selected = 0
elif loadedBase == "Sci Fi":
genreInstance.getChild(0).GetChild(3).Selected = 1
elif loadedBase == "Fantasy":
genreInstance.getChild(0).GetChild(3).Selected = 2
$GenreMenu/HBoxContainer/Default/ScrollContainer/GenreContainer.add_child(genreInstance)
$GenreMenu/HBoxContainer/Default/ScrollContainer/GenreContainer.move_child($GenreMenu/HBoxContainer/Default/ScrollContainer/GenreContainer/NewGenre, $GenreMenu/HBoxContainer/Default/ScrollContainer/GenreContainer.get_child_count() - 1)
def_loaded = false
name_loaded = false
1: 1:
$GenreMenu.hide() $GenreMenu.hide()
$DialogMenu.show() $DialogMenu.show()
$CharacterMenu.hide() $CharacterMenu.hide()
var newTerm = load("res://term_container.tscn")
parser.open("user://DialougeSettings.xml")
var unselected = true
while parser.read() != ERR_FILE_EOF:
if parser.get_node_type() == XMLParser.NODE_ELEMENT:
if $DialogMenu/VBoxContainer.get_child($VBoxContainer.get_child_count() - 1).get_child(0).get_child(0).get_child(1).text == "":
var termInstance = newTerm.instantiate()
unselected = true
termInstance.get_child(0).get_child(0).get_child(1).text = parser.get_node_data()
$DialogMenu/VBoxContainer.add_child(termInstance)
$DialogMenu/VBoxContainer.move_child($VBoxContainer/Button, $VBoxContainer.get_child_count() - 1)
elif $DialogMenu/VBoxContainer.get_child($VBoxContainer.get_child_count() - 1).get_child(0).get_child(1).get_child(1).text == "":
$DialogMenu/VBoxContainer.get_child($VBoxContainer.get_child_count() - 1).get_child(0).get_child(1).get_child(1).text = parser.get_node_data()
elif unselected:
$DialogMenu/VBoxContainer.get_child($VBoxContainer.get_child_count() - 1).get_child(1).get_child(1).Selected = parser.get_node_data()
2: 2:
$GenreMenu.hide() $GenreMenu.hide()
$DialogMenu.hide() $DialogMenu.hide()

View File

@ -80,7 +80,6 @@ layout_mode = 2
script = ExtResource("1_l6hds") script = ExtResource("1_l6hds")
[node name="GenreMenu" type="Label" parent="HBoxContainer/VBoxContainer3"] [node name="GenreMenu" type="Label" parent="HBoxContainer/VBoxContainer3"]
visible = false
layout_mode = 2 layout_mode = 2
text = "Genre Menu" text = "Genre Menu"
script = ExtResource("2_kvqsl") script = ExtResource("2_kvqsl")
@ -209,6 +208,7 @@ offset_bottom = 60.0
text = "Save" text = "Save"
[node name="CharacterMenu" type="Label" parent="HBoxContainer/VBoxContainer3"] [node name="CharacterMenu" type="Label" parent="HBoxContainer/VBoxContainer3"]
visible = false
layout_mode = 2 layout_mode = 2
text = "Character Menu" text = "Character Menu"
script = ExtResource("6_bxipl") script = ExtResource("6_bxipl")