Skip to content

Commit

Permalink
Fix tooltip hovering to accurately track cursor
Browse files Browse the repository at this point in the history
Fix Pixie not removing gpull from tricked creature
  • Loading branch information
serprex committed Feb 19, 2024
1 parent d22bdd6 commit 50e1b85
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions src/rs/src/skill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4520,13 +4520,15 @@ impl Skill {
.map(|(idx, id)| idx as i16)
.collect::<Vec<_>>();
if let Some(&pick) = ctx.choose(&candidates) {
let tidx = ctx.getIndex(t) as usize;
let pl = ctx.get_player_mut(town);
let pickid = pl.deck[pick as usize];
pl.deck_mut()[pick as usize] = t;
ctx.setCrea(town, tidx, pickid);
ctx.fx(pickid, Fx::StartPos(-town));
ctx.fx(t, Fx::EndPos(!town));
let tidx = ctx.remove(t);
if tidx != -1 {
let pl = ctx.get_player_mut(town);
let pickid = pl.deck[pick as usize];
pl.deck_mut()[pick as usize] = t;
ctx.setCrea(town, tidx as usize, pickid);
ctx.fx(pickid, Fx::StartPos(-town));
ctx.fx(t, Fx::EndPos(!town));
}
}
}
Self::tutordraw => {
Expand Down
2 changes: 1 addition & 1 deletion src/views/ArenaTop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function ArenaTop({ lv }) {
<span
class="atoptext"
onMouseMove={e =>
setCard({ card, x: e.pageX + 4, y: e.pageY + 4 })
setCard({ card, x: e.clientX + 4, y: e.clientY + 4 })
}
onMouseLeave={[setCard, null]}>
{card.name}
Expand Down
2 changes: 1 addition & 1 deletion src/views/Match.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1410,7 +1410,7 @@ export default function Match(props) {
game().actinfo(targeting().src, id);
setTooltip({
text: `${game().thingText(id)}${actinfo ? '\n' + actinfo : ''}`,
style: `position:absolute;left:${e.pageX}px;top:${e.pageY}px;z-index:5`,
style: `position:fixed;left:${e.clientX}px;top:${e.clientY}px;z-index:5`,
});
if (game().get_kind(id) !== Kind.Player) setCard(e, game().getCard(id));
};
Expand Down

0 comments on commit 50e1b85

Please sign in to comment.