private void DrawProfileList_ListItem(ProfileData.Profile profile) { GUILayout.BeginHorizontal(); { GUILayout.Box(profile.name, GUILayout.ExpandWidth(true)); // rename button GUI.enabled = profile != ProfileManager.DefaultProfile; if (AudibleButton(new GUIContent(renameButton), GUILayout.MaxWidth(24), GUILayout.MinWidth(24))) { SpawnRenamePopup(profile); } // open button GUI.enabled = true; if (AudibleButton(new GUIContent(openButton), GUILayout.MaxWidth(24), GUILayout.MinWidth(24))) { SpawnOpenPopup(profile); } // delete button GUI.enabled = profile != ProfileManager.DefaultProfile; if (AudibleButton(new GUIContent(deleteButton), GUILayout.MaxWidth(24), GUILayout.MinWidth(24))) { SpawnDeletePopup(profile); } GUI.enabled = true; } GUILayout.EndHorizontal(); }
private void SpawnDeletePopup(ProfileData.Profile target) { editProfile = target; LockControls("ScienceAlertDeletePopup"); popup = PopupDialog.SpawnPopupDialog(new MultiOptionDialog(string.Empty, string.Format("Are you sure you want to\ndelete '{0}'?", target.name), HighLogic.Skin, new DialogOption("Confirm", DeleteTargetProfile), new DialogOption("Cancel", DismissPopup)), false, HighLogic.Skin); }
/// <summary> /// Renames the specified profile /// </summary> /// <param name="target"></param> /// <param name="clone"></param> private void SpawnRenamePopup(ProfileData.Profile target) { editProfile = target; editText = target.name; LockControls("ScienceAlertRenamePopup"); //popup = PopupDialog.SpawnPopupDialog(new MultiOptionDialog(string.Empty, DrawRenameWindow, string.Format("Rename '{0}' to:", ProfileManager.ActiveProfile.name), HighLogic.Skin, new DialogOption[] { new DialogOption("Rename", new Callback(RenameTargetProfile)), new DialogOption("Cancel", new Callback(DismissPopup)) }), false, HighLogic.Skin); popup = PopupDialog.SpawnPopupDialog(new MultiOptionDialog(string.Empty, DrawRenameWindow, string.Format("Rename '{0}' to:", target.name), HighLogic.Skin), false, HighLogic.Skin); }
public static void AssignProfile(FriendSelectControl fsc, ProfileData.Profile actor) { fsc.MouseEnter += (s, e) => { fsc.Background = Brushes.LightGray; }; fsc.MouseLeave += (s, e) => { fsc.Background = Brushes.Transparent; }; fsc.TB_Name.Text = actor.display_name; string imgUri = actor.profile_thumbnail_url; if (Properties.Settings.Default.GIFProfile && actor.profile_video_url_square_small != null) { imgUri = actor.profile_video_url_square_small; } GlobalHelper.AssignImage(fsc.IMG_Profile, imgUri); fsc.IMG_Profile.Tag = actor.id; fsc.IMG_Profile.MouseLeftButtonDown += GlobalHelper.SubContentMouseEvent; MainWindow.SetClickObject(fsc.Grid); if (actor.relationship.Equals("N")) { fsc.IC_Friend.Visibility = Visibility.Visible; MainWindow.SetClickObject(fsc.IC_Friend); fsc.IC_Friend.MouseLeftButtonDown += async(s, e) => { fsc.IC_Friend.Kind = MaterialDesignThemes.Wpf.PackIconKind.ProgressClock; await KakaoRequestClass.FriendRequest(actor.id, false); fsc.IC_Friend.Kind = MaterialDesignThemes.Wpf.PackIconKind.ProgressCheck; fsc.IC_Friend.IsEnabled = false; e.Handled = true; }; } if (actor.relationship.Equals("R")) { fsc.IC_Friend.Visibility = Visibility.Visible; fsc.IC_Friend.Kind = MaterialDesignThemes.Wpf.PackIconKind.PersonAdd; fsc.IC_Friend.Foreground = Brushes.OrangeRed; } }
public ProfileDataWindow(ProfileData.Profile profile) { InitializeComponent(); if(profile is null) { AddGrid("Loading...", ""); } else { AddGrid("Privacy State:", profile.privacyState); AddGrid("Visibility State:", profile.visibilityState); AddGrid("VAC Banned:", profile.vacBanned); AddGrid("Trade Banned:", profile.tradeBanState); AddGrid("Limited Account:", profile.isLimitedAccount); AddGrid("Member Since:", profile.memberSince); AddGrid("Hours Past 2 Weeks:", profile.hoursPlayed2Wk); AddGrid("Privacy Message:", profile.privacyMessage); AddGrid("CSGO Play Time:", profile.GetCSGO()?.hoursOnRecord); } }
private void SpawnOpenPopup(ProfileData.Profile target) { editProfile = target; LockControls("ScienceAlertOpenPopup"); popup = PopupDialog.SpawnPopupDialog(new MultiOptionDialog(string.Empty, string.Format("Load '{0}'?\nUnsaved settings will be lost.", editProfile.name), HighLogic.Skin, new DialogOption("Confirm", LoadTargetProfile), new DialogOption("Cancel", DismissPopup)), false, HighLogic.Skin); }