From 833e8ee23dc2409229c56c3a33fa1eae3cf1d1d7 Mon Sep 17 00:00:00 2001 From: Giggy <71663261+GiggyMantis@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:23:45 -0400 Subject: [PATCH] Hotfix --- ipa_characters.txt | 5 ----- scripts/IPAKeyboardTool.gd | 13 ++++++++----- scripts/Main.gd | 19 +++++++++++++------ 3 files changed, 21 insertions(+), 16 deletions(-) delete mode 100644 ipa_characters.txt diff --git a/ipa_characters.txt b/ipa_characters.txt deleted file mode 100644 index 4284270..0000000 --- a/ipa_characters.txt +++ /dev/null @@ -1,5 +0,0 @@ -pbɓtdɗʈɖcɟʄȶȡkɡɠqɢʛʡʔmɱnɳɲȵŋɴʙⱱrɾɽʀɸβfvθðszʃʒʂʐçʝɕʑxɣχʁħʕʜʢhɦʍwɥʋɹɻjɰɬɮꞎlɫɭʎȴʟɺɧʘǀǃǂǁʦʣʧʤʨʥꭧꭦ -iyɨʉɯuɪʏʊeøɘɵɤoəɛœɜɞʌɔɐæɶaɑɒɚɝ -˩˨˧˦˥↓↑↗↘ -◌̊◌̈◌̽◌̃◌͊◌͋◌̚◌ᵊ◌͡◌◌ː◌ˑ◌̆◌ʰ◌˭◌ʼ◌ⁿ◌ˡ◌ʷ◌ʲ◌ˤ◌ˠ◌ˀ◌̥◌̬◌̤◌̰◌͓◌̨◌̹◌̜◌̮◌̼◌̪◌̺◌̻◌̟◌̠◌̩◌̯◌͜◌◌̙◌̘◌̞◌̝◌̴◌˞◌̋◌́◌̄◌̀◌̏◌᷈◌᷅◌᷄◌̂◌̌ -ˈˌ/[]∅|‖.‿⟨⟩ diff --git a/scripts/IPAKeyboardTool.gd b/scripts/IPAKeyboardTool.gd index aa49c25..3333ba3 100644 --- a/scripts/IPAKeyboardTool.gd +++ b/scripts/IPAKeyboardTool.gd @@ -1,14 +1,17 @@ extends Control -const IPA_CHARACTERS_FILE_LOCATION = "res://ipa_characters.txt" +const IPA_CHARACTERS = " +pbɓtdɗʈɖcɟʄȶȡkɡɠqɢʛʡʔmɱnɳɲȵŋɴʙⱱrɾɽʀɸβfvθðszʃʒʂʐçʝɕʑxɣχʁħʕʜʢhɦʍwɥʋɹɻjɰɬɮꞎlɫɭʎȴʟɺɧʘǀǃǂǁʦʣʧʤʨʥꭧꭦ +iyɨʉɯuɪʏʊeøɘɵɤoəɛœɜɞʌɔɐæɶaɑɒɚɝ +˩˨˧˦˥↓↑↗↘ +◌̊◌̈◌̽◌̃◌͊◌͋◌̚◌ᵊ◌͡◌◌ː◌ˑ◌̆◌ʰ◌˭◌ʼ◌ⁿ◌ˡ◌ʷ◌ʲ◌ˤ◌ˠ◌ˀ◌̥◌̬◌̤◌̰◌͓◌̨◌̹◌̜◌̮◌̼◌̪◌̺◌̻◌̟◌̠◌̩◌̯◌͜◌◌̙◌̘◌̞◌̝◌̴◌˞◌̋◌́◌̄◌̀◌̏◌᷈◌᷅◌᷄◌̂◌̌ +ˈˌ/[]∅|‖.‿⟨⟩ +" 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: + for char in IPA_CHARACTERS: # Ignore whitespace chars if char.strip_edges(true, true).is_empty(): continue diff --git a/scripts/Main.gd b/scripts/Main.gd index 8209a28..dfd4410 100644 --- a/scripts/Main.gd +++ b/scripts/Main.gd @@ -6,8 +6,16 @@ extends Control @export var translation_settings: OptionButton @export var part_of_speech_list: TextEdit -const default_parts_of_speech_filename = "res://config/default_parts_of_speech.txt" -const config_filename = "config/options.cfg" +const DEFAULT_PARTS_OF_SPEECH = "noun +adjective +adverb +verb +adposition +interjection +conjunction +pronoun +phrase" +const CONFIG_FILENAME = "config/options.cfg" var save_location = "unsaved.json" @@ -58,8 +66,7 @@ func _new_project(): $TabManager.current_tab = 1 func _reload_parts_of_speech(): - var f = FileAccess.open(default_parts_of_speech_filename, FileAccess.READ) - part_of_speech_list.text = f.get_as_text() + part_of_speech_list.text = DEFAULT_PARTS_OF_SPEECH func _reload_sound_changes(): $TabManager/SOUND_CHANGE_TOOL/Categories.text = "" @@ -104,11 +111,11 @@ func save_config_file(language: int): config.set_value("Glossorola", "language", language) - config.save(config_filename) + config.save(CONFIG_FILENAME) func load_config_file(): var config = ConfigFile.new() - var err = config.load(config_filename) + var err = config.load(CONFIG_FILENAME) # If the file didn't load, ignore. if err != OK: