mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-08-23 11:31:09 -05:00
Fix multi battles not working on mobile
This commit is contained in:
@@ -640,7 +640,7 @@
|
||||
if (move.id === 'Recharge') move.type = '–';
|
||||
if (name.substr(0, 12) === 'Hidden Power') name = 'Hidden Power';
|
||||
var moveType = this.tooltips.getMoveType(move, typeValueTracker)[0];
|
||||
var tooltipArgs = 'move|' + moveData.move + '|' + activePos;
|
||||
var tooltipArgs = 'move|' + moveData.move + '|' + pos;
|
||||
if (moveData.disabled) {
|
||||
movebuttons += '<button disabled="disabled" class="has-tooltip" data-tooltip="' + BattleLog.escapeHTML(tooltipArgs) + '">';
|
||||
} else {
|
||||
|
||||
@@ -199,10 +199,12 @@ class BattleTooltips {
|
||||
$elem.on('touchstart', '.has-tooltip', e => {
|
||||
e.preventDefault();
|
||||
this.holdLockTooltipEvent(e);
|
||||
if (e.currentTarget === BattleTooltips.parentElem && BattleTooltips.parentElem!.tagName === 'BUTTON') {
|
||||
$(BattleTooltips.parentElem!).addClass('pressed');
|
||||
BattleTooltips.isPressed = true;
|
||||
if (!BattleTooltips.parentElem) {
|
||||
// should never happen, but in case there's a bug in the tooltip handler
|
||||
BattleTooltips.parentElem = e.currentTarget;
|
||||
}
|
||||
$(BattleTooltips.parentElem!).addClass('pressed');
|
||||
BattleTooltips.isPressed = true;
|
||||
});
|
||||
$elem.on('touchend', '.has-tooltip', e => {
|
||||
e.preventDefault();
|
||||
@@ -272,7 +274,9 @@ class BattleTooltips {
|
||||
case 'maxmove': { // move|MOVE|ACTIVEPOKEMON|[GMAXMOVE]
|
||||
let move = this.battle.dex.getMove(args[1]);
|
||||
let teamIndex = parseInt(args[2], 10);
|
||||
let pokemon = this.battle.nearSide.active[teamIndex + this.battle.pokemonControlled * Math.floor(this.battle.mySide!.n / 2)];
|
||||
let pokemon = this.battle.nearSide.active[
|
||||
teamIndex + this.battle.pokemonControlled * Math.floor(this.battle.mySide.n / 2)
|
||||
];
|
||||
let gmaxMove = args[3] ? this.battle.dex.getMove(args[3]) : undefined;
|
||||
if (!pokemon) return false;
|
||||
let serverPokemon = this.battle.myPokemon![teamIndex];
|
||||
|
||||
Reference in New Issue
Block a user