Update MicRecord.gd
This commit is contained in:
parent
4e425f3c2a
commit
8e8da25b77
1 changed files with 7 additions and 6 deletions
13
MicRecord.gd
13
MicRecord.gd
|
@ -56,8 +56,8 @@ var words :Array= []
|
|||
func _on_add_word_btn_pressed() -> void:
|
||||
if (%SoundName.text=="" or words.has(%SoundName.text)):
|
||||
return
|
||||
%WordList.add_item(%SoundName.text)
|
||||
words.append(%SoundName.text)
|
||||
%WordList.add_item(%SoundName.text.to_lower())
|
||||
words.append(%SoundName.text.to_lower())
|
||||
%SoundName.text=""
|
||||
save_words()
|
||||
|
||||
|
@ -165,12 +165,13 @@ func _on_load_text_btn_pressed() -> void:
|
|||
|
||||
func _on_add_words_btn_pressed() -> void:
|
||||
var txt :String= %TextWordsEdit.text
|
||||
txt=txt.replace("\n"," ").replace("\t"," ")
|
||||
txt=txt.replace("\n"," ").replace("\t"," ").replace(",","").replace(",","")
|
||||
var wrds = txt.split(" ",false)
|
||||
for wrd in wrds:
|
||||
if !words.has(wrd):
|
||||
%WordList.add_item(wrd)
|
||||
words.append(wrd)
|
||||
if !words.has(wrd.to_lower()):
|
||||
%WordList.add_item(wrd.to_lower())
|
||||
words.append(wrd.to_lower())
|
||||
save_words()
|
||||
|
||||
var play = false
|
||||
func _on_play_text_btn_pressed() -> void:
|
||||
|
|
Loading…
Reference in a new issue