alkemann wrote:I downloaded this script based on a reply to a support ticket i posted about the need for an undo button on army placement, as I experienced some unfortunate mishaps that i believe was part me and part system fault. Anyways the reply said I should install this script, but it doesnt do what I need it most to. To show a confirmation dialog when I place armies, telling me what country I am placing on and how many. If it could show on the actual map as well, that would rock.
anyways, if this is possible, it would appreciate it
alek
I believe the following code will do for the Deploy button what the confirmation script already does for End Fortification, End Attacks, and Auto-Attack. That it, it will make you confirm the action whenever you press any of these buttons.
This would not be an "undo" button however, just a confirmation dialog (OK or Cancel) when you press the Deploy button. It would effectively tell you how many armies you were placing on a particular country (that's basically what it does now, isn't it?), but it would not show it on the actual map. It would appear on the map when you clicked OK in the confirmation dialog. If you really want an "undo" button, this fix isn't it. But if you want something that will allow you to reject a bad button press when deploying this will do the trick. I've tried it and it works.
- Code: Select all
(function() {
var inputs = document.getElementsByTagName("input");
for(var a = 0; a < inputs.length; a++) {
if (inputs[a].value == "End Attacks")
{
inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
}
if (inputs[a].value == "End Fortification")
{
inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
}
if (inputs[a].value == "Auto-Attack")
{
inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
}
if (inputs[a].value == "Deploy")
{
inputs[a].setAttribute("onclick", "javascript:return confirm('Are you sure?');" );
}
}
})();
How to edit the confirmation script:
Right-click the red greasemonkey icon, and then right-click CC Phase End Confirm script.
Either this will open an editor or it will prompt you to pick an editor to use.
If it opens an editor, fine use that editor.
If it wants you to pick an editor to use, Notepad that comes with Windows works fine.
In the editor replace the entire contents with the code except from above.
When you're done save the file in the editor.
That's all there is to it.
Good luck.