src/scripts/combat.js
//creates buttons for skills of current actor
creates buttons for skills of current actor
creates buttons for skills of current actor
printSkillList() {
  var s = window.story.state;
  var canAct = s.combat.actor._canAct();
  if(canAct.OK===true) {
    var skillIds = s.combat.actor.Skills.getAllIds();
    for(var i=0; i<skillIds.length;i++) {
      var entry = document.createElement('button');
      var res;
      entry.addEventListener("click",(function(me,target){ 
        return(window.gm.Encounter._postSkillSelect.bind(me,target));}(this,skillIds[i])));
      entry.textContent=s.combat.actor.Skills.getItem(skillIds[i]).name;
      res = s.combat.actor.Skills.getItem(skillIds[i]).isEnabled();
      entry.disabled=!res.OK; entry.title=res.msg;  
      $("div#choice")[0].appendChild(entry);      
    }
  } else {  
    var entry = document.createElement('p');
    entry.textContent=canAct.msg;
    $("div#choice")[0].appendChild(entry);
  }
  var entry = document.createElement('button');
  entry.addEventListener('click',(function(me){return(window.gm.Encounter._postSkillAbort.bind(me));}(this)));
  entry.textContent="Do nothing";
  $("div#choice")[0].appendChild(entry);
}
printSkillList ( ) { var s = window . story . state ; var canAct = s . combat . actor . _canAct ( ) ; if ( canAct . OK === true ) { var skillIds = s . combat . actor . Skills . getAllIds ( ) ; for ( var i = 0 ; i < skillIds . length ; i ++ ) { var entry = document . createElement ( 'button' ) ; var res ; entry . addEventListener ( "click" , ( function ( me , target ) { return ( window . gm . Encounter . _postSkillSelect . bind ( me , target ) ) ; } ( this , skillIds [ i ] ) ) ) ; entry . textContent = s . combat . actor . Skills . getItem ( skillIds [ i ] ) . name ; res = s . combat . actor . Skills . getItem ( skillIds [ i ] ) . isEnabled ( ) ; entry . disabled = ! res . OK ; entry . title = res . msg ; $ ( "div#choice" ) [ 0 ] . appendChild ( entry ) ; } } else { var entry = document . createElement ( 'p' ) ; entry . textContent = canAct . msg ; $ ( "div#choice" ) [ 0 ] . appendChild ( entry ) ; } var entry = document . createElement ( 'button' ) ; entry . addEventListener ( 'click' , ( function ( me ) { return ( window . gm . Encounter . _postSkillAbort . bind ( me ) ) ; } ( this ) ) ) ; entry . textContent = "Do nothing" ; $ ( "div#choice" ) [ 0 ] . appendChild ( entry ) ; }
creates buttons for skills of current actor
creates buttons for skills of current actor
//todo how to sort the list in a useful manner? //entry.href='javascript:void(0)'; //Todo use pointevent+toasty? // <- requires this node in html //cannot do a thing //entry.href='javascript:void(0)';