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
Garrison fixes #115
Garrison fixes #115
Conversation
/// Type of Garrison for slot (up or down) | ||
enum GarrisonType | ||
{ | ||
up=0, ///< 0 - up garrison (Garrisoned) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use capital letters for Enum items
|
As for now, engine prevents moving last stack (whole last stack, split for last stack works perfectly) on server side. In this PR it will move all except one creature. |
Prior, you can't move the last stack of a visiting hero into garrison (or from a garrisoned hero to another hero) because the server stops you with an error. In vanilla, if you do this, it will move all the creatures except for one to the other slot. This PR does this and the server no longer complains about something fishy. |
b796805
to
04d3cd0
Compare
Fixed the enum style: uppercase values and use the 'E' prefix |
04d3cd0
to
c150fe9
Compare
Restructure large nested if statements into more shallow blocks Factor out contents of if statements to functions for better readability * viewInfo * hightlightOrDropArtifact * split
ead38ce
to
89fb4aa
Compare
const CArmedInstance * selectedObj = owner->armedObjs[selection->upg]; | ||
if (!creature && selectedObj->stacksCount() == 1) | ||
LOCPLINT->cb->splitStack( | ||
selectedObj, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if splitting arguements like that helps. Before rewrite these lines contained complex conditions, but not they are simple and just use up vertical space.
89fb4aa
to
a79ade7
Compare
@DjWarmonger done |
Looks good to me, merging.
After 8cad239 there was several issues remaining: * Last creature would remain even for town garrisons. * Impossibility to move last stack even within same garrison. * Impossibility of partially merge of last stack into other hero stack. All fixed. However last stack merge to other hero will now make split window appear instead of auto merge.
Fix tooltip for in garrison creatures
Show tooltip after moving hero to garrison
Disable creature split button for garrisoned ally
Refactor and simplify Left Click in Garrison
Fix selection as default when action is made
Implement moving all but last creature mechanic
Various documentation addition