updated context menu function

This commit is contained in:
Chr1Z93 2024-06-02 19:34:35 +02:00
parent 49dcb9625f
commit b2f7f152d3

View File

@ -180,8 +180,8 @@ function updateDisplay()
end
function addContextMenu()
self.addContextMenuItem("Change class", function(playerColor)
Player[playerColor].showOptionsDialog("Choose class", listOfClasses, class, updateClass)
self.addContextMenuItem("Change color", function(playerColor)
Player[playerColor].showOptionsDialog("Choose color", listOfClasses, class, updateClass)
end)
-- get display symbol from potential list
@ -194,15 +194,16 @@ function addContextMenu()
Player[playerColor].showOptionsDialog("Choose symbol", listOfSymbols, symbols[1], updateSymbol)
end)
self.addContextMenuItem("Add 2nd symbol", function(playerColor)
if string.contains(symbol, "/") then
broadcastToColor("Two symbols is the maximum!", playerColor, "Orange")
else
Player[playerColor].showOptionsDialog("Choose 2nd symbol", listOfSymbols, symbol, function(additionalSymbol)
symbol = symbol .. "/" .. additionalSymbol
updateDisplay()
end)
end
self.addContextMenuItem("Change 2nd symbol", function(playerColor)
Player[playerColor].showOptionsDialog("Choose 2nd symbol", listOfSymbols, symbols[1], function(additionalSymbol)
symbol = symbols[1] .. "/" .. additionalSymbol
updateDisplay()
end)
end)
self.addContextMenuItem("Remove 2nd symbol", function()
symbol = symbols[1]
updateDisplay()
end)
end