private DialogDefinition GetImageEditorDefinition(string[] paths) { var imageEditorParameters = new FileManagerDialogParameters { ViewPaths = paths, UploadPaths = paths, DeletePaths = paths, MaxUploadFileSize = _imageManagerConfiguration.MaxUploadFileSize, FileBrowserContentProviderTypeName = _imageManagerConfiguration.ContentProviderTypeName, SearchPatterns = _imageManagerConfiguration.SearchPatterns }; imageEditorParameters["IsSkinTouch"] = false; if (!String.IsNullOrEmpty(FileFilter)) { imageEditorParameters.SearchPatterns = FileFilter.Split(',').Select(v => v.Trim()).ToArray(); } var imageEditorDefinition = new DialogDefinition(typeof(ImageEditorDialog), imageEditorParameters) { Width = Unit.Pixel(832), Height = Unit.Pixel(500), Title = "Image Editor" }; imageEditorDefinition.Parameters["Language"] = Thread.CurrentThread.CurrentCulture.Name; imageEditorDefinition.Parameters["LocalizationPath"] = "~/DesktopModules/Admin/RadEditorProvider/App_LocalResources/"; return(imageEditorDefinition); }
private DialogDefinition GetDocumentManagerDefinition(string[] paths) { var documentManagerParameters = new FileManagerDialogParameters { ViewPaths = paths, UploadPaths = paths, DeletePaths = paths, MaxUploadFileSize = _documentManagerConfiguration.MaxUploadFileSize, FileBrowserContentProviderTypeName = _documentManagerConfiguration.ContentProviderTypeName, SearchPatterns = _documentManagerConfiguration.SearchPatterns }; documentManagerParameters["IsSkinTouch"] = false; if (!String.IsNullOrEmpty(GetMetaDataValue <string>("FileFilter"))) { documentManagerParameters.SearchPatterns = GetMetaDataValue <string>("FileFilter").Split(','); } var documentManagerDefinition = new DialogDefinition(typeof(DocumentManagerDialog), documentManagerParameters) { ClientCallbackFunction = "ToSexyContent.ItemForm.Hyperlink.DocumentManagerCallback", Width = Unit.Pixel(694), Height = Unit.Pixel(440), Title = "Document Manager" }; documentManagerDefinition.Parameters["Language"] = System.Threading.Thread.CurrentThread.CurrentCulture.Name; documentManagerDefinition.Parameters["LocalizationPath"] = "~/DesktopModules/Admin/RadEditorProvider/App_LocalResources/"; return(documentManagerDefinition); }
void OnDialogSelected(object index) { int i = (int)index; DialogDefinition dialog = dialogs[i]; SelectDialog(dialog); }
/// <summary> /// /// </summary> /// <param name="_dialogo"></param> /// <param name="_onEndCallback"></param> private void MostrarDialogo(DialogDefinition _dialogo, Action _onEndCallback) { if (_dialogo == null) { return; } else { GeneralSounds_menu.instance.playOneShot(GeneralSounds_menu.instance.logroDesbloqueadoClip); switch (_dialogo.tipoDialogo) { case DialogDefinition.TipoDialogo.JUGADOR_DESBLOQUEADO: ifcItemRevealDialog.instance.ShowJugadorDesbloqueado((Jugador)_dialogo.parametro, (_name) => { MostrarDialogosRegistradosPendientes(_onEndCallback); }); break; case DialogDefinition.TipoDialogo.EQUIPACION_DESBLOQUEADA: ifcItemRevealDialog.instance.ShowEquipacionDesbloqueada((Equipacion)_dialogo.parametro, (_name) => { MostrarDialogosRegistradosPendientes(_onEndCallback); }); break; case DialogDefinition.TipoDialogo.LOGRO_DESBLOQUEADO: ifcItemRevealDialog.instance.ShowLogroDesbloqueado((string)_dialogo.parametro, (_name) => { MostrarDialogosRegistradosPendientes(_onEndCallback); }); break; case DialogDefinition.TipoDialogo.ESCUDO_DESBLOQUEADO: ifcItemRevealDialog.instance.ShowEscudoDesbloqueado((Escudo)_dialogo.parametro, (_name) => { MostrarDialogosRegistradosPendientes(_onEndCallback); }); break; } } }
private DialogDefinition GetDocumentManagerDefinition(string[] paths) { var documentManagerParameters = new FileManagerDialogParameters { ViewPaths = paths, UploadPaths = paths, DeletePaths = paths, MaxUploadFileSize = _documentManagerConfiguration.MaxUploadFileSize, FileBrowserContentProviderTypeName = _documentManagerConfiguration.ContentProviderTypeName, SearchPatterns = _documentManagerConfiguration.SearchPatterns }; documentManagerParameters["IsSkinTouch"] = false; if (!String.IsNullOrEmpty(FileFilter)) documentManagerParameters.SearchPatterns = FileFilter.Split(',').Select(v => v.Trim()).ToArray(); var documentManagerDefinition = new DialogDefinition(typeof(DocumentManagerDialog), documentManagerParameters) { ClientCallbackFunction = "OnSelectedCallback", Width = Unit.Pixel(694), Height = Unit.Pixel(440), Title = "Document Manager" }; documentManagerDefinition.Parameters["Language"] = Thread.CurrentThread.CurrentCulture.Name; documentManagerDefinition.Parameters["LocalizationPath"] = "~/DesktopModules/Admin/RadEditorProvider/App_LocalResources/"; return documentManagerDefinition; }
public PreviewWindow(DialogDefinition dlg) { mDelegate = new Win32.DialogProcDelegate(DialogProc); mTemplate = new DialogTemplateEx(); ToStyle(dlg.ExStyle, ref mTemplate.exStyle); ToStyle(dlg.Style, ref mTemplate.style); // Ensure that we still show child windows, and do not center them mTemplate.style &= ~(WindowStyles.WS_CHILD | WindowStyles.DS_CENTER | WindowStyles.WS_DISABLED); // Enforce visibility mTemplate.style |= WindowStyles.WS_VISIBLE; mTemplate.style |= WindowStyles.DS_NOFAILCREATE; // HACK :) mTemplate.x = (short)dlg.Dimensions.Left; mTemplate.y = (short)dlg.Dimensions.Top; mTemplate.cx = (short)dlg.Dimensions.Width; mTemplate.cy = (short)dlg.Dimensions.Height; mTemplate.menu = null; mTemplate.windowClass = null; mTemplate.title = Cleanup(dlg.TextValue.Text); if (dlg.Font != null) { mTemplate.mFont = new Font() { Name = Cleanup(dlg.Font.Name), Size = dlg.Font.Size }; } uint id = 1; foreach (var dlgCtrl in dlg.Entries) { var ctrl = new DialogItemTemplateEx(); ctrl.exStyle = 0; ctrl.style = 0; ctrl.x = (short)dlgCtrl.Dimensions.Left; ctrl.y = (short)dlgCtrl.Dimensions.Top; ctrl.cx = (short)dlgCtrl.Dimensions.Width; ctrl.cy = (short)dlgCtrl.Dimensions.Height; ctrl.id = id++; ctrl.windowClass = ControlTypeToClass(dlgCtrl.EntryType.Name, Cleanup(dlgCtrl.GenericControlType), ref ctrl.style); ToStyle(dlgCtrl.Style, ref ctrl.style); ctrl.style |= WindowStyles.WS_CHILD | WindowStyles.WS_VISIBLE; ctrl.style &= ~WindowStyles.WS_POPUP; if (dlgCtrl.TextValue != null) { // FIXME: Ordinal for icon etc! ctrl.title = new sz_Or_Ord(Cleanup(dlgCtrl.TextValue?.Text)); } else { ctrl.title = null; } mTemplate.controls.Add(ctrl); } }
// Called by other friends to test if they are close and control the dialog as it's displayed and interacted with. // Moved this out of Update so it can be controlled better by the friend and what state they are in. public void Execute(string firstIcon = "", string secondIcon = "", string thirdIcon = "") { //Debug.Log("Dialog execute activate"); if (GlobalVariableManager.Instance.CARRYING_SOMETHING == false) { //Debug.Log("Criteria met - 0"); if (startNodeName.Length > 0 && player != null) { //Debug.Log("Criteria met - 1" + Mathf.Abs(transform.position.x - player.transform.position.x) +" " + Mathf.Abs(transform.position.y - player.transform.position.y)); if (Vector2.Distance(player.transform.position, gameObject.transform.position) < distanceThreshold) { //Debug.Log("Criteria met - 2"); if (autoStart && canTalkTo) { //Debug.Log("Criteria met - 3"); startNodeName = friend.nextDialog; ActivateDialog(firstIcon, secondIcon, thirdIcon); } else if (canTalkTo) { //Debug.Log("Autostart val:" + autoStart); //Debug.Log("canTalkTo val:" + canTalkTo); if (spawnSpeechBubble == 0) { speechBubbleIcon = ObjectPool.Instance.GetPooledObject("speechIcon", new Vector2(gameObject.transform.position.x + 2f, gameObject.transform.position.y)); spawnSpeechBubble = 1; } if (ControllerManager.Instance.GetKeyDown(INPUTACTION.INTERACT)) { if (dialogDefiniton == null) { dialogDefiniton = friend.myDialogDefiniton; } DialogManager.Instance.canContinueDialog = true; startNodeName = friend.nextDialog; ActivateDialog(firstIcon, secondIcon, thirdIcon); } } } else { //Debug.Log("Far away from: " + gameObject.name); if (spawnSpeechBubble == 1) { //Debug.Log("Speech Bubble should've died"); ObjectPool.Instance.ReturnPooledObject(speechBubbleIcon); spawnSpeechBubble = 0; //speechBubbleIcon.SetActive(false);//disable speech bubble icon when far away } } } }//end of carry something check }
/// <summary> /// Registra un dialogo a mostrar /// </summary> /// <param name="_dialogo"></param> public void RegistrarDialogo(DialogDefinition _dialogo) { if (_dialogo == null) { return; } else { m_colaDialogos.Enqueue(_dialogo); } }
static void SelectDialog(DialogDefinition dialog) { currentDialog = dialog; guidList = new List <SerializableGuid>(); foreach (var nodePair in currentDialog.nodes) { guidList.Add(nodePair.Key); } scrollPos = new Vector2(currentDialog.nodes[currentDialog.rootNodeId].x - 10, currentDialog.nodes[currentDialog.rootNodeId].y - 10); }
protected void Page_Load(object sender, EventArgs e) { var imageManagerParameters = new FileManagerDialogParameters { ViewPaths = new[] {"~/Images/projects"}, UploadPaths = new[] {"~/Images/projects"}, DeletePaths = new[] {"~/Images/projects"}, MaxUploadFileSize = 157286400 }; var imageManager = new DialogDefinition(typeof (ImageManagerDialog), imageManagerParameters) { ClientCallbackFunction = "ImageManagerFunction", Width = Unit.Pixel(694), Height = Unit.Pixel(440) }; DialogOpener1.DialogDefinitions.Add("ImageManager", imageManager); }
protected override void OnInit(EventArgs e) { base.OnInit(e); Skin = "Sitefinity"; FileManagerDialogParameters imageManagerParameters = new FileManagerDialogParameters(); imageManagerParameters.ViewPaths = new String[] { Settings.HtmlEditor.Downloads.Images }; imageManagerParameters.UploadPaths = new String[] { Settings.HtmlEditor.Downloads.Images }; imageManagerParameters.DeletePaths = new String[] { Settings.HtmlEditor.Downloads.Images }; imageManagerParameters.MaxUploadFileSize = 10485760; //imageManagerParameters.SearchPatterns = new String[] { "*.jpg", "*.png", "*.gif" }; DialogDefinition imageManager = new DialogDefinition(typeof(ImageManagerDialog), imageManagerParameters); imageManager.ClientCallbackFunction = "ImageManagerCallback"; imageManager.Width = Unit.Pixel(694); imageManager.Height = Unit.Pixel(440); DialogDefinitions.Add("ImageManager", imageManager); FileManagerDialogParameters documentManagerParameters = new FileManagerDialogParameters(); documentManagerParameters.ViewPaths = new String[] { Settings.HtmlEditor.Downloads.Documents }; documentManagerParameters.UploadPaths = new String[] { Settings.HtmlEditor.Downloads.Documents }; documentManagerParameters.DeletePaths = new String[] { Settings.HtmlEditor.Downloads.Documents }; documentManagerParameters.MaxUploadFileSize = 10485760; DialogDefinition documentManager = new DialogDefinition(typeof(DocumentManagerDialog), documentManagerParameters); documentManager.ClientCallbackFunction = "DocumentManagerCallback"; documentManager.Width = Unit.Pixel(694); documentManager.Height = Unit.Pixel(440); DialogDefinitions.Add("DocumentManager", documentManager); FileManagerDialogParameters imageEditorParameters = new FileManagerDialogParameters(); imageEditorParameters.ViewPaths = new String[] { Settings.HtmlEditor.Downloads.Images }; imageEditorParameters.UploadPaths = new String[] { Settings.HtmlEditor.Downloads.Images }; imageEditorParameters.DeletePaths = new String[] { Settings.HtmlEditor.Downloads.Images }; imageEditorParameters.MaxUploadFileSize = 10485760; DialogDefinition imageEditor = new DialogDefinition(typeof(ImageEditorDialog), imageEditorParameters); imageEditor.Width = Unit.Pixel(832); imageEditor.Height = Unit.Pixel(520); DialogDefinitions.Add("ImageEditor", imageEditor); }
protected void LoadCustomEditor() { Guid subId = SessionHelper.GetSession(SessionKey.SubDomain) == string.Empty ? Guid.Empty : new Guid(SessionHelper.GetSession(SessionKey.SubDomain)); if (!(subId == Guid.Empty)) { SubDomain subdomain = SubDomainCollection.GetSubDomainCollection().SingleOrDefault(sub => sub.Id == subId); if (subdomain == null) // homepage { Libs.Ultility.SettingEditor(reDescription, ""); Libs.Ultility.SettingEditor(reContent, ""); } else { Libs.Ultility.SettingEditor(reDescription, subdomain.Name); Libs.Ultility.SettingEditor(reContent, subdomain.Name); } } else { reContent.DocumentManager.SearchPatterns = new[] { "*.*" }; reContent.MediaManager.SearchPatterns = new[] { "*.*" }; reContent.FlashManager.SearchPatterns = new[] { "*.*" }; reContent.ImageManager.SearchPatterns = new[] { "*.*" }; reDescription.DocumentManager.SearchPatterns = new[] { "*.*" }; reDescription.MediaManager.SearchPatterns = new[] { "*.*" }; reDescription.FlashManager.SearchPatterns = new[] { "*.*" }; reDescription.ImageManager.SearchPatterns = new[] { "*.*" }; } FileManagerDialogParameters documentManagerParameters = new FileManagerDialogParameters(); documentManagerParameters.ViewPaths = new string[] { "~/Resources/AlbumBookSlider" }; documentManagerParameters.UploadPaths = new string[] { "~/Resources/AlbumBookSlider" }; documentManagerParameters.DeletePaths = new string[] { "~/Resources/AlbumBookSlider" }; documentManagerParameters.MaxUploadFileSize = 52428800; documentManagerParameters.SearchPatterns = new[] { "*.pdf" }; DialogDefinition documentManager = new DialogDefinition(typeof(DocumentManagerDialog), documentManagerParameters); documentManager.ClientCallbackFunction = "DocumentManagerFunction"; documentManager.Width = Unit.Pixel(694); documentManager.Height = Unit.Pixel(440); DialogOpener1.DialogDefinitions.Add("DocumentManager", documentManager); }
/// <summary> /// Muestra en cadena todos los dialogos registrados /// </summary> /// <param name="_onEndCallback">Accion a realizar cuando se muestren todos los dialogos</param> public void MostrarDialogosRegistradosPendientes(Action _onEndCallback) { Debug.Log(">>> MOSTRAR DIALOGOS PENDIENTES: " + m_colaDialogos.Count); if (m_colaDialogos.Count > 0) { // desencolar el primer dialogo y mostrarlo DialogDefinition dialogo = m_colaDialogos.Dequeue(); MostrarDialogo(dialogo, _onEndCallback); } else { // realizar la accion tras haber mostrado todos los dialogos if (_onEndCallback != null) { _onEndCallback(); } } }
public DialogNode(DialogDefinition definition, string p_title, string p_text, DIALOGNODETYPE p_type, float p_x, float p_y) { isCollapsed = false; title = p_title; speakerName = ""; question = ""; action = ""; isDialogAction = false; friendState = ""; id = Guid.NewGuid(); text = p_text; isThought = false; animTrigger = ""; type = p_type; responses = new List <DialogResponse>(); x = p_x; y = p_y; window = new Rect(x, y, defaultWindowWidth, 0); }
private void UpdatePreviewDialog(DialogDefinition dlg) { if (!_dialogPreviewEnabled) { return; } if (_previewDefinition == dlg) { return; } _previewDefinition = dlg; _previewWindow?.Close(); if (_previewDefinition != null) { _previewWindow = new Preview.PreviewWindow(dlg); _previewWindow.Closed += (s, e) => { Interlocked.CompareExchange(ref _previewWindow, null, s as Preview.PreviewWindow); }; _previewWindow.Show(); } }
private void FileContents_OnSelectionChanged(object sender, RoutedEventArgs e) { var s = FileContents.SelectedItems.Cast <FileLineItem>().SelectMany(i => i.Tag.Strings).Distinct().ToList(); DialogDefinition previewDlg = null; if (s.Count == 1) { var item = s.First(); CurrentDetails = item.String.CreateDetailsDocument(NavigateToTranslation, NavigateToFile); previewDlg = item.Entry as DialogDefinition; if (previewDlg == null) { var parent = item.String?.Parent; if (parent != null) { foreach (var parentRef in item.Source.NamedLines.Values) { if (parentRef.Id == parent.Name) { previewDlg = parentRef.Entry as DialogDefinition; } } } } } else if (FoldersTree.SelectedItem is LangFile) { var f = FoldersTree.SelectedItem as LangFile; CurrentDetails = f.CreateDetailsDocument(NavigateToTranslation); } else { CurrentDetails = new ObservableCollection <FileLineItem>(); } UpdatePreviewDialog(previewDlg); }
private DialogDefinition DialogStatement(ExpressionValue ident, bool isEx) { var ctx = PopExpected(isEx ? Tokens.DialogEx : Tokens.Dialog); if (Lexer.Peek() == Tokens.Discardable) { PopExpected(Tokens.Discardable); } var de = new DialogDefinition(); de.Identifier = ident; de.Context = ctx.Context; de.EntryType = ctx; de.Dimensions = Dimensions(); while (IsExpressionStartToken()) { Expression(); // ignore, we don't need it if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } } while (Lexer.Peek() != Tokens.LBrace && Lexer.Peek() != Tokens.Begin) { switch (Lexer.Peek()) { case Tokens.Style: { PopExpected(Tokens.Style); de.Style = StyleStatement(); if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } } break; case Tokens.ExStyle: { PopExpected(Tokens.ExStyle); de.ExStyle = StyleStatement(); if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } } break; case Tokens.Font: { PopExpected(Tokens.Font); var size = PopExpected(Tokens.Double, Tokens.Integer); double sizeVal; double.TryParse(size.Text, out sizeVal); if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } var name = PopExpected(Tokens.String); if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } de.Font = new Font() { Name = name.Text, Size = (float)sizeVal }; } break; case Tokens.Caption: { PopExpected(Tokens.Caption); var caption = PopExpected(Tokens.String); de.TextValue = caption; if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } } break; case Tokens.Menu: { PopExpected(Tokens.Menu); Expression(); if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } } break; case Tokens.LBrace: case Tokens.Begin: break; default: throw new ParserException(this, $"Internal Error: Unexpected Look-Ahead {Lexer.Peek(0)}"); } // Ignore all remaining expressions while (IsExpressionStartToken()) { var expr = Expression(); // ignore, we don't need it if (Lexer.Peek() == Tokens.Comma) { PopExpected(Tokens.Comma); } } } PopExpected(Tokens.LBrace, Tokens.Begin); while (Lexer.Peek() != Tokens.RBrace && Lexer.Peek() != Tokens.IdEnd) { var dc = DialogControlEntry(); if (dc != null) { de.Entries.Add(dc); } } PopExpected(Tokens.RBrace, Tokens.IdEnd); return(de); }
static void ClearDialogs() { dialogs = new List <DialogDefinition>(); currentDialog = null; }
private DialogDefinition GetImageManagerDefinition(string[] paths) { var imageManagerParameters = new FileManagerDialogParameters { ViewPaths = paths, UploadPaths = paths, DeletePaths = paths, MaxUploadFileSize = _imageManagerConfiguration.MaxUploadFileSize, FileBrowserContentProviderTypeName = _imageManagerConfiguration.ContentProviderTypeName, SearchPatterns = _imageManagerConfiguration.SearchPatterns, }; imageManagerParameters["IsSkinTouch"] = false; if (!String.IsNullOrEmpty(GetMetaDataValue<string>("FileFilter"))) imageManagerParameters.SearchPatterns = GetMetaDataValue<string>("FileFilter").Split(','); var imageManagerDefinition = new DialogDefinition(typeof(ImageManagerDialog), imageManagerParameters) { ClientCallbackFunction = "ToSexyContent.ItemForm.Hyperlink.ImageManagerCallback", Width = Unit.Pixel(694), Height = Unit.Pixel(440), Title = "Image Manager" }; imageManagerDefinition.Parameters["Language"] = Thread.CurrentThread.CurrentCulture.Name; imageManagerDefinition.Parameters["LocalizationPath"] = "~/DesktopModules/Admin/RadEditorProvider/App_LocalResources/"; return imageManagerDefinition; }
public void SetDialog(DialogDefinition dd) { dialogDefiniton = dd; Debug.Log("**MY DIALOG DEFINITION***" + dialogDefiniton.name); }