Advertisement
ProzacR

Ancient Beast little idea

Dec 15th, 2012
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.07 KB | None | 0 0
  1. diff --git a/combat/js/hex.js b/combat/js/hex.js
  2. index 21f41c4..a9db9c8 100755
  3. --- a/combat/js/hex.js
  4. +++ b/combat/js/hex.js
  5. @@ -715,8 +715,16 @@ var HexGrid = Class.create({
  6.                         fnOnClick(G.grid.hexs[y][x],args);
  7.                 });
  8.  
  9. -               //ON CANCEL
  10. -               this.$allInptHex.filter(".hex.not-reachable").bind('click', function(){ G.grid.lastClickedtHex = []; fnOnCancel(args); });
  11. +               //ON CANCEL if creature clicked post it in log
  12. +               this.$allInptHex.filter(".hex.not-reachable").bind('click', function(){ G.grid.lastClickedtHex = []; fnOnCancel(args);
  13. +                      var x = $j(this).attr("x")-0;
  14. +                     var y = $j(this).attr("y")-0;
  15. +                      for (var i = 1; i <= G.creatures.length; i++) {
  16. +                          if (G.creatures[i].pos.x == x && G.creatures[i].pos.y == y) {
  17. +                              G.log("Clicked: " + G.creatures[i].name + " " + G.creatures[i].type);
  18. +                          }
  19. +                      }
  20. +                 });
  21.         },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement