예제 #1
0
 /// <summary>
 /// Signals a Dialog to all listeners. (usually a UI)
 /// </summary>
 /// <param name="info">The dialog info to pass along.</param>
 public void SignalDialog(VMDialogInfo info)
 {
     if (OnDialog != null) OnDialog(info);
 }
 public static void ShowDialog(VMStackFrame context, VMDialogStringsOperand operand, STR source)
 {
     VMDialogInfo info = new VMDialogInfo
     {
         Caller = context.Caller,
         Icon = context.StackObject,
         Operand = operand,
         Message = ParseDialogString(context, source.GetString(operand.MessageStringID - 1), source),
         Title = (operand.TitleStringID == 0) ? "" : ParseDialogString(context, source.GetString(operand.TitleStringID - 1), source),
         IconName = (operand.IconNameStringID == 0) ? "" : ParseDialogString(context, source.GetString(operand.IconNameStringID - 1), source),
         Yes = (operand.YesStringID == 0) ? "Yes" : ParseDialogString(context, source.GetString(operand.YesStringID - 1), source),
     };
     context.VM.SignalDialog(info);
 }