Okay, I know I'm overlooking something here and perhaps I'm just plain wiped out but I can't seem to figure out the problem...
The problem is that the resolution is not changing due to the return value always being -1...
Perhaps someone can help me out?
here's the code...// create an options window ONLY if options are not open if options_open = 0 { options_window = ctrl_window_create(0, 0, room_width, room_height, "Options", -1, true, false, false); ctrl_text_create(options_window, 35, 52, "RESOLUTION", 100, fa_left, fa_middle, false); options_resolution = ctrl_listbox_create(options_window, 35, 65, 100, 86, true, false, false); ctrl_listbox_item_add(options_resolution, "640 x 480"); // 0 ctrl_listbox_item_add(options_resolution, "800 x 600"); // 1 ctrl_listbox_item_add(options_resolution, "1024 x 768"); // 2 ctrl_listbox_item_add(options_resolution, "1152 x 864"); // 3 ctrl_listbox_item_add(options_resolution, "1280 x 720"); // 4 ctrl_listbox_item_add(options_resolution, "1280 x 768"); // 5 ctrl_listbox_item_add(options_resolution, "1280 x 800"); // 6 ctrl_listbox_item_add(options_resolution, "1280 x 960"); // 7 ctrl_listbox_item_add(options_resolution, "1280 x 1024"); // 8 ctrl_listbox_item_add(options_resolution, "1360 x 765"); // 9 ctrl_listbox_item_add(options_resolution, "1360 x 768"); // 10 ctrl_listbox_item_add(options_resolution, "1440 x 900"); // 11 ctrl_listbox_item_add(options_resolution, "1600 x 900"); // 12 ctrl_listbox_item_add(options_resolution, "1600 x 1024"); // 13 ctrl_listbox_item_add(options_resolution, "1680 x 1050"); // 14 options_open = 1; } ctrl_text_create(options_window, 350, 52, "SELECTED RESOLUTION: " + string(ctrl_listbox_get_selection(options_resolution)), 250, fa_center, fa_middle, false); switch (ctrl_listbox_get_selection(options_resolution)) { case 0: sin_display_set(0, 640, 480, 32, 60); break; case 1: sin_display_set(0, 800, 600, 32, 60); break; case 2: sin_display_set(0, 1024, 768, 32, 60); break; case 3: sin_display_set(0, 800, 600, 32, 60); break; case 4: sin_display_set(0, 800, 600, 32, 60); break; case 5: sin_display_set(0, 800, 600, 32, 60); break; case 6: sin_display_set(0, 800, 600, 32, 60); break; case 7: sin_display_set(0, 800, 600, 32, 60); break; case 8: sin_display_set(0, 800, 600, 32, 60); break; case 9: sin_display_set(0, 800, 600, 32, 60); break; case 10: sin_display_set(0, 800, 600, 32, 60); break; case 11: sin_display_set(0, 800, 600, 32, 60); break; case 12: sin_display_set(0, 800, 600, 32, 60); break; case 13: sin_display_set(0, 800, 600, 32, 60); break; case 14: sin_display_set(0, 1680, 1050, 32, 60); break; } ctrl_event_set(options_window, ctrl_wd_close, 'options_open = 0;');
The show text part is just to see what it was returning, and it's always -1 for some reason I'm flabbergasted...
I think the listbox is working right, but the text always displays -1 because it isn't updated. You must set its text every step if you want it to show a variable.
Also, I'm rewriting this extension's code, to be compatible with GM8, fix most bugs and to be more customizable (each control can have different font/colors).
The new version will allow you to pass an expression to controls, so it's updated automatically every step.












