Monster eye marks the camera on the minimap; middle double click resets the view angle; creatures by beds up to 100
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0b2d327791
commit
ac22351cdf
22 files changed
+147
-5
No files matched your search
+12
-1
@@ -96,6 +96,7 @@ struct Input {
|
||||
rlast: (f32, f32),
|
||||
rdrag: bool,
|
||||
mlast: Option<(f32, f32)>, // middle button drag
|
||||
mclick: f64, // time of the last middle click (a double click resets the view)
|
||||
minimap_drag: bool,
|
||||
// touch
|
||||
tlast: Option<Vec2>, // last position of a one-finger pan (device pixels)
|
||||
@@ -902,7 +903,7 @@ async fn main() {
|
||||
let mut app = App { game, cam, settings, seed, status: None, recorded: false, client: MatchClient::new(), ws_id: 0, match_mode: false, coop: false, coop_editor: false, coop_run: None, offline: false, tutorial: false, fps: 0.0, renderer: platform::renderer(), frame_ms: 0.0, frame_hist: [0.0; FRAME_HIST], frame_hist_pos: 0, custom_campaign: None, custom_progress: None, custom_mission_index: None, custom_next_index: None, editor: None, editor_testing: false, editor_test_only: false, editor_public_pending: false, editor_loading: None, pending_briefing: None };
|
||||
menu.progress = platform::storage_get(PROGRESS_KEY).and_then(|s| serde_json::from_str(&s).ok()).unwrap_or_default();
|
||||
apply_game_settings(&mut app.game, &app.settings);
|
||||
let mut inp = Input { ldown: None, rdown: None, rlast: (0.0, 0.0), rdrag: false, mlast: None, minimap_drag: false, tlast: None, touch_world: false, inspect: None };
|
||||
let mut inp = Input { ldown: None, rdown: None, rlast: (0.0, 0.0), rdrag: false, mlast: None, mclick: -1.0, minimap_drag: false, tlast: None, touch_world: false, inspect: None };
|
||||
let mut touch = TouchInput::new();
|
||||
let mut auto_touch = platform::coarse_pointer();
|
||||
let mut menu_swipe: Option<(f32, f32)> = None; // a swipe over a menu: last finger y, unused distance
|
||||
@@ -1329,6 +1330,16 @@ async fn main() {
|
||||
if is_key_down(key(Action::TiltDown)) {
|
||||
cam.pitch -= rot * 0.6;
|
||||
}
|
||||
// a double click with the middle button: the standard angle and turn (same place)
|
||||
if is_mouse_button_pressed(MouseButton::Middle) && !touch_mode {
|
||||
let now = get_time();
|
||||
if now - inp.mclick < 0.35 {
|
||||
cam.reset_view();
|
||||
inp.mclick = -1.0;
|
||||
} else {
|
||||
inp.mclick = now;
|
||||
}
|
||||
}
|
||||
if is_mouse_button_down(MouseButton::Middle) && !touch_mode {
|
||||
if let Some((lx, ly)) = inp.mlast {
|
||||
let inv = if keys.invert_mouse { -1.0 } else { 1.0 };
|
||||
|
||||
Reference in new issue
Block a user