|
@@ -174,12 +174,18 @@ impl MainState {
|
174
|
174
|
}
|
175
|
175
|
|
176
|
176
|
if let Some(scene_item_prepare_order) = &self.scene_item_prepare_order {
|
177
|
|
- // TODO: Add order to scene_item
|
178
|
177
|
match scene_item_prepare_order {
|
179
|
178
|
SceneItemPrepareOrder::Move(scene_item_usize) => {
|
180
|
179
|
let mut scene_item = self.get_scene_item_mut(*scene_item_usize);
|
181
|
180
|
scene_item.next_order = Some(Order::MoveTo(scene_click_point));
|
182
|
181
|
}
|
|
182
|
+ SceneItemPrepareOrder::MoveFast(scene_item_usize) => {
|
|
183
|
+ let mut scene_item = self.get_scene_item_mut(*scene_item_usize);
|
|
184
|
+ scene_item.next_order = Some(Order::MoveFastTo(scene_click_point));
|
|
185
|
+ }
|
|
186
|
+ SceneItemPrepareOrder::Hide(scene_item_usize) => {
|
|
187
|
+ let mut scene_item = self.get_scene_item_mut(*scene_item_usize);
|
|
188
|
+ scene_item.next_order = Some(Order::HideTo(scene_click_point));}
|
183
|
189
|
}
|
184
|
190
|
|
185
|
191
|
self.scene_item_prepare_order = None;
|
|
@@ -197,8 +203,16 @@ impl MainState {
|
197
|
203
|
Some(SceneItemPrepareOrder::Move(scene_item_usize));
|
198
|
204
|
self.scene_item_menu = None;
|
199
|
205
|
}
|
200
|
|
- MenuItem::MoveFast => {}
|
201
|
|
- MenuItem::Hide => {}
|
|
206
|
+ MenuItem::MoveFast => {
|
|
207
|
+ self.scene_item_prepare_order =
|
|
208
|
+ Some(SceneItemPrepareOrder::MoveFast(scene_item_usize));
|
|
209
|
+ self.scene_item_menu = None;
|
|
210
|
+ }
|
|
211
|
+ MenuItem::Hide => {
|
|
212
|
+ self.scene_item_prepare_order =
|
|
213
|
+ Some(SceneItemPrepareOrder::Hide(scene_item_usize));
|
|
214
|
+ self.scene_item_menu = None;
|
|
215
|
+ }
|
202
|
216
|
}
|
203
|
217
|
};
|
204
|
218
|
self.scene_item_menu = None;
|
|
@@ -241,7 +255,7 @@ impl MainState {
|
241
|
255
|
// Scene items movements
|
242
|
256
|
for scene_item in self.scene_items.iter_mut() {
|
243
|
257
|
match scene_item.state.current_behavior {
|
244
|
|
- ItemBehavior::WalkingTo(scene_point) => {
|
|
258
|
+ ItemBehavior::MoveTo(scene_point) => {
|
245
|
259
|
// FIXME BS NOW: velocity
|
246
|
260
|
let move_vector = (scene_point - scene_item.position).normalize() * 1.0;
|
247
|
261
|
// TODO ici il faut calculer le déplacement réél (en fonction des ticks, etc ...)
|