[Ohrrpgce] SVN: james/7911 Add .autosize_vertical member to MenuState. It defaults to OFF

James Paige Bob at HamsterRepublic.com
Thu Apr 7 09:34:08 PDT 2016


Hmmm... I certainly wouldn't want MenuDef menus to be resized to fit the
window by default.

I would also want separate settings for whether or not a menudef should try
to fit vertically or horizontally, since I think I would often want a
vertically sizing menu, but only rarely would I want it to horizontally
size too.

The approach I used for resizing the MenuDef menu in edit_platform_options
was fairly crude and simplistic, but it was adequate.

---
James


On Thu, Apr 7, 2016 at 1:54 AM, Ralph Versteegen <teeemcee at gmail.com> wrote:

> On 7 April 2016 at 20:53, Ralph Versteegen <teeemcee at gmail.com> wrote:
> > Awesome! This is something I was hoping we would do soon. When I have
> > some time I'll try to get gfx_directx and gfx_fb to support changing
> > the resolution, and then we could change Custom's default
> > resolution...
> >
> > A month ago I also started work on making menus automatically adjust
> > to the screen size. I didn't finish and thought it too risky anyway,
> > but the patch is here:
> >
> https://bitbucket.org/rbv/ohrrpgce/commits/c6628f9345067f211228ef6ac3e79e10cc2fa952?at=master
> > I wanted to affect both standardmenu and MenuDef menus, but at the
> > time was most concerned with the latter. My approach was to calculate
> > the appropriate .size in init_menu_state, and to set MenuState.spacing
> > in standardmenu like draw_menu already does, but I realised that won't
> > support resizing the menu as the window size changes, so I have had to
> > change the approacht anyway.
> *would have had to change the approach anyway
>
> > It turns out that MenuDef menus cope really badly with changes not
> > just window size but to basic settings! They use a default .size of 17
> > and ignore .itemspacing and the border size. Fixing that is the most
> > interesting part of my patch.
> >
> > On 7 April 2016 at 07:45,  <subversion at hamsterrepublic.com> wrote:
> >> james
> >> 2016-04-06 12:45:05 -0700 (Wed, 06 Apr 2016)
> >> 241
> >> Add .autosize_vertical member to MenuState. It defaults to OFF
> >> but if it is set = ON and .spacing is set correctly, calls to
> >> usemenu will automatically adjust .size to fit the current vertical
> >> screen size
> >>
> >> (tested on the map selection menu)
> >> ---
> >> U   wip/mapsubs.bas
> >> U   wip/menus.bas
> >> U   wip/menus.bi
> >> U   wip/udts.bi
> >> _______________________________________________
> >> Ohrrpgce mailing list
> >> ohrrpgce at lists.motherhamster.org
> >> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.motherhamster.org/pipermail/ohrrpgce-motherhamster.org/attachments/20160407/db99ede0/attachment-0001.htm>


More information about the Ohrrpgce mailing list