* fixed displaying free upgrades
* do not try to print 3rd or more resource in slot cost (in theory possible with mods)
** we need dynamic gui for that
* CDefEssential--
Bonus * -> std::shared_ptr<Bonus>
This cures the following problems:
1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.
Valgrind reports 0 leaked memory now and no invalid reads/writes.
That wouldn't be as big issue if problem affected few files, but it everywhere in codebase.
Fixed it everywhere since in most files that is the only code with wrong indentation.
After 8cad23956c 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.
Restructure large nested if statements into more shallow blocks
Factor out contents of if statements to functions for better readability
* viewInfo
* hightlightOrDropArtifact
* split
New widget specifically for volume settings.
Replace previous implementation using 10 toggle buttons.
Enable indicator animation
Fix indicator ghosting when drag and releasing
Add scroll capability to volume
Volume now can be adjusted from 0 - 99 with the mouse or the scroll wheel
CToggleGroup. Originally when I added initialization for selectedID I didn't find out that -1 is used for "random" buttons. So as result I fixed uninitialized variable usage, but break initial button state change in RMG options because setSelected ignore state change request because it's see -1 button already marked as selected.
Before UI always highlighted all slots in both town garrisons even if there no visiting here and you can't actually set army on these slots.
Now garrison slots only highlighted if they're owned by us or our ally. If there no visiting hero in town then only suitable upper garrison slots will be highlighted.