From 23a130033f455c9aebfa0c7b1ce0f55de947e6d9 Mon Sep 17 00:00:00 2001 From: rylon Date: Wed, 12 Nov 2014 18:09:36 +0100 Subject: [PATCH] fixes for arrows --- mojotrollz/api/char/js/skilltree.js | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/mojotrollz/api/char/js/skilltree.js b/mojotrollz/api/char/js/skilltree.js index 75852da..c6e651f 100644 --- a/mojotrollz/api/char/js/skilltree.js +++ b/mojotrollz/api/char/js/skilltree.js @@ -93,14 +93,17 @@ function is_icon_skillable(id){ } function is_icon_deskillable(id){ - tree = parseInt($(id).attr('t')); - row = parseInt($(id).attr('r')); - count = 0; + var tree = parseInt($(id).attr('t')); + var row = parseInt($(id).attr('r')); + var count = 0; + var count_row = 0; $('#tree'+tree+' .icon').each(function(){ + if($(this).attr('r') == row){ + count_row += parseInt($('#'+this.id+'c').attr('cur'));} if($(this).attr('r') > row){ count += parseInt($('#'+this.id+'c').attr('cur'));} }); - if(count > 0){ + if(count > 0 && count_row <= 5){ return false;} return true; } @@ -201,9 +204,10 @@ function write_icon_green(id,id_count,id_img){ $(id_img).removeClass('icon_border_yellow_down'); $(id_img).addClass('icon_border_green_down'); var tree = parseInt($(id).attr('t')); - var row = parseInt($(id).attr('r'))+1; + var row = parseInt($(id).attr('r')); var column = parseInt($(id).attr('c')); - write_arrow_grey('#t'+tree+'r'+row+'c'+column+'i'); + write_arrow_grey('#t'+tree+'r'+(row+1)+'c'+column+'i'); + write_arrow_grey('#t'+tree+'r'+(row+2)+'c'+column+'i'); } if( $(id_img).hasClass('icon_border_grey_down_right') || @@ -316,9 +320,10 @@ function write_icon_yellow(id,id_count,id_img){ $(id_img).removeClass('icon_border_green_down'); $(id_img).addClass('icon_border_yellow_down'); var tree = parseInt($(id).attr('t')); - var row = parseInt($(id).attr('r'))+1; + var row = parseInt($(id).attr('r')); var column = parseInt($(id).attr('c')); - write_arrow_yellow('#t'+tree+'r'+row+'c'+column+'i'); + write_arrow_yellow('#t'+tree+'r'+(row+1)+'c'+column+'i'); + write_arrow_yellow('#t'+tree+'r'+(row+2)+'c'+column+'i'); } if( $(id_img).hasClass('icon_border_grey_down_right') || @@ -391,9 +396,10 @@ function write_icon_grey(id,id_count,id_img){ $(id_img).removeClass('icon_border_green_down'); $(id_img).addClass('icon_border_grey_down'); var tree = parseInt($(id).attr('t')); - var row = parseInt($(id).attr('r'))+1; + var row = parseInt($(id).attr('r')); var column = parseInt($(id).attr('c')); - write_arrow_grey('#t'+tree+'r'+row+'c'+column+'i'); + write_arrow_grey('#t'+tree+'r'+(row+1)+'c'+column+'i'); + write_arrow_grey('#t'+tree+'r'+(row+2)+'c'+column+'i'); } if( $(id_img).hasClass('icon_border_yellow_down_right') ||