diff --git a/control.tscn b/control.tscn index 1c1d8b6..45d5d2a 100644 --- a/control.tscn +++ b/control.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=7 format=3 uid="uid://b3kp4yvs1tsvk"] +[gd_scene load_steps=8 format=3 uid="uid://b3kp4yvs1tsvk"] [ext_resource type="Script" path="res://scripts/Main.gd" id="1_77o4d"] [ext_resource type="Texture2D" uid="uid://dqxenyuy7cq8p" path="res://textures/github-mark-white.svg" id="2_gxdx2"] @@ -6,6 +6,7 @@ [ext_resource type="Texture2D" uid="uid://dhiglb0caii3k" path="res://textures/email.svg" id="3_t7ds3"] [ext_resource type="Texture2D" uid="uid://b8nrxeivn87uy" path="res://textures/image.svg" id="4_2l70c"] [ext_resource type="Script" path="res://scripts/SoundChangeTool.gd" id="5_8aktb"] +[ext_resource type="Script" path="res://scripts/IPAKeyboardTool.gd" id="7_y4eos"] [node name="Control" type="Control" node_paths=PackedStringArray("open_file_button", "save_file_button", "new_project_button", "translation_settings", "part_of_speech_list")] layout_mode = 3 @@ -32,7 +33,7 @@ color = Color(0.121569, 0.121569, 0.121569, 1) layout_mode = 0 offset_right = 1152.0 offset_bottom = 40.0 -current_tab = 4 +current_tab = 5 [node name="HOME_MENU" type="Control" parent="TabManager"] visible = false @@ -210,12 +211,44 @@ script = ExtResource("3_ba2fa") add_button = NodePath("../../DictionaryAdd") delete_button = NodePath("../../DictionaryRemove") +[node name="GRAMMAR_MODULE" type="Control" parent="TabManager"] +visible = false +layout_mode = 2 +metadata/_tab_index = 3 + +[node name="PartOfSpeechList" type="TextEdit" parent="TabManager/GRAMMAR_MODULE"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 48.0 +offset_right = 368.0 +offset_bottom = 538.0 +tooltip_text = "ADD_WORD_CLASS" +text = "noun +adjective +adverb +verb +adposition +interjection +conjunction +pronoun +phrase" +placeholder_text = "ADD_WORD_CLASS" + +[node name="BriefGrammarOverview" type="TextEdit" parent="TabManager/GRAMMAR_MODULE"] +layout_mode = 0 +offset_left = 426.0 +offset_top = 48.0 +offset_right = 1126.0 +offset_bottom = 538.0 +tooltip_text = "BRIEF_GRAMMAR_OVERVIEW_TOOLTIP" +placeholder_text = "BRIEF_GRAMMAR_OVERVIEW_TOOLTIP" + [node name="SOUND_CHANGE_TOOL" type="Control" parent="TabManager" node_paths=PackedStringArray("button")] visible = false layout_mode = 2 script = ExtResource("5_8aktb") button = NodePath("Apply") -metadata/_tab_index = 3 +metadata/_tab_index = 4 [node name="Categories" type="TextEdit" parent="TabManager/SOUND_CHANGE_TOOL"] layout_mode = 1 @@ -280,33 +313,22 @@ offset_bottom = 78.0 button_pressed = true text = "APPLY_REWRITE_OUTPUT" -[node name="GRAMMAR_MODULE" type="Control" parent="TabManager"] +[node name="IPA_KEYBOARD_TOOL" type="Control" parent="TabManager"] layout_mode = 2 -metadata/_tab_index = 4 +script = ExtResource("7_y4eos") +metadata/_tab_index = 5 -[node name="PartOfSpeechList" type="TextEdit" parent="TabManager/GRAMMAR_MODULE"] +[node name="Keyboard" type="GridContainer" parent="TabManager/IPA_KEYBOARD_TOOL"] layout_mode = 0 -offset_left = 16.0 -offset_top = 48.0 -offset_right = 368.0 -offset_bottom = 538.0 -tooltip_text = "ADD_WORD_CLASS" -text = "noun -adjective -adverb -verb -adposition -interjection -conjunction -pronoun -phrase" -placeholder_text = "ADD_WORD_CLASS" +offset_left = 15.0 +offset_top = 200.0 +offset_right = 815.0 +offset_bottom = 500.0 +columns = 20 -[node name="BriefGrammarOverview" type="TextEdit" parent="TabManager/GRAMMAR_MODULE"] +[node name="TextEdit" type="TextEdit" parent="TabManager/IPA_KEYBOARD_TOOL"] layout_mode = 0 -offset_left = 426.0 -offset_top = 48.0 -offset_right = 1126.0 -offset_bottom = 538.0 -tooltip_text = "BRIEF_GRAMMAR_OVERVIEW_TOOLTIP" -placeholder_text = "BRIEF_GRAMMAR_OVERVIEW_TOOLTIP" +offset_left = 15.0 +offset_top = 15.0 +offset_right = 815.0 +offset_bottom = 180.0 diff --git a/ipa_characters.txt b/ipa_characters.txt new file mode 100644 index 0000000..4284270 --- /dev/null +++ b/ipa_characters.txt @@ -0,0 +1,5 @@ +pbɓtdɗʈɖcɟʄȶȡkɡɠqɢʛʡʔmɱnɳɲȵŋɴʙⱱrɾɽʀɸβfvθðszʃʒʂʐçʝɕʑxɣχʁħʕʜʢhɦʍwɥʋɹɻjɰɬɮꞎlɫɭʎȴʟɺɧʘǀǃǂǁʦʣʧʤʨʥꭧꭦ +iyɨʉɯuɪʏʊeøɘɵɤoəɛœɜɞʌɔɐæɶaɑɒɚɝ +˩˨˧˦˥↓↑↗↘ +◌̊◌̈◌̽◌̃◌͊◌͋◌̚◌ᵊ◌͡◌◌ː◌ˑ◌̆◌ʰ◌˭◌ʼ◌ⁿ◌ˡ◌ʷ◌ʲ◌ˤ◌ˠ◌ˀ◌̥◌̬◌̤◌̰◌͓◌̨◌̹◌̜◌̮◌̼◌̪◌̺◌̻◌̟◌̠◌̩◌̯◌͜◌◌̙◌̘◌̞◌̝◌̴◌˞◌̋◌́◌̄◌̀◌̏◌᷈◌᷅◌᷄◌̂◌̌ +ˈˌ/[]∅|‖.‿⟨⟩ diff --git a/phonology_module_wip.tscn b/phonology_module_wip.tscn deleted file mode 100644 index 26e476f..0000000 --- a/phonology_module_wip.tscn +++ /dev/null @@ -1,35 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://cd7n53s846vf8"] - -[ext_resource type="Script" path="res://scripts/PhonologyContainer.gd" id="1_5b5us"] - -[node name="PHONOLOGY_MODULE" type="Control"] -visible = false -layout_mode = 3 -anchors_preset = 0 - -[node name="ConsonantsContainer" type="GridContainer" parent="." node_paths=PackedStringArray("add_button", "delete_button")] -layout_mode = 0 -offset_left = 20.0 -offset_top = 90.0 -offset_right = 508.0 -offset_bottom = 262.0 -columns = 5 -script = ExtResource("1_5b5us") -add_button = NodePath("") -delete_button = NodePath("") - -[node name="ConsonantAdd" type="Button" parent="."] -layout_mode = 0 -offset_left = 20.0 -offset_top = 52.0 -offset_right = 52.0 -offset_bottom = 83.0 -text = "+" - -[node name="ConsonantDelete" type="Button" parent="."] -layout_mode = 0 -offset_left = 68.0 -offset_top = 52.0 -offset_right = 100.0 -offset_bottom = 83.0 -text = "-" diff --git a/project.godot b/project.godot index 0621551..8e19103 100644 --- a/project.godot +++ b/project.godot @@ -30,6 +30,10 @@ project/assembly_name="Glossorola" version_control/plugin_name="GitPlugin" version_control/autoload_on_startup=true +[gui] + +theme/custom_font="res://textures/NotoSans-Regular.ttf" + [internationalization] locale/translations=PackedStringArray("res://translation/translation.en.translation", "res://translation/translation.es.translation", "res://translation/translation.pt_BR.translation") diff --git a/scripts/IPAButton.gd b/scripts/IPAButton.gd new file mode 100644 index 0000000..54f5999 --- /dev/null +++ b/scripts/IPAButton.gd @@ -0,0 +1,7 @@ +extends Button +class_name IPAButton + +signal _ipa_key_pressed + +func _pressed(): + _ipa_key_pressed.emit(text) diff --git a/scripts/IPAKeyboardTool.gd b/scripts/IPAKeyboardTool.gd new file mode 100644 index 0000000..aa49c25 --- /dev/null +++ b/scripts/IPAKeyboardTool.gd @@ -0,0 +1,37 @@ +extends Control + +const IPA_CHARACTERS_FILE_LOCATION = "res://ipa_characters.txt" + +func _ready(): + var load_file = FileAccess.open(IPA_CHARACTERS_FILE_LOCATION, FileAccess.READ) + var lines = load_file.get_as_text() + + var diacritic = false + + for char in lines: + # Ignore whitespace chars + if char.strip_edges(true, true).is_empty(): + continue + + if char == "◌": + diacritic = true + continue + + if diacritic: + diacritic = false + if char == "͡" or char == "͜": + create_button("◌" + char + "◌") + continue + create_button("◌" + char) + else: + create_button(char) + + +func create_button(c: String): + var b = IPAButton.new() + b.text = c + b._ipa_key_pressed.connect(_button_pressed) + $Keyboard.add_child(b) + +func _button_pressed(c: String): + $TextEdit.text += c.replace("◌","") diff --git a/textures/NotoSans-Regular.ttf b/textures/NotoSans-Regular.ttf new file mode 100644 index 0000000..fa4cff5 Binary files /dev/null and b/textures/NotoSans-Regular.ttf differ diff --git a/textures/NotoSans-Regular.ttf.import b/textures/NotoSans-Regular.ttf.import new file mode 100644 index 0000000..6e49e92 --- /dev/null +++ b/textures/NotoSans-Regular.ttf.import @@ -0,0 +1,34 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bcp48nqyj4gjt" +path="res://.godot/imported/NotoSans-Regular.ttf-a831e082a52645a3e688e40ab8539031.fontdata" + +[deps] + +source_file="res://textures/NotoSans-Regular.ttf" +dest_files=["res://.godot/imported/NotoSans-Regular.ttf-a831e082a52645a3e688e40ab8539031.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={}