Widget:A2debugger: Unterschied zwischen den Versionen

aus Kamelopedia, der wüsten Enzyklopädie
Zur Navigation springen Zur Suche springen
Zeile 24: Zeile 24:
  
 
  $("#a2dbgGotoBtn").click( function(){
 
  $("#a2dbgGotoBtn").click( function(){
 +
  a2.clearEventChain();
 
   a2.loadPage(parseInt($("#a2dbgGoto").val()));
 
   a2.loadPage(parseInt($("#a2dbgGoto").val()));
 
  });
 
  });

Version vom 30. April 2013, 20:42 Uhr

<form>
  <select id="a2dbgSwitch">
    <option value="a2dbgState">Spielstand</option>
    <option value="a2dbgEventLog">Event-Log</option>
  </select>
      <input type="text" id="a2dbgGoto" maxlength="3" style="width: 4em;"/><input type="button" value="Los!" id="a2dbgGotoBtn">
<textarea id="a2dbgItems" style="width:80%; height: 200px;"></textarea><input type="button" value="Setze!" id="a2dbgItemBtn">
</form>

<script type="text/javascript">
$("#a2dbgSwitch").click(function(){
  $(".a2dbgWindow").hide();
  $("#"+$(this).val()).show();
  $("#a2dbgBottom:visible").scrollTop($("#a2dbgBottom")[0].scrollHeight);
});

$("#a2dbgSwitch").click();
$("#a2dbgGotoBtn").click( function(){
  a2.clearEventChain();
  a2.loadPage(parseInt($("#a2dbgGoto").val()));
});
$("#a2dbgItemBtn").click( function(){
  var d = "";
  var items = $("#a2dbgItems").val().split(/[\s\r\n]+/);
  for (var i=0; i<items.length; i++)
    if (!items[i].match(/^[\s\r\n]*$/))
      d += "|" + items[i]
  a2.stateDecode(a2.cpage+d);
});
</script>