While it didn't hurt much to autocomplete the string [color=\"orange\"]Random[/color], it is annoying not to be able to autocomplete observer names in the gamesetup.
By adding a new property "colors" to g_Dropdowns and g_PlayerDropdowns, we can separate the label string and it's color cleanly, thereby fix the bug and remove some color tag duplication as well.
Details
Open a multiplayer gamesetup, unassign yourself, try to autocompelte your playername in the chat. Will work with the patch but not without.
Press F9 and type warn(uneval(g_Autocomplete)) and see color tagged strings in there without the patch but not if applied.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Build is green
Updating workspaces. Build (release)... Build (debug)... Running release tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK! Running debug tests... Running cxxtest tests (306 tests)..................................................................................................................................................................................................................................................................................................................OK!
http://jw:8080/job/phabricator/1038/ for more details.
Looks good. Works.
binaries/data/mods/public/gui/gamesetup/gamesetup.js | ||
---|---|---|
562 ↗ | (On Diff #1694) | Is that || [] really needed? |
binaries/data/mods/public/gui/gamesetup/gamesetup.js | ||
---|---|---|
1282 ↗ | (On Diff #1694) | Why not using unshift? |
Thanks for the review!
binaries/data/mods/public/gui/gamesetup/gamesetup.js | ||
---|---|---|
562 ↗ | (On Diff #1694) | Since the g_PlayerAssignmentList is empty until the local client join was finished, it will complain about missing Name property until then |
1282 ↗ | (On Diff #1694) | Oh yes, that's nicer. Never really had the pleasure of taking advantage of this statement. |
Now we can't type mapnames and playernames anymore to select the according dropdown item because of the explicit color.
But we couldn't type observernames before, so doing the right fix seems better: D462