lua/wrappers/game/lua_dialogue.cpp
/**
	 * Sets how the dialogue is unlocked, it is either locked by subject or
	 * always unlocked.
	 * 
	 * @param string flag Either "none" or "locked"
	 * @returns am.dialogue This
	 */
Sets how the dialogue is unlocked, it is either locked by subject or
always unlocked.

@param string flag Either "none" or "locked"
@returns am.dialogue This
Sets how the dialogue is unlocked it is either locked by subject or always unlocked . @param string flag Either " none " or " locked " @returns am . dialogue This
int Dialogue_unlock_flag(lua_State *lua)
	{
		Dialogue *diag = castUData<Dialogue>(lua, 1);
		if (diag)
		{
			if (lua_gettop(lua) == 1)
			{
				lua_pushstring(lua, Dialogue::getUnlockFlagName(diag->getUnlockFlag()));
				return 1;
			}
			else if (lua_isstr(lua, 2))
			{
				Dialogue::UnlockFlag flag = getUnlockFlag(lua, 2);
				if (flag != Dialogue::UNLOCK_UNKNOWN)
				{
					diag->setUnlockFlag(flag);
				}
				else
				{
					LuaState::warning(lua, "Valid dialogue unlock flag values are \"none\" or \"locked\"");
				}
				lua_first(lua);
			}
			return LuaState::expectedArgs(lua, "unlock", "string flag");
		}
		return LuaState::expectedContext(lua, "unlock", "am.dialogue");
	}
int Dialogue_unlock_flag ( lua_State * lua ) { Dialogue * diag = castUData < Dialogue > ( lua , 1 ) ; if ( diag ) { if ( lua_gettop ( lua ) == 1 ) { lua_pushstring ( lua , Dialogue :: getUnlockFlagName ( diag -> getUnlockFlag ( ) ) ) ; return 1 ; } else if ( lua_isstr ( lua , 2 ) ) { Dialogue :: UnlockFlag flag = getUnlockFlag ( lua , 2 ) ; if ( flag != Dialogue :: UNLOCK_UNKNOWN ) { diag -> setUnlockFlag ( flag ) ; } else { LuaState :: warning ( lua , " \" \" \" \" " ) ; } lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Sets how the dialogue is unlocked, it is either locked by subject or
 always unlocked.
Sets how the dialogue is unlocked it is either locked by subject or always unlocked .