public WorkspaceAddEditDialog(Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace, Microsoft.TeamFoundation.Client.ProjectCollection projectCollection) { this.projectCollection = projectCollection; if (workspace == null) { _action = DialogAction.Create; } else { this._workspace = workspace; _action = DialogAction.Edit; } _workingFoldersStore = new ListStore(_tfsFolder, _localFolder); BuildGui(); }
// Use this for initialization void Start() { if (PossibleDialog == null) { print("Dialog : " + GameObject.FindGameObjectWithTag("Dialog").tag); PossibleDialog = GameObject.FindGameObjectWithTag("Dialog").GetComponents<DialogAction>(); print("Possible :" + PossibleDialog); } if (!Dialog) { print("Select Dialog"); int r = (int)Math.Round(UnityEngine.Random.Range(0f, (float) PossibleDialog.Length-1)); Dialog = PossibleDialog[r]; } _movePlayer = GameObject.FindWithTag("Player").GetComponent<MovePlayer>(); }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Console.WriteLine(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (TypeDialog == "EditComment") { if (p1 == DialogAction.Positive) { if (Methods.CheckConnectivity()) { var data = MAdapter.CommentList.FirstOrDefault(a => a.Id == ItemComments?.Id); if (data != null) { //Send api delete PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Activities.EditCommentActivity_Http(ItemActivity.Id, data.Text) }); } } else { Toast.MakeText(Activity, Activity.GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } else { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } } catch (Exception e) { Console.WriteLine(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { switch (TypeDialog) { case "ShareToMyTimeline": { Intent intent = new Intent(Context, typeof(SharePostActivity)); intent.PutExtra("ShareToType", "MyTimeline"); //intent.PutExtra("ShareToMyTimeline", ""); intent.PutExtra("PostObject", JsonConvert.SerializeObject(DataPost)); //PostDataObject Context.StartActivity(intent); Dismiss(); break; } } } else if (p1 == DialogAction.Neutral) { switch (TypeDialog) { case "ShareToGroup": Context.StartActivity(new Intent(Context, typeof(CreateGroupActivity))); break; case "ShareToPage": Context.StartActivity(new Intent(Context, typeof(CreatePageActivity))); break; } } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { Toast.MakeText(Activity, Activity.GetText(Resource.String.Lbl_You_will_be_logged), ToastLength.Long)?.Show(); ApiRequest.Logout(Activity); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { Toast.MakeText(ActivityContext, GetText(Resource.String.Lbl_You_will_be_logged), ToastLength.Long).Show(); ApiRequest.Logout(ActivityContext); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Console.WriteLine(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { switch (TypeDialog) { case "DeleteAccount" when p1 == DialogAction.Positive: { var intent = new Intent(ActivityContext, typeof(DeleteAccountActivity)); ActivityContext.StartActivity(intent); break; } case "DeleteAccount": { if (p1 == DialogAction.Negative) { p0.Dismiss(); } break; } default: { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } break; } } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
//Show user option to save current craft or carry on loading internal void load_craft_confirm_dialog(DialogAction action) { string resp = ""; show_dialog("Confirm Load", "The Current Craft has unsaved changes", d => { section((w) => { button("Save Current Craft first", "button.continue_with_save", () => { string path = ShipConstruction.GetSavePath(EditorLogic.fetch.ship.shipName); EditorLogic.fetch.ship.SaveShip().Save(path); action(); resp = "200"; }); button("Continue Without Saving", "button.continue_no_save", () => { action(); resp = "200"; }); }); GUILayout.Space(10); button("Cancel", "button.cancel_load", close_dialog); return(resp); }); }
//**KerbalX Specific Dialogs**// internal void download_confirm_dialog(DialogAction action = null) { string resp = ""; show_dialog("Overwrite", "A Craft with this name already exists", d => { section(() => { button("Replace Existing Craft", "button.continue_with_save", () => { download(true, true, action); resp = "200"; }); button("Load Craft (without saving)", "button.continue_no_save", () => { load_craft("dl_load_no_save"); resp = "200"; }); }); GUILayout.Space(10); button("Cancel", "button.cancel_load", close_dialog); return(resp); }); }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { var Intent = new Intent(ActivityContext, typeof(DeleteAccount_Activity)); StartActivity(Intent); ((Tabbed_Main_Activity)ActivityContext).JobRescheduble.StopJob(); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Crashes.TrackError(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (TypeDialog == "Login") { if (p1 == DialogAction.Positive) { ActivityContext.StartActivity(new Intent(ActivityContext, typeof(LoginActivity))); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } } catch (Exception e) { Console.WriteLine(e); } }
public Transform CreateDialogWindow(string windowTypeName, string header, DialogAction <DialogCancelArgs> okAction, DialogAction <DialogCancelArgs> cancelAction, float minWidth, float minHeight, float preferredWidth, float preferredHeight, bool canResize = true) { WindowDescriptor wd; GameObject content; bool isDialog; Transform window = CreateWindow(windowTypeName, out wd, out content, out isDialog); if (!window) { return(window); } if (isDialog) { if (header == null) { header = wd.Header; } Dialog dialog = m_dialogManager.ShowDialog(wd.Icon, header, content.transform, okAction, m_localization.GetString("ID_RTEditor_WM_Dialog_OK", "OK"), cancelAction, m_localization.GetString("ID_RTEditor_WM_Dialog_Cancel", "Cancel"), minWidth, minHeight, preferredWidth, preferredHeight, canResize); dialog.IsCancelVisible = false; dialog.IsOkVisible = false; } else { throw new ArgumentException(windowTypeName + " is not a dialog"); } ActivateContent(wd, content); return(window); }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (TypeDialog == "PostPrivacy") { if (p1 == DialogAction.Positive) { p0.Dismiss(); } } else if (TypeDialog == "PostBack") { if (p1 == DialogAction.Positive) { p0.Dismiss(); Finish(); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } else { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { if (ItemSessionsDataObject == null) { return; } var index = MAdapter.SessionsList.IndexOf(MAdapter.SessionsList.FirstOrDefault(a => a.Id == ItemSessionsDataObject.Id)); if (index == -1) { return; } MAdapter.SessionsList.Remove(ItemSessionsDataObject); MAdapter.NotifyItemRemoved(index); if (Methods.CheckConnectivity()) { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Global.DeleteSessionsAsync(ItemSessionsDataObject.Id) }); } else { Toast.MakeText(this, GetText(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Long).Show(); } } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Console.WriteLine(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (TypeDialog == "PostPrivacy") { if (p1 == DialogAction.Positive) { p0.Dismiss(); } } else if (TypeDialog == "PostBack") { if (p1 == DialogAction.Positive) { p0.Dismiss(); Finish(); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } else { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } } catch (Exception e) { Crashes.TrackError(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { // Check if we're running on Android 5.0 or higher if ((int)Build.VERSION.SdkInt < 23) { Toast.MakeText(Activity, Activity.GetText(Resource.String.Lbl_You_will_be_logged), ToastLength.Long).Show(); API_Request.Logout(Activity); } else { if (Activity.CheckSelfPermission(Manifest.Permission.ReadExternalStorage) == Permission.Granted && Activity.CheckSelfPermission(Manifest.Permission.WriteExternalStorage) == Permission.Granted) { Toast.MakeText(Activity, Activity.GetText(Resource.String.Lbl_You_will_be_logged), ToastLength.Long).Show(); API_Request.Logout(Activity); } else { RequestPermissions(new[] { Manifest.Permission.ReadExternalStorage, Manifest.Permission.WriteExternalStorage }, 101); } } } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Crashes.TrackError(e); } }
public void Init(string title, string message, DialogAction dialogAction, string dismissMessage) { currentAction = dialogAction; txtTitle.text = title; txtMessage.text = '"' + message + '"'; dismissButton.SetActive(true); txtDismissButton.text = dismissMessage; exitToMainMenuButton.SetActive(false); nextLevelButton.SetActive(false); restartLevelButton.SetActive(false); retryButton.SetActive(false); if (dialogAction == DialogAction.MainMenu) { exitToMainMenuButton.SetActive(true); } else if (dialogAction == DialogAction.NextLevel) { dismissButton.SetActive(false); nextLevelButton.SetActive(true); } else if (dialogAction == DialogAction.Restart) { dismissButton.SetActive(false); exitToMainMenuButton.SetActive(true); restartLevelButton.SetActive(true); } else if (dialogAction == DialogAction.GameFinished) { exitToMainMenuButton.SetActive(true); dismissButton.SetActive(false); restartLevelButton.SetActive(true); } else if (dialogAction == DialogAction.Retry) { retryButton.SetActive(true); } animator.SetTrigger("Show"); Time.timeScale = 0f; }
public static DXMessageBox Show(string message, string caption, DialogAction action = DialogAction.None) { DXMessageBox box = new DXMessageBox(message, caption); switch (action) { case DialogAction.None: break; case DialogAction.Close: box.OKButton.MouseClick += (o, e) => CEnvir.Target.Close(); box.CloseButton.MouseClick += (o, e) => CEnvir.Target.Close(); break; case DialogAction.ReturnToLogin: box.OKButton.MouseClick += (o, e) => CEnvir.ReturnToLogin(); box.CloseButton.MouseClick += (o, e) => CEnvir.ReturnToLogin(); break; } return(box); }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { if (TypeDialog == "ShareToMyTimeline") { Intent intent = new Intent(Context, typeof(SharePostActivity)); intent.PutExtra("ShareToType", "MyTimeline"); //intent.PutExtra("ShareToMyTimeline", ""); intent.PutExtra("PostObject", JsonConvert.SerializeObject(DataPost)); //PostDataObject Context.StartActivity(intent); Dismiss(); } } else if (p1 == DialogAction.Neutral) { if (TypeDialog == "ShareToGroup") { Context.StartActivity(new Intent(Context, typeof(CreateGroupActivity))); } else if (TypeDialog == "ShareToPage") { Context.StartActivity(new Intent(Context, typeof(CreatePageActivity))); } } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { Console.WriteLine(e); } }
public MoveSaveCategory(DialogAction action, BindingList <Category> categories, string originalCategory, SaveState originalSave) : this() { _action = action; Categories = categories; OriginalCategory = originalCategory; _originalSave = originalSave; if (_action == DialogAction.Move) { Text = MOVETITLE; MoveSave.Text = MOVEBUTTON; } else { Text = COPYTITLE; MoveSave.Text = COPYBUTTON; } _categoryNames = new BindingList <string>(Categories.Select(o => o.CategoryName).Where(o => !string.Equals(o, originalCategory, StringComparison.InvariantCulture)).ToList()); BindCategories(); NewCategory = _categoryNames[0]; }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { ((AddPostActivity)Activity)?.RemoveLocation(); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } else if (p1 == DialogAction.Neutral) { //Open intent Location when the request code of result is 502 new IntentController(Activity).OpenIntentLocation(); } } catch (Exception e) { Console.WriteLine(e); } }
private Dialog ShowDialog(Sprite icon, string header, DialogAction <DialogCancelArgs> okAction = null, string okText = "OK", DialogAction <DialogCancelArgs> cancelAction = null, string cancelText = "Cancel", float minWidth = 350, float minHeight = 115, float preferredWidth = 350, float preferredHeight = 100, bool canResize = false) { if (m_dialogStack.Count > 0) { Dialog previousDialog = m_dialogStack.Peek(); previousDialog.Hide(); } Dialog dialog = Instantiate(m_dialogPrefab); dialog.name = "Dialog " + header; dialog.Icon = icon; dialog.HeaderText = header; dialog.OkAction = okAction; dialog.OkText = okText; if (cancelAction != null) { dialog.CancelAction = cancelAction; dialog.CancelText = cancelText; dialog.IsCancelVisible = true; } else { dialog.IsCancelVisible = false; } dialog.Closed += OnDestroyed; return(dialog); }
public override void OnAction(DialogAction dialogAction, object data) { switch (dialogAction) { case DialogAction.Close: case DialogAction.BackButton: ChangeState(null); break; case DialogAction.Previous: if (previousS != null) { ChangeState(previousS); } else { ChangeState(Main.Ins.DialogStateManager.MainMenuState); } break; default: break; } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { ((AddPostActivity)Activity)?.RemoveLocation(); ((PostSharingActivity)Activity)?.RemoveLocation(); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } else if (p1 == DialogAction.Neutral) { //Open intent Location when the request code of result is 502 new IntentController(Activity).OpenIntentLocation(); } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public override void Fail(string?message, string?detailMessage) { // top 4 frames are TraceListener implementation details, so we need to skip them to get to the Debug.Assert call var stackTrace = new StackTrace(4, true); var vm = new AssertionViewModel(message ?? string.Empty, detailMessage ?? string.Empty, stackTrace.ToString()); DialogAction action = ShowAssertDialog(vm); switch (action) { case DialogAction.Quit: string exitMessage = message + (detailMessage?.Length > 0 ? Environment.NewLine + detailMessage : null); Environment.FailFast(exitMessage); break; case DialogAction.Debug: if (!Debugger.IsAttached) { Debugger.Launch(); } Debugger.Break(); break; } }
internal void download(bool save = true, bool force_overwrite = false, DialogAction action = null) { CraftData craft = CraftData.selected_craft; if (craft != null && craft.remote) { if (save) { KerbalX.ensure_ship_folders_exist(current_save_dir); if (!File.Exists(craft.path) || force_overwrite) { KerbalX.download(craft.remote_id, craft_file => { craft_file.Save(craft.path); craft.exists_locally = true; if (action != null) { action(); } }); } else { CraftManager.main_ui.download_confirm_dialog(action); } } else { KerbalX.download(craft.remote_id, craft_file => { string temp_path = Paths.joined(CraftManager.ksp_root, "GameData", "CraftManager", "temp.craft"); craft_file.Save(temp_path); EditorLogic.LoadShipFromFile(temp_path); File.Delete(temp_path); }); } } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { switch (TypeDialog) { case "DeleteComment" when p1 == DialogAction.Positive: MainContext?.RunOnUiThread(() => { try { switch (TypeClass) { case "Comment": { //TypeClass var adapterGlobal = ArticlesViewActivity.GetInstance()?.MAdapter; var dataGlobal = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id); if (dataGlobal != null) { var index = adapterGlobal.CommentList.IndexOf(dataGlobal); switch (index) { case > -1: adapterGlobal.CommentList.RemoveAt(index); adapterGlobal.NotifyItemRemoved(index); break; } } if (!Methods.CheckConnectivity()) { Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } else { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Article.DeleteCommentAsync(CommentObject.BlogId, CommentObject.Id) }); } break; } case "Reply": { //TypeClass var adapterGlobal = ReplyCommentBottomSheet.GetInstance()?.MAdapterArticles; var dataGlobal = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id); if (dataGlobal != null) { var index = adapterGlobal.CommentList.IndexOf(dataGlobal); switch (index) { case > -1: adapterGlobal.CommentList.RemoveAt(index); adapterGlobal.NotifyItemRemoved(index); break; } } if (!Methods.CheckConnectivity()) { Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } else { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Article.DeleteCommentAsync(CommentObject.BlogId, CommentObject.Id, "reply_delete") }); } break; } } Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CommentSuccessfullyDeleted), ToastLength.Short)?.Show(); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }); break; case "DeleteComment": { if (p1 == DialogAction.Negative) { p0.Dismiss(); } break; } default: { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } break; } } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
public void OnClick(MaterialDialog p0, DialogAction p1) { try { if (TypeDialog == "DeleteComment") { if (p1 == DialogAction.Positive) { MainContext.RunOnUiThread(() => { try { if (TypeClass == "Comment") { //TypeClass var adapterGlobal = VideoViewerActivity.GetInstance()?.TabVideosComment?.MAdapter; var dataGlobal = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id); if (dataGlobal != null) { var index = adapterGlobal.CommentList.IndexOf(dataGlobal); if (index > -1) { adapterGlobal.CommentList.RemoveAt(index); adapterGlobal.NotifyItemRemoved(index); } } if (!Methods.CheckConnectivity()) { Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } else { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Movies.DeleteCommentAsync(CommentObject.MovieId, CommentObject.Id) }); } } else if (TypeClass == "Reply") { //TypeClass var adapterGlobal = VideoViewerActivity.GetInstance()?.ReplyFragment?.MAdapterMovies; var dataGlobal = adapterGlobal?.CommentList?.FirstOrDefault(a => a.Id == CommentObject?.Id); if (dataGlobal != null) { var index = adapterGlobal.CommentList.IndexOf(dataGlobal); if (index > -1) { adapterGlobal.CommentList.RemoveAt(index); adapterGlobal.NotifyItemRemoved(index); } } if (!Methods.CheckConnectivity()) { Toast.MakeText(MainContext, MainContext.GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short)?.Show(); } else { PollyController.RunRetryPolicyFunction(new List <Func <Task> > { () => RequestsAsync.Movies.DeleteCommentAsync(CommentObject.MovieId, CommentObject.Id, "reply_delete") }); } } Toast.MakeText(MainContext, MainContext.GetText(Resource.String.Lbl_CommentSuccessfullyDeleted), ToastLength.Short)?.Show(); } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }); } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } else { if (p1 == DialogAction.Positive) { } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } } catch (Exception e) { Methods.DisplayReportResultTrack(e); } }
private void IgnoreButton_Click(object sender, RoutedEventArgs e) { Action = DialogAction.Ignore; Close(); }
private void ShowDialog(DialogAction action) { Microsoft.TeamFoundation.VersionControl.Client.Workspace workspace = null; if (action == DialogAction.Edit) { string workspaceName = _listStore.GetValue(_listView.SelectedRow, _name); workspace = WorkspaceHelper.GetWorkspace(this.projectCollection, workspaceName); } using (var dialog = new WorkspaceAddEditDialog(workspace, this.projectCollection)) { if (dialog.Run(this) == Command.Ok) { FillWorkspaces(); } } }
IList<GameState> GetScene2List() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.mainCamera.GetComponent<DialogManager>(); SoundManager soundManager = GameObject.Find ("SoundManager").GetComponent<SoundManager> (); GameObject person = GameObject.Find ("person"); soundManager.addSound (new Sound ("Assets/Sounds/surreal_sound4.mp3", "surrealSound")); GameObject obj = GameObject.Find ("Main Camera"); if (obj == null) { Debug.Log ("couldn't find Main Camera"); } ParallelAction hallu = new ParallelAction (new CameraInvertAction(), new SoundAction("surrealSound", true)); SequentialAction visitor = new SequentialAction ( new ChildSelectorAction("Sibling", "normalpose"), new DialogAction("Sibling: I’m glad to see you’re awake."), new DialogAction("Sibling: We’re in St. Paul’s Hospital which works with Lydersen Labs to develop pharmaceuticals."), new DialogAction("Sibling: Actually, I work here, but in the research side with people from Lydersen.") ); DialogAction WorldExpo = new DialogAction ("I’m your brother. Uh, I don’t know what to say… I work here and, \n" + "um, I do research in epigenetics. \n" + "This never happened before… I didn’t think that — the doctor did say you might…"); if (dialog == null) { Debug.Log("null pointer with dialog"); } return new List<GameState> { new GameState( "hallucination", new Dictionary<Trigger, string>() { {new NodTrigger(), "Visitor"} },hallu ), new GameState( "Visitor", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question1Prompt"} }, visitor, hallu ), new GameState( "question1Prompt", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "question1"}}, new SequentialAction(new DialogAction("Sibling: We were really worried we were going to lose you, and there’s barely enough people around as it is…"), new DialogAction("Sibling: Do you remember your name?")) ), new GameState( "question1", new Dictionary<Trigger, string>(){ {new NodTrigger(), "question2prompt"}, {new ShakeTrigger(), "question3prompt"} }, new NoAction() ), new GameState( "question2prompt", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "question2"}}, new DialogAction("Sibling: See, I knew the doctor was worrying too much. In that case, you remember me, right?") ), new GameState( "question2", new Dictionary<Trigger, string>(){ {new NodTrigger(), "scene3Hallucinate"}, {new ShakeTrigger(), "question2No"} }, new NoAction() ), new GameState( "question2No", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "WorldExpo"}}, new DialogAction("I- um. I, well") ), new GameState( "question3prompt", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "question3"}}, new DialogAction("Sibling: Wait, really? But that — In that case, do you remember me?") ), new GameState( "question3", new Dictionary<Trigger, string>(){ {new NodTrigger(), "question3Yes"}, {new ShakeTrigger(), "question2No"} }, new NoAction() ), new GameState( "question3Yes", new Dictionary<Trigger, string>(){{new MainActionFinishedTrigger(), "scene3Hallucinate"}}, new DialogAction("Sibling: But then, how do — no, nevermind.") ), new GameState( "WorldExpo", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "scene3Hallucinate"}, }, WorldExpo ) }; }
public Builder SetBtnSelector(int selectorRes, DialogAction which) { switch (which) { default: this.BtnSelectorPositive = selectorRes; break; case DialogAction.Neutral: this.BtnSelectorNeutral = selectorRes; break; case DialogAction.Negative: this.BtnSelectorNegative = selectorRes; break; } return this; }
public void SetActionButton(DialogAction which, int titleRes) { SetActionButton(which, Context.GetText(titleRes)); }
public void SetActionButton(DialogAction which, string title) { switch (which) { default: { MBuilder.PositiveText = title; PositiveButton.Text = title; PositiveButton.Visibility = title == null ? ViewStates.Gone : ViewStates.Visible; } break; case DialogAction.Neutral: { MBuilder.NeutralText = title; NeutralButton.Text = title; NeutralButton.Visibility = title == null ? ViewStates.Gone : ViewStates.Visible; } break; case DialogAction.Negative: { MBuilder.NegativeText = title; NegativeButton.Text = title; NegativeButton.Visibility = title == null ? ViewStates.Gone : ViewStates.Visible; } break; } }
public async void OnClick(MaterialDialog p0, DialogAction p1) { try { if (p1 == DialogAction.Positive) { if (!Methods.CheckConnectivity()) { Toast.MakeText(this, GetString(Resource.String.Lbl_CheckYourInternetConnection), ToastLength.Short).Show(); } else { if (Type == "Exit") { //Show a progress AndHUD.Shared.Show(this, GetText(Resource.String.Lbl_Loading)); var(apiStatus, respond) = await RequestsAsync.GroupChat.ExitGroupChat(GroupId); if (apiStatus == 200) { if (respond is AddOrRemoveUserToGroupObject result) { Console.WriteLine(result.MessageData); Toast.MakeText(this, GetString(Resource.String.Lbl_GroupSuccessfullyLeaved), ToastLength.Short).Show(); //remove new item to my Group list if (AppSettings.LastChatSystem == SystemApiGetLastChat.New) { var adapter = GlobalContext?.LastChatTab.MAdapter; var data = adapter?.ChatList?.FirstOrDefault(a => a.GroupId == GroupId); if (data != null) { adapter.ChatList.Remove(data); adapter.NotifyItemRemoved(adapter.ChatList.IndexOf(data)); } } else { var adapter = GlobalContext?.LastGroupChatsTab.MAdapter; var data = adapter?.LastGroupList?.FirstOrDefault(a => a.GroupId == GroupId); if (data != null) { adapter.LastGroupList.Remove(data); adapter.NotifyItemRemoved(adapter.LastGroupList.IndexOf(data)); } } AndHUD.Shared.ShowSuccess(this); Finish(); } } else { if (respond is ErrorObject error) { var errorText = error.Error.ErrorText; //Show a Error AndHUD.Shared.ShowError(this, errorText, MaskType.Clear, TimeSpan.FromSeconds(2)); } //Methods.DisplayReportResult(this, respond); } } else if (Type == "Delete") { //Show a progress AndHUD.Shared.Show(this, GetText(Resource.String.Lbl_Loading)); var(apiStatus, respond) = await RequestsAsync.GroupChat.DeleteGroupChat(GroupId); if (apiStatus == 200) { if (respond is AddOrRemoveUserToGroupObject result) { Console.WriteLine(result.MessageData); Toast.MakeText(this, GetString(Resource.String.Lbl_GroupSuccessfullyDeleted), ToastLength.Short).Show(); //remove item to my Group list if (AppSettings.LastChatSystem == SystemApiGetLastChat.New) { var adapter = GlobalContext?.LastChatTab.MAdapter; var data = adapter?.ChatList?.FirstOrDefault(a => a.GroupId == GroupId); if (data != null) { adapter.ChatList.Remove(data); adapter.NotifyItemRemoved(adapter.ChatList.IndexOf(data)); } } else { var adapter = GlobalContext?.LastGroupChatsTab.MAdapter; var data = adapter?.LastGroupList?.FirstOrDefault(a => a.GroupId == GroupId); if (data != null) { adapter.LastGroupList.Remove(data); adapter.NotifyItemRemoved(adapter.LastGroupList.IndexOf(data)); } } AndHUD.Shared.ShowSuccess(this); Finish(); } } else { if (respond is ErrorObject error) { var errorText = error.Error.ErrorText; //Show a Error AndHUD.Shared.ShowError(this, errorText, MaskType.Clear, TimeSpan.FromSeconds(2)); } //Methods.DisplayReportResult(this, respond); } } else if (Type == "RemoveUser") { var itemUser = MAdapter.GetItem(Position); if (itemUser != null) { MAdapter.UserList.Remove(itemUser); MAdapter.NotifyItemRemoved(Position); var(apiStatus, respond) = await RequestsAsync.GroupChat .AddOrRemoveUserToGroup(GroupId, itemUser.UserId, "remove_user") .ConfigureAwait(false); if (apiStatus == 200) { } else { Methods.DisplayReportResult(this, respond); } } } } } else if (p1 == DialogAction.Negative) { p0.Dismiss(); } } catch (Exception e) { AndHUD.Shared.ShowSuccess(this); Console.WriteLine(e); } }
public View GetActionButton(DialogAction which) { switch (which) { default: return view.FindViewById(Resource.Id.buttonDefaultPositive); case DialogAction.Neutral: return view.FindViewById(Resource.Id.buttonDefaultNeutral); case DialogAction.Negative: return view.FindViewById(Resource.Id.buttonDefaultNegative); } }
/** * Creates the gameState for the PatientScene */ protected override IList<GameState> GetGameStatesList() { //Gets the Dialog object from the camera for the dialog action DialogManager dialog = Camera.mainCamera.GetComponent<DialogManager>(); SoundManager soundManager = GameObject.Find ("SoundManager").GetComponent<SoundManager> (); AnimationManager animationManager = GameObject.Find ("animationManager").GetComponent<AnimationManager> (); GameObject person = GameObject.Find ("person"); AnimationClip animation = person.GetComponent<Animation> ().GetClip ("Take 001"); soundManager.addSound (new Sound (person, "Assets\\surreal sounds 4.mp3", "surrealSound")); GameObject obj = GameObject.Find ("Main Camera"); if (obj == null) { Debug.Log ("couldn't find Main Camera"); } List<ActionRunner> surrealEffects = new List<ActionRunner> (); surrealEffects.Add (new CameraInvertAction()); surrealEffects.Add (new SoundAction("surrealSound", true)); ParallelAction hallu = new ParallelAction (surrealEffects); List<ActionRunner> list = new List<ActionRunner> (); list.Add (new DialogAction ("How long have you been awake? Uh, actually, first, do you know where you are?")); SequentialAction visitor = new SequentialAction (list); DialogAction no1 = new DialogAction ("Well, we’re in St. Paul’s Hospital. It works with Lydersen Labs to develop pharmaceuticals. " + "Actually, I work here, but in the research side with people from Lydersen."); DialogAction yes1 = new DialogAction ("Oh, okay, that’s good."); DialogAction no2 = new DialogAction ("That’s fine, I’m just glad you’re okay. You got " + "hit by a car. I don’t know exactly what happened, but you’ve been in a coma for a while."); DialogAction yes2 = new DialogAction ("Yeah, that was a pretty bad crash. We were worried you wouldn’t make it."); DialogAction preDoctorQs = new DialogAction ("Okay, you should remember who you are, right? " + "The doctor gave me these questions to ask you, just making sure you’re all here."); DialogAction no3 = new DialogAction ("Wait, really? But that — In that case, do you remember me? "); DialogAction yes3 = new DialogAction ("See, I knew the doctor was worrying too much. In that case, you remember me, right?"); DialogAction no4 = new DialogAction ("I- um. I, well."); DialogAction yes4 = new DialogAction ("But then, how do — no, nevermind."); DialogAction WorldExpo = new DialogAction ("I’m your brother. Uh, I don’t know what to say… I work here and, \n" + "um, I do research in epigenetics. \n" + "This never happened before… I didn’t think that — the doctor did say you might…"); DialogAction question2 = new DialogAction ("Do you remember anything about how you got here?"); NodTrigger nodTrigger = new NodTrigger (obj); ShakeTrigger shakeTrigger = new ShakeTrigger (obj); if (dialog == null) { Debug.Log("null pointer with dialog"); } return new List<GameState> { new GameState( "hallucination", new Dictionary<Trigger, string>() { {shakeTrigger, "Visitor"} },hallu ), new GameState( "Visitor", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "QATime1"} }, visitor, hallu ), new GameState( "QATime1", new Dictionary<Trigger, string>() { {shakeTrigger, "no1"}, {nodTrigger, "yes1"} }, new NoAction() ), new GameState( "no1", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question2"} }, no1 ), new GameState( "yes1", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question2"} }, yes1 ), new GameState( "question2", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "QATime2"} }, question2 ), new GameState( "QATime2", new Dictionary<Trigger, string>() { {shakeTrigger, "no2"}, {nodTrigger, "yes2"} }, new NoAction() ), new GameState( "no2", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question3"} }, no2 ), new GameState( "yes2", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "question3"} }, yes2 ), new GameState( "question3", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "preQATime3"} }, preDoctorQs ), new GameState( "preQATime3", new Dictionary<Trigger, string>() { {shakeTrigger, "question4_no"}, {nodTrigger, "question4_yes"} }, new NoAction() ), new GameState( "question4_no", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "no3"} }, no3 ), new GameState( "no3", new Dictionary<Trigger, string>() { {shakeTrigger, "no4"}, {nodTrigger, "Scene3"} }, new NoAction() ), new GameState( "question4_yes", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "yes3"} }, yes3 ), new GameState( "yes3", new Dictionary<Trigger, string>() { {shakeTrigger, "no4"}, {nodTrigger, "yes4"} }, new NoAction() ), new GameState( "no4", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "WorldExpo"}, }, no4 ), new GameState( "yes4", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "WorldExpo"}, }, yes4 ), new GameState( "WorldExpo", new Dictionary<Trigger, string>() { {new MainActionFinishedTrigger(), "Scene3"}, }, WorldExpo ), new GameState( "Scene3", new Dictionary<Trigger, string>() { }, new NoAction() ) }; }
public Drawable GetButtonSelector(DialogAction which, bool isStacked) { if (isStacked) { if (MBuilder.BtnSelectorStacked != 0) { return ResourcesCompat.GetDrawable(MBuilder.Context.Resources, MBuilder.BtnSelectorStacked, null); } Drawable d = DialogUtils.ResolveDrawable(MBuilder.Context, Resource.Attribute.sino_droid_md_btn_stacked_selector); if (d != null) return d; return DialogUtils.ResolveDrawable(Context, Resource.Attribute.sino_droid_md_btn_stacked_selector); } else { switch (which) { default: { if (MBuilder.BtnSelectorPositive != 0) { return ResourcesCompat.GetDrawable(MBuilder.Context.Resources, MBuilder.BtnSelectorPositive, null); } Drawable d = DialogUtils.ResolveDrawable(MBuilder.Context, Resource.Attribute.sino_droid_md_btn_positive_selector); if (d != null) return d; return DialogUtils.ResolveDrawable(Context, Resource.Attribute.sino_droid_md_btn_positive_selector); } case DialogAction.Neutral: { if (MBuilder.BtnSelectorNeutral != 0) return ResourcesCompat.GetDrawable(MBuilder.Context.Resources, MBuilder.BtnSelectorNeutral, null); Drawable d = DialogUtils.ResolveDrawable(MBuilder.Context, Resource.Attribute.sino_droid_md_btn_neutral_selector); if (d != null) return d; return DialogUtils.ResolveDrawable(Context, Resource.Attribute.sino_droid_md_btn_neutral_selector); } case DialogAction.Negative: { if (MBuilder.BtnSelectorNegative != 0) return ResourcesCompat.GetDrawable(MBuilder.Context.Resources, MBuilder.BtnSelectorNegative, null); Drawable d = DialogUtils.ResolveDrawable(MBuilder.Context, Resource.Attribute.sino_droid_md_btn_negative_selector); if (d != null) return d; return DialogUtils.ResolveDrawable(Context, Resource.Attribute.sino_droid_md_btn_negative_selector); } } } }