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

add adv. preference for number of menu items displayed at once #229

Merged
merged 7 commits into from
Jul 7, 2014
Merged

add adv. preference for number of menu items displayed at once #229

merged 7 commits into from
Jul 7, 2014

Conversation

cbeck88
Copy link
Member

@cbeck88 cbeck88 commented Jun 29, 2014

Not completely sure if this is necessary, but various people have expressed varying opinions about how this should work, what is most comfortable for machines with large screens vs small screens etc.

The purpose is that, we are making an effort to support having lots of add-ons active simultaneously, and then the number of wml item slots becomes a scarce resource, so we want to mitigate that and make it not a concern.

See earlier commit: f24f6ad

Forum discussion: http://forums.wesnoth.org/viewtopic.php?f=6&t=40668

This commit makes the pager just show enough entries from the
previous page to ensure that we have a full page. When the number
of displayed entries is large, if we don't do this then the menu
can resize dramatically which is a bit jarring.
@AI0867
Copy link
Member

AI0867 commented Jul 1, 2014

This doesn't feel like something that should be a preference, but something that should be a function of the vertical space available. What happens if someone sets 32 and tries to play on 800x480?

@cbeck88
Copy link
Member Author

cbeck88 commented Jul 1, 2014

Edit: Basically, allowing the user to set 32 and play on a small screen just disables the pager and reverts to default gui behavior.

The gui code gives you a vertical slider if the menu goes over some hardcoded vertical size I think:

http://i.imgur.com/bTETfOu.png?1

The pager exists at a very low level of the code. The previous limit of 7 was hard coded in the wmi_container object, it would never emit more than 7 items to a gui menu. The pager wraps over that object, keeping a page counter.

In principle I guess the pager could be generalized and become a gui element and interact with the layout algorithm for menus, but I think the current behavior is probably fine. The alternative is that it's always 7 and you can't reset it even if you have lots of space available -- in any case this version feels like an improvement.

@cbeck88
Copy link
Member Author

cbeck88 commented Jul 7, 2014

This branch is getting stale -- there are clearly ways it can be improved but no obvious step forward without rewriting a bunch of gui code that we intend to remove eventually anyway, or putting new gui logic inside of the play_controller. Someone else is free to build upon this as they see fit but esp. with regards to the latter I wipe my hands of the matter.

Besides this I think a user might legitimately have preferences about how many items to display at once, independent of how much space is on their screen.

So for now I will merge it.

cbeck88 added a commit that referenced this pull request Jul 7, 2014
add adv. preference for number of menu items displayed at once,

and remaining fixups there
@cbeck88 cbeck88 merged commit 1cb74d6 into wesnoth:master Jul 7, 2014
@cbeck88 cbeck88 deleted the wmi_items_preference branch July 7, 2014 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants