Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Automatically unpark a ship if it is moved to position 1 in the fleet list #9984

Open
brendanjones opened this issue Apr 10, 2024 · 3 comments
Labels
enhancement A suggestion for new content or functionality that requires code changes

Comments

@brendanjones
Copy link
Contributor

brendanjones commented Apr 10, 2024

Problem Description

This is a very small problem but still, it'd be a nice usability fix IMO: I can't count the number of times I've been switching ship so I've moved a parked ship to position 1 in my fleet list, and then taken off, completely forgetting to unpark it first meaning it stays on the planet instead of it being the ship I'm flying.

After all, it's impossible to park a ship when it's in position 1, so why is it possible to move a parked ship there without it being unparked in the process?

Related Issue Links

Plenty related to (un)parking but none specific to this.

Desired Solution

If a ship is parked and it is moved to the number 1 spot in the fleet list, then unpark it.

This should apply no matter where the ship position is changed (shipyard, outfits, player info).

Alternative Approaches

Additional Context

No response

@xX-Dillinger-Xx
Copy link

I have had the same issue and vote yes for this request.

@TomGoodIdea TomGoodIdea added the enhancement A suggestion for new content or functionality that requires code changes label Apr 19, 2024
@SomeTroglodyte
Copy link

...and make "unpark/park local" treat fighters as part of their mother ship - oh wait they don't know what that is... 😸

Jokes aside,

This patch seems to do the job
Index: source/PlayerInfo.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/source/PlayerInfo.cpp b/source/PlayerInfo.cpp
--- a/source/PlayerInfo.cpp	(revision 31f36f65c7092c9d8ee0f472f7d48dfcaf9d2d6b)
+++ b/source/PlayerInfo.cpp	(date 1713568002873)
@@ -1335,6 +1335,7 @@
 	shared_ptr<Ship> ship = ships[fromIndex];
 	ships.erase(ships.begin() + fromIndex);
 	ships.insert(ships.begin() + toIndex, ship);
+	if ((fromIndex == 0 || toIndex == 0) && !ships[0]->IsDisabled()) ships[0]->SetIsParked(false);
 	flagship.reset();
 }
 
@@ -1346,6 +1347,7 @@
 	if(std::is_permutation(ships.begin(), ships.end(), newOrder.begin()))
 	{
 		ships = newOrder;
+		if (ships.size() > 0 && !ships[0]->IsDisabled()) ships[0]->SetIsParked(false);
 		flagship.reset();
 	}
 	else
... though my grasp of c++ and coding styles and data structures here is abysmal, so a true coder would come up with better. I'll still leave it in the binary I'm playing.

@Hyratel
Copy link

Hyratel commented May 29, 2024

...and make "unpark/park local" treat fighters as part of their mother ship - oh wait they don't know what that is... 😸

treat first N=Bays fighters/drones in the list immediately after a Carrier && Same System as "its wing", up to NumBays. any Hyper-capable Ship halts check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A suggestion for new content or functionality that requires code changes
Projects
None yet
Development

No branches or pull requests

5 participants