Page MenuHomeWildfire Games

list & olist: don't draw text above the golden bottom line
AbandonedPublic

Authored by Imarok on Dec 7 2017, 11:26 PM.

Details

Reviewers
gentz
vladislavbelov
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Done by drawing the line below the list. Thus the list gets 1px bigger than defined in xml.

Test Plan

Look at some list/olist and scroll

Event Timeline

Imarok created this revision.Dec 7 2017, 11:26 PM

@ffffffff had one too, didn't @temple also have one?

Would be nicer to fix the rendering order.

I always failed trying to move the DrawSprite(*sprite calls in COlist.cpp and inherited CList.cpp.

Vulcan added a subscriber: Vulcan.Dec 7 2017, 11:36 PM

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Executing section Default...
Executing section Source...
Executing section JS...

Other places should be adjusted the same way, whatever's decided.

My solution was to change the z_level. I don't know what's best.
https://code.wildfiregames.com/D1023#40247

In D1023#40247, @temple wrote:

This is what I had in mind.

Index: binaries/data/mods/mod/gui/common/modern/sprites.xml
===================================================================
--- binaries/data/mods/mod/gui/common/modern/sprites.xml	(revision 20434)
+++ binaries/data/mods/mod/gui/common/modern/sprites.xml	(working copy)
@@ -221,6 +221,7 @@
 		<image texture = "global/modern/gold-separator.png"
 			real_texture_placement = "0 0 806 1"
 			size = "0 100%-1 100% 100%"
+			z_level = "15"
 		/>
 		<image backcolor = "12 12 12 100"
 			size = "0 0 100% 100%-1"

It's a hack, I think, it's better to make clip for the element.

Given that my order change in C++ didn't work out it must have been a Z issue, so that would be a lesser workaround than the +1 px.
Not sure how we would specify a clipping area for the text. @vladislavbelov got an idea?

elexis edited the summary of this revision. (Show Details)Dec 8 2017, 12:34 AM

This is mine was ok

I believe the Z-index fix is the correct one, because we might want to render a transparent sprite in the middle of the list above the text (hypothetically) which we can't clip.

Imarok updated this revision to Diff 4692.Dec 10 2017, 11:56 AM

z-fix is cleaner

Executing section Default...
Executing section Source...
Executing section JS...

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (308 tests)....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...

There are other places with scroll bars and text over the bottom/top, might want to fix all of those too.
(I think the dropdown uses a border so instead probably need to make a "black box" sprite.)

In D1127#45613, @temple wrote:

There are other places with scroll bars and text over the bottom/top, might want to fix all of those too.
(I think the dropdown uses a border so instead probably need to make a "black box" sprite.)

I can't find any broken ones on a quick look. Can you hint me?

In D1127#50140, @Imarok wrote:
In D1127#45613, @temple wrote:

There are other places with scroll bars and text over the bottom/top, might want to fix all of those too.
(I think the dropdown uses a border so instead probably need to make a "black box" sprite.)

I can't find any broken ones on a quick look. Can you hint me?

Any place where there's a scroll bar then it's probably a problem. E.g. in the replay menu with the map dropdown.


Also in the match setup select map dropdown and map information. There were problems in the game lobby, I don't know if those are fixed or not.

Basically, in all of the box sprites you'll probably want to add z_level to the gold-separator and white-separator images. And also make a black box sprite to use in the dropdowns.

wraitii added a reviewer: Restricted Owners Package.Jan 22 2018, 10:12 AM
Imarok updated this revision to Diff 5596.Jan 31 2018, 12:04 AM

Seems to fix most (all?) cases.

temple added inline comments.Jan 31 2018, 1:19 AM
binaries/data/mods/mod/gui/common/modern/sprites.xml
183–190

This sprite is used for the selection box, and here we can see that it's covered by the new black sprite:


It seems to be fixed by again using z_level = "11".

I think this sprite is used in some scroll boxes too but maybe it's hard to tell if the white border is the same color as the white text. I didn't check where all the box sprites were used or if they're all used, but it seems like whenever we have borders on boxes we'll never want text to be on top. So I think we should make the z_level adjustment in all of them.

482

unnecessary?

486

I think we want another at the top as well, since words can cover the border:

Executing section Default...
Executing section Source...
Executing section JS...

Successful build - Chance fights ever on the side of the prudent.

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (309 tests).....................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Imarok abandoned this revision.EditedMay 22 2021, 6:04 PM

Will do it the right way.

Edit: See D4004