Pixel-art mouse pointers and hand actions
- pointing monster hand with the active tool's icon, grabbing hand / fist, animated backhand and punch - active tool highlighted in the toolbar (pulsing frame, arrow) - hand: pick up unconscious heroes on own ground, drop prisoners anywhere on own ground (onto a free torture place = locked up), Shift+click backhand (speed-up) / punch (stun) - fix: hint slots overflowed with the new hints; hint times are no longer saved - test for the hand rules Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
50d013bb28
commit
f113e1085c
9 files changed
+372
-32
No files matched your search
+11
-2
@@ -209,6 +209,7 @@ impl App {
|
||||
#[macroquad::main(conf)]
|
||||
async fn main() {
|
||||
let gfx = Gfx::new();
|
||||
show_mouse(false); // the game draws its own pixel-art pointer
|
||||
let mut r3d = R3d::new();
|
||||
let mut sounds = SoundBank::new();
|
||||
let mut music = MusicDirector::new();
|
||||
@@ -506,8 +507,15 @@ async fn main() {
|
||||
match (ui.tool, hover_tile) {
|
||||
(Tool::Dig | Tool::Room(_) | Tool::Sell, Some(t)) => inp.ldown = Some(t),
|
||||
(Tool::Hand, _) => {
|
||||
let j = r3d.pick_ent(&app.game, &app.cam, mx, my, true);
|
||||
app.game.pickup(j);
|
||||
let j = r3d.pick_ent(&app.game, &app.cam, mx, my, false);
|
||||
if is_key_down(KeyCode::LeftShift) || is_key_down(KeyCode::RightShift) {
|
||||
let kind = app.game.slap(j);
|
||||
if kind > 0 {
|
||||
ui.hand_anim = Some((kind, now));
|
||||
}
|
||||
} else {
|
||||
app.game.pickup(j);
|
||||
}
|
||||
}
|
||||
(Tool::Flag, Some((x, z))) => app.game.set_flag(x, z),
|
||||
(Tool::Lightning, _) => app.game.lightning(wx, wy),
|
||||
@@ -640,4 +648,5 @@ fn draw_frame(app: &mut App, gfx: &Gfx, r3d: &mut R3d, ui: &mut Ui, menu: &mut M
|
||||
if !menu.open() || ui.show_help || ui.show_langsel {
|
||||
ui.draw_dialogs(&app.game, gfx);
|
||||
}
|
||||
ui.draw_cursor(gfx, &app.game, now, blocked);
|
||||
}
|
||||
Reference in new issue
Block a user