Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #911906

Qt - in the map view, display the unit stack count

Added by John Robertson over 1 year ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Category:
Client
Sprint/Milestone:
Start date:
Due date:
% Done:

40%

Estimated time:

Description

- no more middle mouse clicking to search for the short stack or the transport that can take more units.

0 through 20 use unicode circled number characters. Greater than 20 uses a lower quality drawText() construct.

Please review and advise while the GTK and SDL implementation.

stack_counts.PNG (313 KB) stack_counts.PNG John Robertson, 2021-01-01 04:57 PM
0002-Qt-unit-stack-count-sprites.patch (16.1 KB) 0002-Qt-unit-stack-count-sprites.patch master branch John Robertson, 2021-01-01 05:04 PM
0003-Qt-unit-stack-count-sprites-v2.patch (16.3 KB) 0003-Qt-unit-stack-count-sprites-v2.patch master John Robertson, 2021-02-08 12:02 AM
0025-Qt-Add-unit-stack-size-display.patch (14 KB) 0025-Qt-Add-unit-stack-size-display.patch Marko Lindqvist, 2021-11-10 06:38 PM
250

History

#1 Updated by Marko Lindqvist over 1 year ago

  • Category set to Client
  • Sprint/Milestone set to 3.1.0

How does it show loaded transport of enemy player? Seems like it would show stack size of the transport itself (1) if there's no other units in the tile.
I don't see you freeing the stack size sprites anywhere, nor inserting them to the hash where they would be automatically freed from.

#2 Updated by John Robertson over 1 year ago

(Replaces previous patch)
Added participation in the QPixmapCache for the numeric sprites.

#3 Updated by Marko Lindqvist over 1 year ago

Marko Lindqvist wrote:

How does it show loaded transport of enemy player? Seems like it would show stack size of the transport itself (1) if there's no other units in the tile.
I don't see you freeing the stack size sprites anywhere, nor inserting them to the hash where they would be automatically freed from.

Ping for answers.

#4 Updated by John Robertson over 1 year ago

· 0003-Qt-unit-stack-count-sprites-v2.patch addresses the memory issue by adding and retrieving the sprites from the QPixmapCache.

· No count is added for unit stack of one (e.g. an empty transport).

· Enemy units show their stack counts when more than one, ... If this is not desired behavior, then I could add an `is_player's_unit` check.

#5 Updated by Marko Lindqvist over 1 year ago

John Robertson wrote:

· 0003-Qt-unit-stack-count-sprites-v2.patch addresses the memory issue by adding and retrieving the sprites from the QPixmapCache.

That's Qt-client specific solution. The solution should be in client-common code. Something along the lines of "sprite_hash_insert(t->sprite_hash ...)" in tilespec.c

· No count is added for unit stack of one (e.g. an empty transport).

Hmm.. there's still
"if (stack_count > 1 || punit->client.occupied) {"
i.e. occupied enemy transport is considered even if there's no other units visible to the client in the tile. That might be caught by the later " t->sprites.unit.stack[stack_count] != NULL" check, but the other part of this issue is that you should still indicate such occupied transports somehow, or there's a regression.

#6 Updated by Marko Lindqvist 9 months ago

I was about to just fix those couple of issues listed earlier, but then I noticed several more minor issues/annoyances, and am now in the process of writing the patch from scratch, using John's patch as a reference, especially for the Qt-client part.

#8 Updated by Marko Lindqvist 9 months ago

  • Status changed from Resolved to Closed
  • Assignee set to Marko Lindqvist

Also available in: Atom PDF