# HG changeset patch # User Wuzzy # Date 1540561613 -7200 # Node ID 681a53c8b18c8b9f91c4c77cf1f1ee5550f3acd4 # Parent 8e479dabdd88271ce21f3a8394b042a936130e4b Prettify the menu arrows in WxW diff -r 8e479dabdd88 -r 681a53c8b18c share/hedgewars/Data/Scripts/Multiplayer/WxW.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua Fri Oct 26 15:04:07 2018 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/WxW.lua Fri Oct 26 15:46:53 2018 +0200 @@ -1535,12 +1535,22 @@ function HandleStartingStage() - temp = menu[menuIndex].line - menu[menuIndex].line = "--> " .. menu[menuIndex].line + local renderedLines = {} + for m = 1, #menu do + local marker + local line = menu[m].line + if m == menuIndex then + marker = "▶" + else + marker = "▷" + line = string.gsub(line, ":", "\\:") + end + table.insert(renderedLines, marker .. " " .. line) + end missionComment = "" - for i = 1, #menu do - missionComment = missionComment .. menu[i].line + for l = 1, #renderedLines do + missionComment = missionComment .. renderedLines[l] end ShowMission ( @@ -1552,8 +1562,6 @@ "", 2, 9999000, true ) - menu[menuIndex].line = temp - end function onGameTick()