When you control a lot of provinces, and especially when auto-recruit is on, it's a lot of work having to move all of your armies one by one.
There should be a way to automatically move armies in any direction.
Here's my idea:
Create the code architecture
[x] Add new object in Country called AutoArrows, a list of AutoArrow
[x] Create AutoArrow class: has a source province and a destination province
[x] AutoArrows ignores any attempt to add a new AutoArrow that's a duplicate of an existing one
[x] AutoArrows listens to changes in all AutoArrow objects in the list. Whenever an arrow's information matches another one's, it deletes that arrow and its visuals
[x] Add new node in GameWorld2D called AutoArrowsNode2D, a list of AutoArrowNode2D
[x] Create AutoArrowNode2D class: contains an AutoArrow or, alternatively, can also take just a source province and a Vector2 destination
Draw the arrows on the world map
[x] AutoArrowNode draws an arrow using the information it has
[x] AutoArrowNode listens to changes in AutoArrow's provinces and updates the visuals accordingly
[x] Only show arrows when a province is selected (any province)
[x] Only show the playing country's arrows
Save the arrows between sessions
[x] Save the arrows for each Country
[x] Load the arrows for each Country
Add behavior
[x] At the end of a player's turn, the game goes through all of the country's arrows. For each arrow, checks if a controlled army is in the source province, and if so, creates and applies a new army movement action
[x] If more than one arrow points from the source province, splits the army evenly between each destination
Make the user able to add new arrows
[x] Have a new node that listens to mouse input for arrows
[x] When right click is pressed on a province, creates a new AutoArrowNode2D
[x] The AutoArrowNode2D points from the source province to the mouse cursor's position
[x] If the mouse cursor is on a valid destination, then the arrow snaps to the destination province
[x] If the right mouse button is released with a valid destination province, an AutoArrow is created and added to the Country's AutoArrows
[x] Players can add and remove arrows at any time, but they can only add them to their own country
Make the user able to remove arrows
[x] When a new arrow is created by the user that matches an existing arrow, it deletes the existing arrow instead of creating a new arrow
[x] A double right click on a province deletes all arrows going from that province
Synchronize between clients
[x] Sync the addition of an AutoArrow
[x] Sync the removal of an AutoArrow
[x] Non-server clients can only edit the AutoArrows of their locally controlled countries
[x] When it's a remote player's turn to play, you can't create or remove arrows
Note: no need to sync changes in AutoArrow properties because they de facto never change. Arrows are only added and removed, never modified.
I want to mention that I created two related issues (#179 #180) to make auto-arrows even better.
I might implement them for 4.1, if there's still time before the deadline.
When you control a lot of provinces, and especially when auto-recruit is on, it's a lot of work having to move all of your armies one by one. There should be a way to automatically move armies in any direction. Here's my idea:
Create the code architecture
Draw the arrows on the world map
Save the arrows between sessions
Add behavior
Make the user able to add new arrows
Make the user able to remove arrows
Synchronize between clients
Note: no need to sync changes in AutoArrow properties because they de facto never change. Arrows are only added and removed, never modified.