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

Change: Use selected group as parent when creating a new group. #7224

Merged
merged 1 commit into from Feb 15, 2019

Conversation

@PeterN
Copy link
Member

PeterN commented Feb 13, 2019

No description provided.

Copy link
Contributor

nielsmh left a comment

Looks like it works as intended. The livery copying looks a bit strange to me (I'd expect it to inherit rather than copy) but I trust PeterN to extend his own code in the most appropriate way.

@J0anJosep
Copy link
Contributor

J0anJosep commented Feb 14, 2019

Great idea. I also expected to inherit liveries instead of copying them.

@PeterN
Copy link
Member Author

PeterN commented Feb 14, 2019

Inheritance is set by the in_use flag, in the case of inheritance colour1/colour2 are set to the parent. This is because when using 2cc mode, the two colours can actually inherit from different parent groups independently, but GetEngineLivery returns a Livery struct, not two colours.

When changing a parent livery, PropagateChildLivery() applies that change to all the group's children recursively.

Turns out there's some left over code in GetEngineLivery that traverses parents when it's not actually necessary. Oops.

@PeterN PeterN added the wip label Feb 15, 2019
@PeterN
Copy link
Member Author

PeterN commented Feb 15, 2019

Okay, I think it should check the group ID exists and return an error if not, instead of silently creating a top-level group. Going to fix it :-)

EDIT: Other functions also do it this way, so for consistency I'll leave this as is and then change them all together, possibly.

@PeterN PeterN merged commit 3a4b6b4 into OpenTTD:master Feb 15, 2019
8 checks passed
8 checks passed
OpenTTD CI Build #20190213.4 succeeded
Details
OpenTTD CI (Linux commit-checker) Linux commit-checker succeeded
Details
OpenTTD CI (Linux linux-amd64-clang-3.8) Linux linux-amd64-clang-3.8 succeeded
Details
OpenTTD CI (Linux linux-amd64-gcc-6) Linux linux-amd64-gcc-6 succeeded
Details
OpenTTD CI (Linux linux-i386-gcc-6) Linux linux-i386-gcc-6 succeeded
Details
OpenTTD CI (MacOS) MacOS succeeded
Details
OpenTTD CI (Windows Win32) Windows Win32 succeeded
Details
OpenTTD CI (Windows Win64) Windows Win64 succeeded
Details
@PeterN PeterN deleted the PeterN:new-group-parent branch Feb 15, 2019
PeterN added a commit to PeterN/OpenTTD that referenced this pull request Feb 15, 2019
PeterN added a commit that referenced this pull request Feb 15, 2019
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this pull request Feb 18, 2019
J0anJosep added a commit to J0anJosep/OpenTTD that referenced this pull request Feb 18, 2019
nielsmh added a commit to nielsmh/OpenTTD that referenced this pull request Mar 11, 2019
stormcone added a commit to stormcone/OpenTTD that referenced this pull request May 10, 2019
… correctly.

When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
stormcone added a commit to stormcone/OpenTTD that referenced this pull request May 10, 2019
…correctly.

When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
nielsmh added a commit that referenced this pull request May 10, 2019
When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
michicc added a commit to michicc/OpenTTD that referenced this pull request Jun 30, 2019
…correctly.

When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
michicc added a commit that referenced this pull request Jul 7, 2019
When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
douiwby added a commit to douiwby/OpenTTD that referenced this pull request Apr 16, 2020
douiwby added a commit to douiwby/OpenTTD that referenced this pull request Apr 16, 2020
…correctly.

When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
spnda added a commit to spnda/OpenTTD that referenced this pull request Jun 17, 2020
…correctly.

When drag and drop a vehicle into an empty slot in the vehicle group window it tries to create the new group as the subgroup of the first group (GroupID = 0). This is failing if the dragged vehicle's type is different than the first group's vehicle type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.