|
@@ -1,10 +1,9 @@
|
1
|
1
|
use std::cmp;
|
2
|
2
|
use std::collections::HashMap;
|
3
|
|
-use std::f32::consts::FRAC_PI_2;
|
4
|
3
|
|
5
|
4
|
use ggez::event::MouseButton;
|
6
|
5
|
use ggez::graphics::{DrawMode, MeshBuilder, StrokeOptions};
|
7
|
|
-use ggez::input::keyboard::{pressed_keys, KeyCode};
|
|
6
|
+use ggez::input::keyboard::KeyCode;
|
8
|
7
|
use ggez::timer::check_update_time;
|
9
|
8
|
use ggez::{event, graphics, input, Context, GameResult};
|
10
|
9
|
|
|
@@ -13,8 +12,7 @@ use crate::behavior::order::Order;
|
13
|
12
|
use crate::behavior::ItemBehavior;
|
14
|
13
|
use crate::config::{
|
15
|
14
|
ANIMATE_EACH, DEFAULT_SELECTED_SQUARE_SIDE, DEFAULT_SELECTED_SQUARE_SIDE_HALF,
|
16
|
|
- DISPLAY_OFFSET_BY, DISPLAY_OFFSET_BY_SPEED, MAX_FRAME_I, META_EACH, MOVE_FAST_VELOCITY,
|
17
|
|
- MOVE_HIDE_VELOCITY, MOVE_TO_REACHED_WHEN_DISTANCE_INFERIOR_AT, MOVE_VELOCITY, PHYSICS_EACH,
|
|
15
|
+ DISPLAY_OFFSET_BY, DISPLAY_OFFSET_BY_SPEED, MAX_FRAME_I, META_EACH, PHYSICS_EACH,
|
18
|
16
|
SCENE_ITEMS_CHANGE_ERR_MSG, SPRITE_EACH, TARGET_FPS,
|
19
|
17
|
};
|
20
|
18
|
use crate::map::Map;
|
|
@@ -22,15 +20,12 @@ use crate::physics::util::scene_point_from_window_point;
|
22
|
20
|
use crate::physics::util::window_point_from_scene_point;
|
23
|
21
|
use crate::physics::GridPosition;
|
24
|
22
|
use crate::physics::{util, MetaEvent, PhysicEvent};
|
25
|
|
-use crate::scene::item::{
|
26
|
|
- apply_scene_item_modifier, ItemState, SceneItem, SceneItemModifier, SceneItemType,
|
27
|
|
-};
|
28
|
|
-use crate::ui::vertical_menu::{vertical_menu_sprite_info, VerticalMenuSpriteInfo};
|
|
23
|
+use crate::scene::item::{apply_scene_item_modifier, ItemState, SceneItem, SceneItemType};
|
|
24
|
+use crate::ui::vertical_menu::vertical_menu_sprite_info;
|
29
|
25
|
use crate::ui::MenuItem;
|
30
|
26
|
use crate::ui::{SceneItemPrepareOrder, UiComponent, UserEvent};
|
31
|
27
|
use crate::util::velocity_for_behavior;
|
32
|
28
|
use crate::{Offset, ScenePoint, WindowPoint};
|
33
|
|
-use std::fs::File;
|
34
|
29
|
use std::path::Path;
|
35
|
30
|
use std::time::Instant;
|
36
|
31
|
|
|
@@ -375,7 +370,7 @@ impl MainState {
|
375
|
370
|
}
|
376
|
371
|
|
377
|
372
|
fn animate(&mut self) {
|
378
|
|
- for (i, scene_item) in self.scene_items.iter_mut().enumerate() {
|
|
373
|
+ for (_, scene_item) in self.scene_items.iter_mut().enumerate() {
|
379
|
374
|
apply_scene_item_modifier(scene_item, digest_next_order(&scene_item));
|
380
|
375
|
apply_scene_item_modifier(scene_item, digest_current_order(&scene_item));
|
381
|
376
|
apply_scene_item_modifier(scene_item, digest_current_behavior(&scene_item));
|