Prettify the menu arrows in WxW
authorWuzzy <Wuzzy2@mail.ru>
Fri, 26 Oct 2018 15:46:53 +0200
changeset 13982 681a53c8b18c
parent 13981 8e479dabdd88
child 13983 cde9920150c6
Prettify the menu arrows in WxW
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()