private void AddFileList() { DropDown = ScrollableContent.AddUIComponent <FileDropDown>(); DropDown.atlas = TextureUtil.InGameAtlas; DropDown.height = 38; DropDown.width = Width - 2 * Padding; DropDown.listBackground = "OptionsDropboxListbox"; DropDown.itemHeight = 24; DropDown.itemHover = "ListItemHover"; DropDown.itemHighlight = "ListItemHighlight"; DropDown.normalBgSprite = "OptionsDropbox"; DropDown.hoveredBgSprite = "OptionsDropboxHovered"; DropDown.focusedBgSprite = "OptionsDropboxFocused"; DropDown.listWidth = (int)DropDown.width; DropDown.listHeight = 200; DropDown.listPosition = UIDropDown.PopupListPosition.Below; DropDown.clampListToScreen = true; DropDown.foregroundSpriteMode = UIForegroundSpriteMode.Stretch; DropDown.popupTextColor = new Color32(170, 170, 170, 255); DropDown.textScale = 1.25f; DropDown.textFieldPadding = new RectOffset(14, 40, 7, 0); DropDown.verticalAlignment = UIVerticalAlignment.Middle; DropDown.horizontalAlignment = UIHorizontalAlignment.Center; DropDown.itemPadding = new RectOffset(14, 14, 0, 0); DropDown.verticalAlignment = UIVerticalAlignment.Middle; DropDown.eventSelectedIndexChanged += DropDownIndexChanged; DropDown.triggerButton = DropDown; AddData(); DropDown.selectedIndex = 0; }
private void AddFileList() { DropDown = ScrollableContent.AddUIComponent <FileDropDown>(); DropDown.SetSettingsStyle(new Vector2(Width - 2 * Padding, 38)); DropDown.listWidth = (int)DropDown.width; DropDown.listHeight = 200; DropDown.itemPadding = new RectOffset(14, 14, 0, 0); DropDown.textScale = 1.25f; DropDown.clampListToScreen = true; DropDown.eventSelectedIndexChanged += DropDownIndexChanged; AddData(); DropDown.selectedIndex = 0; }