mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
[MIRROR] tgui input list improvements (#6405)
* tgui input list improvements (#59668) pressing enter or space now selects the selected button duplicate keys no longer cause input lists to break * tgui input list improvements Co-authored-by: LatteKat <56778689+jupyterkat@users.noreply.github.com>
This commit is contained in:
@@ -82,6 +82,7 @@
|
||||
src.message = message
|
||||
src.buttons = list()
|
||||
src.buttons_map = list()
|
||||
var/list/repeat_buttons = list()
|
||||
|
||||
// Gets rid of illegal characters
|
||||
var/static/regex/whitelistedWords = regex(@{"([^\u0020-\u8000]+)"})
|
||||
@@ -89,6 +90,9 @@
|
||||
for(var/i in buttons)
|
||||
var/string_key = whitelistedWords.Replace("[i]", "")
|
||||
|
||||
//avoids duplicated keys E.g: when areas have the same name
|
||||
string_key = avoid_assoc_duplicate_keys(string_key, repeat_buttons)
|
||||
|
||||
src.buttons += string_key
|
||||
src.buttons_map[string_key] = i
|
||||
|
||||
|
||||
Reference in New Issue
Block a user