Ticket #2723: gamesetup.js_NoSpam.patch
File gamesetup.js_NoSpam.patch, 1.3 KB (added by , 10 years ago) |
---|
-
binaries/data/mods/public/gui/gamesetup/gamesetup.js
1641 1641 Engine.GetGUIObjectByName("moreOptions").hidden = !Engine.GetGUIObjectByName("moreOptions").hidden; 1642 1642 } 1643 1643 1644 1645 var lastToggleReady = new Date(0); // Start at Unix Epoch to enable the first click. 1646 var spamMsgShown = false; 1644 1647 function toggleReady() 1645 1648 { 1649 var now = new Date; 1650 var tickLength = now - lastToggleReady; 1651 1652 // Allow ready status once every five seconds but allow immediate revocation of the ready status. 1653 if (tickLength < 5000 && !g_IsReady) 1654 { 1655 if(!spamMsgShown) 1656 { 1657 g_ChatMessages.push(translate(" * Please do not spam the other players.")); 1658 Engine.GetGUIObjectByName("chatText").caption = g_ChatMessages.join("\n"); 1659 } 1660 spamMsgShown = true; 1661 return; 1662 } 1663 1646 1664 g_IsReady = !g_IsReady; 1647 1665 if (g_IsReady) 1648 1666 { … … 1656 1674 Engine.GetGUIObjectByName("startGame").caption = translate("I'm ready!"); 1657 1675 Engine.GetGUIObjectByName("startGame").tooltip = translate("State that you are ready to play!"); 1658 1676 } 1677 1678 spamMsgShown = false; // Allow showing the message again. 1679 lastToggleReady = now; // Update the timer. 1659 1680 } 1660 1681 1661 1682 function updateReadyUI()