Fixed window titles not being detected

This commit is contained in:
Marc Gilleron 2020-06-14 20:30:05 +01:00
parent 3cdfde5f28
commit dc763e93df

View File

@ -96,7 +96,11 @@ func _index_file(fpath: String):
func _process_tscn(f: File, fpath: String):
# TOOD Also search for "window_title" and "dialog_text"
var pattern := "text ="
var patterns := [
"text =",
"window_title =",
"dialog_text ="
]
var text := ""
var state := STATE_SEARCHING
var line_number := 0
@ -110,9 +114,17 @@ func _process_tscn(f: File, fpath: String):
match state:
STATE_SEARCHING:
var i := line.find(pattern)
var pattern : String
var i : int
for p in patterns:
i = line.find(p)
if i != -1:
pattern = p
break
if i == -1:
continue
var begin_quote_index := line.find('"', i + len(pattern))
if begin_quote_index == -1:
_logger.error(