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

Ralph Versteegen teeemcee at gmail.com
Thu Apr 7 13:47:59 PDT 2016


I was only modifying init_menu_state to set the default .size if "max
rows = default" was set in the menu editor. In that case I expect a
reasonable default to be used (also because MenuDef is used in
Custom). Once fonts can be different sizes there will be another
reason why the default of 18 may be wrong. Actually, I just remembered
that I was thinking of eventually replacing the "max rows" setting
entirely, in order to allow menus where the menu items are variable
heights (wrapping menu item text). I was thinking of drawing menus
with a clipping parent slice, and the same also for scrolling
textboxes. That would only be necessary if counting text in lines is
unreasonable.

There would be no need to handle window resizing in Game, so modifying
init_menu would do... although come to think of it it would be
necessary to take into account in the menu editor that Game and Custom
run at different resolutions... this is getting messy.



On 8 April 2016 at 04:34, James Paige <Bob at hamsterrepublic.com> wrote:
> 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
>
>
>
> _______________________________________________
> Ohrrpgce mailing list
> ohrrpgce at lists.motherhamster.org
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>


More information about the Ohrrpgce mailing list