Пример #1
0
        public override void itemSelected(SelectMenu menu)
        {
            if (menu == renderMenu)
            {
                while (GameManager.Instance.trayMgr.getNumWidgets(renderMenu.getTrayLocation()) > 2)
                {
                    GameManager.Instance.trayMgr.destroyWidget(renderMenu.getTrayLocation(), 2);
                }
                uint            i       = 0;
                ConfigOptionMap options = GameManager.Instance.root.GetRenderSystemByName(renderMenu.getSelectedItem()).GetConfigOptions();
                foreach (var item in options)
                {
                    i++;
                    SelectMenu optionMenu = GameManager.Instance.trayMgr.createLongSelectMenu(
                        TrayLocation.TL_CENTER, "ConfigOption" + i.ToString(), item.Key, 450, 240, 10);
                    optionMenu.setItems(item.Value.possibleValues);

                    try
                    {
                        optionMenu.selectItem(item.Value.currentValue);
                    }
                    catch
                    {
                        optionMenu.addItem(item.Value.currentValue);
                        optionMenu.selectItem(item.Value.currentValue);
                    }
                }
            }
        }