Skip to content

Commit e1ce96f

Browse files
authored
Merge pull request #2130 from thatgato/username-autocomplete-fix
Fix username autocompletion in custom themes #2067
1 parent 20820c2 commit e1ce96f

5 files changed

Lines changed: 45 additions & 5 deletions

File tree

MainModule/Client/UI/Aero/Console.rbxmx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,15 @@ return function(data, env)
856856
if c == 'Text' and text.Text ~= '' and open then
857857
if string.sub(text.Text, string.len(text.Text)) == " " then
858858
if players:FindFirstChild("Entry 0") then
859-
text.Text = `{string.sub(text.Text, 1, (string.len(text.Text) - 1))}{players["Entry 0"].Text} `
859+
local args = string.split(text.Text, splitKey)
860+
args[#args] = nil
861+
local textWithoutLastArg = table.concat(args, splitKey)
862+
863+
if textWithoutLastArg ~= "" then
864+
textWithoutLastArg ..= splitKey
865+
end
866+
867+
text.Text = textWithoutLastArg .. players["Entry 0"].Text .. " "
860868
elseif scroll:FindFirstChild("Entry 0") then
861869
text.Text = string.split(scroll["Entry 0"].Text, "<")[1]
862870
else

MainModule/Client/UI/Rounded/Console.rbxmx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,15 @@ return function(data, env)
658658
if c == 'Text' and text.Text ~= '' and open then
659659
if string.sub(text.Text, string.len(text.Text)) == " " then
660660
if players:FindFirstChild("Entry 0") then
661-
text.Text = `{string.sub(text.Text, 1, (string.len(text.Text) - 1))}{players["Entry 0"].Text} `
661+
local args = string.split(text.Text, splitKey)
662+
args[#args] = nil
663+
local textWithoutLastArg = table.concat(args, splitKey)
664+
665+
if textWithoutLastArg ~= "" then
666+
textWithoutLastArg ..= splitKey
667+
end
668+
669+
text.Text = textWithoutLastArg .. players["Entry 0"].Text .. " "
662670
elseif scroll:FindFirstChild("Entry 0") then
663671
text.Text = string.split(scroll["Entry 0"].Text, "<")[1]
664672
else

MainModule/Client/UI/Steampunk/Console.rbxmx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,15 @@ return function(data, env)
251251
if text.Text ~= "" and openConsole then
252252
if string.sub(text.Text, string.len(text.Text)) == " " then
253253
if players:FindFirstChild("Entry 0") then
254-
text.Text = `{string.sub(text.Text, 1, (string.len(text.Text) - 1))}{players["Entry 0"].Text} `
254+
local args = string.split(text.Text, splitKey)
255+
args[#args] = nil
256+
local textWithoutLastArg = table.concat(args, splitKey)
257+
258+
if textWithoutLastArg ~= "" then
259+
textWithoutLastArg ..= splitKey
260+
end
261+
262+
text.Text = textWithoutLastArg .. players["Entry 0"].Text .. " "
255263
elseif scroll:FindFirstChild("Entry 0") then
256264
text.Text = string.split(scroll["Entry 0"].Text, "<")[1]
257265
else

MainModule/Client/UI/Unity/Console.rbxmx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,15 @@ return function(data, env)
712712
if c == 'Text' and text.Text ~= '' and open then
713713
if string.sub(text.Text, string.len(text.Text)) == " " then
714714
if players:FindFirstChild("Entry 0") then
715-
text.Text = `{string.sub(text.Text, 1, (string.len(text.Text) - 1))}{players["Entry 0"].Text} `
715+
local args = string.split(text.Text, splitKey)
716+
args[#args] = nil
717+
local textWithoutLastArg = table.concat(args, splitKey)
718+
719+
if textWithoutLastArg ~= "" then
720+
textWithoutLastArg ..= splitKey
721+
end
722+
723+
text.Text = textWithoutLastArg .. players["Entry 0"].Text .. " "
716724
elseif scroll:FindFirstChild("Entry 0") then
717725
text.Text = string.split(scroll["Entry 0"].Text, "<")[1]
718726
else

MainModule/Client/UI/Windows XP/Console.rbxmx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,15 @@ return function(data, env)
630630
if c == 'Text' and text.Text ~= '' and open then
631631
if string.sub(text.Text, string.len(text.Text)) == " " then
632632
if players:FindFirstChild("Entry 0") then
633-
text.Text = `{string.sub(text.Text, 1, (string.len(text.Text) - 1))}{players["Entry 0"].Text} `
633+
local args = string.split(text.Text, splitKey)
634+
args[#args] = nil
635+
local textWithoutLastArg = table.concat(args, splitKey)
636+
637+
if textWithoutLastArg ~= "" then
638+
textWithoutLastArg ..= splitKey
639+
end
640+
641+
text.Text = textWithoutLastArg .. players["Entry 0"].Text .. " "
634642
elseif scroll:FindFirstChild("Entry 0") then
635643
text.Text = string.split(scroll["Entry 0"].Text, "<")[1]
636644
else

0 commit comments

Comments
 (0)