Newmenu update includes main_menu?

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

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

Newmenu update includes main_menu?

Post by Bainespal »

I downloaded the new version of Roodylib from the IF Archive as mentioned on Not Dead Hugo, and I saw that there were new versions of newmenu.h and beta.h, so I grabbed them too.

Tree and Star wasn't compiling with the latest version of newmenu, due to the lines where I defined "menu category main_menu". It said that main_menu was already defined.

I see that main_menu is defined on line 1156 of newmenu.h, so I simply commented out my version, and it compiles. I believe the commented documentation needs updating, because it still says this:
This extension *expects* a menu_category object named main_menu. Add the following to your code.

menu_category main_menu "TITLE OF YOUR MAIN MENU"
{}
I like the change, in general. Before, I kind of felt that the main_menu object could be part of the library. I'm fine with the default heading as the game title, but is there a way to change it?

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

Post by Roody_Yogurt »

Thanks for this. Hidden in the changelog, I mention the change to newmenu-including-a-main_menu-object, but you're right, it should be changed there, too. In the future, that section will read:
This extension *expects* a menu_category object named main_menu. One is provided by newmenu.h, but if you need to replace it, do the following:

replace main_menu "TITLE OF YOUR MAIN MENU"
{
inherits menu_category
}
To answer your question, to change the menu title, you can either do the above or have a line like the following in init or SetGlobalsAndFillArrays:

Code: Select all

main_menu.name = "Your New Name"

Post Reply