/// <summary> /// Performs this dialog command if the condition is met /// </summary> /// <param name="context">The Lua context to use for performing this command</param> public void Perform(LuaContext context) { if (ConditionsMet(context)) { context.DoString(m_command); } }
/// <summary> /// Makes this scene go to it's first Dialog Output /// </summary> public void GotoFirst() { object id = m_luaContext.DoString(m_initDialogSelector)[0]; if (id.GetType() == typeof(Double)) { CurrentDialog = this[(int)((double)id)]; } else { Logger.LogMessage(LogMessageType.Warning, "DialogScene \"{0}\" has a selector that does not return a number, instead returns {1}", m_name, id.GetType().Name); CurrentDialog = UNKNOWN_CHOICE; } }
/// <summary> /// Checks if the conditions are met to run this command /// </summary> /// <param name="context">The Lua context to run the command with</param> /// <returns>True if the command's conditions are met, otherwise false</returns> public bool ConditionsMet(LuaContext context) { return((bool)context.DoString("return " + m_condition)[0]); }
/// <summary> /// Checks if this choice's conditions are met - Matthew /// </summary> /// <param name="context">The Lua context to use for checking conditions</param> /// <returns>True if the choice's conditions are met, otherwise false</returns> public bool IsAvailable(LuaContext context) { return((bool)context.DoString(string.Format("return {0}", m_condition))[0]); }