function createMoveElement(selectedMove) {
    let moveButton = document.createElement("BUTTON");
    moveButton.style.top = y + "px";
    moveButton.style.left = x + "px";
    moveButton.className = "moves";
    moveButton.onclick = function () {
        createCharTargets(selectedMove);
        createMonsterTargets(selectedMove);
    };
    document.body.appendChild(moveButton);
    let tooltip = document.createElement("SPAN");
    tooltip.className = "tooltips";
    let searchedMove = findMove(selectedMove);
    checkMoveType(searchedMove, tooltip), checkElementType(searchedMove, tooltip);
    tooltip.innerHTML = `<b>Name:</b> ${searchedMove.name} <br>
    <b>Pow:</b> ${searchedMove.pow} <br>
    <b>Acc:</b> ${searchedMove.acc} <br>
    <b>MP:</b> ${searchedMove.mp} <br><br>
    <b>Description:</b> ${searchedMove.desc} <br><br>
    <b>Type:</b> ${searchedMove.type}`;
    moveButton.appendChild(tooltip);

    x += 60;
    movesShown++;

    if ((movesShown) % 5 === 0) {
        x = 100;
        y += 60;
    }
}
/**
 * Creates a button and tooltip for the chosen move.
 * @param {Move} selectedMove the chosen move.
 */
Creates a button and tooltip for the chosen move.
@param {Move} selectedMove the chosen move.
Creates a button and tooltip for the chosen move . @param { Move } selectedMove the chosen move .
function createMoveElement(selectedMove) {
    let moveButton = document.createElement("BUTTON");
    moveButton.style.top = y + "px";
    moveButton.style.left = x + "px";
    moveButton.className = "moves";
    moveButton.onclick = function () {
        createCharTargets(selectedMove);
        createMonsterTargets(selectedMove);
    };
    document.body.appendChild(moveButton);
    let tooltip = document.createElement("SPAN");
    tooltip.className = "tooltips";
    let searchedMove = findMove(selectedMove);
    checkMoveType(searchedMove, tooltip), checkElementType(searchedMove, tooltip);
    tooltip.innerHTML = `<b>Name:</b> ${searchedMove.name} <br>
    <b>Pow:</b> ${searchedMove.pow} <br>
    <b>Acc:</b> ${searchedMove.acc} <br>
    <b>MP:</b> ${searchedMove.mp} <br><br>
    <b>Description:</b> ${searchedMove.desc} <br><br>
    <b>Type:</b> ${searchedMove.type}`;
    moveButton.appendChild(tooltip);
    x += 60;
    movesShown++;
    if ((movesShown) % 5 === 0) {
        x = 100;
        y += 60;
    }
}
function createMoveElement ( selectedMove ) { let moveButton = document . createElement ( "BUTTON" ) ; moveButton . style . top = y + "px" ; moveButton . style . left = x + "px" ; moveButton . className = "moves" ; moveButton . onclick = function ( ) { createCharTargets ( selectedMove ) ; createMonsterTargets ( selectedMove ) ; } ; document . body . appendChild ( moveButton ) ; let tooltip = document . createElement ( "SPAN" ) ; tooltip . className = "tooltips" ; let searchedMove = findMove ( selectedMove ) ; checkMoveType ( searchedMove , tooltip ) , checkElementType ( searchedMove , tooltip ) ; tooltip . innerHTML = ` ${ searchedMove . name } ${ searchedMove . pow } ${ searchedMove . acc } ${ searchedMove . mp } ${ searchedMove . desc } ${ searchedMove . type } ` ; moveButton . appendChild ( tooltip ) ; x += 60 ; movesShown ++ ; if ( ( movesShown ) % 5 === 0 ) { x = 100 ; y += 60 ; } }
Creates a button and tooltip for the chosen move.
Creates a button and tooltip for the chosen move .