private static void ViewModeChange(object userData) { ViewModeData <T> data = (ViewModeData <T>)userData; PresetLibraryEditor <T> .SettingsMenu.s_Owner.itemViewMode = data.viewmode; PresetLibraryEditor <T> .SettingsMenu.s_Owner.previewHeight = data.itemHeight; }
static void ViewModeChange(object userData) { ViewModeData viewModeData = (ViewModeData)userData; s_Owner.itemViewMode = viewModeData.viewmode; s_Owner.previewHeight = viewModeData.itemHeight; }
public static void Show(Rect activatorRect, PresetLibraryEditor <T> owner) { List <ViewModeData <T> > list; List <string> list2; List <string> list3; List <ViewModeData <T> > list4; ViewModeData <T> data; PresetLibraryEditor <T> .SettingsMenu.s_Owner = owner; GenericMenu menu = new GenericMenu(); int x = (int)PresetLibraryEditor <T> .SettingsMenu.s_Owner.minMaxPreviewHeight.x; int y = (int)PresetLibraryEditor <T> .SettingsMenu.s_Owner.minMaxPreviewHeight.y; if (x == y) { list4 = new List <ViewModeData <T> >(); data = new ViewModeData <T> { text = new GUIContent("Grid"), itemHeight = x, viewmode = PresetLibraryEditorState.ItemViewMode.Grid }; list4.Add(data); data = new ViewModeData <T> { text = new GUIContent("List"), itemHeight = x, viewmode = PresetLibraryEditorState.ItemViewMode.List }; list4.Add(data); list = list4; } else { list4 = new List <ViewModeData <T> >(); data = new ViewModeData <T> { text = new GUIContent("Small Grid"), itemHeight = x, viewmode = PresetLibraryEditorState.ItemViewMode.Grid }; list4.Add(data); data = new ViewModeData <T> { text = new GUIContent("Large Grid"), itemHeight = y, viewmode = PresetLibraryEditorState.ItemViewMode.Grid }; list4.Add(data); data = new ViewModeData <T> { text = new GUIContent("Small List"), itemHeight = x, viewmode = PresetLibraryEditorState.ItemViewMode.List }; list4.Add(data); data = new ViewModeData <T> { text = new GUIContent("Large List"), itemHeight = y, viewmode = PresetLibraryEditorState.ItemViewMode.List }; list4.Add(data); list = list4; } for (int i = 0; i < list.Count; i++) { bool on = (PresetLibraryEditor <T> .SettingsMenu.s_Owner.itemViewMode == list[i].viewmode) && (((int)PresetLibraryEditor <T> .SettingsMenu.s_Owner.previewHeight) == list[i].itemHeight); menu.AddItem(list[i].text, on, new GenericMenu.MenuFunction2(PresetLibraryEditor <T> .SettingsMenu.ViewModeChange), list[i]); } menu.AddSeparator(string.Empty); ScriptableSingleton <PresetLibraryManager> .instance.GetAvailableLibraries <T>(PresetLibraryEditor <T> .SettingsMenu.s_Owner.m_SaveLoadHelper, out list2, out list3); list2.Sort(); list3.Sort(); string str = PresetLibraryEditor <T> .SettingsMenu.s_Owner.currentLibraryWithoutExtension + "." + PresetLibraryEditor <T> .SettingsMenu.s_Owner.m_SaveLoadHelper.fileExtensionWithoutDot; string str2 = " (Project)"; foreach (string str3 in list2) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(str3); menu.AddItem(new GUIContent(fileNameWithoutExtension), str == str3, new GenericMenu.MenuFunction2(PresetLibraryEditor <T> .SettingsMenu.LibraryModeChange), str3); } foreach (string str5 in list3) { string str6 = Path.GetFileNameWithoutExtension(str5); menu.AddItem(new GUIContent(str6 + str2), str == str5, new GenericMenu.MenuFunction2(PresetLibraryEditor <T> .SettingsMenu.LibraryModeChange), str5); } menu.AddSeparator(string.Empty); menu.AddItem(new GUIContent("Create New Library..."), false, new GenericMenu.MenuFunction2(PresetLibraryEditor <T> .SettingsMenu.CreateLibrary), 0); if (PresetLibraryEditor <T> .SettingsMenu.HasDefaultPresets()) { menu.AddSeparator(string.Empty); menu.AddItem(new GUIContent("Add Factory Presets To Current Library"), false, new GenericMenu.MenuFunction2(PresetLibraryEditor <T> .SettingsMenu.AddDefaultPresetsToCurrentLibrary), 0); } menu.AddSeparator(string.Empty); menu.AddItem(new GUIContent("Reveal Current Library Location"), false, new GenericMenu.MenuFunction2(PresetLibraryEditor <T> .SettingsMenu.RevealCurrentLibrary), 0); menu.DropDown(activatorRect); }
public void SetViewMode(ViewMode mode, bool triggerResponse, ViewModeData userdata) { object[] objArray1 = new object[] { mode, triggerResponse, userdata }; base.method_9("SetViewMode", new Class272.Enum20[] { Class272.Enum20.ValueType }, objArray1); }
public void SetViewMode(ViewMode mode, ViewModeData userdata) { Class272.Enum20[] enumArray1 = new Class272.Enum20[] { Class272.Enum20.ValueType, Class272.Enum20.Class }; object[] objArray1 = new object[] { mode, userdata }; base.method_9("SetViewMode", enumArray1, objArray1); }
public void OnSwitchViewModeResponse(bool triggerResponse, ViewMode prevMode, ViewMode newMode, ViewModeData userdata) { object[] objArray1 = new object[] { triggerResponse, prevMode, newMode, userdata }; base.method_8("OnSwitchViewModeResponse", objArray1); }