|
@@ -21,6 +21,7 @@ from synergine2_cocos2d.util import PathManager
|
21
|
21
|
from opencombat.gui.animation import ANIMATION_WALK
|
22
|
22
|
from opencombat.gui.animation import ANIMATION_CRAWL
|
23
|
23
|
from opencombat.gui.fire import GuiFiringEvent
|
|
24
|
+from opencombat.gui.placement import SetSubjectPositionsInteraction
|
24
|
25
|
from opencombat.gui.state import SaveStateInteraction
|
25
|
26
|
from opencombat.simulation.interior import InteriorManager
|
26
|
27
|
from opencombat.simulation.tmx import TileMap
|
|
@@ -74,6 +75,20 @@ class EditLayer(BaseEditLayer):
|
74
|
75
|
)
|
75
|
76
|
interaction.execute()
|
76
|
77
|
|
|
78
|
+ def can_move(self, selected) -> bool:
|
|
79
|
+ return self.config.resolve('_runtime.placement_mode', False)
|
|
80
|
+
|
|
81
|
+ def end_drag_move(self, wx, wy):
|
|
82
|
+ # set position
|
|
83
|
+ super().end_drag_move(wx, wy)
|
|
84
|
+
|
|
85
|
+ interaction = self.layer_manager \
|
|
86
|
+ .interaction_manager \
|
|
87
|
+ .get_for_user_action(
|
|
88
|
+ UserAction.SET_SUBJECTS_POSITION,
|
|
89
|
+ )
|
|
90
|
+ interaction.execute()
|
|
91
|
+
|
77
|
92
|
|
78
|
93
|
class BackgroundLayer(cocos.layer.Layer):
|
79
|
94
|
def __init__(
|
|
@@ -280,14 +295,30 @@ class Game(TMXGui):
|
280
|
295
|
from opencombat.gui.move import MoveCrawlActorInteraction
|
281
|
296
|
from opencombat.gui.fire import FireActorInteraction
|
282
|
297
|
|
283
|
|
- self.layer_manager.interaction_manager.register(MoveActorInteraction, self.layer_manager)
|
284
|
|
- self.layer_manager.interaction_manager.register(MoveFastActorInteraction, self.layer_manager)
|
285
|
|
- self.layer_manager.interaction_manager.register(MoveCrawlActorInteraction, self.layer_manager)
|
286
|
|
- self.layer_manager.interaction_manager.register(FireActorInteraction, self.layer_manager)
|
|
298
|
+ self.layer_manager.interaction_manager.register(
|
|
299
|
+ MoveActorInteraction,
|
|
300
|
+ self.layer_manager,
|
|
301
|
+ )
|
|
302
|
+ self.layer_manager.interaction_manager.register(
|
|
303
|
+ MoveFastActorInteraction,
|
|
304
|
+ self.layer_manager,
|
|
305
|
+ )
|
|
306
|
+ self.layer_manager.interaction_manager.register(
|
|
307
|
+ MoveCrawlActorInteraction,
|
|
308
|
+ self.layer_manager,
|
|
309
|
+ )
|
|
310
|
+ self.layer_manager.interaction_manager.register(
|
|
311
|
+ FireActorInteraction,
|
|
312
|
+ self.layer_manager,
|
|
313
|
+ )
|
287
|
314
|
self.layer_manager.interaction_manager.register(
|
288
|
315
|
SaveStateInteraction,
|
289
|
316
|
self.layer_manager,
|
290
|
317
|
)
|
|
318
|
+ self.layer_manager.interaction_manager.register(
|
|
319
|
+ SetSubjectPositionsInteraction,
|
|
320
|
+ self.layer_manager,
|
|
321
|
+ )
|
291
|
322
|
|
292
|
323
|
def set_subject_position(
|
293
|
324
|
self,
|