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

DSXMENU feature request: Can we have a plain text line? #57

Open
NebularNerd opened this issue Sep 16, 2022 · 1 comment
Open

DSXMENU feature request: Can we have a plain text line? #57

NebularNerd opened this issue Sep 16, 2022 · 1 comment

Comments

@NebularNerd
Copy link

I was looking at using DSXMENU inside DosBox to make things a little easier for games and apps when starting them from a frontend or bat. The menu itself does everything you need functionality wise, however I was wondering if we can have a simple non navigable text line entry.

For example:

[menu]
menutext=Awesome Game Menu
menuitem=choice_a,Menu item A
menuitem=choice_b,Menu item B
menuitem=choice_c,Menu item C
menudefault=choice_b,10

You can sort of do this with a dummy line menuitem=,Some text but it's still navigable. It would be handy for adding a title to the menu or some sort of hint about which option to select.

@NebularNerd
Copy link
Author

NebularNerd commented Apr 8, 2023

I've had another look at the code and I think an easy way to make this feature work is the ignore and skip over any line in the .ini that has # for the choice value like:

[menu]
menuitem=#,A Line of text to quickly explain choices
menuitem=#,A Line of text to quickly explain choices
menuitem=choice_a,Menu item A
menuitem=choice_b,Menu item B
menuitem=choice_c,Menu item C
menudefault=choice_b,10  

Changes to the code [at lines 368-380]

menu_sel = 0;
{
unsigned int i;
for (i=0;i < menu_items;i++) {
struct menuitem *item = &menu[i];
assert(item->menu_item_name != NULL);
if (!strcmp(item->menu_item_name,menu_default_name)) {
menu_sel = i;
break;
}
}
}
should be as follows:

    menu_sel = 0;
	 {
		unsigned int i;
		for (i = 0; i < menu_items; i++) {
			struct menuitem *item = &menu[i];

			assert(item->menu_item_name != NULL);
			if (strstr(item->menu_item_name, "#") != NULL) {
				continue;  // skip this item if '#' is found
			}
			if (!strcmp(item->menu_item_name, menu_default_name)) {
				menu_sel = i;
				break;
			}
		}
	}

I'm having trouble figuring out how to build with OpenWatcom, if anyone here can build this and see if it works that would be cool, if not I'll keep trying to learn how to compile with OpenWatcom. If I'm able to build and it works I'll open a PR, if anyone beats me to it that's cool 😎

EDIT:
Finally got Wacom to compile under Ubuntu WSA, but my idea did not work. Time to try something else....

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

No branches or pull requests

1 participant