public MenuItem(string txt, Screen screenLink, LinkedEvent evLink, bool isEnabled) { enabled = isEnabled; text = txt; linksTo = screenLink; if (evLink != null) { eventLink = new InputEventHandler(evLink); } else { eventLink = null; } actionLink = null; }
public DialogItem(string txt, Dialog dialogLink, LinkedEvent evLink, LinkedAction act) { //enabled = true; text = txt; linksTo = dialogLink; if (evLink != null) { eventLink = new InputEventHandler(evLink); } else { eventLink = null; } if (act != null) { actionLink = act; } }
public MenuItem(string txt, Screen screenLink, LinkedEvent evLink, LinkedAction act) { enabled = true; text = txt; linksTo = screenLink; if (evLink != null) { eventLink = new InputEventHandler(evLink); } else { eventLink = null; } if (act != null) { actionLink = act; } }
/// <summary> /// Converts the <see cref="sourceValue" /> parameter to the <see cref="destinationType" /> parameter using <see cref="formatProvider" /// /> and <see cref="ignoreCase" /> /// </summary> /// <param name="sourceValue">the <see cref="System.Object"/> to convert from</param> /// <param name="destinationType">the <see cref="System.Type" /> to convert to</param> /// <param name="formatProvider">not used by this TypeConverter.</param> /// <param name="ignoreCase">when set to <c>true</c>, will ignore the case when converting.</param> /// <returns> /// an instance of <see cref="LinkedAction" />, or <c>null</c> if there is no suitable conversion. /// </returns> public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LinkedAction.CreateFrom(sourceValue);
public static DialogUI CreateYesNoDialog(string speaker, List <string> startText, LinkedAction yesAction, LinkedAction noAction) { FontSurface fnt = FontSurface.BitmapMonospace("Resources" + "/" + "monkey.png", new Size(6, 14)); Dialog initialDialog = new Dialog(speaker, startText, new List <DialogItem>()); DialogItem yesItem = new DialogItem("Yes", null, null, yesAction), noItem = new DialogItem("No", null, null, noAction); initialDialog.options.Add(yesItem); initialDialog.options.Add(noItem); initialDialog.setSize(); //attackChoices.menu.Add(new DialogItem("Scorch", null, Demo.OnKeyDown_SelectSkill)); DialogUI dui = new DialogUI(initialDialog, fnt); dui.allDialogItems.Add(yesItem); dui.allDialogItems.Add(noItem); return(dui); }
public static DialogUI CreateYesNoDialog(string speaker, List<string> startText, LinkedAction yesAction, LinkedAction noAction) { FontSurface fnt = FontSurface.BitmapMonospace("Resources" + "/" + "monkey.png", new Size(6, 14)); Dialog initialDialog = new Dialog(speaker, startText, new List<DialogItem>()); DialogItem yesItem = new DialogItem("Yes", null, null, yesAction), noItem = new DialogItem("No", null, null, noAction); initialDialog.options.Add(yesItem); initialDialog.options.Add(noItem); initialDialog.setSize(); //attackChoices.menu.Add(new DialogItem("Scorch", null, Demo.OnKeyDown_SelectSkill)); DialogUI dui = new DialogUI(initialDialog, fnt); dui.allDialogItems.Add(yesItem); dui.allDialogItems.Add(noItem); return dui; }