My New Menu System

This is a discussion / support forum for the Hugo programming language by Kent Tessman. Hugo is a powerful programming language for making text games / interactive fiction with multimedia support.

Hugo download links: https://www.generalcoffee.com/hugo
Roody Yogurt's Hugo Blog: https://notdeadhugo.blogspot.com
The Hugor interpreter by RealNC: http://ifwiki.org/index.php/Hugor

Moderators: Ice Cream Jonsey, joltcountry

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

My New Menu System

Post by Roody_Yogurt »

I have released my new menu replacement extension! The most important thing is that it makes menus more compatible with glk and cheapglk interpreters, but even if you do not use that, it attempts to make transcripts prettier and menu set-up a tad easier. Plus, it tries to make Guilty Bastard style hints easier to look at, too.

Anyhow, usage is explained in the comments in the newmenu.h file. A sample game is included also.

Even if you have your own glk-detecting code, to use the glk aspects of this extension, you DO need to use glk.h and cheapglk.h, as they set important flags.

Eventually, I will write a Hugo By Example page for both this (and the new cheapglk library). In the meantime, enjoy!

http://roody.gerynarsabode.org/hbe/newmenu.zip

When you give it a spin, be sure to make a transcript and try various choices. Try it with Gargoyle, too!

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post by Bainespal »

I take it that including glk and cheapglk is helpful when using the new menu extension even if the game has no other use of features that don't work in glk, because these extensions will make the menus look alright in glk/cheapglk interpreters. Is that correct?

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

That is correct! (Besides including the files, you'll have to add "glkcheck" to the init routine)

Again, though, if you don't care how menus look (or don't work) under glk interpreters, you don't need to use glk.h or cheapglk.h at all.

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post by Bainespal »

I added this to World Builder and sent you a transcript at the email in the comment at the top of newmenu.h.

I would never have planned to use a menu at all. I never looked into using menus because they seemed complicated and I never got to the ending stages of tuning up a game before. The menu generated by newmenu.h looks perfect! Thanks for the extension.

I forgot to mention in the email that I made the transcript with the Hugo Debugger. I haven't looked at it in a glk interpreter or in Hugor. However, I did include glk.h and cheapglk.h as well as newmenu.h.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

Glad it works to your liking. Some of the line spacing in the transcript notation might be actually my fault; I kind of put in whatever looked good to me at the time. Whatever mistakes are there, in any case, I think it looks better than what it did previously.

User avatar
Tdarcos
Posts: 9333
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Re: My New Menu System

Post by Tdarcos »

Roody_Yogurt wrote:Plus, it tries to make Guilty Bastard style hints easier to look at, too.
What on earth is a 'Guilty Bastard Style' hint?
Alan Francis wrote a book containing everything men understand about women. It consisted of 100 blank pages.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

It means they are styled after the hint system used in the game 'Guilty Bastards', an early yet prominent Hugo game by Kent Tessman:

http://mirror.ifarchive.org/if-archive/ ... guilty.zip

Bainespal
Posts: 151
Joined: Fri Jul 09, 2010 8:59 am

Post by Bainespal »

Roody_Yogurt wrote:Some of the line spacing in the transcript notation might be actually my fault; I kind of put in whatever looked good to me at the time.
No, it was simply a matter of my putting consistent new lines. It looks better now.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I made a small change, so newmap.h is now at version 1.1 ( http://roody.gerynarsabode.org/hbe/newmenu.zip ).

I decided that I didn't like that I had hardcoded a blank line between the menu title and the "[N]ext Item" text, so now there is a title_gap property for menucategory objects. If you want a blank space, put a true value there. Otherwise, leave it as it is. I thought this'd allow authors to get menus looking exactly how they like.

Ideally, I'd throw every bit of printed text to a "replace NewMessages" routine for easily swappable-text, but I'm saving that for another day.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I've changed my messaging approach. Until recently, I had mistakenly been trying to have all regular routine messages get directed to NewMessages, all object messages to NewOMessages, all verb routines to NewVMessages, and so forth. I finally realized that the way Christopher Tate's contribution handles it is the best way; all messaging routines should be self-contained to their file, so beta.h has a BetaMessage routine that looks to NewBetaMessages for replacements, and so on.

I've updated newmenu.zip, simpletalk.zip, and beta.h to reflect this code design. While doing so, I found bugs in the newmenu extension and simpletalk, so if you use either of those, I recommend updating. Links to the files can be found here.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I've also updated the Footnotes library contribution ( http://hugo.gerynarsabode.org/index.php ... ibution%29 ) to be more message-configurable. Also, I got rid of an extraneous property array and added default support to Guilty Bastards "footnote always" mode.

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

So yesterday, I thought it was time to finally upload some of my library contributions to the IF Archive, including my menu update. Of course, as luck would have it, later that day, while putting menus into my WIP, I realized that colors are messed up when people actually define the hugolib-provided MENU_TEXTCOLOR, MENU_BGCOLOR, MENU_SELECTCOLOR, and MENU_SELECTBGCOLOR global variables.

Fortunately for my ego, part of the problem was due to the original menu routine. Like, if you have a non-black default background, in CZK, when you go to the in-game options menu, menu options are on "islands" of color, instead of the whole page.

Unfortunately, the "islands" effect sometimes looks kind of cool so I feel bad about turning it off completely, but I guess consistency is the more important thing here.

Anyhow, I've updated newmenu.h both to fix this issue, and I also provided some color-holding properties for menu_category objects so you can have connected menus have different color schemes. I haven't been able to decide whether this is overkill.

I think I'm going to sit on this one a bit longer before I upload it to HbE and the IF archive, just in case there are some more tweaks ahead, but you guys can take a look at it now:
http://roody.gerynarsabode.org/JC/test/newmenu.h

Roody_Yogurt
Posts: 2179
Joined: Mon Apr 29, 2002 6:23 pm
Location: Milwaukee

Post by Roody_Yogurt »

I just uploade version 2.6 to http://roody.gerynarsabode.org/hbe/newmenu.zip. Other than fixing some bugs with the default menu, I also changed up the default look of "press a key" text in the CoolPause routine. Instead of being prefaced by a not-tied-to-anything number of spaces, it is now just a regular indent, and instead of being bold, the text defaults to being italicized. I may/probably-will make it further customizable down the road, but I figured this is an improvement for now.

Post Reply